Codebase list gpaste / c017f22
New upstream version 3.40.2 Jérémy Lal 2 years ago
151 changed file(s) with 15061 addition(s) and 6203 deletion(s). Raw diff Collapse all Expand all
00 /.buildconfig
11 /Makefile
22 /bin/*
3 /build
34 /tests/bin/*
45 /data/appstream/*.appdata.xml
56 /data/appstream/*.appdata.valid
2727 -I$(srcdir)/src/libgpaste/screensaver-client \
2828 -I$(srcdir)/src/libgpaste/settings \
2929 -I$(srcdir)/src/libgpaste/settings-ui \
30 -I$(srcdir)/src/libgpaste/ui \
3130 -I$(srcdir)/src/libgpaste/util \
3231 -DG_PASTE_COMPILATION \
3332 -DGTK_API=$(GTK_API) \
0 NEW in 3.40.2 (30/04/2021)
1 =============
2
3 - fix a crash in memory usage checking
4
5 NEW in 3.40.1 (10/04/2021)
6 =============
7
8 - fix build with meson
9
10 NEW in 3.40.0 (09/04/2021)
11 =============
12
13 - port to gnome-shell 40
14 - placeholder for gnome-shell prefs
15
016 NEW in 3.38.6 (08/03/2021)
117 =============
218
4040
4141 You can see everything I'll post about GPaste [there](https://www.imagination-land.org/tags/GPaste.html).
4242
43 Latest release for GNOME 3.38 is: [GPaste 3.38.6](https://www.imagination-land.org/posts/2021-03-08-gpaste-3.38.6-released.html).
43 Latest release for GNOME 40 is: [GPaste 3.40.2](https://www.imagination-land.org/posts/2021-04-30-gpaste-3.40.2-released.html).
4444
45 Direct link to download: <https://www.imagination-land.org/files/gpaste/gpaste-3.38.6.tar.xz>
45 Direct link to download: <https://www.imagination-land.org/files/gpaste/gpaste-3.40.2.tar.xz>
11 ##
22 ## Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
33
4 m4_define([gpaste_version], [3.38.6])
4 m4_define([gpaste_version], [3.40.2])
55
66 # Update gpaste_lt_version before each release (and only then)
77 # The format is C:R:A (current revision age)
88 # - If any interface has been added, ‘C:R:A’ becomes ‘C+1:0:A+1’.
99 # - If any interface has been removed or modified, ‘C:R:A’ becomes ‘C+1:0:0’.
1010 # - Otherwise, ‘C:R:A’ becomes ‘C:R+1:A’.
11 m4_define([gpaste_lt_version], [13:3:0])
11 m4_define([gpaste_lt_version], [13:4:0])
1212
1313 # Build system requirements
1414 m4_define([autoconf_required], [2.69])
129129
130130 PKG_CHECK_MODULES(GLIB, [glib-2.0 >= glib_required gobject-2.0 >= glib_required gio-2.0 >= glib_required])
131131 PKG_CHECK_MODULES(GTK, [${GDK_DEP} >= ${GTK_REQUIRED} ${GTK_DEP} >= ${GTK_REQUIRED} pango])
132 PKG_CHECK_MODULES(GTK3, [gtk+-3.0 >= 3.24])
132133 PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0 >= gdk_pixbuf_required])
133134 PKG_CHECK_MODULES(X11, [x11 xi])
134135 PKG_CHECK_MODULES(APPSTREAM, [appstream-glib])
156157
157158 AS_IF([test x${enable_gnome_shell_extension} = xyes], [
158159 AS_IF([test x${enable_introspection} != xyes], [AC_MSG_ERROR([*** Introspection support is required to run the gnome-shell extension])])
159 PKG_CHECK_MODULES(JS_EXTENSION, [mutter-clutter-7 gjs-1.0 >= gjs_required])
160 PKG_CHECK_MODULES(JS_EXTENSION, [mutter-clutter-8 gjs-1.0 >= gjs_required])
160161 ])
161162
162163 AS_IF([test x${enable_x_keybinder} = xyes], [
4242 <url type="translate">https://github.com/Keruspe/GPaste</url>
4343 <translation type="gettext">GPaste</translation>
4444 <releases>
45 <release version="3.40.2" type="stable" date="2020-04-30">
46 <description>
47 <p>This is a maintenance release. Changes:</p>
48 <ul>
49 <li>fix a crash in memory usage checking</li>
50 </ul>
51 </description>
52 </release>
53 <release version="3.40.1" type="stable" date="2021-04-10" />
54 <release version="3.40.0" type="stable" date="2021-04-09">
55 <description>
56 <p>First release for GNOME 40. Changes:</p>
57 <ul>
58 <li>port to gnome-shell 40</li>
59 <li>placeholder for gnome-shell prefs</li>
60 </ul>
61 </description>
62 </release>
4563 <release version="3.38.6" type="stable" date="2020-03-08">
4664 <description>
4765 <p>This is a maintenance release. Changes:</p>
8989
9090 <key name="max-text-item-size" type="t">
9191 <range min="1" max="2147483647"/>
92 <default>2147483647</default>
92 <default>1048575</default>
9393 <summary>Max text item size</summary>
9494 <description>
9595 Maximum size of a text item. Anything out of this boundary is ignored.
00 project('GPaste',
11 'c',
2 version: '3.38.6',
3 meson_version: '>=0.46.0',
2 version: '3.40.2',
3 meson_version: '>=0.50.0',
44 )
55
66 apiversion = '1.0'
7 gpaste_soversion = '13.0.3'
7 gpaste_soversion = '13.0.4'
88
99 glib_req='>=2.64.0'
1010 gdk_pixbuf_req='>=2.38.0'
1111 gjs_req='>=1.54.0'
1212 gtk3_req='>=3.24.0'
13 mutter_clutter_req='>=3.36.0'
13 mutter_clutter_req='>=40.0'
1414
1515 appstream_dep = dependency('appstream-glib')
1616 gdk_dep = dependency('gdk-3.0', version: gtk3_req)
1919 glib_dep = dependency('glib-2.0', version: glib_req)
2020 gobject_dep = dependency('gobject-2.0', version: glib_req)
2121 gtk_dep = dependency('gtk+-3.0', version: gtk3_req)
22 gtk3_dep = dependency('gtk+-3.0', version: '>=3.24')
2223 pango_dep = dependency('pango')
2324
2425 # Don't make dbus/gnome-control-center a build dependency if so desired.
3637 libgpaste_deps = [ gdk_dep, gdk_pixbuf_dep, glib_dep, gtk_dep ]
3738
3839 if get_option('introspection')
39 mutter_clutter_dep = dependency('mutter-clutter-7', version: mutter_clutter_req)
40 mutter_clutter_dep = dependency('mutter-clutter-8', version: mutter_clutter_req)
4041 gjs_dep = dependency('gjs-1.0', version: gjs_req)
4142 endif
4243
55 #, fuzzy
66 msgid ""
77 msgstr ""
8 "Project-Id-Version: gpaste 3.38.6\n"
8 "Project-Id-Version: gpaste 3.40.2\n"
99 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
10 "POT-Creation-Date: 2021-03-08 22:16+0100\n"
10 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
1111 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1212 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313 "Language-Team: LANGUAGE <LL@li.org>\n"
5353 msgstr ""
5454
5555 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
56 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:56
57 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:65
56 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
5857 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
5958 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
60 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:91
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:120
63 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:128
64 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:136
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:144
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:160
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:168
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:176
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:184
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:200
59 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
60 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
63 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
64 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
7172 msgid "This is a maintenance release. Changes:"
7273 msgstr ""
7374
7475 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:114
76 msgid "fix a crash in memory usage checking"
77 msgstr ""
78
79 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
80 msgid "First release for GNOME 40. Changes:"
81 msgstr ""
82
83 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
84 msgid "port to gnome-shell 40"
85 msgstr ""
86
87 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
88 msgid "placeholder for gnome-shell prefs"
89 msgstr ""
90
91 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
92 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
7693 msgid "fix X11 keybinder outside of GNOME"
7794 msgstr ""
7895
79 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:58
96 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
8097 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
8198 msgstr ""
8299
83 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
100 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
84101 msgid ""
85102 "gpaste-client now has a --use-index argument for several subcommands to use "
86103 "index instead of uuid"
87104 msgstr ""
88105
89 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:67
106 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
90107 msgid "fix the make-password keybinding"
91108 msgstr ""
92109
93 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
94 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
110 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
111 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
95112 msgid "updated translations"
96113 msgstr ""
97114
98 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
115 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
99116 msgid "gnome-shell extension warning fixes"
100117 msgstr ""
101118
102 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
119 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
120 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
121 msgid "gnome-shell extension cosmetic updates"
122 msgstr ""
123
124 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
125 msgid "Disable images support by default (can be reenabled in preferences)"
126 msgstr ""
127
128 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
129 msgid "Search now includes passwords (using their names)"
130 msgstr ""
131
132 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
133 msgid "systemd integration enhancements"
134 msgstr ""
135
136 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
137 msgid "First release for GNOME 3.38. Changes:"
138 msgstr ""
139
140 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
141 msgid "Drop the Tracking DBus signal"
142 msgstr ""
143
103144 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
104 msgid "gnome-shell extension cosmetic updates"
105 msgstr ""
106
107 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:93
108 msgid "Disable images support by default (can be reenabled in preferences)"
109 msgstr ""
110
111 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
112 msgid "Search now includes passwords (using their names)"
113 msgstr ""
114
115 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
116 msgid "systemd integration enhancements"
117 msgstr ""
118
119 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
120 msgid "First release for GNOME 3.38. Changes:"
121 msgstr ""
122
123 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
124 msgid "Drop the Tracking DBus signal"
125 msgstr ""
126
127 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:104
128145 msgid "Switch to uuids to identify items"
129146 msgstr ""
130147
131 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:105
148 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
132149 msgid "Bump DBus interface to org.gnome.GPaste2"
133150 msgstr ""
134151
135 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:106
152 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
136153 msgid "Update to gnome-shell 3.38.0"
137154 msgstr ""
138155
139 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
140 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
156 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
157 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
158 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
159 msgid "Fix activating items using Ctrl-Number in gnome-shell"
160 msgstr ""
161
162 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
163 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
164 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
165 msgid "Fix keybinding regrab with gnome-shell"
166 msgstr ""
167
168 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
169 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
170 msgid "Fix keybinding grab with gnome-shell"
171 msgstr ""
172
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
174 msgid "First release for GNOME 3.36. Changes:"
175 msgstr ""
176
177 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
178 msgid "Update to gnome-shell 3.36.0"
179 msgstr ""
180
141181 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
142 msgid "Fix activating items using Ctrl-Number in gnome-shell"
143 msgstr ""
144
145 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
146 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
147 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:203
148 msgid "Fix keybinding regrab with gnome-shell"
149 msgstr ""
150
151 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
152 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
153 msgid "Fix keybinding grab with gnome-shell"
154 msgstr ""
155
156 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:152
157 msgid "First release for GNOME 3.36. Changes:"
158 msgstr ""
159
160 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
161 msgid "Update to gnome-shell 3.36.0"
162 msgstr ""
163
164 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
165 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
182 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
166183 msgid "Compatibility with recent appstream-glib"
167184 msgstr ""
168185
169 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:192
186 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
170187 msgid "First release for GNOME 3.34. Changes:"
171188 msgstr ""
172189
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
190 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
174191 msgid "Update to gnome-shell 3.34.0"
175192 msgstr ""
176193
180197
181198 #: data/control-center/42-gpaste.control-center.xml.in:3
182199 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
183 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:73
200 #: src/ui/gpaste-ui-shortcuts-window.c:73
184201 msgid "Launch the graphical tool"
185202 msgstr ""
186203
187204 #: data/control-center/42-gpaste.control-center.xml.in:4
188205 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
189 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:74
206 #: src/ui/gpaste-ui-shortcuts-window.c:74
190207 msgid "Mark the active item as being a password"
191208 msgstr ""
192209
193210 #: data/control-center/42-gpaste.control-center.xml.in:5
194211 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
195 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:72
212 #: src/ui/gpaste-ui-shortcuts-window.c:72
196213 msgid "Delete the active item from history"
197214 msgstr ""
198215
199216 #: data/control-center/42-gpaste.control-center.xml.in:6
200217 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
201 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:75
218 #: src/ui/gpaste-ui-shortcuts-window.c:75
202219 msgid "Display the history"
203220 msgstr ""
204221
205222 #: data/control-center/42-gpaste.control-center.xml.in:7
206223 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
207 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:76
224 #: src/ui/gpaste-ui-shortcuts-window.c:76
208225 msgid "Sync the clipboard to the primary selection"
209226 msgstr ""
210227
211228 #: data/control-center/42-gpaste.control-center.xml.in:8
212229 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
213 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:77
230 #: src/ui/gpaste-ui-shortcuts-window.c:77
214231 msgid "Sync the primary selection to the clipboard"
215232 msgstr ""
216233
217234 #: data/control-center/42-gpaste.control-center.xml.in:9
218235 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
219 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:78
236 #: src/ui/gpaste-ui-shortcuts-window.c:78
220237 msgid "Upload the active item to a pastebin service"
221238 msgstr ""
222239
466483
467484 #. Translators: help for gpaste history
468485 #: src/client/gpaste-client.c:157
469 msgid "print the history with uuids"
486 msgid "print the history with UUIDs"
470487 msgstr ""
471488
472489 #. Translators: help for gpaste history-size
562579 #. Translators: help for gpaste merge <uuid> … <uuid>
563580 #: src/client/gpaste-client.c:183
564581 msgid ""
565 "merge the items matching the uuids from the history and put the result in "
582 "merge the items matching the UUIDs from the history and put the result in "
566583 "the clipboard"
567584 msgstr ""
568585
669686
670687 #. Translators: help for --use-index
671688 #: src/client/gpaste-client.c:225
672 msgid "use the index of the item instead of its uuid"
689 msgid "use the index of the item instead of its UUID"
673690 msgstr ""
674691
675692 #: src/client/gpaste-client.c:228
729746
730747 #: src/client/gpaste-client.c:808
731748 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
732 #: src/libgpaste/ui/gpaste-ui-window.c:311
749 #: src/ui/gpaste-ui-window.c:311
733750 msgid "Couldn't connect to GPaste daemon"
734751 msgstr ""
735752
771788 msgstr ""
772789
773790 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
774 #: src/libgpaste/ui/gpaste-ui-switch.c:92
791 #: src/ui/gpaste-ui-switch.c:92
775792 msgid "Track clipboard changes"
776793 msgstr ""
777794
837854
838855 #. translators: This is the name of a multi-history management action
839856 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
840 #: src/libgpaste/ui/gpaste-ui-panel.c:297
857 #: src/ui/gpaste-ui-panel.c:297
841858 msgid "Switch to"
842859 msgstr ""
843860
844861 #. translators: This is the name of a multi-history management action
845862 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
846 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
847 #: src/libgpaste/ui/gpaste-ui-delete-history.c:65
848 #: src/libgpaste/ui/gpaste-ui-delete-item.c:49
863 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
864 #: src/ui/gpaste-ui-delete-item.c:49
849865 msgid "Delete"
850866 msgstr ""
851867
852 #: src/libgpaste/ui/gpaste-ui-about.c:41
853 msgid "About"
854 msgstr ""
855
856 #: src/libgpaste/ui/gpaste-ui-backup-history.c:43
857 #: src/libgpaste/ui/gpaste-ui-backup-history.c:140
858 msgid "Backup"
859 msgstr ""
860
861 #: src/libgpaste/ui/gpaste-ui-backup-history.c:44
862 #: src/libgpaste/ui/gpaste-ui-edit-item.c:46
863 #: src/libgpaste/ui/gpaste-ui-new-item.c:32 src/libgpaste/util/gpaste-util.c:30
868 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
869 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
864870 msgid "Cancel"
865871 msgstr ""
866872
867 #: src/libgpaste/ui/gpaste-ui-backup-history.c:47
868 msgid "Under which name do you want to backup this history?"
869 msgstr ""
870
871 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
872 msgid "Are you sure you want to delete this history?"
873 msgstr ""
874
875 #: src/libgpaste/ui/gpaste-ui-edit-item.c:45
876 #: src/libgpaste/ui/gpaste-ui-edit-item.c:118
877 msgid "Edit"
878 msgstr ""
879
880873 #. Translators: this is the translation for emptying the history
881 #: src/libgpaste/ui/gpaste-ui-empty-history.c:65
882 #: src/libgpaste/util/gpaste-util.c:410
874 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
883875 msgid "Empty"
884 msgstr ""
885
886 #: src/libgpaste/ui/gpaste-ui-empty-item.c:35
887 msgid "(No result)"
888 msgstr ""
889
890 #: src/libgpaste/ui/gpaste-ui-empty-item.c:49
891 msgid "(Empty)"
892 msgstr ""
893
894 #: src/libgpaste/ui/gpaste-ui-empty-item.c:60
895 msgid "(Couldn't connect to GPaste daemon)"
896 msgstr ""
897
898 #: src/libgpaste/ui/gpaste-ui-new-item.c:31
899 #: src/libgpaste/ui/gpaste-ui-new-item.c:83
900 msgid "New"
901 msgstr ""
902
903 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
904 msgid "Restart"
905 msgstr ""
906
907 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
908 msgid "Do you really want to restart the daemon?"
909 msgstr ""
910
911 #: src/libgpaste/ui/gpaste-ui-reexec.c:55
912 msgid "Restart the daemon"
913 msgstr ""
914
915 #: src/libgpaste/ui/gpaste-ui-search.c:26
916 msgid "Search"
917 msgstr ""
918
919 #: src/libgpaste/ui/gpaste-ui-settings.c:32 src/ui/gpaste-ui.c:105
920 msgid "GPaste Settings"
921 msgstr ""
922
923 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:64
924 msgid "General"
925 msgstr ""
926
927 #: src/libgpaste/ui/gpaste-ui-switch.c:54
928 msgid "Stop"
929 msgstr ""
930
931 #: src/libgpaste/ui/gpaste-ui-switch.c:54
932 msgid "Do you really want to stop tracking clipboard changes?"
933 msgstr ""
934
935 #: src/libgpaste/ui/gpaste-ui-upload-item.c:49
936 msgid "Upload"
937876 msgstr ""
938877
939878 #: src/libgpaste/util/gpaste-util.c:410
944883 msgid "Could not create history dir"
945884 msgstr ""
946885
886 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
887 msgid "GPaste Settings"
888 msgstr ""
889
947890 #: src/ui/gpaste-ui.c:106
948891 msgid "Keyboard Shortcuts"
949892 msgstr ""
955898 #: src/ui/gpaste-ui.c:108
956899 msgid "Quit"
957900 msgstr ""
901
902 #: src/ui/gpaste-ui-about.c:41
903 msgid "About"
904 msgstr ""
905
906 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
907 msgid "Backup"
908 msgstr ""
909
910 #: src/ui/gpaste-ui-backup-history.c:47
911 msgid "Under which name do you want to backup this history?"
912 msgstr ""
913
914 #: src/ui/gpaste-ui-delete-history.c:25
915 msgid "Are you sure you want to delete this history?"
916 msgstr ""
917
918 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
919 msgid "Edit"
920 msgstr ""
921
922 #: src/ui/gpaste-ui-empty-item.c:35
923 msgid "(No result)"
924 msgstr ""
925
926 #: src/ui/gpaste-ui-empty-item.c:49
927 msgid "(Empty)"
928 msgstr ""
929
930 #: src/ui/gpaste-ui-empty-item.c:60
931 msgid "(Couldn't connect to GPaste daemon)"
932 msgstr ""
933
934 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
935 msgid "New"
936 msgstr ""
937
938 #: src/ui/gpaste-ui-reexec.c:29
939 msgid "Restart"
940 msgstr ""
941
942 #: src/ui/gpaste-ui-reexec.c:29
943 msgid "Do you really want to restart the daemon?"
944 msgstr ""
945
946 #: src/ui/gpaste-ui-reexec.c:55
947 msgid "Restart the daemon"
948 msgstr ""
949
950 #: src/ui/gpaste-ui-search.c:26
951 msgid "Search"
952 msgstr ""
953
954 #: src/ui/gpaste-ui-shortcuts-window.c:64
955 msgid "General"
956 msgstr ""
957
958 #: src/ui/gpaste-ui-switch.c:54
959 msgid "Stop"
960 msgstr ""
961
962 #: src/ui/gpaste-ui-switch.c:54
963 msgid "Do you really want to stop tracking clipboard changes?"
964 msgstr ""
965
966 #: src/ui/gpaste-ui-upload-item.c:49
967 msgid "Upload"
968 msgstr ""
55 pt_BR
66 sv
77 nb_NO
8 ar
9 it
10 sl
7878 src/libgpaste/settings-ui/gpaste-settings-ui-stack.h
7979 src/libgpaste/settings-ui/gpaste-settings-ui-widget.c
8080 src/libgpaste/settings-ui/gpaste-settings-ui-widget.h
81 src/libgpaste/ui/gpaste-ui-about.c
82 src/libgpaste/ui/gpaste-ui-about.h
83 src/libgpaste/ui/gpaste-ui-backup-history.c
84 src/libgpaste/ui/gpaste-ui-backup-history.h
85 src/libgpaste/ui/gpaste-ui-delete-history.c
86 src/libgpaste/ui/gpaste-ui-delete-history.h
87 src/libgpaste/ui/gpaste-ui-delete-item.c
88 src/libgpaste/ui/gpaste-ui-delete-item.h
89 src/libgpaste/ui/gpaste-ui-edit-item.c
90 src/libgpaste/ui/gpaste-ui-edit-item.h
91 src/libgpaste/ui/gpaste-ui-empty-history.c
92 src/libgpaste/ui/gpaste-ui-empty-history.h
93 src/libgpaste/ui/gpaste-ui-empty-item.c
94 src/libgpaste/ui/gpaste-ui-empty-item.h
95 src/libgpaste/ui/gpaste-ui-header.c
96 src/libgpaste/ui/gpaste-ui-header.h
97 src/libgpaste/ui/gpaste-ui-history-action.c
98 src/libgpaste/ui/gpaste-ui-history-action.h
99 src/libgpaste/ui/gpaste-ui-history-actions.c
100 src/libgpaste/ui/gpaste-ui-history-actions.h
101 src/libgpaste/ui/gpaste-ui-history.c
102 src/libgpaste/ui/gpaste-ui-history.h
103 src/libgpaste/ui/gpaste-ui-item-action.c
104 src/libgpaste/ui/gpaste-ui-item-action.h
105 src/libgpaste/ui/gpaste-ui-item.c
106 src/libgpaste/ui/gpaste-ui-item.h
107 src/libgpaste/ui/gpaste-ui-item-skeleton.c
108 src/libgpaste/ui/gpaste-ui-item-skeleton.h
109 src/libgpaste/ui/gpaste-ui-new-item.c
110 src/libgpaste/ui/gpaste-ui-new-item.h
111 src/libgpaste/ui/gpaste-ui-panel.c
112 src/libgpaste/ui/gpaste-ui-panel.h
113 src/libgpaste/ui/gpaste-ui-panel-history.c
114 src/libgpaste/ui/gpaste-ui-panel-history.h
115 src/libgpaste/ui/gpaste-ui-reexec.c
116 src/libgpaste/ui/gpaste-ui-reexec.h
117 src/libgpaste/ui/gpaste-ui-search-bar.c
118 src/libgpaste/ui/gpaste-ui-search-bar.h
119 src/libgpaste/ui/gpaste-ui-search.c
120 src/libgpaste/ui/gpaste-ui-search.h
121 src/libgpaste/ui/gpaste-ui-settings.c
122 src/libgpaste/ui/gpaste-ui-settings.h
123 src/libgpaste/ui/gpaste-ui-shortcuts-window.c
124 src/libgpaste/ui/gpaste-ui-shortcuts-window.h
125 src/libgpaste/ui/gpaste-ui-switch.c
126 src/libgpaste/ui/gpaste-ui-switch.h
127 src/libgpaste/ui/gpaste-ui-upload-item.c
128 src/libgpaste/ui/gpaste-ui-upload-item.h
129 src/libgpaste/ui/gpaste-ui-window.c
130 src/libgpaste/ui/gpaste-ui-window.h
13181 src/libgpaste/util/gpaste-util.c
13282 src/libgpaste/util/gpaste-util.h
13383 src/ui/gpaste-ui.c
84 src/ui/gpaste-ui-about.c
85 src/ui/gpaste-ui-about.h
86 src/ui/gpaste-ui-backup-history.c
87 src/ui/gpaste-ui-backup-history.h
88 src/ui/gpaste-ui-delete-history.c
89 src/ui/gpaste-ui-delete-history.h
90 src/ui/gpaste-ui-delete-item.c
91 src/ui/gpaste-ui-delete-item.h
92 src/ui/gpaste-ui-edit-item.c
93 src/ui/gpaste-ui-edit-item.h
94 src/ui/gpaste-ui-empty-history.c
95 src/ui/gpaste-ui-empty-history.h
96 src/ui/gpaste-ui-empty-item.c
97 src/ui/gpaste-ui-empty-item.h
98 src/ui/gpaste-ui-header.c
99 src/ui/gpaste-ui-header.h
100 src/ui/gpaste-ui-history-action.c
101 src/ui/gpaste-ui-history-action.h
102 src/ui/gpaste-ui-history-actions.c
103 src/ui/gpaste-ui-history-actions.h
104 src/ui/gpaste-ui-history.c
105 src/ui/gpaste-ui-history.h
106 src/ui/gpaste-ui-item-action.c
107 src/ui/gpaste-ui-item-action.h
108 src/ui/gpaste-ui-item.c
109 src/ui/gpaste-ui-item.h
110 src/ui/gpaste-ui-item-skeleton.c
111 src/ui/gpaste-ui-item-skeleton.h
112 src/ui/gpaste-ui-new-item.c
113 src/ui/gpaste-ui-new-item.h
114 src/ui/gpaste-ui-panel.c
115 src/ui/gpaste-ui-panel.h
116 src/ui/gpaste-ui-panel-history.c
117 src/ui/gpaste-ui-panel-history.h
118 src/ui/gpaste-ui-reexec.c
119 src/ui/gpaste-ui-reexec.h
120 src/ui/gpaste-ui-search-bar.c
121 src/ui/gpaste-ui-search-bar.h
122 src/ui/gpaste-ui-search.c
123 src/ui/gpaste-ui-search.h
124 src/ui/gpaste-ui-settings.c
125 src/ui/gpaste-ui-settings.h
126 src/ui/gpaste-ui-shortcuts-window.c
127 src/ui/gpaste-ui-shortcuts-window.h
128 src/ui/gpaste-ui-switch.c
129 src/ui/gpaste-ui-switch.h
130 src/ui/gpaste-ui-upload-item.c
131 src/ui/gpaste-ui-upload-item.h
132 src/ui/gpaste-ui-window.c
133 src/ui/gpaste-ui-window.h
134134 tests/gnome-shell-client/test-gnome-shell-client.c
0 # SOME DESCRIPTIVE TITLE.
1 # Copyright (C) YEAR Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2 # This file is distributed under the same license as the gpaste package.
3 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4 #
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: gpaste 3.38.3\n"
8 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
9 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "Last-Translator: Automatically generated\n"
12 "Language-Team: none\n"
13 "Language: ar\n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:5
19 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:4
20 msgid "GPaste"
21 msgstr ""
22
23 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:6
24 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:5
25 msgid "Manage your clipboard history"
26 msgstr ""
27
28 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:7
29 msgid "Marc-Antoine Perennou"
30 msgstr ""
31
32 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:13
33 msgid ""
34 "GPaste is a clipboard managing system allowing you to track and manage your "
35 "clipboard history in a highly customizable way."
36 msgstr ""
37
38 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:16
39 msgid ""
40 "GPaste provides you with a graphical tool allowing you to manage everything "
41 "easily."
42 msgstr ""
43
44 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:23
45 msgid "The main UI"
46 msgstr ""
47
48 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:27
49 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:31
50 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:35
51 msgid "The settings UI"
52 msgstr ""
53
54 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
55 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
56 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
57 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
58 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
59 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
60 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
63 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
64 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
71 msgid "This is a maintenance release. Changes:"
72 msgstr ""
73
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
75 msgid "fix a crash in memory usage checking"
76 msgstr ""
77
78 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
79 msgid "First release for GNOME 40. Changes:"
80 msgstr ""
81
82 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
83 msgid "port to gnome-shell 40"
84 msgstr ""
85
86 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
87 msgid "placeholder for gnome-shell prefs"
88 msgstr ""
89
90 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
91 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
92 msgid "fix X11 keybinder outside of GNOME"
93 msgstr ""
94
95 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
96 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
97 msgstr ""
98
99 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
100 msgid ""
101 "gpaste-client now has a --use-index argument for several subcommands to use "
102 "index instead of uuid"
103 msgstr ""
104
105 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
106 msgid "fix the make-password keybinding"
107 msgstr ""
108
109 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
110 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
111 msgid "updated translations"
112 msgstr ""
113
114 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
115 msgid "gnome-shell extension warning fixes"
116 msgstr ""
117
118 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
119 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
120 msgid "gnome-shell extension cosmetic updates"
121 msgstr ""
122
123 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
124 msgid "Disable images support by default (can be reenabled in preferences)"
125 msgstr ""
126
127 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
128 msgid "Search now includes passwords (using their names)"
129 msgstr ""
130
131 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
132 msgid "systemd integration enhancements"
133 msgstr ""
134
135 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
136 msgid "First release for GNOME 3.38. Changes:"
137 msgstr ""
138
139 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
140 msgid "Drop the Tracking DBus signal"
141 msgstr ""
142
143 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
144 msgid "Switch to uuids to identify items"
145 msgstr ""
146
147 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
148 msgid "Bump DBus interface to org.gnome.GPaste2"
149 msgstr ""
150
151 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
152 msgid "Update to gnome-shell 3.38.0"
153 msgstr ""
154
155 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
156 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
157 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
158 msgid "Fix activating items using Ctrl-Number in gnome-shell"
159 msgstr ""
160
161 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
162 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
163 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
164 msgid "Fix keybinding regrab with gnome-shell"
165 msgstr ""
166
167 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
168 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
169 msgid "Fix keybinding grab with gnome-shell"
170 msgstr ""
171
172 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
173 msgid "First release for GNOME 3.36. Changes:"
174 msgstr ""
175
176 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
177 msgid "Update to gnome-shell 3.36.0"
178 msgstr ""
179
180 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
181 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
182 msgid "Compatibility with recent appstream-glib"
183 msgstr ""
184
185 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
186 msgid "First release for GNOME 3.34. Changes:"
187 msgstr ""
188
189 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
190 msgid "Update to gnome-shell 3.34.0"
191 msgstr ""
192
193 #: data/control-center/42-gpaste.control-center.xml.in:2
194 msgid "@GETTEXT_PACKAGE@"
195 msgstr ""
196
197 #: data/control-center/42-gpaste.control-center.xml.in:3
198 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
199 #: src/ui/gpaste-ui-shortcuts-window.c:73
200 msgid "Launch the graphical tool"
201 msgstr ""
202
203 #: data/control-center/42-gpaste.control-center.xml.in:4
204 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
205 #: src/ui/gpaste-ui-shortcuts-window.c:74
206 msgid "Mark the active item as being a password"
207 msgstr ""
208
209 #: data/control-center/42-gpaste.control-center.xml.in:5
210 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
211 #: src/ui/gpaste-ui-shortcuts-window.c:72
212 msgid "Delete the active item from history"
213 msgstr ""
214
215 #: data/control-center/42-gpaste.control-center.xml.in:6
216 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
217 #: src/ui/gpaste-ui-shortcuts-window.c:75
218 msgid "Display the history"
219 msgstr ""
220
221 #: data/control-center/42-gpaste.control-center.xml.in:7
222 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
223 #: src/ui/gpaste-ui-shortcuts-window.c:76
224 msgid "Sync the clipboard to the primary selection"
225 msgstr ""
226
227 #: data/control-center/42-gpaste.control-center.xml.in:8
228 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
229 #: src/ui/gpaste-ui-shortcuts-window.c:77
230 msgid "Sync the primary selection to the clipboard"
231 msgstr ""
232
233 #: data/control-center/42-gpaste.control-center.xml.in:9
234 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
235 #: src/ui/gpaste-ui-shortcuts-window.c:78
236 msgid "Upload the active item to a pastebin service"
237 msgstr ""
238
239 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:6
240 msgid "Clipboard;Manager;Settings;Preferences;Configuration;"
241 msgstr ""
242
243 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:7
244 msgid "Max size of an element when displaying it"
245 msgstr ""
246
247 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:8
248 msgid ""
249 "The extra stuff of that element will be replaced by \"…\", and newlines by "
250 "\" \" when displaying from the applet, 0 to disable."
251 msgstr ""
252
253 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:15
254 msgid "Do we detect and replace growing lines in history?"
255 msgstr ""
256
257 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:16
258 msgid ""
259 "By default, selecting \"Here is\", then \"Here is an example\" will create "
260 "two entries in the history. With this feature enabled, the first one will be "
261 "replaced by the second one."
262 msgstr ""
263
264 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:24
265 msgid "The name of the current history"
266 msgstr ""
267
268 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:25
269 msgid "The default name is \"history\""
270 msgstr ""
271
272 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:32
273 msgid "Do we save the images copied to history, or only text?"
274 msgstr ""
275
276 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:33
277 msgid "By default, we're saving only text"
278 msgstr ""
279
280 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:40
281 msgid "Do we close the UI after selecting an item?"
282 msgstr ""
283
284 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:41
285 msgid "By default, we close it"
286 msgstr ""
287
288 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:48
289 msgid "The keyboard shortcut to launch the graphical interface"
290 msgstr ""
291
292 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:49
293 msgid ""
294 "By default, hitting ctrl + alt + g does that (\"<Ctrl><Alt>G\"). An empty "
295 "string here disables this functionnality."
296 msgstr ""
297
298 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:57
299 msgid "The keyboard shortcut to mark the active item as being a password"
300 msgstr ""
301
302 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:58
303 msgid ""
304 "By default, hitting ctrl + alt + s will mark the active item as being a "
305 "password (\"<Ctrl><Alt>S\"). An empty string here disables this "
306 "functionnality."
307 msgstr ""
308
309 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:67
310 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:208
311 msgid "Max displayed history size"
312 msgstr ""
313
314 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:68
315 msgid "Maximum number of items displayed in the history"
316 msgstr ""
317
318 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:76
319 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:215
320 msgid "Max history size"
321 msgstr ""
322
323 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:77
324 msgid "Maximum number of items in history"
325 msgstr ""
326
327 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:85
328 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:222
329 msgid "Max memory usage (MB)"
330 msgstr ""
331
332 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:86
333 msgid "Maximum amount of memory used to store contents"
334 msgstr ""
335
336 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:94
337 msgid "Max text item size"
338 msgstr ""
339
340 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:95
341 msgid "Maximum size of a text item. Anything out of this boundary is ignored."
342 msgstr ""
343
344 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:103
345 msgid "Min text item size"
346 msgstr ""
347
348 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:104
349 msgid "Minimum size of a text item. Anything out of this boundary is ignored."
350 msgstr ""
351
352 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:111
353 msgid "The keyboard shortcut to delete the first element in history"
354 msgstr ""
355
356 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:112
357 msgid ""
358 "By default, hitting ctrl + alt + v does that (\"<Ctrl><Alt>V\"). An empty "
359 "string here disables this functionnality."
360 msgstr ""
361
362 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:120
363 msgid "Does the primary selection affects history?"
364 msgstr ""
365
366 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:121
367 msgid "By default, only clipboard (ctrl+c) affects history."
368 msgstr ""
369
370 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:128
371 msgid ""
372 "Do we save all versions of selected rich text (e.g. html) or just the plain "
373 "text version?"
374 msgstr ""
375
376 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:129
377 msgid "By default, we're saving all"
378 msgstr ""
379
380 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:136
381 msgid "Do we save the history from one session to another?"
382 msgstr ""
383
384 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:137
385 msgid "By default, we're saving it"
386 msgstr ""
387
388 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:144
389 msgid "The keyboard shortcut to display the menu"
390 msgstr ""
391
392 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:145
393 msgid ""
394 "By default, hitting ctrl + alt + h displays the menu (\"<Ctrl><Alt>H\"). An "
395 "empty string here disables this functionnality."
396 msgstr ""
397
398 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:153
399 msgid "The keyboard shortcut to sync the clipboard to the primary selection"
400 msgstr ""
401
402 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:154
403 msgid ""
404 "By default, hitting ctrl + alt + o syncs them (\"<Ctrl><Alt>P\"). An empty "
405 "string here disables this functionnality."
406 msgstr ""
407
408 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:162
409 msgid "The keyboard shortcut to sync the primary selection to the clipboard"
410 msgstr ""
411
412 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:163
413 msgid ""
414 "By default, hitting ctrl + alt + p syncs them (\"<Ctrl><Alt>P\"). An empty "
415 "string here disables this functionnality."
416 msgstr ""
417
418 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:171
419 msgid "Are the primary selection and the clipboard synchronized?"
420 msgstr ""
421
422 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:172
423 msgid "By default, the primary selection and the clipboard are independent."
424 msgstr ""
425
426 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:179
427 msgid "Do we track the clipboard changes?"
428 msgstr ""
429
430 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:180
431 msgid "By default, we're tracking those changes."
432 msgstr ""
433
434 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:187
435 msgid ""
436 "Do we sync the daemon state with the gnome-shell extension's one? (disable "
437 "the daemon when disabling the extension)"
438 msgstr ""
439
440 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:188
441 msgid "By default, the daemon state keeps unchanged"
442 msgstr ""
443
444 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:195
445 msgid "Do we trim the textual items before adding them to history?"
446 msgstr ""
447
448 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:196
449 msgid ""
450 "Trimming means removing all trailing and ending spaces. By default, we're "
451 "letting them as-is."
452 msgstr ""
453
454 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:204
455 msgid ""
456 "The keyboard shortcut to upload the first element in history to a pastebin "
457 "service"
458 msgstr ""
459
460 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:205
461 msgid ""
462 "By default, hitting ctrl + alt + u does that (\"<Ctrl><Alt>U\"). An empty "
463 "string here disables this functionnality."
464 msgstr ""
465
466 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:213
467 msgid "Do we prompt for confirmation when emptying an history?"
468 msgstr ""
469
470 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:214
471 msgid "By default, we do as it's a destructive action"
472 msgstr ""
473
474 #: src/client/gpaste-client.c:143 src/client/gpaste-client.c:437
475 msgid "Couldn't spawn"
476 msgstr ""
477
478 #: src/client/gpaste-client.c:155
479 #, c-format
480 msgid "Usage:\n"
481 msgstr ""
482
483 #. Translators: help for gpaste history
484 #: src/client/gpaste-client.c:157
485 msgid "print the history with UUIDs"
486 msgstr ""
487
488 #. Translators: help for gpaste history-size
489 #: src/client/gpaste-client.c:159
490 msgid "print the size of the history"
491 msgstr ""
492
493 #. Translators: help for gpaste get-history
494 #: src/client/gpaste-client.c:161
495 msgid "get the name of the current history"
496 msgstr ""
497
498 #. Translators: help for gpaste backup-history <name>
499 #. Translators: help for gpaste switch-history <name>
500 #. Translators: help for gpaste delete-history <name>
501 #. Translators: help for gpaste add-password <name> <text>
502 #. Translators: help for gpaste set-password <uuid> <name>
503 #. Translators: help for gpaste delete-passworf <name>
504 #: src/client/gpaste-client.c:163 src/client/gpaste-client.c:165
505 #: src/client/gpaste-client.c:167 src/client/gpaste-client.c:173
506 #: src/client/gpaste-client.c:185 src/client/gpaste-client.c:189
507 msgid "name"
508 msgstr ""
509
510 #: src/client/gpaste-client.c:163
511 msgid "backup current history"
512 msgstr ""
513
514 #: src/client/gpaste-client.c:165
515 msgid "switch to another history"
516 msgstr ""
517
518 #: src/client/gpaste-client.c:167
519 msgid "delete a history"
520 msgstr ""
521
522 #. Translators: help for gpaste list-histories
523 #: src/client/gpaste-client.c:169
524 msgid "list available histories"
525 msgstr ""
526
527 #. Translators: help for gpaste add <text>
528 #: src/client/gpaste-client.c:171
529 msgid "text"
530 msgstr ""
531
532 #: src/client/gpaste-client.c:171
533 msgid "set text to clipboard"
534 msgstr ""
535
536 #: src/client/gpaste-client.c:173
537 msgid "password"
538 msgstr ""
539
540 #: src/client/gpaste-client.c:173
541 msgid "add the name - password couple to the clipboard"
542 msgstr ""
543
544 #. Translators: help for gpaste rename-password <old name> <new name>
545 #: src/client/gpaste-client.c:175
546 msgid "old name"
547 msgstr ""
548
549 #: src/client/gpaste-client.c:175
550 msgid "new name"
551 msgstr ""
552
553 #: src/client/gpaste-client.c:175
554 msgid "rename the password"
555 msgstr ""
556
557 #. Translators: help for gpaste get <uuid>
558 #: src/client/gpaste-client.c:177
559 msgid "get the item <uuid> from the history"
560 msgstr ""
561
562 #. Translators: help for gpaste select <uuid>
563 #: src/client/gpaste-client.c:179
564 msgid "set the item <uuid> from the history to the clipboard"
565 msgstr ""
566
567 #. Translators: help for gpaste replace <uuid> <contents>
568 #: src/client/gpaste-client.c:181
569 msgid "contents"
570 msgstr ""
571
572 #: src/client/gpaste-client.c:181
573 msgid ""
574 "replace the contents of the item <uuid> from the history with the provided "
575 "one"
576 msgstr ""
577
578 #. Translators: help for gpaste merge <uuid> … <uuid>
579 #: src/client/gpaste-client.c:183
580 msgid ""
581 "merge the items matching the UUIDs from the history and put the result in "
582 "the clipboard"
583 msgstr ""
584
585 #: src/client/gpaste-client.c:185
586 msgid "set the item <uuid> from the history as a password named <name>"
587 msgstr ""
588
589 #. Translators: help for gpaste delete <uuid>
590 #: src/client/gpaste-client.c:187
591 msgid "delete item <uuid> from the history"
592 msgstr ""
593
594 #: src/client/gpaste-client.c:189
595 msgid "delete the password <name> from the history"
596 msgstr ""
597
598 #. Translators: help for gpaste file <path>
599 #: src/client/gpaste-client.c:191
600 msgid "path"
601 msgstr ""
602
603 #: src/client/gpaste-client.c:191
604 msgid "put the content of the file at <path> into the clipboard"
605 msgstr ""
606
607 #. Translators: help for whatever | gpaste
608 #: src/client/gpaste-client.c:193
609 msgid "whatever"
610 msgstr ""
611
612 #: src/client/gpaste-client.c:193
613 msgid "set the output of whatever to clipboard"
614 msgstr ""
615
616 #. Translators: help for gpaste empty
617 #: src/client/gpaste-client.c:195
618 msgid "empty the history"
619 msgstr ""
620
621 #. Translators: help for gpaste start
622 #: src/client/gpaste-client.c:197
623 msgid "start tracking clipboard changes"
624 msgstr ""
625
626 #. Translators: help for gpaste stop
627 #: src/client/gpaste-client.c:199
628 msgid "stop tracking clipboard changes"
629 msgstr ""
630
631 #. Translators: help for gpaste quit
632 #: src/client/gpaste-client.c:201
633 msgid "alias for stop"
634 msgstr ""
635
636 #. Translators: help for gpaste daemon-reexec
637 #: src/client/gpaste-client.c:203
638 msgid "reexecute the daemon (after upgrading...)"
639 msgstr ""
640
641 #. Translators: help for gpaste settings
642 #: src/client/gpaste-client.c:205
643 msgid "launch the configuration tool"
644 msgstr ""
645
646 #. Translators: help for gpaste ui
647 #: src/client/gpaste-client.c:207
648 msgid "launch the graphical tool"
649 msgstr ""
650
651 #. Translators: help for gpaste show-history
652 #: src/client/gpaste-client.c:209
653 msgid "make the applet or extension display the history"
654 msgstr ""
655
656 #. Translators: help for gpaste upload
657 #: src/client/gpaste-client.c:211
658 msgid "upload the item <uuid> to a pastebin service"
659 msgstr ""
660
661 #. Translators: help for gpaste version
662 #: src/client/gpaste-client.c:213
663 msgid "display the version"
664 msgstr ""
665
666 #. Translators: help for gpaste daemon-version
667 #: src/client/gpaste-client.c:215
668 msgid "display the daemon version"
669 msgstr ""
670
671 #. Translators: help for gpaste help
672 #: src/client/gpaste-client.c:217
673 msgid "display this help"
674 msgstr ""
675
676 #. Translators: help for gpaste about
677 #: src/client/gpaste-client.c:219
678 msgid "display the about dialog"
679 msgstr ""
680
681 #: src/client/gpaste-client.c:222
682 #, c-format
683 msgid "Convenience options:"
684 msgstr ""
685
686 #. Translators: help for --use-index
687 #: src/client/gpaste-client.c:225
688 msgid "use the index of the item instead of its UUID"
689 msgstr ""
690
691 #: src/client/gpaste-client.c:228
692 #, c-format
693 msgid "Display options:"
694 msgstr ""
695
696 #. Translators: help for --oneline
697 #: src/client/gpaste-client.c:231
698 msgid "display each item on only one line"
699 msgstr ""
700
701 #. Translators: help for --raw
702 #: src/client/gpaste-client.c:233
703 msgid "display each item raw (without line numbers)"
704 msgstr ""
705
706 #. Translators: help for --reverse
707 #: src/client/gpaste-client.c:235
708 msgid "display the items in reverse order"
709 msgstr ""
710
711 #. Translators: help for --zero
712 #: src/client/gpaste-client.c:237
713 msgid "use a NUL character instead of a new line betweean each item"
714 msgstr ""
715
716 #: src/client/gpaste-client.c:240
717 #, c-format
718 msgid "Merge options:"
719 msgstr ""
720
721 #. Translators: help for --decoration <string>
722 #. Translators: help for --separator <string>
723 #: src/client/gpaste-client.c:243 src/client/gpaste-client.c:245
724 msgid "string"
725 msgstr ""
726
727 #: src/client/gpaste-client.c:243
728 msgid ""
729 "add the given decoration to the beginning and the end of each item before "
730 "merging"
731 msgstr ""
732
733 #: src/client/gpaste-client.c:245
734 msgid "add the given separator between each item when merging"
735 msgstr ""
736
737 #: src/client/gpaste-client.c:342
738 #, c-format
739 msgid "Successfully reexecuted the daemon\n"
740 msgstr ""
741
742 #: src/client/gpaste-client.c:491
743 msgid "Cannot add non utf8 data as text."
744 msgstr ""
745
746 #: src/client/gpaste-client.c:808
747 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
748 #: src/ui/gpaste-ui-window.c:311
749 msgid "Couldn't connect to GPaste daemon"
750 msgstr ""
751
752 #: src/daemon/gpaste-daemon.c:33
753 msgid "Stop signal received, exiting"
754 msgstr ""
755
756 #: src/daemon/gpaste-daemon.c:70
757 msgid "Could not acquire DBus name."
758 msgstr ""
759
760 #. This is the date format "month/day/year time"
761 #: src/libgpaste/core/gpaste-image-item.c:240
762 msgid "%m/%d/%y %T"
763 msgstr ""
764
765 #. This gets displayed in history when selecting an image
766 #: src/libgpaste/core/gpaste-image-item.c:242
767 #, c-format
768 msgid "[Image, %d x %d (%s)]"
769 msgstr ""
770
771 #. This is the prefix displayed in history to identify a password
772 #: src/libgpaste/core/gpaste-password-item.c:67
773 msgid "Password"
774 msgstr ""
775
776 #. This is the prefix displayed in history to identify selected files
777 #: src/libgpaste/core/gpaste-uris-item.c:104
778 msgid "[Files] "
779 msgstr ""
780
781 #: src/libgpaste/gpaste-macros.h:98
782 msgid "Failed to register the gtk application"
783 msgstr ""
784
785 #: src/libgpaste/gpaste-macros.h:110
786 msgid "is already running."
787 msgstr ""
788
789 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
790 #: src/ui/gpaste-ui-switch.c:92
791 msgid "Track clipboard changes"
792 msgstr ""
793
794 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:122
795 msgid "Close UI on select"
796 msgstr ""
797
798 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:131
799 msgid "Enable the gnome-shell extension"
800 msgstr ""
801
802 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:137
803 msgid "Sync the daemon state with the extension's one"
804 msgstr ""
805
806 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:146
807 msgid "Primary selection affects history"
808 msgstr ""
809
810 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:152
811 msgid "Synchronize clipboard with primary selection"
812 msgstr ""
813
814 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:159
815 msgid "Images support"
816 msgstr ""
817
818 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:165
819 msgid "Trim items"
820 msgstr ""
821
822 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:171
823 msgid "Detect growing lines"
824 msgstr ""
825
826 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:178
827 msgid "Save history"
828 msgstr ""
829
830 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:201
831 msgid "Max element size when displaying"
832 msgstr ""
833
834 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:229
835 msgid "Max text item length"
836 msgstr ""
837
838 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:236
839 msgid "Min text item length"
840 msgstr ""
841
842 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:334
843 msgid "General behaviour"
844 msgstr ""
845
846 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:335
847 msgid "History settings"
848 msgstr ""
849
850 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:336
851 msgid "Keyboard shortcuts"
852 msgstr ""
853
854 #. translators: This is the name of a multi-history management action
855 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
856 #: src/ui/gpaste-ui-panel.c:297
857 msgid "Switch to"
858 msgstr ""
859
860 #. translators: This is the name of a multi-history management action
861 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
862 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
863 #: src/ui/gpaste-ui-delete-item.c:49
864 msgid "Delete"
865 msgstr ""
866
867 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
868 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
869 msgid "Cancel"
870 msgstr ""
871
872 #. Translators: this is the translation for emptying the history
873 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
874 msgid "Empty"
875 msgstr ""
876
877 #: src/libgpaste/util/gpaste-util.c:410
878 msgid "Do you really want to empty the history?"
879 msgstr ""
880
881 #: src/libgpaste/util/gpaste-util.c:709
882 msgid "Could not create history dir"
883 msgstr ""
884
885 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
886 msgid "GPaste Settings"
887 msgstr ""
888
889 #: src/ui/gpaste-ui.c:106
890 msgid "Keyboard Shortcuts"
891 msgstr ""
892
893 #: src/ui/gpaste-ui.c:107
894 msgid "About GPaste"
895 msgstr ""
896
897 #: src/ui/gpaste-ui.c:108
898 msgid "Quit"
899 msgstr ""
900
901 #: src/ui/gpaste-ui-about.c:41
902 msgid "About"
903 msgstr ""
904
905 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
906 msgid "Backup"
907 msgstr ""
908
909 #: src/ui/gpaste-ui-backup-history.c:47
910 msgid "Under which name do you want to backup this history?"
911 msgstr ""
912
913 #: src/ui/gpaste-ui-delete-history.c:25
914 msgid "Are you sure you want to delete this history?"
915 msgstr ""
916
917 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
918 msgid "Edit"
919 msgstr ""
920
921 #: src/ui/gpaste-ui-empty-item.c:35
922 msgid "(No result)"
923 msgstr ""
924
925 #: src/ui/gpaste-ui-empty-item.c:49
926 msgid "(Empty)"
927 msgstr ""
928
929 #: src/ui/gpaste-ui-empty-item.c:60
930 msgid "(Couldn't connect to GPaste daemon)"
931 msgstr ""
932
933 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
934 msgid "New"
935 msgstr ""
936
937 #: src/ui/gpaste-ui-reexec.c:29
938 msgid "Restart"
939 msgstr ""
940
941 #: src/ui/gpaste-ui-reexec.c:29
942 msgid "Do you really want to restart the daemon?"
943 msgstr ""
944
945 #: src/ui/gpaste-ui-reexec.c:55
946 msgid "Restart the daemon"
947 msgstr ""
948
949 #: src/ui/gpaste-ui-search.c:26
950 msgid "Search"
951 msgstr ""
952
953 #: src/ui/gpaste-ui-shortcuts-window.c:64
954 msgid "General"
955 msgstr ""
956
957 #: src/ui/gpaste-ui-switch.c:54
958 msgid "Stop"
959 msgstr ""
960
961 #: src/ui/gpaste-ui-switch.c:54
962 msgid "Do you really want to stop tracking clipboard changes?"
963 msgstr ""
964
965 #: src/ui/gpaste-ui-upload-item.c:49
966 msgid "Upload"
967 msgstr ""
+158
-143
po/de.po less more
66 msgstr ""
77 "Project-Id-Version: GPaste\n"
88 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
9 "POT-Creation-Date: 2021-03-08 22:16+0100\n"
9 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
1010 "PO-Revision-Date: 2020-11-25 00:29+0000\n"
1111 "Last-Translator: J. Lavoie <j.lavoie@net-c.ca>\n"
1212 "Language-Team: German <https://hosted.weblate.org/projects/gpaste/gpaste/de/"
6161 msgstr "Die Benutzeroberfläche für Einstellungen"
6262
6363 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
64 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:56
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:65
64 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
6665 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
6766 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:91
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:120
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:128
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:136
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:144
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:160
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:168
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:176
77 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:184
78 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:200
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
77 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
78 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
79 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
7980 msgid "This is a maintenance release. Changes:"
8081 msgstr "Dies ist eine Wartungsfreigabe. Änderungen:"
8182
8283 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
83 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:114
84 msgid "fix a crash in memory usage checking"
85 msgstr ""
86
87 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
88 #, fuzzy
89 #| msgid "First release for GNOME 3.38. Changes:"
90 msgid "First release for GNOME 40. Changes:"
91 msgstr "Erstes Release für GNOME 3.38. Änderungen:"
92
93 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
94 #, fuzzy
95 #| msgid "Update to gnome-shell 3.34.0"
96 msgid "port to gnome-shell 40"
97 msgstr "Aktualisierung auf gnome-shell 3.34.0"
98
99 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
100 msgid "placeholder for gnome-shell prefs"
101 msgstr ""
102
103 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
104 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
84105 msgid "fix X11 keybinder outside of GNOME"
85106 msgstr ""
86107
87 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:58
108 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
88109 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
89110 msgstr ""
90111
91 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
112 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
92113 msgid ""
93114 "gpaste-client now has a --use-index argument for several subcommands to use "
94115 "index instead of uuid"
95116 msgstr ""
96117
97 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:67
118 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
98119 msgid "fix the make-password keybinding"
99120 msgstr ""
100121
101 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
102 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
122 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
123 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
103124 msgid "updated translations"
104125 msgstr "Übersetzungen aktualisiert"
105126
106 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
127 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
107128 #, fuzzy
108129 #| msgid "Enable the gnome-shell extension"
109130 msgid "gnome-shell extension warning fixes"
110131 msgstr "Die Gnome-Shell-Erweiterung aktivieren"
111132
112 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
113 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
133 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
134 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
114135 msgid "gnome-shell extension cosmetic updates"
115136 msgstr "kosmetische Aktualisierungen für die Gnome-Shell-Erweiterung"
116137
117 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:93
138 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
118139 msgid "Disable images support by default (can be reenabled in preferences)"
119140 msgstr ""
120141 "Deaktiviere die Unterstützung für Bilder standardmäßig (kann in den "
121142 "Einstellungen wiederhergestellt werden)"
122143
123 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
144 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
124145 msgid "Search now includes passwords (using their names)"
125146 msgstr "Die Suche bezieht nun auch Passwörter ein (über deren Namen)"
126147
127 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
148 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
128149 msgid "systemd integration enhancements"
129150 msgstr "Verbesserungen hinsichtlich der systemd-Integration"
130151
131 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
152 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
132153 msgid "First release for GNOME 3.38. Changes:"
133154 msgstr "Erstes Release für GNOME 3.38. Änderungen:"
134155
135 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
156 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
136157 msgid "Drop the Tracking DBus signal"
137158 msgstr "Verwerfe das Tracking DBus-Signal"
138159
139 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:104
160 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
140161 msgid "Switch to uuids to identify items"
141162 msgstr "Wechsel zu UUIDs, um Elemente zu identifizieren"
142163
143 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:105
164 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
144165 msgid "Bump DBus interface to org.gnome.GPaste2"
145166 msgstr "Upgrade DBus-Interface zu org.gnome.GPaste2"
146167
147 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:106
168 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
148169 msgid "Update to gnome-shell 3.38.0"
149170 msgstr "Update auf gnome-shell 3.38.0"
150171
151 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
152 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
153 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
172 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
174 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
154175 msgid "Fix activating items using Ctrl-Number in gnome-shell"
155176 msgstr "Repariere die Aktivierung von Elementen via Ctrl+Nummer in gnome-shell"
156177
157 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
158 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
159 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:203
178 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
179 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
180 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
160181 msgid "Fix keybinding regrab with gnome-shell"
161182 msgstr "Repariere die Tastenkürzel-Akquise mit gnome-shell"
162183
163 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
164 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
184 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
185 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
165186 msgid "Fix keybinding grab with gnome-shell"
166187 msgstr "Repariere die Tastenkürzel-Akquise mit gnome-shell"
167188
168 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:152
189 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
169190 msgid "First release for GNOME 3.36. Changes:"
170191 msgstr "Erstes Release für GNOME 3.36. Änderungen:"
171192
172 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
193 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
173194 msgid "Update to gnome-shell 3.36.0"
174195 msgstr "Update auf gnome-shell 3.36.0"
175196
176 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
177 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
197 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
198 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
178199 msgid "Compatibility with recent appstream-glib"
179200 msgstr "Kompatibilität mit der aktuellen appstream-glib"
180201
181 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:192
202 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
182203 msgid "First release for GNOME 3.34. Changes:"
183204 msgstr ""
184205
185 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
206 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
186207 msgid "Update to gnome-shell 3.34.0"
187208 msgstr "Aktualisierung auf gnome-shell 3.34.0"
188209
192213
193214 #: data/control-center/42-gpaste.control-center.xml.in:3
194215 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
195 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:73
216 #: src/ui/gpaste-ui-shortcuts-window.c:73
196217 #, fuzzy
197218 msgid "Launch the graphical tool"
198219 msgstr "Konfigurationswerkzeug starten"
199220
200221 #: data/control-center/42-gpaste.control-center.xml.in:4
201222 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
202 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:74
223 #: src/ui/gpaste-ui-shortcuts-window.c:74
203224 #, fuzzy
204225 msgid "Mark the active item as being a password"
205226 msgstr "Tastenkürzel um den ersten Eintrag in der Chronik zu löschen"
206227
207228 #: data/control-center/42-gpaste.control-center.xml.in:5
208229 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
209 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:72
230 #: src/ui/gpaste-ui-shortcuts-window.c:72
210231 #, fuzzy
211232 msgid "Delete the active item from history"
212233 msgstr "Lösche den <number>ten Eintrag aus der Chronik"
213234
214235 #: data/control-center/42-gpaste.control-center.xml.in:6
215236 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
216 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:75
237 #: src/ui/gpaste-ui-shortcuts-window.c:75
217238 msgid "Display the history"
218239 msgstr "Chronik anzeigen"
219240
220241 #: data/control-center/42-gpaste.control-center.xml.in:7
221242 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
222 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:76
243 #: src/ui/gpaste-ui-shortcuts-window.c:76
223244 msgid "Sync the clipboard to the primary selection"
224245 msgstr "Zwischenablage mit der Auswahl synchronisieren"
225246
226247 #: data/control-center/42-gpaste.control-center.xml.in:8
227248 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
228 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:77
249 #: src/ui/gpaste-ui-shortcuts-window.c:77
229250 msgid "Sync the primary selection to the clipboard"
230251 msgstr "Auswahl mit der Zwischenablage synchronisieren"
231252
232253 #: data/control-center/42-gpaste.control-center.xml.in:9
233254 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
234 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:78
255 #: src/ui/gpaste-ui-shortcuts-window.c:78
235256 #, fuzzy
236257 msgid "Upload the active item to a pastebin service"
237258 msgstr "Lösche den <number>ten Eintrag aus der Chronik"
519540 #: src/client/gpaste-client.c:157
520541 #, fuzzy
521542 #| msgid "print the history with indexes"
522 msgid "print the history with uuids"
543 msgid "print the history with UUIDs"
523544 msgstr "Chronik mit Index anzeigen"
524545
525546 #. Translators: help for gpaste history-size
625646 #: src/client/gpaste-client.c:183
626647 #, fuzzy
627648 msgid ""
628 "merge the items matching the uuids from the history and put the result in "
649 "merge the items matching the UUIDs from the history and put the result in "
629650 "the clipboard"
630651 msgstr "Setze den <number>ten Eintrag aus der Chronik in die Zwischenablage"
631652
741762
742763 #. Translators: help for --use-index
743764 #: src/client/gpaste-client.c:225
744 msgid "use the index of the item instead of its uuid"
765 msgid "use the index of the item instead of its UUID"
745766 msgstr ""
746767
747768 #: src/client/gpaste-client.c:228
803824
804825 #: src/client/gpaste-client.c:808
805826 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
806 #: src/libgpaste/ui/gpaste-ui-window.c:311
827 #: src/ui/gpaste-ui-window.c:311
807828 msgid "Couldn't connect to GPaste daemon"
808829 msgstr "Verbindung zum GPaste daemon fehlgeschlagen"
809830
845866 msgstr ""
846867
847868 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
848 #: src/libgpaste/ui/gpaste-ui-switch.c:92
869 #: src/ui/gpaste-ui-switch.c:92
849870 msgid "Track clipboard changes"
850871 msgstr "Verfolge Änderungen in der Zwischenablage"
851872
911932
912933 #. translators: This is the name of a multi-history management action
913934 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
914 #: src/libgpaste/ui/gpaste-ui-panel.c:297
935 #: src/ui/gpaste-ui-panel.c:297
915936 msgid "Switch to"
916937 msgstr "Wechseln zu"
917938
918939 #. translators: This is the name of a multi-history management action
919940 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
920 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
921 #: src/libgpaste/ui/gpaste-ui-delete-history.c:65
922 #: src/libgpaste/ui/gpaste-ui-delete-item.c:49
941 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
942 #: src/ui/gpaste-ui-delete-item.c:49
923943 msgid "Delete"
924944 msgstr "Löschen"
925945
926 #: src/libgpaste/ui/gpaste-ui-about.c:41
927 msgid "About"
928 msgstr "Über"
929
930 #: src/libgpaste/ui/gpaste-ui-backup-history.c:43
931 #: src/libgpaste/ui/gpaste-ui-backup-history.c:140
932 msgid "Backup"
933 msgstr "Backup"
934
935 #: src/libgpaste/ui/gpaste-ui-backup-history.c:44
936 #: src/libgpaste/ui/gpaste-ui-edit-item.c:46
937 #: src/libgpaste/ui/gpaste-ui-new-item.c:32 src/libgpaste/util/gpaste-util.c:30
946 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
947 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
938948 msgid "Cancel"
939949 msgstr ""
940950
941 #: src/libgpaste/ui/gpaste-ui-backup-history.c:47
942 msgid "Under which name do you want to backup this history?"
943 msgstr ""
944
945 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
946 msgid "Are you sure you want to delete this history?"
947 msgstr "Möchten Sie diesen Verlauf wirklich löschen?"
948
949 #: src/libgpaste/ui/gpaste-ui-edit-item.c:45
950 #: src/libgpaste/ui/gpaste-ui-edit-item.c:118
951 msgid "Edit"
952 msgstr "Bearbeiten"
953
954951 #. Translators: this is the translation for emptying the history
955 #: src/libgpaste/ui/gpaste-ui-empty-history.c:65
956 #: src/libgpaste/util/gpaste-util.c:410
952 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
957953 #, fuzzy
958954 msgid "Empty"
959955 msgstr "(Leer)"
960
961 #: src/libgpaste/ui/gpaste-ui-empty-item.c:35
962 msgid "(No result)"
963 msgstr ""
964
965 #: src/libgpaste/ui/gpaste-ui-empty-item.c:49
966 msgid "(Empty)"
967 msgstr "(Leer)"
968
969 #: src/libgpaste/ui/gpaste-ui-empty-item.c:60
970 #, fuzzy
971 msgid "(Couldn't connect to GPaste daemon)"
972 msgstr "Verbindung zum GPaste daemon fehlgeschlagen"
973
974 #: src/libgpaste/ui/gpaste-ui-new-item.c:31
975 #: src/libgpaste/ui/gpaste-ui-new-item.c:83
976 msgid "New"
977 msgstr ""
978
979 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
980 msgid "Restart"
981 msgstr ""
982
983 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
984 msgid "Do you really want to restart the daemon?"
985 msgstr "Möchten Sie den Daemon wirklich neu starten?"
986
987 #: src/libgpaste/ui/gpaste-ui-reexec.c:55
988 msgid "Restart the daemon"
989 msgstr ""
990
991 #: src/libgpaste/ui/gpaste-ui-search.c:26
992 msgid "Search"
993 msgstr ""
994
995 #: src/libgpaste/ui/gpaste-ui-settings.c:32 src/ui/gpaste-ui.c:105
996 msgid "GPaste Settings"
997 msgstr "GPaste-Daemon-Einstellungen"
998
999 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:64
1000 msgid "General"
1001 msgstr ""
1002
1003 #: src/libgpaste/ui/gpaste-ui-switch.c:54
1004 msgid "Stop"
1005 msgstr ""
1006
1007 #: src/libgpaste/ui/gpaste-ui-switch.c:54
1008 msgid "Do you really want to stop tracking clipboard changes?"
1009 msgstr ""
1010 "Möchten Sie wirklich aufhören, Änderungen in der Zwischenablage zu verfolgen?"
1011
1012 #: src/libgpaste/ui/gpaste-ui-upload-item.c:49
1013 msgid "Upload"
1014 msgstr ""
1015956
1016957 #: src/libgpaste/util/gpaste-util.c:410
1017958 msgid "Do you really want to empty the history?"
1021962 msgid "Could not create history dir"
1022963 msgstr "Ordner für die Chronik konnte nicht angelegt werden"
1023964
965 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
966 msgid "GPaste Settings"
967 msgstr "GPaste-Daemon-Einstellungen"
968
1024969 #: src/ui/gpaste-ui.c:106
1025970 #, fuzzy
1026971 msgid "Keyboard Shortcuts"
1033978 #: src/ui/gpaste-ui.c:108
1034979 msgid "Quit"
1035980 msgstr "Beenden"
981
982 #: src/ui/gpaste-ui-about.c:41
983 msgid "About"
984 msgstr "Über"
985
986 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
987 msgid "Backup"
988 msgstr "Backup"
989
990 #: src/ui/gpaste-ui-backup-history.c:47
991 msgid "Under which name do you want to backup this history?"
992 msgstr ""
993
994 #: src/ui/gpaste-ui-delete-history.c:25
995 msgid "Are you sure you want to delete this history?"
996 msgstr "Möchten Sie diesen Verlauf wirklich löschen?"
997
998 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
999 msgid "Edit"
1000 msgstr "Bearbeiten"
1001
1002 #: src/ui/gpaste-ui-empty-item.c:35
1003 msgid "(No result)"
1004 msgstr ""
1005
1006 #: src/ui/gpaste-ui-empty-item.c:49
1007 msgid "(Empty)"
1008 msgstr "(Leer)"
1009
1010 #: src/ui/gpaste-ui-empty-item.c:60
1011 #, fuzzy
1012 msgid "(Couldn't connect to GPaste daemon)"
1013 msgstr "Verbindung zum GPaste daemon fehlgeschlagen"
1014
1015 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
1016 msgid "New"
1017 msgstr ""
1018
1019 #: src/ui/gpaste-ui-reexec.c:29
1020 msgid "Restart"
1021 msgstr ""
1022
1023 #: src/ui/gpaste-ui-reexec.c:29
1024 msgid "Do you really want to restart the daemon?"
1025 msgstr "Möchten Sie den Daemon wirklich neu starten?"
1026
1027 #: src/ui/gpaste-ui-reexec.c:55
1028 msgid "Restart the daemon"
1029 msgstr ""
1030
1031 #: src/ui/gpaste-ui-search.c:26
1032 msgid "Search"
1033 msgstr ""
1034
1035 #: src/ui/gpaste-ui-shortcuts-window.c:64
1036 msgid "General"
1037 msgstr ""
1038
1039 #: src/ui/gpaste-ui-switch.c:54
1040 msgid "Stop"
1041 msgstr ""
1042
1043 #: src/ui/gpaste-ui-switch.c:54
1044 msgid "Do you really want to stop tracking clipboard changes?"
1045 msgstr ""
1046 "Möchten Sie wirklich aufhören, Änderungen in der Zwischenablage zu verfolgen?"
1047
1048 #: src/ui/gpaste-ui-upload-item.c:49
1049 msgid "Upload"
1050 msgstr ""
10361051
10371052 #~ msgid "number"
10381053 #~ msgstr "Nummer"
+161
-146
po/es.po less more
66 msgstr ""
77 "Project-Id-Version: GPaste\n"
88 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
9 "POT-Creation-Date: 2021-03-08 22:16+0100\n"
9 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
1010 "PO-Revision-Date: 2020-10-30 17:26+0000\n"
1111 "Last-Translator: Adolfo Jayme Barrientos <fitojb@ubuntu.com>\n"
1212 "Language-Team: Spanish <https://hosted.weblate.org/projects/gpaste/gpaste/es/"
6060 msgstr "La interfaz de configuración"
6161
6262 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
63 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:56
64 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:65
63 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
6564 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
6665 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:91
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:120
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:128
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:136
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:144
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:160
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:168
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:176
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:184
77 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:200
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
77 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
78 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
7879 msgid "This is a maintenance release. Changes:"
7980 msgstr "Esta es una versión de mantenimiento. Cambios:"
8081
8182 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
82 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:114
83 msgid "fix a crash in memory usage checking"
84 msgstr ""
85
86 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
87 #, fuzzy
88 #| msgid "First release for GNOME 3.34. Changes:"
89 msgid "First release for GNOME 40. Changes:"
90 msgstr "Primera versión para GNOME 3.34. Cambios:"
91
92 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
93 #, fuzzy
94 #| msgid "Update to gnome-shell 3.34.0"
95 msgid "port to gnome-shell 40"
96 msgstr "Actualización a gnome-shell 3.34.0"
97
98 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
99 msgid "placeholder for gnome-shell prefs"
100 msgstr ""
101
102 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
103 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
83104 msgid "fix X11 keybinder outside of GNOME"
84105 msgstr ""
85106
86 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:58
107 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
87108 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
88109 msgstr ""
89110
90 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
111 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
91112 msgid ""
92113 "gpaste-client now has a --use-index argument for several subcommands to use "
93114 "index instead of uuid"
94115 msgstr ""
95116
96 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:67
117 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
97118 msgid "fix the make-password keybinding"
98119 msgstr ""
99120
100 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
101 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
121 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
122 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
102123 msgid "updated translations"
103124 msgstr ""
104125
105 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
126 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
106127 #, fuzzy
107128 #| msgid "gnome-shell extension cosmetic updates"
108129 msgid "gnome-shell extension warning fixes"
109130 msgstr "Actualizaciones superficiales a la extensión para GNOME Shell"
110131
111 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
112 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
132 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
133 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
113134 msgid "gnome-shell extension cosmetic updates"
114135 msgstr "Actualizaciones superficiales a la extensión para GNOME Shell"
115136
116 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:93
137 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
117138 msgid "Disable images support by default (can be reenabled in preferences)"
118139 msgstr ""
119140 "Se desactiva la compatibilidad con imágenes de manera predeterminada (puede "
120141 "reactivarse en la configuración)"
121142
122 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
143 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
123144 msgid "Search now includes passwords (using their names)"
124145 msgstr "La búsqueda ahora incluye contraseñas (utilizando sus nombres)"
125146
126 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
147 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
127148 msgid "systemd integration enhancements"
128149 msgstr "Mejoras en la integración con systemd"
129150
130 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
151 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
131152 msgid "First release for GNOME 3.38. Changes:"
132153 msgstr "Primera versión para GNOME 3.38. Cambios:"
133154
134 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
155 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
135156 msgid "Drop the Tracking DBus signal"
136157 msgstr "Se desecha la señal Tracking de DBus"
137158
138 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:104
159 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
139160 msgid "Switch to uuids to identify items"
140161 msgstr "Se cambia a utilizar UUID para identificar elementos"
141162
142 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:105
163 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
143164 msgid "Bump DBus interface to org.gnome.GPaste2"
144165 msgstr "Se actualiza la interfaz de DBus a org.gnome.GPaste2"
145166
146 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:106
167 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
147168 msgid "Update to gnome-shell 3.38.0"
148169 msgstr "Actualización a gnome-shell 3.38.0"
149170
150 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
151 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
152 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
171 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
172 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
153174 msgid "Fix activating items using Ctrl-Number in gnome-shell"
154175 msgstr "Se corrige la activación de elementos con Ctrl+número en GNOME Shell"
155176
156 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
157 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
158 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:203
177 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
178 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
179 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
159180 msgid "Fix keybinding regrab with gnome-shell"
160181 msgstr "Se arregla la recaptación de los vínculos de teclado en GNOME Shell"
161182
162 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
163 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
183 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
184 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
164185 msgid "Fix keybinding grab with gnome-shell"
165186 msgstr "Se arregla la captación de los vínculos de teclado en GNOME Shell"
166187
167 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:152
188 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
168189 msgid "First release for GNOME 3.36. Changes:"
169190 msgstr "Primera versión para GNOME 3.36. Cambios:"
170191
171 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
192 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
172193 msgid "Update to gnome-shell 3.36.0"
173194 msgstr "Actualización a gnome-shell 3.36.0"
174195
175 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
176 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
196 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
197 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
177198 msgid "Compatibility with recent appstream-glib"
178199 msgstr "Compatibilidad con appstream-glib recientes"
179200
180 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:192
201 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
181202 msgid "First release for GNOME 3.34. Changes:"
182203 msgstr "Primera versión para GNOME 3.34. Cambios:"
183204
184 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
205 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
185206 msgid "Update to gnome-shell 3.34.0"
186207 msgstr "Actualización a gnome-shell 3.34.0"
187208
191212
192213 #: data/control-center/42-gpaste.control-center.xml.in:3
193214 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
194 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:73
215 #: src/ui/gpaste-ui-shortcuts-window.c:73
195216 msgid "Launch the graphical tool"
196217 msgstr "Iniciar la herramienta gráfica"
197218
198219 #: data/control-center/42-gpaste.control-center.xml.in:4
199220 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
200 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:74
221 #: src/ui/gpaste-ui-shortcuts-window.c:74
201222 msgid "Mark the active item as being a password"
202223 msgstr "Marca elemento activo como contraseña"
203224
204225 #: data/control-center/42-gpaste.control-center.xml.in:5
205226 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
206 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:72
227 #: src/ui/gpaste-ui-shortcuts-window.c:72
207228 msgid "Delete the active item from history"
208229 msgstr "Eliminar el elemento activo del histórico"
209230
210231 #: data/control-center/42-gpaste.control-center.xml.in:6
211232 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
212 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:75
233 #: src/ui/gpaste-ui-shortcuts-window.c:75
213234 msgid "Display the history"
214235 msgstr "Mostrar el histórico"
215236
216237 #: data/control-center/42-gpaste.control-center.xml.in:7
217238 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
218 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:76
239 #: src/ui/gpaste-ui-shortcuts-window.c:76
219240 #, fuzzy
220241 msgid "Sync the clipboard to the primary selection"
221242 msgstr "Sincronizar el portapapeles con selección principal: "
222243
223244 #: data/control-center/42-gpaste.control-center.xml.in:8
224245 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
225 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:77
246 #: src/ui/gpaste-ui-shortcuts-window.c:77
226247 #, fuzzy
227248 msgid "Sync the primary selection to the clipboard"
228249 msgstr "Sincronizar selección principal con el portapapeles: "
229250
230251 #: data/control-center/42-gpaste.control-center.xml.in:9
231252 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
232 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:78
253 #: src/ui/gpaste-ui-shortcuts-window.c:78
233254 #, fuzzy
234255 msgid "Upload the active item to a pastebin service"
235256 msgstr "Eliminar el primer elemento del historial"
517538 #: src/client/gpaste-client.c:157
518539 #, fuzzy
519540 #| msgid "print the history with indexes"
520 msgid "print the history with uuids"
541 msgid "print the history with UUIDs"
521542 msgstr "imprimir el historial con números de indice"
522543
523544 #. Translators: help for gpaste history-size
620641 #: src/client/gpaste-client.c:183
621642 #, fuzzy
622643 msgid ""
623 "merge the items matching the uuids from the history and put the result in "
644 "merge the items matching the UUIDs from the history and put the result in "
624645 "the clipboard"
625646 msgstr "enviar el elemento número <número> del historial al portapapeles"
626647
736757
737758 #. Translators: help for --use-index
738759 #: src/client/gpaste-client.c:225
739 msgid "use the index of the item instead of its uuid"
760 msgid "use the index of the item instead of its UUID"
740761 msgstr ""
741762
742763 #: src/client/gpaste-client.c:228
798819
799820 #: src/client/gpaste-client.c:808
800821 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
801 #: src/libgpaste/ui/gpaste-ui-window.c:311
822 #: src/ui/gpaste-ui-window.c:311
802823 msgid "Couldn't connect to GPaste daemon"
803824 msgstr "No se pudo conectar al servicio GPaste"
804825
841862 msgstr "ya está ejecutándose."
842863
843864 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
844 #: src/libgpaste/ui/gpaste-ui-switch.c:92
865 #: src/ui/gpaste-ui-switch.c:92
845866 msgid "Track clipboard changes"
846867 msgstr "Seguimiento de cambios en el portapapeles"
847868
910931
911932 #. translators: This is the name of a multi-history management action
912933 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
913 #: src/libgpaste/ui/gpaste-ui-panel.c:297
934 #: src/ui/gpaste-ui-panel.c:297
914935 msgid "Switch to"
915936 msgstr "Cambiar a"
916937
917938 #. translators: This is the name of a multi-history management action
918939 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
919 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
920 #: src/libgpaste/ui/gpaste-ui-delete-history.c:65
921 #: src/libgpaste/ui/gpaste-ui-delete-item.c:49
940 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
941 #: src/ui/gpaste-ui-delete-item.c:49
922942 msgid "Delete"
923943 msgstr "Suprimir"
924944
925 #: src/libgpaste/ui/gpaste-ui-about.c:41
926 msgid "About"
927 msgstr ""
928
929 #: src/libgpaste/ui/gpaste-ui-backup-history.c:43
930 #: src/libgpaste/ui/gpaste-ui-backup-history.c:140
931 msgid "Backup"
932 msgstr "Copia de seguridad"
933
934 #: src/libgpaste/ui/gpaste-ui-backup-history.c:44
935 #: src/libgpaste/ui/gpaste-ui-edit-item.c:46
936 #: src/libgpaste/ui/gpaste-ui-new-item.c:32 src/libgpaste/util/gpaste-util.c:30
945 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
946 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
937947 msgid "Cancel"
938948 msgstr ""
939949
940 #: src/libgpaste/ui/gpaste-ui-backup-history.c:47
941 msgid "Under which name do you want to backup this history?"
942 msgstr ""
943
944 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
945 #, fuzzy
946 msgid "Are you sure you want to delete this history?"
947 msgstr "Atajo de teclado para eliminar la primera entrada del historial"
948
949 #: src/libgpaste/ui/gpaste-ui-edit-item.c:45
950 #: src/libgpaste/ui/gpaste-ui-edit-item.c:118
951 msgid "Edit"
952 msgstr ""
953
954950 #. Translators: this is the translation for emptying the history
955 #: src/libgpaste/ui/gpaste-ui-empty-history.c:65
956 #: src/libgpaste/util/gpaste-util.c:410
951 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
957952 #, fuzzy
958953 msgid "Empty"
959954 msgstr "(Vacío)"
960
961 #: src/libgpaste/ui/gpaste-ui-empty-item.c:35
962 msgid "(No result)"
963 msgstr ""
964
965 #: src/libgpaste/ui/gpaste-ui-empty-item.c:49
966 msgid "(Empty)"
967 msgstr "(Vacío)"
968
969 #: src/libgpaste/ui/gpaste-ui-empty-item.c:60
970 #, fuzzy
971 msgid "(Couldn't connect to GPaste daemon)"
972 msgstr "No se pudo conectar al servicio GPaste"
973
974 #: src/libgpaste/ui/gpaste-ui-new-item.c:31
975 #: src/libgpaste/ui/gpaste-ui-new-item.c:83
976 msgid "New"
977 msgstr ""
978
979 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
980 msgid "Restart"
981 msgstr ""
982
983 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
984 #, fuzzy
985 msgid "Do you really want to restart the daemon?"
986 msgstr "detener seguimiento de cambios en el portapapeles"
987
988 #: src/libgpaste/ui/gpaste-ui-reexec.c:55
989 msgid "Restart the daemon"
990 msgstr ""
991
992 #: src/libgpaste/ui/gpaste-ui-search.c:26
993 msgid "Search"
994 msgstr ""
995
996 #: src/libgpaste/ui/gpaste-ui-settings.c:32 src/ui/gpaste-ui.c:105
997 #, fuzzy
998 msgid "GPaste Settings"
999 msgstr "Ajustes del servicio GPaste"
1000
1001 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:64
1002 msgid "General"
1003 msgstr ""
1004
1005 #: src/libgpaste/ui/gpaste-ui-switch.c:54
1006 msgid "Stop"
1007 msgstr ""
1008
1009 #: src/libgpaste/ui/gpaste-ui-switch.c:54
1010 #, fuzzy
1011 msgid "Do you really want to stop tracking clipboard changes?"
1012 msgstr "detener seguimiento de cambios en el portapapeles"
1013
1014 #: src/libgpaste/ui/gpaste-ui-upload-item.c:49
1015 msgid "Upload"
1016 msgstr ""
1017955
1018956 #: src/libgpaste/util/gpaste-util.c:410
1019957 msgid "Do you really want to empty the history?"
1023961 msgid "Could not create history dir"
1024962 msgstr "No se pudo crear directorio de historial"
1025963
964 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
965 #, fuzzy
966 msgid "GPaste Settings"
967 msgstr "Ajustes del servicio GPaste"
968
1026969 #: src/ui/gpaste-ui.c:106
1027970 #, fuzzy
1028971 msgid "Keyboard Shortcuts"
1036979 msgid "Quit"
1037980 msgstr "Salir"
1038981
982 #: src/ui/gpaste-ui-about.c:41
983 msgid "About"
984 msgstr ""
985
986 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
987 msgid "Backup"
988 msgstr "Copia de seguridad"
989
990 #: src/ui/gpaste-ui-backup-history.c:47
991 msgid "Under which name do you want to backup this history?"
992 msgstr ""
993
994 #: src/ui/gpaste-ui-delete-history.c:25
995 #, fuzzy
996 msgid "Are you sure you want to delete this history?"
997 msgstr "Atajo de teclado para eliminar la primera entrada del historial"
998
999 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
1000 msgid "Edit"
1001 msgstr ""
1002
1003 #: src/ui/gpaste-ui-empty-item.c:35
1004 msgid "(No result)"
1005 msgstr ""
1006
1007 #: src/ui/gpaste-ui-empty-item.c:49
1008 msgid "(Empty)"
1009 msgstr "(Vacío)"
1010
1011 #: src/ui/gpaste-ui-empty-item.c:60
1012 #, fuzzy
1013 msgid "(Couldn't connect to GPaste daemon)"
1014 msgstr "No se pudo conectar al servicio GPaste"
1015
1016 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
1017 msgid "New"
1018 msgstr ""
1019
1020 #: src/ui/gpaste-ui-reexec.c:29
1021 msgid "Restart"
1022 msgstr ""
1023
1024 #: src/ui/gpaste-ui-reexec.c:29
1025 #, fuzzy
1026 msgid "Do you really want to restart the daemon?"
1027 msgstr "detener seguimiento de cambios en el portapapeles"
1028
1029 #: src/ui/gpaste-ui-reexec.c:55
1030 msgid "Restart the daemon"
1031 msgstr ""
1032
1033 #: src/ui/gpaste-ui-search.c:26
1034 msgid "Search"
1035 msgstr ""
1036
1037 #: src/ui/gpaste-ui-shortcuts-window.c:64
1038 msgid "General"
1039 msgstr ""
1040
1041 #: src/ui/gpaste-ui-switch.c:54
1042 msgid "Stop"
1043 msgstr ""
1044
1045 #: src/ui/gpaste-ui-switch.c:54
1046 #, fuzzy
1047 msgid "Do you really want to stop tracking clipboard changes?"
1048 msgstr "detener seguimiento de cambios en el portapapeles"
1049
1050 #: src/ui/gpaste-ui-upload-item.c:49
1051 msgid "Upload"
1052 msgstr ""
1053
10391054 #~ msgid "number"
10401055 #~ msgstr "número"
10411056
+160
-149
po/fr.po less more
66 msgstr ""
77 "Project-Id-Version: GPaste\n"
88 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
9 "POT-Creation-Date: 2021-03-08 22:16+0100\n"
10 "PO-Revision-Date: 2020-11-25 00:29+0000\n"
9 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
10 "PO-Revision-Date: 2021-04-17 23:26+0000\n"
1111 "Last-Translator: J. Lavoie <j.lavoie@net-c.ca>\n"
1212 "Language-Team: French <https://hosted.weblate.org/projects/gpaste/gpaste/fr/"
1313 ">\n"
1616 "Content-Type: text/plain; charset=UTF-8\n"
1717 "Content-Transfer-Encoding: 8bit\n"
1818 "Plural-Forms: nplurals=2; plural=n > 1;\n"
19 "X-Generator: Weblate 4.4-dev\n"
19 "X-Generator: Weblate 4.6-dev\n"
2020
2121 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:5
2222 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:4
5959 msgstr "L'interface de préférences"
6060
6161 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:56
63 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:65
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
6463 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
6564 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:91
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:120
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:128
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:136
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:144
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:160
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:168
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:176
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:184
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:200
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
77 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
7778 msgid "This is a maintenance release. Changes:"
7879 msgstr "Ceci est une mise à jour de maintenance. Changements :"
7980
8081 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
81 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:114
82 msgid "fix a crash in memory usage checking"
83 msgstr ""
84
85 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
86 msgid "First release for GNOME 40. Changes:"
87 msgstr "Première mise à jour pour GNOME 40. Changements :"
88
89 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
90 msgid "port to gnome-shell 40"
91 msgstr "port vers gnome-shell version 40"
92
93 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
94 msgid "placeholder for gnome-shell prefs"
95 msgstr "espace réservé aux préférences gnome-shell"
96
97 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
98 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
8299 msgid "fix X11 keybinder outside of GNOME"
83 msgstr ""
84
85 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:58
100 msgstr "corriger le clavier X11 en dehors de GNOME"
101
102 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
86103 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
87104 msgstr ""
88105 "meilleure gestion et remontée d'erreurs quand des uuids invalides sont "
89106 "passés à gpaste-client"
90107
91 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
108 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
92109 msgid ""
93110 "gpaste-client now has a --use-index argument for several subcommands to use "
94111 "index instead of uuid"
96113 "gpaste-client a maintenant un paramètre --use-index pour plusieurs sous-"
97114 "commandes pour utiliser l'index à la place de l'uuid"
98115
99 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:67
116 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
100117 msgid "fix the make-password keybinding"
101118 msgstr "correction du raccourcis clavier pour créer un mot de passe"
102119
103 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
104 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
120 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
121 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
105122 msgid "updated translations"
106123 msgstr "Mise à jour des traductions"
107124
108 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
125 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
109126 msgid "gnome-shell extension warning fixes"
110127 msgstr "Correction de warnings dans l'extension gnome-shell"
111128
112 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
113 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
129 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
130 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
114131 msgid "gnome-shell extension cosmetic updates"
115132 msgstr "Mises à jour cosmétiques de l'extension gnome-shell"
116133
117 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:93
134 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
118135 msgid "Disable images support by default (can be reenabled in preferences)"
119136 msgstr ""
120137 "Désactivation de la prise en charge des images par défaut (peut être "
121138 "réactivée dans les préférences)"
122139
123 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
140 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
124141 msgid "Search now includes passwords (using their names)"
125142 msgstr ""
126143 "La recherche inclut maintenant les mots de passe (en utilisant leurs noms)"
127144
128 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
145 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
129146 msgid "systemd integration enhancements"
130147 msgstr "Amélioration de l'intégration avec systemd"
131148
132 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
149 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
133150 msgid "First release for GNOME 3.38. Changes:"
134151 msgstr "Première mise à jour pour GNOME 3.38. Changements :"
135152
136 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
153 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
137154 msgid "Drop the Tracking DBus signal"
138155 msgstr "Suppression du signal DBus Tracking"
139156
140 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:104
157 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
141158 msgid "Switch to uuids to identify items"
142159 msgstr "Utilisation d'uuids pour identifier les éléments"
143160
144 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:105
161 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
145162 msgid "Bump DBus interface to org.gnome.GPaste2"
146163 msgstr "Mise à jour de l'intrface DBus en org.gnome.GPaste2"
147164
148 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:106
165 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
149166 msgid "Update to gnome-shell 3.38.0"
150167 msgstr "Mise à jour de gnome-shell en verison 3.38.0"
151168
152 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
153 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
154 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
169 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
170 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
171 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
155172 msgid "Fix activating items using Ctrl-Number in gnome-shell"
156173 msgstr ""
157174 "Correction de l'activation d'un élément avec Ctrl-Nombre dans gnome-shell"
158175
159 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
160 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
161 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:203
176 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
177 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
178 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
162179 msgid "Fix keybinding regrab with gnome-shell"
163180 msgstr "Correction de la modification des raccourcis clavier dans gnome-shell"
164181
165 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
166 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
182 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
183 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
167184 msgid "Fix keybinding grab with gnome-shell"
168185 msgstr "Correction des raccourcis clavier dans gnome-shell"
169186
170 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:152
187 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
171188 msgid "First release for GNOME 3.36. Changes:"
172189 msgstr "Première mise à jour pour GNOME 3.36. Changements :"
173190
174 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
191 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
175192 msgid "Update to gnome-shell 3.36.0"
176193 msgstr "Mise à jour de gnome-shell en verison 3.36.0"
177194
178 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
179 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
195 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
196 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
180197 msgid "Compatibility with recent appstream-glib"
181198 msgstr "Compatibilité avec les versions récentes d'appstream-glib"
182199
183 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:192
200 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
184201 msgid "First release for GNOME 3.34. Changes:"
185202 msgstr "Première mise à jour pour GNOME 3.34. Changements :"
186203
187 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
204 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
188205 msgid "Update to gnome-shell 3.34.0"
189206 msgstr "Mise à jour de gnome-shell version 3.34.0"
190207
194211
195212 #: data/control-center/42-gpaste.control-center.xml.in:3
196213 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
197 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:73
214 #: src/ui/gpaste-ui-shortcuts-window.c:73
198215 msgid "Launch the graphical tool"
199216 msgstr "Lancer l'interface graphique"
200217
201218 #: data/control-center/42-gpaste.control-center.xml.in:4
202219 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
203 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:74
220 #: src/ui/gpaste-ui-shortcuts-window.c:74
204221 msgid "Mark the active item as being a password"
205222 msgstr "Marquer l'élément actif comme étant un mot de passe"
206223
207224 #: data/control-center/42-gpaste.control-center.xml.in:5
208225 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
209 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:72
226 #: src/ui/gpaste-ui-shortcuts-window.c:72
210227 msgid "Delete the active item from history"
211228 msgstr "Supprimer l'élément actif de l'historique"
212229
213230 #: data/control-center/42-gpaste.control-center.xml.in:6
214231 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
215 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:75
232 #: src/ui/gpaste-ui-shortcuts-window.c:75
216233 msgid "Display the history"
217234 msgstr "Afficher l'historique"
218235
219236 #: data/control-center/42-gpaste.control-center.xml.in:7
220237 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
221 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:76
238 #: src/ui/gpaste-ui-shortcuts-window.c:76
222239 msgid "Sync the clipboard to the primary selection"
223240 msgstr "Synchroniser le presse-papier avec la sélection primaire"
224241
225242 #: data/control-center/42-gpaste.control-center.xml.in:8
226243 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
227 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:77
244 #: src/ui/gpaste-ui-shortcuts-window.c:77
228245 msgid "Sync the primary selection to the clipboard"
229246 msgstr "Synchroniser la sélection primaire avec le presse-papier"
230247
231248 #: data/control-center/42-gpaste.control-center.xml.in:9
232249 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
233 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:78
250 #: src/ui/gpaste-ui-shortcuts-window.c:78
234251 msgid "Upload the active item to a pastebin service"
235252 msgstr "Téléverser l'élément actif vers un sevice type pastebin"
236253
525542
526543 #. Translators: help for gpaste history
527544 #: src/client/gpaste-client.c:157
528 msgid "print the history with uuids"
529 msgstr "affiche l'historique avec les uuids"
545 msgid "print the history with UUIDs"
546 msgstr "afficher l'historique avec les UUID"
530547
531548 #. Translators: help for gpaste history-size
532549 #: src/client/gpaste-client.c:159
622639 #. Translators: help for gpaste merge <uuid> … <uuid>
623640 #: src/client/gpaste-client.c:183
624641 msgid ""
625 "merge the items matching the uuids from the history and put the result in "
642 "merge the items matching the UUIDs from the history and put the result in "
626643 "the clipboard"
627644 msgstr ""
628 "fusionne les éléments identifées par ces uuids de l'historique et met le "
645 "fusionne les éléments identifées par ces UUID de l'historique et met le "
629646 "résultat dans le presse-papier"
630647
631648 #: src/client/gpaste-client.c:185
733750
734751 #. Translators: help for --use-index
735752 #: src/client/gpaste-client.c:225
736 msgid "use the index of the item instead of its uuid"
737 msgstr "utiliser l'index au lieu de l'uuid"
753 msgid "use the index of the item instead of its UUID"
754 msgstr "utiliser l'index au lieu de l'UUID"
738755
739756 #: src/client/gpaste-client.c:228
740757 #, c-format
796813
797814 #: src/client/gpaste-client.c:808
798815 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
799 #: src/libgpaste/ui/gpaste-ui-window.c:311
816 #: src/ui/gpaste-ui-window.c:311
800817 msgid "Couldn't connect to GPaste daemon"
801818 msgstr "Impossible de se connecter au démon GPaste"
802819
838855 msgstr "tourne déjà."
839856
840857 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
841 #: src/libgpaste/ui/gpaste-ui-switch.c:92
858 #: src/ui/gpaste-ui-switch.c:92
842859 msgid "Track clipboard changes"
843860 msgstr "Suivre les changements du presse-papier"
844861
904921
905922 #. translators: This is the name of a multi-history management action
906923 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
907 #: src/libgpaste/ui/gpaste-ui-panel.c:297
924 #: src/ui/gpaste-ui-panel.c:297
908925 msgid "Switch to"
909926 msgstr "Passer à"
910927
911928 #. translators: This is the name of a multi-history management action
912929 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
913 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
914 #: src/libgpaste/ui/gpaste-ui-delete-history.c:65
915 #: src/libgpaste/ui/gpaste-ui-delete-item.c:49
930 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
931 #: src/ui/gpaste-ui-delete-item.c:49
916932 msgid "Delete"
917933 msgstr "Supprimer"
918934
919 #: src/libgpaste/ui/gpaste-ui-about.c:41
920 msgid "About"
921 msgstr "À propos"
922
923 #: src/libgpaste/ui/gpaste-ui-backup-history.c:43
924 #: src/libgpaste/ui/gpaste-ui-backup-history.c:140
925 msgid "Backup"
926 msgstr "Copier"
927
928 #: src/libgpaste/ui/gpaste-ui-backup-history.c:44
929 #: src/libgpaste/ui/gpaste-ui-edit-item.c:46
930 #: src/libgpaste/ui/gpaste-ui-new-item.c:32 src/libgpaste/util/gpaste-util.c:30
935 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
936 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
931937 msgid "Cancel"
932938 msgstr "Annuler"
933939
934 #: src/libgpaste/ui/gpaste-ui-backup-history.c:47
935 msgid "Under which name do you want to backup this history?"
936 msgstr "Sous quel nom voulez-vous copier cet historique ?"
937
938 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
939 msgid "Are you sure you want to delete this history?"
940 msgstr "Voulez-vous vraiment supprimer cet historique ?"
941
942 #: src/libgpaste/ui/gpaste-ui-edit-item.c:45
943 #: src/libgpaste/ui/gpaste-ui-edit-item.c:118
944 msgid "Edit"
945 msgstr "Modifier"
946
947940 #. Translators: this is the translation for emptying the history
948 #: src/libgpaste/ui/gpaste-ui-empty-history.c:65
949 #: src/libgpaste/util/gpaste-util.c:410
941 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
950942 msgid "Empty"
951943 msgstr "Vider"
952
953 #: src/libgpaste/ui/gpaste-ui-empty-item.c:35
954 msgid "(No result)"
955 msgstr "(Aucun résultat)"
956
957 #: src/libgpaste/ui/gpaste-ui-empty-item.c:49
958 msgid "(Empty)"
959 msgstr "(Vide)"
960
961 #: src/libgpaste/ui/gpaste-ui-empty-item.c:60
962 msgid "(Couldn't connect to GPaste daemon)"
963 msgstr "(Impossible de se connecter au démon GPaste)"
964
965 #: src/libgpaste/ui/gpaste-ui-new-item.c:31
966 #: src/libgpaste/ui/gpaste-ui-new-item.c:83
967 msgid "New"
968 msgstr "Nouveau"
969
970 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
971 msgid "Restart"
972 msgstr "Redémarer"
973
974 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
975 msgid "Do you really want to restart the daemon?"
976 msgstr "Voulez-vous vraiment redémarer le démon ?"
977
978 #: src/libgpaste/ui/gpaste-ui-reexec.c:55
979 msgid "Restart the daemon"
980 msgstr "Redémarer le démon"
981
982 #: src/libgpaste/ui/gpaste-ui-search.c:26
983 msgid "Search"
984 msgstr "Recherche"
985
986 #: src/libgpaste/ui/gpaste-ui-settings.c:32 src/ui/gpaste-ui.c:105
987 msgid "GPaste Settings"
988 msgstr "Préférences du démon GPaste"
989
990 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:64
991 msgid "General"
992 msgstr "Général"
993
994 #: src/libgpaste/ui/gpaste-ui-switch.c:54
995 msgid "Stop"
996 msgstr "Arrêter"
997
998 #: src/libgpaste/ui/gpaste-ui-switch.c:54
999 msgid "Do you really want to stop tracking clipboard changes?"
1000 msgstr ""
1001 "Voulez-vous vraiment arrêter de suivre les changements du presse-papier ?"
1002
1003 #: src/libgpaste/ui/gpaste-ui-upload-item.c:49
1004 msgid "Upload"
1005 msgstr "Publier"
1006944
1007945 #: src/libgpaste/util/gpaste-util.c:410
1008946 msgid "Do you really want to empty the history?"
1012950 msgid "Could not create history dir"
1013951 msgstr "Impossible de créer le dossier d'historique"
1014952
953 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
954 msgid "GPaste Settings"
955 msgstr "Préférences du démon GPaste"
956
1015957 #: src/ui/gpaste-ui.c:106
1016958 msgid "Keyboard Shortcuts"
1017959 msgstr "Raccourcis clavier"
1023965 #: src/ui/gpaste-ui.c:108
1024966 msgid "Quit"
1025967 msgstr "Quitter"
968
969 #: src/ui/gpaste-ui-about.c:41
970 msgid "About"
971 msgstr "À propos"
972
973 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
974 msgid "Backup"
975 msgstr "Copier"
976
977 #: src/ui/gpaste-ui-backup-history.c:47
978 msgid "Under which name do you want to backup this history?"
979 msgstr "Sous quel nom voulez-vous copier cet historique ?"
980
981 #: src/ui/gpaste-ui-delete-history.c:25
982 msgid "Are you sure you want to delete this history?"
983 msgstr "Voulez-vous vraiment supprimer cet historique ?"
984
985 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
986 msgid "Edit"
987 msgstr "Modifier"
988
989 #: src/ui/gpaste-ui-empty-item.c:35
990 msgid "(No result)"
991 msgstr "(Aucun résultat)"
992
993 #: src/ui/gpaste-ui-empty-item.c:49
994 msgid "(Empty)"
995 msgstr "(Vide)"
996
997 #: src/ui/gpaste-ui-empty-item.c:60
998 msgid "(Couldn't connect to GPaste daemon)"
999 msgstr "(Impossible de se connecter au démon GPaste)"
1000
1001 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
1002 msgid "New"
1003 msgstr "Nouveau"
1004
1005 #: src/ui/gpaste-ui-reexec.c:29
1006 msgid "Restart"
1007 msgstr "Redémarer"
1008
1009 #: src/ui/gpaste-ui-reexec.c:29
1010 msgid "Do you really want to restart the daemon?"
1011 msgstr "Voulez-vous vraiment redémarer le démon ?"
1012
1013 #: src/ui/gpaste-ui-reexec.c:55
1014 msgid "Restart the daemon"
1015 msgstr "Redémarer le démon"
1016
1017 #: src/ui/gpaste-ui-search.c:26
1018 msgid "Search"
1019 msgstr "Recherche"
1020
1021 #: src/ui/gpaste-ui-shortcuts-window.c:64
1022 msgid "General"
1023 msgstr "Général"
1024
1025 #: src/ui/gpaste-ui-switch.c:54
1026 msgid "Stop"
1027 msgstr "Arrêter"
1028
1029 #: src/ui/gpaste-ui-switch.c:54
1030 msgid "Do you really want to stop tracking clipboard changes?"
1031 msgstr ""
1032 "Voulez-vous vraiment arrêter de suivre les changements du presse-papier ?"
1033
1034 #: src/ui/gpaste-ui-upload-item.c:49
1035 msgid "Upload"
1036 msgstr "Publier"
0 # SOME DESCRIPTIVE TITLE.
1 # Copyright (C) YEAR Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2 # This file is distributed under the same license as the gpaste package.
3 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4 #
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: gpaste 3.38.4\n"
8 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
9 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
10 "PO-Revision-Date: 2021-01-15 12:32+0000\n"
11 "Last-Translator: wiselynx <wiselynx@fastwebnet.it>\n"
12 "Language-Team: Italian <https://hosted.weblate.org/projects/gpaste/gpaste/it/"
13 ">\n"
14 "Language: it\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18 "Plural-Forms: nplurals=2; plural=n != 1;\n"
19 "X-Generator: Weblate 4.5-dev\n"
20
21 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:5
22 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:4
23 msgid "GPaste"
24 msgstr "GPaste"
25
26 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:6
27 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:5
28 msgid "Manage your clipboard history"
29 msgstr "Gestisci la storia degli appunti"
30
31 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:7
32 msgid "Marc-Antoine Perennou"
33 msgstr "Marc-Antoine Perennou"
34
35 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:13
36 msgid ""
37 "GPaste is a clipboard managing system allowing you to track and manage your "
38 "clipboard history in a highly customizable way."
39 msgstr ""
40 "GPaste è un sistema per la gestione degli appunti che permette di tracciare "
41 "la storia degli appunti in modo altamente personalizzabile."
42
43 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:16
44 msgid ""
45 "GPaste provides you with a graphical tool allowing you to manage everything "
46 "easily."
47 msgstr ""
48 "GPaste ti fornisce uno strumento grafico per gestire tutto agevolmente."
49
50 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:23
51 msgid "The main UI"
52 msgstr "L'interfaccia utente principale"
53
54 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:27
55 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:31
56 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:35
57 msgid "The settings UI"
58 msgstr "L'interfaccia utente delle impostazioni"
59
60 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
63 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
64 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
77 msgid "This is a maintenance release. Changes:"
78 msgstr "Questo è un rilascio di manutenzione. Cambiamenti:"
79
80 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
81 msgid "fix a crash in memory usage checking"
82 msgstr ""
83
84 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
85 #, fuzzy
86 #| msgid "First release for GNOME 3.34. Changes:"
87 msgid "First release for GNOME 40. Changes:"
88 msgstr "Primo rilascio per GNOME 3.34. Cambiamenti:"
89
90 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
91 #, fuzzy
92 #| msgid "Update to gnome-shell 3.34.0"
93 msgid "port to gnome-shell 40"
94 msgstr "Aggiornamento a gnome-shell 3.34.0"
95
96 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
97 msgid "placeholder for gnome-shell prefs"
98 msgstr ""
99
100 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
101 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
102 msgid "fix X11 keybinder outside of GNOME"
103 msgstr ""
104
105 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
106 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
107 msgstr ""
108
109 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
110 msgid ""
111 "gpaste-client now has a --use-index argument for several subcommands to use "
112 "index instead of uuid"
113 msgstr ""
114
115 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
116 msgid "fix the make-password keybinding"
117 msgstr "fix per la scorciatoia da tastiera per rendere password"
118
119 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
120 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
121 msgid "updated translations"
122 msgstr "traduzioni aggiornate"
123
124 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
125 msgid "gnome-shell extension warning fixes"
126 msgstr "fix per warning dell'estensione gnome-shell"
127
128 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
129 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
130 msgid "gnome-shell extension cosmetic updates"
131 msgstr "aggiornamenti cosmetici dell'estensione gnome-shell"
132
133 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
134 msgid "Disable images support by default (can be reenabled in preferences)"
135 msgstr ""
136 "Disabilita di default il supporto per le immagini (può essere riabilitato "
137 "nelle preferenze)"
138
139 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
140 msgid "Search now includes passwords (using their names)"
141 msgstr "La ricerca ora include le password (usando il loro nome)"
142
143 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
144 msgid "systemd integration enhancements"
145 msgstr "miglioramenti nell'integrazione con systemd"
146
147 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
148 msgid "First release for GNOME 3.38. Changes:"
149 msgstr "Primo rilascio per GNOME 3.38. Cambiamenti:"
150
151 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
152 msgid "Drop the Tracking DBus signal"
153 msgstr "Abbandona il segnale Tracking DBus"
154
155 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
156 msgid "Switch to uuids to identify items"
157 msgstr "Passa ad identificare gli oggetti tramite uuid"
158
159 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
160 msgid "Bump DBus interface to org.gnome.GPaste2"
161 msgstr ""
162
163 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
164 msgid "Update to gnome-shell 3.38.0"
165 msgstr "Aggiorna a gnome-shell 3.38.0"
166
167 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
168 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
169 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
170 msgid "Fix activating items using Ctrl-Number in gnome-shell"
171 msgstr "Fix per l'attivazione degli elementi con Ctrl-Numero in gnome-shell"
172
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
174 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
175 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
176 #, fuzzy
177 msgid "Fix keybinding regrab with gnome-shell"
178 msgstr "Fix per la riassegnazione delle scorciatoie da tastiera in gnome-shell"
179
180 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
181 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
182 msgid "Fix keybinding grab with gnome-shell"
183 msgstr ""
184
185 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
186 msgid "First release for GNOME 3.36. Changes:"
187 msgstr "Primo rilascio per GNOME 3.36. Cambiamenti:"
188
189 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
190 msgid "Update to gnome-shell 3.36.0"
191 msgstr "Aggiornamento a gnome-shell 3.36.0"
192
193 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
194 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
195 msgid "Compatibility with recent appstream-glib"
196 msgstr "Compatibilità con appstream-glib recente"
197
198 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
199 msgid "First release for GNOME 3.34. Changes:"
200 msgstr "Primo rilascio per GNOME 3.34. Cambiamenti:"
201
202 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
203 msgid "Update to gnome-shell 3.34.0"
204 msgstr "Aggiornamento a gnome-shell 3.34.0"
205
206 #: data/control-center/42-gpaste.control-center.xml.in:2
207 msgid "@GETTEXT_PACKAGE@"
208 msgstr "@GETTEXT_PACKAGE@"
209
210 #: data/control-center/42-gpaste.control-center.xml.in:3
211 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
212 #: src/ui/gpaste-ui-shortcuts-window.c:73
213 msgid "Launch the graphical tool"
214 msgstr "Lancia lo strumento grafico"
215
216 #: data/control-center/42-gpaste.control-center.xml.in:4
217 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
218 #: src/ui/gpaste-ui-shortcuts-window.c:74
219 msgid "Mark the active item as being a password"
220 msgstr "Segna l'elemento attivo come password"
221
222 #: data/control-center/42-gpaste.control-center.xml.in:5
223 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
224 #: src/ui/gpaste-ui-shortcuts-window.c:72
225 msgid "Delete the active item from history"
226 msgstr "Elimina l'elemento attivo dallo storico"
227
228 #: data/control-center/42-gpaste.control-center.xml.in:6
229 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
230 #: src/ui/gpaste-ui-shortcuts-window.c:75
231 msgid "Display the history"
232 msgstr "Mostra lo storico"
233
234 #: data/control-center/42-gpaste.control-center.xml.in:7
235 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
236 #: src/ui/gpaste-ui-shortcuts-window.c:76
237 msgid "Sync the clipboard to the primary selection"
238 msgstr "Sincronizza gli appunti alla selezione primaria"
239
240 #: data/control-center/42-gpaste.control-center.xml.in:8
241 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
242 #: src/ui/gpaste-ui-shortcuts-window.c:77
243 msgid "Sync the primary selection to the clipboard"
244 msgstr "Sincronizza la selezione primaria agli appunti"
245
246 #: data/control-center/42-gpaste.control-center.xml.in:9
247 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
248 #: src/ui/gpaste-ui-shortcuts-window.c:78
249 msgid "Upload the active item to a pastebin service"
250 msgstr "Esegui l'upload dell'elemento attivo ad un servizio pastebin"
251
252 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:6
253 msgid "Clipboard;Manager;Settings;Preferences;Configuration;"
254 msgstr "Appunti;Manager;Impostazioni;Preferenze;Configurazione;"
255
256 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:7
257 msgid "Max size of an element when displaying it"
258 msgstr "Dimensione massima di un elemento quando viene visualizzato"
259
260 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:8
261 msgid ""
262 "The extra stuff of that element will be replaced by \"…\", and newlines by "
263 "\" \" when displaying from the applet, 0 to disable."
264 msgstr ""
265 "La roba extra di quell'elemento sarà rimpiazzata da \"...\", ed i ritorni a "
266 "capo da \" \" nella visualizzazione dall'applet, 0 per disabilitare."
267
268 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:15
269 #, fuzzy
270 msgid "Do we detect and replace growing lines in history?"
271 msgstr "Rileviamo e rimpiazziamo le linee in aumento nello storico?"
272
273 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:16
274 msgid ""
275 "By default, selecting \"Here is\", then \"Here is an example\" will create "
276 "two entries in the history. With this feature enabled, the first one will be "
277 "replaced by the second one."
278 msgstr ""
279 "Di default, selezionando \"Qui c'è\", poi \"Qui c'è un esempio\" creerà due "
280 "voci nello storico. Con questa funzione attiva, la prima verrà rimpiazzata "
281 "dalla seconda."
282
283 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:24
284 msgid "The name of the current history"
285 msgstr "Il nome dello storico corrente"
286
287 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:25
288 msgid "The default name is \"history\""
289 msgstr "Il nome di default è \"storico\""
290
291 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:32
292 msgid "Do we save the images copied to history, or only text?"
293 msgstr "Salviamo le immagine copiate nello storico, o solo il testo?"
294
295 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:33
296 msgid "By default, we're saving only text"
297 msgstr "Di default salviamo solo il testo"
298
299 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:40
300 msgid "Do we close the UI after selecting an item?"
301 msgstr "Chiudiamo l'interfaccia utente dopo aver selezionato un elemento?"
302
303 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:41
304 msgid "By default, we close it"
305 msgstr "Di default la chiudiamo"
306
307 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:48
308 msgid "The keyboard shortcut to launch the graphical interface"
309 msgstr "La scorciatoia da tastiera per lanciare l'interfaccia grafica"
310
311 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:49
312 msgid ""
313 "By default, hitting ctrl + alt + g does that (\"<Ctrl><Alt>G\"). An empty "
314 "string here disables this functionnality."
315 msgstr ""
316 "Di default avviene premendo ctrl + alt + g (\"<Ctrl><Alt>G\"). Una stringa "
317 "vuota qui disabilita questa funzionalità."
318
319 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:57
320 msgid "The keyboard shortcut to mark the active item as being a password"
321 msgstr "La scorciatoia da tastiera per segnare l'elemento attivo come password"
322
323 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:58
324 msgid ""
325 "By default, hitting ctrl + alt + s will mark the active item as being a "
326 "password (\"<Ctrl><Alt>S\"). An empty string here disables this "
327 "functionnality."
328 msgstr ""
329 "Di default, premendo ctrl + alt + s segnerà l'elemento attivo come password "
330 "(\"<Ctrl><Alt>S\"). Una stringa vuota qui disabilita questa funzionalità."
331
332 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:67
333 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:208
334 msgid "Max displayed history size"
335 msgstr "Dimensione massima dello storico visualizzato"
336
337 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:68
338 msgid "Maximum number of items displayed in the history"
339 msgstr "Numero massimo di elementi mostrati nello storico"
340
341 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:76
342 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:215
343 msgid "Max history size"
344 msgstr "Dimensione massima dello storico"
345
346 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:77
347 msgid "Maximum number of items in history"
348 msgstr "Numero massimo di elementi nello storico"
349
350 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:85
351 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:222
352 msgid "Max memory usage (MB)"
353 msgstr "Memoria massima utilizzata (MB)"
354
355 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:86
356 msgid "Maximum amount of memory used to store contents"
357 msgstr "Quantitativo massimo di memoria usato per memorizzare i contenuti"
358
359 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:94
360 msgid "Max text item size"
361 msgstr "Dimensione massima degli elementi di testo"
362
363 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:95
364 msgid "Maximum size of a text item. Anything out of this boundary is ignored."
365 msgstr ""
366 "Dimensione massima di un elemento di testo. Qualsiasi cosa oltre questo "
367 "limite viene ignorata."
368
369 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:103
370 msgid "Min text item size"
371 msgstr "Dimensione minima degli elementi di testo"
372
373 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:104
374 msgid "Minimum size of a text item. Anything out of this boundary is ignored."
375 msgstr ""
376 "Dimensione minima di un elemento di testo. Qualsiasi cosa fuori da questo "
377 "limite viene ignorata."
378
379 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:111
380 msgid "The keyboard shortcut to delete the first element in history"
381 msgstr ""
382 "La scorciatoia da tastiera per cancellare il primo elemento nello storico"
383
384 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:112
385 msgid ""
386 "By default, hitting ctrl + alt + v does that (\"<Ctrl><Alt>V\"). An empty "
387 "string here disables this functionnality."
388 msgstr ""
389 "Di default, ciò avviene premendo ctrl + alt + v (\"<Ctrl><Alt>V\"). Una "
390 "stringa vuota qui disabilita la funzionalità."
391
392 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:120
393 msgid "Does the primary selection affects history?"
394 msgstr "La selezione primaria ha effetto sullo storico?"
395
396 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:121
397 msgid "By default, only clipboard (ctrl+c) affects history."
398 msgstr "Di default, solo gli appunti (ctrl+c) hanno effetto sullo storico."
399
400 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:128
401 msgid ""
402 "Do we save all versions of selected rich text (e.g. html) or just the plain "
403 "text version?"
404 msgstr ""
405 "Salviamo tutte le versioni del rich text (ad es. html) selezionato o solo la "
406 "versione plain text?"
407
408 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:129
409 msgid "By default, we're saving all"
410 msgstr "Di default, salviamo tutto"
411
412 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:136
413 msgid "Do we save the history from one session to another?"
414 msgstr "Salviamo lo storico da una sessione all'altra?"
415
416 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:137
417 msgid "By default, we're saving it"
418 msgstr "Di default, lo salviamo"
419
420 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:144
421 msgid "The keyboard shortcut to display the menu"
422 msgstr "La scorciatoia da tastiera per visualizzare il menu"
423
424 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:145
425 msgid ""
426 "By default, hitting ctrl + alt + h displays the menu (\"<Ctrl><Alt>H\"). An "
427 "empty string here disables this functionnality."
428 msgstr ""
429 "Di default, premendo ctrl + alt + h mostra il menu (\"<Ctrl><Alt>H\"). Una "
430 "stringa vuota qui disabilita questa funzionalità."
431
432 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:153
433 msgid "The keyboard shortcut to sync the clipboard to the primary selection"
434 msgstr ""
435 "La scorciatoia da tastiera per sincronizzare dagli appunti alla selezione "
436 "primaria"
437
438 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:154
439 msgid ""
440 "By default, hitting ctrl + alt + o syncs them (\"<Ctrl><Alt>P\"). An empty "
441 "string here disables this functionnality."
442 msgstr ""
443 "Di default, premendo ctrl + alt + o li sincronizza (\"<Ctrl><Alt>P\"). Una "
444 "stringa vuota qui disabilita questa funzionalità."
445
446 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:162
447 msgid "The keyboard shortcut to sync the primary selection to the clipboard"
448 msgstr ""
449 "La scorciatoia da tastiera per sincronizzare dalla selezione primaria agli "
450 "appunti"
451
452 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:163
453 msgid ""
454 "By default, hitting ctrl + alt + p syncs them (\"<Ctrl><Alt>P\"). An empty "
455 "string here disables this functionnality."
456 msgstr ""
457 "Di default, premendo ctrl + alt + p li sincronizza (\"<Ctrl><Alt>P\"). Una "
458 "stringa vuota qui disabilita questa funzionalità."
459
460 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:171
461 msgid "Are the primary selection and the clipboard synchronized?"
462 msgstr "La selezione primaria e gli appunti sono sincronizzati?"
463
464 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:172
465 msgid "By default, the primary selection and the clipboard are independent."
466 msgstr "Di default, la selezione primaria e gli appunti sono indipendenti."
467
468 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:179
469 msgid "Do we track the clipboard changes?"
470 msgstr "Tracciamo i cambiamenti negli appunti?"
471
472 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:180
473 msgid "By default, we're tracking those changes."
474 msgstr "Di default, questi cambiamenti sono tracciati."
475
476 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:187
477 msgid ""
478 "Do we sync the daemon state with the gnome-shell extension's one? (disable "
479 "the daemon when disabling the extension)"
480 msgstr ""
481 "Sincronizziamo lo stato del demone con quello della estensione gnome-shell? "
482 "(il demone viene disabilitato quando viene disabilitata l'estensione)"
483
484 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:188
485 msgid "By default, the daemon state keeps unchanged"
486 msgstr "Di default, lo stato del demone rimane inalterato"
487
488 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:195
489 msgid "Do we trim the textual items before adding them to history?"
490 msgstr "Accorciamo gli elementi testuali prima di aggiungerli allo storico?"
491
492 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:196
493 msgid ""
494 "Trimming means removing all trailing and ending spaces. By default, we're "
495 "letting them as-is."
496 msgstr ""
497 "Accorciare significa rimuovere tutta la spaziatura iniziale e finale. Di "
498 "default, la lasciamo com'è."
499
500 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:204
501 msgid ""
502 "The keyboard shortcut to upload the first element in history to a pastebin "
503 "service"
504 msgstr ""
505 "La scorciatoia da tastiera per eseguire l'upload del primo elemento nello "
506 "storico verso un servizio pastebin"
507
508 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:205
509 msgid ""
510 "By default, hitting ctrl + alt + u does that (\"<Ctrl><Alt>U\"). An empty "
511 "string here disables this functionnality."
512 msgstr ""
513 "Di default, ciò avviene premendo ctrl + alt + u (\"<Ctrl><Alt>U\"). Una "
514 "stringa vuota qui disabilita questa funzionalità."
515
516 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:213
517 msgid "Do we prompt for confirmation when emptying an history?"
518 msgstr "Chiediamo conferma prima di svuotare uno storico?"
519
520 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:214
521 msgid "By default, we do as it's a destructive action"
522 msgstr "Di default lo facciamo, poiché e una azione distruttiva"
523
524 #: src/client/gpaste-client.c:143 src/client/gpaste-client.c:437
525 msgid "Couldn't spawn"
526 msgstr ""
527
528 #: src/client/gpaste-client.c:155
529 #, c-format
530 msgid "Usage:\n"
531 msgstr "Utilizzo:\n"
532
533 #. Translators: help for gpaste history
534 #: src/client/gpaste-client.c:157
535 #, fuzzy
536 #| msgid "print the history with indexes"
537 msgid "print the history with UUIDs"
538 msgstr "stampa lo storico con gli indici"
539
540 #. Translators: help for gpaste history-size
541 #: src/client/gpaste-client.c:159
542 msgid "print the size of the history"
543 msgstr "stampa la dimensione dello storico"
544
545 #. Translators: help for gpaste get-history
546 #: src/client/gpaste-client.c:161
547 msgid "get the name of the current history"
548 msgstr "ottieni il nome dello storico corrente"
549
550 #. Translators: help for gpaste backup-history <name>
551 #. Translators: help for gpaste switch-history <name>
552 #. Translators: help for gpaste delete-history <name>
553 #. Translators: help for gpaste add-password <name> <text>
554 #. Translators: help for gpaste set-password <uuid> <name>
555 #. Translators: help for gpaste delete-passworf <name>
556 #: src/client/gpaste-client.c:163 src/client/gpaste-client.c:165
557 #: src/client/gpaste-client.c:167 src/client/gpaste-client.c:173
558 #: src/client/gpaste-client.c:185 src/client/gpaste-client.c:189
559 msgid "name"
560 msgstr "nome"
561
562 #: src/client/gpaste-client.c:163
563 msgid "backup current history"
564 msgstr "esegui backup dello storico corrente"
565
566 #: src/client/gpaste-client.c:165
567 msgid "switch to another history"
568 msgstr "passa ad un altro storico"
569
570 #: src/client/gpaste-client.c:167
571 msgid "delete a history"
572 msgstr "cancella uno storico"
573
574 #. Translators: help for gpaste list-histories
575 #: src/client/gpaste-client.c:169
576 msgid "list available histories"
577 msgstr "elenca gli storici disponibili"
578
579 #. Translators: help for gpaste add <text>
580 #: src/client/gpaste-client.c:171
581 msgid "text"
582 msgstr "testo"
583
584 #: src/client/gpaste-client.c:171
585 msgid "set text to clipboard"
586 msgstr ""
587
588 #: src/client/gpaste-client.c:173
589 #, fuzzy
590 msgid "password"
591 msgstr "password"
592
593 #: src/client/gpaste-client.c:173
594 msgid "add the name - password couple to the clipboard"
595 msgstr "aggiungi la coppia nome - password agli appunti"
596
597 #. Translators: help for gpaste rename-password <old name> <new name>
598 #: src/client/gpaste-client.c:175
599 msgid "old name"
600 msgstr "vecchio nome"
601
602 #: src/client/gpaste-client.c:175
603 msgid "new name"
604 msgstr "nuovo nome"
605
606 #: src/client/gpaste-client.c:175
607 msgid "rename the password"
608 msgstr "rinomina la password"
609
610 #. Translators: help for gpaste get <uuid>
611 #: src/client/gpaste-client.c:177
612 msgid "get the item <uuid> from the history"
613 msgstr "ottieni l'elemento <uuid> dallo storico"
614
615 #. Translators: help for gpaste select <uuid>
616 #: src/client/gpaste-client.c:179
617 msgid "set the item <uuid> from the history to the clipboard"
618 msgstr ""
619
620 #. Translators: help for gpaste replace <uuid> <contents>
621 #: src/client/gpaste-client.c:181
622 msgid "contents"
623 msgstr ""
624
625 #: src/client/gpaste-client.c:181
626 msgid ""
627 "replace the contents of the item <uuid> from the history with the provided "
628 "one"
629 msgstr ""
630 "rimpiazza il contenuto dell'elemento <uuid> nello storico con quello fornito"
631
632 #. Translators: help for gpaste merge <uuid> … <uuid>
633 #: src/client/gpaste-client.c:183
634 #, fuzzy
635 #| msgid ""
636 #| "merge the items matching the uuids from the history and put the result in "
637 #| "the clipboard"
638 msgid ""
639 "merge the items matching the UUIDs from the history and put the result in "
640 "the clipboard"
641 msgstr ""
642 "unisci gli elementi che corrispondono agli uuid nello storico e metti i il "
643 "risultato negli appunti"
644
645 #: src/client/gpaste-client.c:185
646 msgid "set the item <uuid> from the history as a password named <name>"
647 msgstr "imposta l'elemento <uuid> nello storico come password con nome <name>"
648
649 #. Translators: help for gpaste delete <uuid>
650 #: src/client/gpaste-client.c:187
651 msgid "delete item <uuid> from the history"
652 msgstr "cancella l'elemento <uuid> dallo storico"
653
654 #: src/client/gpaste-client.c:189
655 msgid "delete the password <name> from the history"
656 msgstr "cancella la password <name> dallo storico"
657
658 #. Translators: help for gpaste file <path>
659 #: src/client/gpaste-client.c:191
660 msgid "path"
661 msgstr "percorso"
662
663 #: src/client/gpaste-client.c:191
664 msgid "put the content of the file at <path> into the clipboard"
665 msgstr "inserisci il contenuto del file <path> negli appunti"
666
667 #. Translators: help for whatever | gpaste
668 #: src/client/gpaste-client.c:193
669 msgid "whatever"
670 msgstr "qualunque"
671
672 #: src/client/gpaste-client.c:193
673 msgid "set the output of whatever to clipboard"
674 msgstr ""
675
676 #. Translators: help for gpaste empty
677 #: src/client/gpaste-client.c:195
678 msgid "empty the history"
679 msgstr "svuota lo storico"
680
681 #. Translators: help for gpaste start
682 #: src/client/gpaste-client.c:197
683 msgid "start tracking clipboard changes"
684 msgstr "inizia a tracciare i cambiamenti negli appunti"
685
686 #. Translators: help for gpaste stop
687 #: src/client/gpaste-client.c:199
688 msgid "stop tracking clipboard changes"
689 msgstr "smetti di tracciare i cambiamenti negli appunti"
690
691 #. Translators: help for gpaste quit
692 #: src/client/gpaste-client.c:201
693 msgid "alias for stop"
694 msgstr "alias per stop"
695
696 #. Translators: help for gpaste daemon-reexec
697 #: src/client/gpaste-client.c:203
698 msgid "reexecute the daemon (after upgrading...)"
699 msgstr "riesegui il demone (dopo un aggiornamento...)"
700
701 #. Translators: help for gpaste settings
702 #: src/client/gpaste-client.c:205
703 msgid "launch the configuration tool"
704 msgstr "lancia lo strumento di configurazione"
705
706 #. Translators: help for gpaste ui
707 #: src/client/gpaste-client.c:207
708 msgid "launch the graphical tool"
709 msgstr "lancia lo strumento grafico"
710
711 #. Translators: help for gpaste show-history
712 #: src/client/gpaste-client.c:209
713 msgid "make the applet or extension display the history"
714 msgstr "fai visualizzare lo storico all'applet o all'estensione"
715
716 #. Translators: help for gpaste upload
717 #: src/client/gpaste-client.c:211
718 msgid "upload the item <uuid> to a pastebin service"
719 msgstr "esegui l'upload dell'elemento <uuid>ad un servizio pastebin"
720
721 #. Translators: help for gpaste version
722 #: src/client/gpaste-client.c:213
723 msgid "display the version"
724 msgstr "mostra la versione"
725
726 #. Translators: help for gpaste daemon-version
727 #: src/client/gpaste-client.c:215
728 msgid "display the daemon version"
729 msgstr "mostra la versione del demone"
730
731 #. Translators: help for gpaste help
732 #: src/client/gpaste-client.c:217
733 msgid "display this help"
734 msgstr "mostra questo help"
735
736 #. Translators: help for gpaste about
737 #: src/client/gpaste-client.c:219
738 msgid "display the about dialog"
739 msgstr ""
740
741 #: src/client/gpaste-client.c:222
742 #, c-format
743 msgid "Convenience options:"
744 msgstr ""
745
746 #. Translators: help for --use-index
747 #: src/client/gpaste-client.c:225
748 msgid "use the index of the item instead of its UUID"
749 msgstr ""
750
751 #: src/client/gpaste-client.c:228
752 #, c-format
753 msgid "Display options:"
754 msgstr "Mostra le opzioni:"
755
756 #. Translators: help for --oneline
757 #: src/client/gpaste-client.c:231
758 msgid "display each item on only one line"
759 msgstr "mostra ogni elemento su un'unica riga"
760
761 #. Translators: help for --raw
762 #: src/client/gpaste-client.c:233
763 msgid "display each item raw (without line numbers)"
764 msgstr "mostra ogni elemento in formato grezzo (senza numeri di linea)"
765
766 #. Translators: help for --reverse
767 #: src/client/gpaste-client.c:235
768 msgid "display the items in reverse order"
769 msgstr "mostra gli elementi in ordine inverso"
770
771 #. Translators: help for --zero
772 #: src/client/gpaste-client.c:237
773 msgid "use a NUL character instead of a new line betweean each item"
774 msgstr "uns un carattere NUL invece di un a capo tra ogni elemento"
775
776 #: src/client/gpaste-client.c:240
777 #, c-format
778 msgid "Merge options:"
779 msgstr ""
780
781 #. Translators: help for --decoration <string>
782 #. Translators: help for --separator <string>
783 #: src/client/gpaste-client.c:243 src/client/gpaste-client.c:245
784 msgid "string"
785 msgstr "stringa"
786
787 #: src/client/gpaste-client.c:243
788 msgid ""
789 "add the given decoration to the beginning and the end of each item before "
790 "merging"
791 msgstr ""
792
793 #: src/client/gpaste-client.c:245
794 msgid "add the given separator between each item when merging"
795 msgstr "aggiungi tra ogni elemento il separatore indicato quando unisci"
796
797 #: src/client/gpaste-client.c:342
798 #, c-format
799 msgid "Successfully reexecuted the daemon\n"
800 msgstr "Demone rieseguito con successo\n"
801
802 #: src/client/gpaste-client.c:491
803 msgid "Cannot add non utf8 data as text."
804 msgstr "Impossibile aggiungere dati non utf8 come testo."
805
806 #: src/client/gpaste-client.c:808
807 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
808 #: src/ui/gpaste-ui-window.c:311
809 msgid "Couldn't connect to GPaste daemon"
810 msgstr "Impossibile connettersi al demone GPaste"
811
812 #: src/daemon/gpaste-daemon.c:33
813 msgid "Stop signal received, exiting"
814 msgstr ""
815
816 #: src/daemon/gpaste-daemon.c:70
817 msgid "Could not acquire DBus name."
818 msgstr "Impossibile acquisire un nome DBus."
819
820 #. This is the date format "month/day/year time"
821 #: src/libgpaste/core/gpaste-image-item.c:240
822 msgid "%m/%d/%y %T"
823 msgstr ""
824
825 #. This gets displayed in history when selecting an image
826 #: src/libgpaste/core/gpaste-image-item.c:242
827 #, c-format
828 msgid "[Image, %d x %d (%s)]"
829 msgstr "[Immagine, %d x %d (%s)]"
830
831 #. This is the prefix displayed in history to identify a password
832 #: src/libgpaste/core/gpaste-password-item.c:67
833 msgid "Password"
834 msgstr "Password"
835
836 #. This is the prefix displayed in history to identify selected files
837 #: src/libgpaste/core/gpaste-uris-item.c:104
838 msgid "[Files] "
839 msgstr "[File] "
840
841 #: src/libgpaste/gpaste-macros.h:98
842 msgid "Failed to register the gtk application"
843 msgstr "Impossibile registrare l'applicazione gtk"
844
845 #: src/libgpaste/gpaste-macros.h:110
846 msgid "is already running."
847 msgstr "è già in esecuzione."
848
849 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
850 #: src/ui/gpaste-ui-switch.c:92
851 msgid "Track clipboard changes"
852 msgstr "Traccia i cambiamenti negli appunti"
853
854 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:122
855 msgid "Close UI on select"
856 msgstr "Chiudi l'interfaccia utente sulla selezione"
857
858 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:131
859 msgid "Enable the gnome-shell extension"
860 msgstr "Abilita l'estensione gnome-shell"
861
862 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:137
863 msgid "Sync the daemon state with the extension's one"
864 msgstr "Sincronizza lo stato del demone con quello dell'estensione"
865
866 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:146
867 msgid "Primary selection affects history"
868 msgstr "La selezione primaria influenza lo storico"
869
870 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:152
871 msgid "Synchronize clipboard with primary selection"
872 msgstr "Sincronizza gli appunti con la selezione primaria"
873
874 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:159
875 msgid "Images support"
876 msgstr "Supporto per le immagini"
877
878 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:165
879 msgid "Trim items"
880 msgstr "Accorcia gli elementi"
881
882 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:171
883 msgid "Detect growing lines"
884 msgstr ""
885
886 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:178
887 msgid "Save history"
888 msgstr "Salva lo storico"
889
890 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:201
891 msgid "Max element size when displaying"
892 msgstr "Dimensione massima degli elementi in visualizzazione"
893
894 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:229
895 msgid "Max text item length"
896 msgstr "Lunghezza massima degli elementi di testo"
897
898 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:236
899 msgid "Min text item length"
900 msgstr "Lunghezza minima degli elementi di testo"
901
902 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:334
903 msgid "General behaviour"
904 msgstr "Comportamento generale"
905
906 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:335
907 msgid "History settings"
908 msgstr "Impostazioni dello storico"
909
910 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:336
911 msgid "Keyboard shortcuts"
912 msgstr "Scorciatoie da tastiera"
913
914 #. translators: This is the name of a multi-history management action
915 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
916 #: src/ui/gpaste-ui-panel.c:297
917 msgid "Switch to"
918 msgstr "Passa a"
919
920 #. translators: This is the name of a multi-history management action
921 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
922 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
923 #: src/ui/gpaste-ui-delete-item.c:49
924 msgid "Delete"
925 msgstr "Cancella"
926
927 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
928 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
929 msgid "Cancel"
930 msgstr "Annulla"
931
932 #. Translators: this is the translation for emptying the history
933 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
934 msgid "Empty"
935 msgstr "Svuota"
936
937 #: src/libgpaste/util/gpaste-util.c:410
938 msgid "Do you really want to empty the history?"
939 msgstr "Vuoi davvero vuotare lo storico?"
940
941 #: src/libgpaste/util/gpaste-util.c:709
942 msgid "Could not create history dir"
943 msgstr "Impossibile creare la directory dello storico"
944
945 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
946 msgid "GPaste Settings"
947 msgstr "Impostazioni di GPaste"
948
949 #: src/ui/gpaste-ui.c:106
950 msgid "Keyboard Shortcuts"
951 msgstr "Scorciatoie da Tastiera"
952
953 #: src/ui/gpaste-ui.c:107
954 msgid "About GPaste"
955 msgstr "Su GPaste"
956
957 #: src/ui/gpaste-ui.c:108
958 msgid "Quit"
959 msgstr "Esci"
960
961 #: src/ui/gpaste-ui-about.c:41
962 msgid "About"
963 msgstr ""
964
965 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
966 msgid "Backup"
967 msgstr "Backup"
968
969 #: src/ui/gpaste-ui-backup-history.c:47
970 msgid "Under which name do you want to backup this history?"
971 msgstr "Con che nome vuoi eseguire il backup di questo storico?"
972
973 #: src/ui/gpaste-ui-delete-history.c:25
974 msgid "Are you sure you want to delete this history?"
975 msgstr "Sei sicuro di voler cancellare questo storico?"
976
977 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
978 msgid "Edit"
979 msgstr "Modifica"
980
981 #: src/ui/gpaste-ui-empty-item.c:35
982 msgid "(No result)"
983 msgstr "(Nessun risultato)"
984
985 #: src/ui/gpaste-ui-empty-item.c:49
986 msgid "(Empty)"
987 msgstr ""
988
989 #: src/ui/gpaste-ui-empty-item.c:60
990 msgid "(Couldn't connect to GPaste daemon)"
991 msgstr "(Impossibile connettersi al demone GPaste)"
992
993 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
994 msgid "New"
995 msgstr "Nuovo"
996
997 #: src/ui/gpaste-ui-reexec.c:29
998 msgid "Restart"
999 msgstr "Riavvia"
1000
1001 #: src/ui/gpaste-ui-reexec.c:29
1002 msgid "Do you really want to restart the daemon?"
1003 msgstr "Vuoi davvero riavviare il demone?"
1004
1005 #: src/ui/gpaste-ui-reexec.c:55
1006 msgid "Restart the daemon"
1007 msgstr "Riavvia il demone"
1008
1009 #: src/ui/gpaste-ui-search.c:26
1010 msgid "Search"
1011 msgstr "Cerca"
1012
1013 #: src/ui/gpaste-ui-shortcuts-window.c:64
1014 msgid "General"
1015 msgstr "Generale"
1016
1017 #: src/ui/gpaste-ui-switch.c:54
1018 msgid "Stop"
1019 msgstr "Arresta"
1020
1021 #: src/ui/gpaste-ui-switch.c:54
1022 msgid "Do you really want to stop tracking clipboard changes?"
1023 msgstr "Vuoi davvero smettere di tracciare i cambiamenti degli appunti?"
1024
1025 #: src/ui/gpaste-ui-upload-item.c:49
1026 msgid "Upload"
1027 msgstr "Upload"
+166
-155
po/ja.po less more
66 msgstr ""
77 "Project-Id-Version: GPaste\n"
88 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
9 "POT-Creation-Date: 2021-03-08 22:16+0100\n"
9 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
1010 "PO-Revision-Date: 2020-04-10 21:57-0400\n"
1111 "Last-Translator: Peniel Vargas <tsuneake.kaemitsu@gmail.com>\n"
1212 "Language-Team: Japanese\n"
5858 msgstr "GPaste の設定"
5959
6060 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:56
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:65
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
6362 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
6463 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:91
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:120
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:128
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:136
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:144
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:160
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:168
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:176
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:184
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:200
64 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
7677 msgid "This is a maintenance release. Changes:"
7778 msgstr ""
7879
7980 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
80 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:114
81 msgid "fix a crash in memory usage checking"
82 msgstr ""
83
84 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
85 msgid "First release for GNOME 40. Changes:"
86 msgstr ""
87
88 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
89 msgid "port to gnome-shell 40"
90 msgstr ""
91
92 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
93 msgid "placeholder for gnome-shell prefs"
94 msgstr ""
95
96 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
97 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
8198 msgid "fix X11 keybinder outside of GNOME"
8299 msgstr ""
83100
84 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:58
101 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
85102 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
86103 msgstr ""
87104
88 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
105 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
89106 msgid ""
90107 "gpaste-client now has a --use-index argument for several subcommands to use "
91108 "index instead of uuid"
92109 msgstr ""
93110
94 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:67
111 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
95112 msgid "fix the make-password keybinding"
96113 msgstr ""
97114
98 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
99 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
115 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
116 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
100117 msgid "updated translations"
101118 msgstr ""
102119
103 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
120 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
104121 #, fuzzy
105122 #| msgid "Enable the gnome-shell extension"
106123 msgid "gnome-shell extension warning fixes"
107124 msgstr "GNOME Shell 拡張機能を有効化する"
108125
109 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
110 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
126 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
127 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
111128 #, fuzzy
112129 #| msgid "Enable the gnome-shell extension"
113130 msgid "gnome-shell extension cosmetic updates"
114131 msgstr "GNOME Shell 拡張機能を有効化する"
115132
116 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:93
133 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
117134 msgid "Disable images support by default (can be reenabled in preferences)"
118135 msgstr ""
119136
120 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
137 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
121138 msgid "Search now includes passwords (using their names)"
122139 msgstr ""
123140
124 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
141 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
125142 msgid "systemd integration enhancements"
126143 msgstr ""
127144
128 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
145 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
129146 msgid "First release for GNOME 3.38. Changes:"
130147 msgstr ""
131148
132 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
149 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
133150 msgid "Drop the Tracking DBus signal"
134151 msgstr ""
135152
136 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:104
153 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
137154 msgid "Switch to uuids to identify items"
138155 msgstr ""
139156
140 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:105
157 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
141158 msgid "Bump DBus interface to org.gnome.GPaste2"
142159 msgstr ""
143160
144 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:106
161 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
145162 msgid "Update to gnome-shell 3.38.0"
146163 msgstr ""
147164
148 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
149 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
165 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
166 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
167 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
168 msgid "Fix activating items using Ctrl-Number in gnome-shell"
169 msgstr ""
170
171 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
172 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
174 msgid "Fix keybinding regrab with gnome-shell"
175 msgstr ""
176
177 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
178 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
179 msgid "Fix keybinding grab with gnome-shell"
180 msgstr ""
181
182 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
183 msgid "First release for GNOME 3.36. Changes:"
184 msgstr ""
185
186 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
187 msgid "Update to gnome-shell 3.36.0"
188 msgstr ""
189
150190 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
151 msgid "Fix activating items using Ctrl-Number in gnome-shell"
152 msgstr ""
153
154 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
155 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
156 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:203
157 msgid "Fix keybinding regrab with gnome-shell"
158 msgstr ""
159
160 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
161 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
162 msgid "Fix keybinding grab with gnome-shell"
163 msgstr ""
164
165 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:152
166 msgid "First release for GNOME 3.36. Changes:"
167 msgstr ""
168
169 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
170 msgid "Update to gnome-shell 3.36.0"
171 msgstr ""
172
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
174 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
191 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
175192 msgid "Compatibility with recent appstream-glib"
176193 msgstr ""
177194
178 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:192
195 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
179196 msgid "First release for GNOME 3.34. Changes:"
180197 msgstr ""
181198
182 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
199 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
183200 msgid "Update to gnome-shell 3.34.0"
184201 msgstr ""
185202
189206
190207 #: data/control-center/42-gpaste.control-center.xml.in:3
191208 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
192 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:73
209 #: src/ui/gpaste-ui-shortcuts-window.c:73
193210 msgid "Launch the graphical tool"
194211 msgstr "GUI ツールを起動する"
195212
196213 #: data/control-center/42-gpaste.control-center.xml.in:4
197214 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
198 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:74
215 #: src/ui/gpaste-ui-shortcuts-window.c:74
199216 msgid "Mark the active item as being a password"
200217 msgstr "アクティブな項目をパスワードとしてマークする"
201218
202219 #: data/control-center/42-gpaste.control-center.xml.in:5
203220 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
204 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:72
221 #: src/ui/gpaste-ui-shortcuts-window.c:72
205222 msgid "Delete the active item from history"
206223 msgstr "履歴からアクティブな項目を削除する"
207224
208225 #: data/control-center/42-gpaste.control-center.xml.in:6
209226 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
210 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:75
227 #: src/ui/gpaste-ui-shortcuts-window.c:75
211228 msgid "Display the history"
212229 msgstr "履歴を表示する"
213230
214231 #: data/control-center/42-gpaste.control-center.xml.in:7
215232 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
216 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:76
233 #: src/ui/gpaste-ui-shortcuts-window.c:76
217234 msgid "Sync the clipboard to the primary selection"
218235 msgstr "クリップボードからプライマリー選択に同期する"
219236
220237 #: data/control-center/42-gpaste.control-center.xml.in:8
221238 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
222 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:77
239 #: src/ui/gpaste-ui-shortcuts-window.c:77
223240 msgid "Sync the primary selection to the clipboard"
224241 msgstr "プライマリー選択からクリップボードに同期する"
225242
226243 #: data/control-center/42-gpaste.control-center.xml.in:9
227244 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
228 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:78
245 #: src/ui/gpaste-ui-shortcuts-window.c:78
229246 msgid "Upload the active item to a pastebin service"
230247 msgstr "Pastebin にアクティブな項目をアップロードする"
231248
507524 #: src/client/gpaste-client.c:157
508525 #, fuzzy
509526 #| msgid "print the history with indexes"
510 msgid "print the history with uuids"
527 msgid "print the history with UUIDs"
511528 msgstr "インデックス付きの履歴を表示する"
512529
513530 #. Translators: help for gpaste history-size
615632 #| "merge the <number>th items from the history and add put the result in the "
616633 #| "clipboard"
617634 msgid ""
618 "merge the items matching the uuids from the history and put the result in "
635 "merge the items matching the UUIDs from the history and put the result in "
619636 "the clipboard"
620637 msgstr "履歴の <数字> 番目の項目をマージして、結果をクリップボードに追加する"
621638
729746
730747 #. Translators: help for --use-index
731748 #: src/client/gpaste-client.c:225
732 msgid "use the index of the item instead of its uuid"
749 msgid "use the index of the item instead of its UUID"
733750 msgstr ""
734751
735752 #: src/client/gpaste-client.c:228
789806
790807 #: src/client/gpaste-client.c:808
791808 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
792 #: src/libgpaste/ui/gpaste-ui-window.c:311
809 #: src/ui/gpaste-ui-window.c:311
793810 msgid "Couldn't connect to GPaste daemon"
794811 msgstr "GPaste デーモンに接続できませんでした"
795812
831848 msgstr "はすでに実行しています。"
832849
833850 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
834 #: src/libgpaste/ui/gpaste-ui-switch.c:92
851 #: src/ui/gpaste-ui-switch.c:92
835852 msgid "Track clipboard changes"
836853 msgstr "クリップボードの変更を追跡する"
837854
897914
898915 #. translators: This is the name of a multi-history management action
899916 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
900 #: src/libgpaste/ui/gpaste-ui-panel.c:297
917 #: src/ui/gpaste-ui-panel.c:297
901918 msgid "Switch to"
902919 msgstr "切り替え"
903920
904921 #. translators: This is the name of a multi-history management action
905922 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
906 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
907 #: src/libgpaste/ui/gpaste-ui-delete-history.c:65
908 #: src/libgpaste/ui/gpaste-ui-delete-item.c:49
923 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
924 #: src/ui/gpaste-ui-delete-item.c:49
909925 msgid "Delete"
910926 msgstr "削除"
911927
912 #: src/libgpaste/ui/gpaste-ui-about.c:41
913 msgid "About"
914 msgstr "GPaste について"
915
916 #: src/libgpaste/ui/gpaste-ui-backup-history.c:43
917 #: src/libgpaste/ui/gpaste-ui-backup-history.c:140
918 msgid "Backup"
919 msgstr "バックアップ"
920
921 #: src/libgpaste/ui/gpaste-ui-backup-history.c:44
922 #: src/libgpaste/ui/gpaste-ui-edit-item.c:46
923 #: src/libgpaste/ui/gpaste-ui-new-item.c:32 src/libgpaste/util/gpaste-util.c:30
928 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
929 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
924930 msgid "Cancel"
925931 msgstr "キャンセル"
926932
927 #: src/libgpaste/ui/gpaste-ui-backup-history.c:47
928 msgid "Under which name do you want to backup this history?"
929 msgstr "この履歴をどのような名前でバックアップしますか?"
930
931 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
932 msgid "Are you sure you want to delete this history?"
933 msgstr "この履歴を削除してもよろしいですか?"
934
935 #: src/libgpaste/ui/gpaste-ui-edit-item.c:45
936 #: src/libgpaste/ui/gpaste-ui-edit-item.c:118
937 msgid "Edit"
938 msgstr "編集"
939
940933 #. Translators: this is the translation for emptying the history
941 #: src/libgpaste/ui/gpaste-ui-empty-history.c:65
942 #: src/libgpaste/util/gpaste-util.c:410
934 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
943935 msgid "Empty"
944936 msgstr "空にする"
945
946 #: src/libgpaste/ui/gpaste-ui-empty-item.c:35
947 msgid "(No result)"
948 msgstr "(検索結果はありません)"
949
950 #: src/libgpaste/ui/gpaste-ui-empty-item.c:49
951 msgid "(Empty)"
952 msgstr "(履歴は空です)"
953
954 #: src/libgpaste/ui/gpaste-ui-empty-item.c:60
955 msgid "(Couldn't connect to GPaste daemon)"
956 msgstr "(GPaste デーモンに接続できませんでした)"
957
958 #: src/libgpaste/ui/gpaste-ui-new-item.c:31
959 #: src/libgpaste/ui/gpaste-ui-new-item.c:83
960 msgid "New"
961 msgstr "新規"
962
963 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
964 msgid "Restart"
965 msgstr "再起動"
966
967 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
968 msgid "Do you really want to restart the daemon?"
969 msgstr "本当にデーモンを再起動しますか?"
970
971 #: src/libgpaste/ui/gpaste-ui-reexec.c:55
972 msgid "Restart the daemon"
973 msgstr "デーモンを再起動する"
974
975 #: src/libgpaste/ui/gpaste-ui-search.c:26
976 msgid "Search"
977 msgstr "検索"
978
979 #: src/libgpaste/ui/gpaste-ui-settings.c:32 src/ui/gpaste-ui.c:105
980 msgid "GPaste Settings"
981 msgstr "GPaste の設定"
982
983 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:64
984 msgid "General"
985 msgstr "全般"
986
987 #: src/libgpaste/ui/gpaste-ui-switch.c:54
988 msgid "Stop"
989 msgstr "停止"
990
991 #: src/libgpaste/ui/gpaste-ui-switch.c:54
992 msgid "Do you really want to stop tracking clipboard changes?"
993 msgstr "本当にクリップボードの変更の追跡を停止しますか?"
994
995 #: src/libgpaste/ui/gpaste-ui-upload-item.c:49
996 msgid "Upload"
997 msgstr "アップロード"
998937
999938 #: src/libgpaste/util/gpaste-util.c:410
1000939 msgid "Do you really want to empty the history?"
1004943 msgid "Could not create history dir"
1005944 msgstr "履歴ディレクトリを作成できませんでした"
1006945
946 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
947 msgid "GPaste Settings"
948 msgstr "GPaste の設定"
949
1007950 #: src/ui/gpaste-ui.c:106
1008951 msgid "Keyboard Shortcuts"
1009952 msgstr "キーボードショートカット"
1016959 msgid "Quit"
1017960 msgstr "終了"
1018961
962 #: src/ui/gpaste-ui-about.c:41
963 msgid "About"
964 msgstr "GPaste について"
965
966 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
967 msgid "Backup"
968 msgstr "バックアップ"
969
970 #: src/ui/gpaste-ui-backup-history.c:47
971 msgid "Under which name do you want to backup this history?"
972 msgstr "この履歴をどのような名前でバックアップしますか?"
973
974 #: src/ui/gpaste-ui-delete-history.c:25
975 msgid "Are you sure you want to delete this history?"
976 msgstr "この履歴を削除してもよろしいですか?"
977
978 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
979 msgid "Edit"
980 msgstr "編集"
981
982 #: src/ui/gpaste-ui-empty-item.c:35
983 msgid "(No result)"
984 msgstr "(検索結果はありません)"
985
986 #: src/ui/gpaste-ui-empty-item.c:49
987 msgid "(Empty)"
988 msgstr "(履歴は空です)"
989
990 #: src/ui/gpaste-ui-empty-item.c:60
991 msgid "(Couldn't connect to GPaste daemon)"
992 msgstr "(GPaste デーモンに接続できませんでした)"
993
994 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
995 msgid "New"
996 msgstr "新規"
997
998 #: src/ui/gpaste-ui-reexec.c:29
999 msgid "Restart"
1000 msgstr "再起動"
1001
1002 #: src/ui/gpaste-ui-reexec.c:29
1003 msgid "Do you really want to restart the daemon?"
1004 msgstr "本当にデーモンを再起動しますか?"
1005
1006 #: src/ui/gpaste-ui-reexec.c:55
1007 msgid "Restart the daemon"
1008 msgstr "デーモンを再起動する"
1009
1010 #: src/ui/gpaste-ui-search.c:26
1011 msgid "Search"
1012 msgstr "検索"
1013
1014 #: src/ui/gpaste-ui-shortcuts-window.c:64
1015 msgid "General"
1016 msgstr "全般"
1017
1018 #: src/ui/gpaste-ui-switch.c:54
1019 msgid "Stop"
1020 msgstr "停止"
1021
1022 #: src/ui/gpaste-ui-switch.c:54
1023 msgid "Do you really want to stop tracking clipboard changes?"
1024 msgstr "本当にクリップボードの変更の追跡を停止しますか?"
1025
1026 #: src/ui/gpaste-ui-upload-item.c:49
1027 msgid "Upload"
1028 msgstr "アップロード"
1029
10191030 #~ msgid "number"
10201031 #~ msgstr "数字"
10211032
66 msgstr ""
77 "Project-Id-Version: gpaste 3.38.2\n"
88 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
9 "POT-Creation-Date: 2021-03-08 22:16+0100\n"
9 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
1010 "PO-Revision-Date: 2020-11-18 09:28+0000\n"
1111 "Last-Translator: Allan Nordhøy <epost@anotheragency.no>\n"
1212 "Language-Team: Norwegian Bokmål <https://hosted.weblate.org/projects/gpaste/"
5858 msgstr "Innstillingsgrensesnittet"
5959
6060 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:56
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:65
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
6362 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
6463 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:91
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:120
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:128
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:136
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:144
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:160
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:168
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:176
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:184
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:200
64 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
7677 msgid "This is a maintenance release. Changes:"
7778 msgstr "Dette er en vedlikeholdsutgivelse. Endringer:"
7879
7980 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
80 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:114
81 msgid "fix a crash in memory usage checking"
82 msgstr ""
83
84 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
85 #, fuzzy
86 #| msgid "First release for GNOME 3.34. Changes:"
87 msgid "First release for GNOME 40. Changes:"
88 msgstr "Første utgave for GNOME 3.34. Endringer:"
89
90 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
91 #, fuzzy
92 #| msgid "Update to gnome-shell 3.34.0"
93 msgid "port to gnome-shell 40"
94 msgstr "Oppgradering til gnome-shell 3.34.0"
95
96 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
97 msgid "placeholder for gnome-shell prefs"
98 msgstr ""
99
100 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
101 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
81102 msgid "fix X11 keybinder outside of GNOME"
82103 msgstr ""
83104
84 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:58
105 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
85106 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
86107 msgstr ""
87108
88 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
109 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
89110 msgid ""
90111 "gpaste-client now has a --use-index argument for several subcommands to use "
91112 "index instead of uuid"
92113 msgstr ""
93114
94 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:67
115 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
95116 msgid "fix the make-password keybinding"
96117 msgstr ""
97118
98 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
99 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
119 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
120 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
100121 msgid "updated translations"
101122 msgstr "oppdaterte oversettelser"
102123
103 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
124 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
104125 #, fuzzy
105126 #| msgid "gnome-shell extension cosmetic updates"
106127 msgid "gnome-shell extension warning fixes"
107128 msgstr "kosmetiske oppdateringer i gnome-shell-utvidelsen"
108129
109 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
110 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
130 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
131 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
111132 msgid "gnome-shell extension cosmetic updates"
112133 msgstr "kosmetiske oppdateringer i gnome-shell-utvidelsen"
113134
114 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:93
135 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
115136 #, fuzzy
116137 msgid "Disable images support by default (can be reenabled in preferences)"
117138 msgstr "Skru av bildestøtte (kan skrus på igjen i innstillingene)"
118139
119 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
140 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
120141 #, fuzzy
121142 msgid "Search now includes passwords (using their names)"
122143 msgstr "Søk inneholder nå passord (ved bruk av navnene deres)"
123144
124 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
145 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
125146 msgid "systemd integration enhancements"
126147 msgstr "forbedringer i systemd-integrasjon"
127148
128 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
149 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
129150 msgid "First release for GNOME 3.38. Changes:"
130151 msgstr "Første utgave for GNOME 3.38. Endringer:"
131152
132 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
153 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
133154 #, fuzzy
134155 msgid "Drop the Tracking DBus signal"
135156 msgstr "Ikke bruk sporingssymbolet fra D-Bus"
136157
137 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:104
158 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
138159 #, fuzzy
139160 msgid "Switch to uuids to identify items"
140161 msgstr "Byttet til UUID-er for å identifisere elementer"
141162
142 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:105
163 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
143164 #, fuzzy
144165 msgid "Bump DBus interface to org.gnome.GPaste2"
145166 msgstr "Oppgradering av D-Bus-grensesnitt til org.gnome.GPaste2"
146167
147 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:106
168 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
148169 msgid "Update to gnome-shell 3.38.0"
149170 msgstr "Oppgradering til gnome-shell 3.38.0"
150171
151 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
152 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
153 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
172 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
174 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
154175 #, fuzzy
155176 msgid "Fix activating items using Ctrl-Number in gnome-shell"
156177 msgstr "Fiks aktivering av elementer ved bruk av Ctrl+nummer i gnome-shell"
157178
158 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
159 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
160 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:203
179 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
180 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
181 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
161182 #, fuzzy
162183 msgid "Fix keybinding regrab with gnome-shell"
163184 msgstr "Fiks av ny opphenting av tastaturhurtigsekvens med gnome-shell"
164185
165 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
166 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
186 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
187 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
167188 #, fuzzy
168189 msgid "Fix keybinding grab with gnome-shell"
169190 msgstr "Fiks opphenting av tastaturhurtigsekvens med gnome-shell"
170191
171 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:152
192 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
172193 msgid "First release for GNOME 3.36. Changes:"
173194 msgstr "Første utgave for GNOME 3.36. Endringer:"
174195
175 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
196 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
176197 msgid "Update to gnome-shell 3.36.0"
177198 msgstr "Oppgradering til gnome-shell 3.36.0."
178199
179 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
180 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
200 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
201 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
181202 msgid "Compatibility with recent appstream-glib"
182203 msgstr "Kompabilitet med nyere appstream-glib"
183204
184 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:192
205 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
185206 msgid "First release for GNOME 3.34. Changes:"
186207 msgstr "Første utgave for GNOME 3.34. Endringer:"
187208
188 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
209 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
189210 msgid "Update to gnome-shell 3.34.0"
190211 msgstr "Oppgradering til gnome-shell 3.34.0"
191212
195216
196217 #: data/control-center/42-gpaste.control-center.xml.in:3
197218 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
198 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:73
219 #: src/ui/gpaste-ui-shortcuts-window.c:73
199220 msgid "Launch the graphical tool"
200221 msgstr "Start det grafiske verktøyet"
201222
202223 #: data/control-center/42-gpaste.control-center.xml.in:4
203224 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
204 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:74
225 #: src/ui/gpaste-ui-shortcuts-window.c:74
205226 msgid "Mark the active item as being a password"
206227 msgstr "Maker aktivt element som passord"
207228
208229 #: data/control-center/42-gpaste.control-center.xml.in:5
209230 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
210 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:72
231 #: src/ui/gpaste-ui-shortcuts-window.c:72
211232 msgid "Delete the active item from history"
212233 msgstr "Slett aktivt element fra historikk"
213234
214235 #: data/control-center/42-gpaste.control-center.xml.in:6
215236 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
216 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:75
237 #: src/ui/gpaste-ui-shortcuts-window.c:75
217238 msgid "Display the history"
218239 msgstr "Vis historikken"
219240
220241 #: data/control-center/42-gpaste.control-center.xml.in:7
221242 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
222 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:76
243 #: src/ui/gpaste-ui-shortcuts-window.c:76
223244 #, fuzzy
224245 msgid "Sync the clipboard to the primary selection"
225246 msgstr "Synkroniser utklippstavle til primærmarkering"
226247
227248 #: data/control-center/42-gpaste.control-center.xml.in:8
228249 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
229 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:77
250 #: src/ui/gpaste-ui-shortcuts-window.c:77
230251 #, fuzzy
231252 msgid "Sync the primary selection to the clipboard"
232253 msgstr "Synkroniser primær markering til utklippstavle"
233254
234255 #: data/control-center/42-gpaste.control-center.xml.in:9
235256 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
236 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:78
257 #: src/ui/gpaste-ui-shortcuts-window.c:78
237258 #, fuzzy
238259 msgid "Upload the active item to a pastebin service"
239260 msgstr "Last opp aktivt element til en innlimingsnett-tjeneste"
553574 #. Translators: help for gpaste history
554575 #: src/client/gpaste-client.c:157
555576 #, fuzzy
556 msgid "print the history with uuids"
577 msgid "print the history with UUIDs"
557578 msgstr "skriv ut historikken med indekser"
558579
559580 #. Translators: help for gpaste history-size
657678 #: src/client/gpaste-client.c:183
658679 #, fuzzy
659680 msgid ""
660 "merge the items matching the uuids from the history and put the result in "
681 "merge the items matching the UUIDs from the history and put the result in "
661682 "the clipboard"
662683 msgstr ""
663684 "flett elementene som samsvarer med UUID-ene fra historikken og legg til "
775796
776797 #. Translators: help for --use-index
777798 #: src/client/gpaste-client.c:225
778 msgid "use the index of the item instead of its uuid"
799 msgid "use the index of the item instead of its UUID"
779800 msgstr ""
780801
781802 #: src/client/gpaste-client.c:228
840861
841862 #: src/client/gpaste-client.c:808
842863 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
843 #: src/libgpaste/ui/gpaste-ui-window.c:311
864 #: src/ui/gpaste-ui-window.c:311
844865 msgid "Couldn't connect to GPaste daemon"
845866 msgstr "Kunne ikke koble til GPaste-nisse igjen"
846867
885906 msgstr "kjører allerede."
886907
887908 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
888 #: src/libgpaste/ui/gpaste-ui-switch.c:92
909 #: src/ui/gpaste-ui-switch.c:92
889910 msgid "Track clipboard changes"
890911 msgstr "Spor endringer i utklippstavlen"
891912
958979
959980 #. translators: This is the name of a multi-history management action
960981 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
961 #: src/libgpaste/ui/gpaste-ui-panel.c:297
982 #: src/ui/gpaste-ui-panel.c:297
962983 msgid "Switch to"
963984 msgstr "Bytt til"
964985
965986 #. translators: This is the name of a multi-history management action
966987 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
967 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
968 #: src/libgpaste/ui/gpaste-ui-delete-history.c:65
969 #: src/libgpaste/ui/gpaste-ui-delete-item.c:49
988 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
989 #: src/ui/gpaste-ui-delete-item.c:49
970990 msgid "Delete"
971991 msgstr "Slett"
972992
973 #: src/libgpaste/ui/gpaste-ui-about.c:41
974 msgid "About"
975 msgstr "Om"
976
977 #: src/libgpaste/ui/gpaste-ui-backup-history.c:43
978 #: src/libgpaste/ui/gpaste-ui-backup-history.c:140
979 #, fuzzy
980 msgid "Backup"
981 msgstr "Sikkerhetskopi"
982
983 #: src/libgpaste/ui/gpaste-ui-backup-history.c:44
984 #: src/libgpaste/ui/gpaste-ui-edit-item.c:46
985 #: src/libgpaste/ui/gpaste-ui-new-item.c:32 src/libgpaste/util/gpaste-util.c:30
993 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
994 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
986995 msgid "Cancel"
987996 msgstr "Avbryt"
988997
989 #: src/libgpaste/ui/gpaste-ui-backup-history.c:47
990 #, fuzzy
991 msgid "Under which name do you want to backup this history?"
992 msgstr "Hvilket navn ønsker du å bruke for sikkerhetskopiering av historikken?"
993
994 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
995 msgid "Are you sure you want to delete this history?"
996 msgstr "Er du sikker på at du ønsker å slette denne historikken?"
997
998 #: src/libgpaste/ui/gpaste-ui-edit-item.c:45
999 #: src/libgpaste/ui/gpaste-ui-edit-item.c:118
1000 msgid "Edit"
1001 msgstr "Rediger"
1002
1003998 #. Translators: this is the translation for emptying the history
1004 #: src/libgpaste/ui/gpaste-ui-empty-history.c:65
1005 #: src/libgpaste/util/gpaste-util.c:410
999 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
10061000 msgid "Empty"
10071001 msgstr "Tom"
1008
1009 #: src/libgpaste/ui/gpaste-ui-empty-item.c:35
1010 msgid "(No result)"
1011 msgstr "(Resultatløst)"
1012
1013 #: src/libgpaste/ui/gpaste-ui-empty-item.c:49
1014 msgid "(Empty)"
1015 msgstr "(Tom)"
1016
1017 #: src/libgpaste/ui/gpaste-ui-empty-item.c:60
1018 msgid "(Couldn't connect to GPaste daemon)"
1019 msgstr "(Kunne ikke koble til GPaste-nisse)"
1020
1021 #: src/libgpaste/ui/gpaste-ui-new-item.c:31
1022 #: src/libgpaste/ui/gpaste-ui-new-item.c:83
1023 msgid "New"
1024 msgstr "Ny"
1025
1026 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
1027 #, fuzzy
1028 msgid "Restart"
1029 msgstr "Start på ny"
1030
1031 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
1032 #, fuzzy
1033 msgid "Do you really want to restart the daemon?"
1034 msgstr "Ønsker du virkelig å starte nissen på ny?"
1035
1036 #: src/libgpaste/ui/gpaste-ui-reexec.c:55
1037 #, fuzzy
1038 msgid "Restart the daemon"
1039 msgstr "Start nissen på ny"
1040
1041 #: src/libgpaste/ui/gpaste-ui-search.c:26
1042 msgid "Search"
1043 msgstr "Søk"
1044
1045 #: src/libgpaste/ui/gpaste-ui-settings.c:32 src/ui/gpaste-ui.c:105
1046 msgid "GPaste Settings"
1047 msgstr "GPaste-innstillinger"
1048
1049 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:64
1050 msgid "General"
1051 msgstr "Generelt"
1052
1053 #: src/libgpaste/ui/gpaste-ui-switch.c:54
1054 msgid "Stop"
1055 msgstr "Stopp"
1056
1057 #: src/libgpaste/ui/gpaste-ui-switch.c:54
1058 #, fuzzy
1059 msgid "Do you really want to stop tracking clipboard changes?"
1060 msgstr "Ønsker du virkelig å slutte å spore utklippstavleendringer?"
1061
1062 #: src/libgpaste/ui/gpaste-ui-upload-item.c:49
1063 msgid "Upload"
1064 msgstr "Last opp"
10651002
10661003 #: src/libgpaste/util/gpaste-util.c:410
10671004 msgid "Do you really want to empty the history?"
10721009 msgid "Could not create history dir"
10731010 msgstr "Kunne ikke opprette historikkmappe"
10741011
1012 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
1013 msgid "GPaste Settings"
1014 msgstr "GPaste-innstillinger"
1015
10751016 #: src/ui/gpaste-ui.c:106
10761017 msgid "Keyboard Shortcuts"
10771018 msgstr "Tastatursnarveier"
10841025 #: src/ui/gpaste-ui.c:108
10851026 msgid "Quit"
10861027 msgstr "Avslutt"
1028
1029 #: src/ui/gpaste-ui-about.c:41
1030 msgid "About"
1031 msgstr "Om"
1032
1033 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
1034 #, fuzzy
1035 msgid "Backup"
1036 msgstr "Sikkerhetskopi"
1037
1038 #: src/ui/gpaste-ui-backup-history.c:47
1039 #, fuzzy
1040 msgid "Under which name do you want to backup this history?"
1041 msgstr "Hvilket navn ønsker du å bruke for sikkerhetskopiering av historikken?"
1042
1043 #: src/ui/gpaste-ui-delete-history.c:25
1044 msgid "Are you sure you want to delete this history?"
1045 msgstr "Er du sikker på at du ønsker å slette denne historikken?"
1046
1047 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
1048 msgid "Edit"
1049 msgstr "Rediger"
1050
1051 #: src/ui/gpaste-ui-empty-item.c:35
1052 msgid "(No result)"
1053 msgstr "(Resultatløst)"
1054
1055 #: src/ui/gpaste-ui-empty-item.c:49
1056 msgid "(Empty)"
1057 msgstr "(Tom)"
1058
1059 #: src/ui/gpaste-ui-empty-item.c:60
1060 msgid "(Couldn't connect to GPaste daemon)"
1061 msgstr "(Kunne ikke koble til GPaste-nisse)"
1062
1063 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
1064 msgid "New"
1065 msgstr "Ny"
1066
1067 #: src/ui/gpaste-ui-reexec.c:29
1068 #, fuzzy
1069 msgid "Restart"
1070 msgstr "Start på ny"
1071
1072 #: src/ui/gpaste-ui-reexec.c:29
1073 #, fuzzy
1074 msgid "Do you really want to restart the daemon?"
1075 msgstr "Ønsker du virkelig å starte nissen på ny?"
1076
1077 #: src/ui/gpaste-ui-reexec.c:55
1078 #, fuzzy
1079 msgid "Restart the daemon"
1080 msgstr "Start nissen på ny"
1081
1082 #: src/ui/gpaste-ui-search.c:26
1083 msgid "Search"
1084 msgstr "Søk"
1085
1086 #: src/ui/gpaste-ui-shortcuts-window.c:64
1087 msgid "General"
1088 msgstr "Generelt"
1089
1090 #: src/ui/gpaste-ui-switch.c:54
1091 msgid "Stop"
1092 msgstr "Stopp"
1093
1094 #: src/ui/gpaste-ui-switch.c:54
1095 #, fuzzy
1096 msgid "Do you really want to stop tracking clipboard changes?"
1097 msgstr "Ønsker du virkelig å slutte å spore utklippstavleendringer?"
1098
1099 #: src/ui/gpaste-ui-upload-item.c:49
1100 msgid "Upload"
1101 msgstr "Last opp"
66 msgstr ""
77 "Project-Id-Version: GPaste\n"
88 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
9 "POT-Creation-Date: 2021-03-08 22:16+0100\n"
9 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
1010 "PO-Revision-Date: 2017-03-17 17:38+0100\n"
1111 "Last-Translator: Heimen Stoffels <vistausss@outlook.com>\n"
1212 "Language-Team: Vistaus <vistausss@outlook.com>\n"
5959 msgstr "Instellingenvenster"
6060
6161 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:56
63 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:65
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
6463 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
6564 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:91
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:120
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:128
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:136
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:144
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:160
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:168
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:176
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:184
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:200
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
77 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
7778 msgid "This is a maintenance release. Changes:"
7879 msgstr ""
7980
8081 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
81 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:114
82 msgid "fix a crash in memory usage checking"
83 msgstr ""
84
85 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
86 msgid "First release for GNOME 40. Changes:"
87 msgstr ""
88
89 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
90 msgid "port to gnome-shell 40"
91 msgstr ""
92
93 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
94 msgid "placeholder for gnome-shell prefs"
95 msgstr ""
96
97 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
98 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
8299 msgid "fix X11 keybinder outside of GNOME"
83100 msgstr ""
84101
85 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:58
102 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
86103 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
87104 msgstr ""
88105
89 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
106 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
90107 msgid ""
91108 "gpaste-client now has a --use-index argument for several subcommands to use "
92109 "index instead of uuid"
93110 msgstr ""
94111
95 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:67
112 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
96113 msgid "fix the make-password keybinding"
97114 msgstr ""
98115
99 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
100 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
116 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
117 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
101118 msgid "updated translations"
102119 msgstr ""
103120
104 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
121 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
105122 #, fuzzy
106123 #| msgid "Enable the gnome-shell extension"
107124 msgid "gnome-shell extension warning fixes"
108125 msgstr "GNOME Shell-extensie inschakelen"
109126
110 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
111 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
127 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
128 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
112129 #, fuzzy
113130 #| msgid "Enable the gnome-shell extension"
114131 msgid "gnome-shell extension cosmetic updates"
115132 msgstr "GNOME Shell-extensie inschakelen"
116133
117 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:93
134 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
118135 msgid "Disable images support by default (can be reenabled in preferences)"
119136 msgstr ""
120137
121 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
138 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
122139 msgid "Search now includes passwords (using their names)"
123140 msgstr ""
124141
125 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
142 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
126143 msgid "systemd integration enhancements"
127144 msgstr ""
128145
129 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
146 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
130147 msgid "First release for GNOME 3.38. Changes:"
131148 msgstr ""
132149
133 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
150 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
134151 msgid "Drop the Tracking DBus signal"
135152 msgstr ""
136153
137 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:104
154 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
138155 msgid "Switch to uuids to identify items"
139156 msgstr ""
140157
141 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:105
158 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
142159 msgid "Bump DBus interface to org.gnome.GPaste2"
143160 msgstr ""
144161
145 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:106
162 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
146163 msgid "Update to gnome-shell 3.38.0"
147164 msgstr ""
148165
149 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
150 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
166 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
167 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
168 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
169 msgid "Fix activating items using Ctrl-Number in gnome-shell"
170 msgstr ""
171
172 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
174 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
175 msgid "Fix keybinding regrab with gnome-shell"
176 msgstr ""
177
178 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
179 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
180 msgid "Fix keybinding grab with gnome-shell"
181 msgstr ""
182
183 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
184 msgid "First release for GNOME 3.36. Changes:"
185 msgstr ""
186
187 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
188 msgid "Update to gnome-shell 3.36.0"
189 msgstr ""
190
151191 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
152 msgid "Fix activating items using Ctrl-Number in gnome-shell"
153 msgstr ""
154
155 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
156 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
157 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:203
158 msgid "Fix keybinding regrab with gnome-shell"
159 msgstr ""
160
161 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
162 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
163 msgid "Fix keybinding grab with gnome-shell"
164 msgstr ""
165
166 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:152
167 msgid "First release for GNOME 3.36. Changes:"
168 msgstr ""
169
170 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
171 msgid "Update to gnome-shell 3.36.0"
172 msgstr ""
173
174 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
175 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
192 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
176193 msgid "Compatibility with recent appstream-glib"
177194 msgstr ""
178195
179 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:192
196 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
180197 msgid "First release for GNOME 3.34. Changes:"
181198 msgstr ""
182199
183 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
200 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
184201 msgid "Update to gnome-shell 3.34.0"
185202 msgstr ""
186203
190207
191208 #: data/control-center/42-gpaste.control-center.xml.in:3
192209 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
193 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:73
210 #: src/ui/gpaste-ui-shortcuts-window.c:73
194211 msgid "Launch the graphical tool"
195212 msgstr "Grafisch venster openen"
196213
197214 #: data/control-center/42-gpaste.control-center.xml.in:4
198215 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
199 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:74
216 #: src/ui/gpaste-ui-shortcuts-window.c:74
200217 msgid "Mark the active item as being a password"
201218 msgstr "Actief item markeren als wachtwoord"
202219
203220 #: data/control-center/42-gpaste.control-center.xml.in:5
204221 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
205 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:72
222 #: src/ui/gpaste-ui-shortcuts-window.c:72
206223 msgid "Delete the active item from history"
207224 msgstr "Actief item verwijderen uit geschiedenis"
208225
209226 #: data/control-center/42-gpaste.control-center.xml.in:6
210227 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
211 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:75
228 #: src/ui/gpaste-ui-shortcuts-window.c:75
212229 msgid "Display the history"
213230 msgstr "Geschiedenis weergeven"
214231
215232 #: data/control-center/42-gpaste.control-center.xml.in:7
216233 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
217 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:76
234 #: src/ui/gpaste-ui-shortcuts-window.c:76
218235 msgid "Sync the clipboard to the primary selection"
219236 msgstr "Klembord synchroniseren met primaire selectie"
220237
221238 #: data/control-center/42-gpaste.control-center.xml.in:8
222239 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
223 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:77
240 #: src/ui/gpaste-ui-shortcuts-window.c:77
224241 msgid "Sync the primary selection to the clipboard"
225242 msgstr "Primaire selectie synchroniseren met klembord"
226243
227244 #: data/control-center/42-gpaste.control-center.xml.in:9
228245 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
229 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:78
246 #: src/ui/gpaste-ui-shortcuts-window.c:78
230247 msgid "Upload the active item to a pastebin service"
231248 msgstr "Actief item uploaden naar een pastebin-dienst"
232249
518535 #: src/client/gpaste-client.c:157
519536 #, fuzzy
520537 #| msgid "print the history with indexes"
521 msgid "print the history with uuids"
538 msgid "print the history with UUIDs"
522539 msgstr "geschiedenis met indexen weergeven"
523540
524541 #. Translators: help for gpaste history-size
628645 #| "merge the <number>th items from the history and add put the result in the "
629646 #| "clipboard"
630647 msgid ""
631 "merge the items matching the uuids from the history and put the result in "
648 "merge the items matching the UUIDs from the history and put the result in "
632649 "the clipboard"
633650 msgstr ""
634651 "voeg de items <number> uit de geschiedenis samen en plaats het resultaat op "
746763
747764 #. Translators: help for --use-index
748765 #: src/client/gpaste-client.c:225
749 msgid "use the index of the item instead of its uuid"
766 msgid "use the index of the item instead of its UUID"
750767 msgstr ""
751768
752769 #: src/client/gpaste-client.c:228
810827
811828 #: src/client/gpaste-client.c:808
812829 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
813 #: src/libgpaste/ui/gpaste-ui-window.c:311
830 #: src/ui/gpaste-ui-window.c:311
814831 msgid "Couldn't connect to GPaste daemon"
815832 msgstr "Het verbinden met de GPaste-daemon is mislukt"
816833
852869 msgstr "draait al."
853870
854871 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
855 #: src/libgpaste/ui/gpaste-ui-switch.c:92
872 #: src/ui/gpaste-ui-switch.c:92
856873 msgid "Track clipboard changes"
857874 msgstr "Klembordwijzigingen bijhouden"
858875
918935
919936 #. translators: This is the name of a multi-history management action
920937 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
921 #: src/libgpaste/ui/gpaste-ui-panel.c:297
938 #: src/ui/gpaste-ui-panel.c:297
922939 msgid "Switch to"
923940 msgstr "Overschakelen naar"
924941
925942 #. translators: This is the name of a multi-history management action
926943 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
927 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
928 #: src/libgpaste/ui/gpaste-ui-delete-history.c:65
929 #: src/libgpaste/ui/gpaste-ui-delete-item.c:49
944 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
945 #: src/ui/gpaste-ui-delete-item.c:49
930946 msgid "Delete"
931947 msgstr "Verwijderen"
932948
933 #: src/libgpaste/ui/gpaste-ui-about.c:41
934 msgid "About"
935 msgstr "Over"
936
937 #: src/libgpaste/ui/gpaste-ui-backup-history.c:43
938 #: src/libgpaste/ui/gpaste-ui-backup-history.c:140
939 msgid "Backup"
940 msgstr "Back-uppen"
941
942 #: src/libgpaste/ui/gpaste-ui-backup-history.c:44
943 #: src/libgpaste/ui/gpaste-ui-edit-item.c:46
944 #: src/libgpaste/ui/gpaste-ui-new-item.c:32 src/libgpaste/util/gpaste-util.c:30
949 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
950 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
945951 msgid "Cancel"
946952 msgstr "Annuleren"
947953
948 #: src/libgpaste/ui/gpaste-ui-backup-history.c:47
949 msgid "Under which name do you want to backup this history?"
950 msgstr "Onder welke naam wilt u de geschiedenis opslaan?"
951
952 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
953 msgid "Are you sure you want to delete this history?"
954 msgstr "Weet u zeker dat u de geschiedenis wilt verwijderen?"
955
956 #: src/libgpaste/ui/gpaste-ui-edit-item.c:45
957 #: src/libgpaste/ui/gpaste-ui-edit-item.c:118
958 msgid "Edit"
959 msgstr "Bewerken"
960
961954 #. Translators: this is the translation for emptying the history
962 #: src/libgpaste/ui/gpaste-ui-empty-history.c:65
963 #: src/libgpaste/util/gpaste-util.c:410
955 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
964956 msgid "Empty"
965957 msgstr "Legen"
966
967 #: src/libgpaste/ui/gpaste-ui-empty-item.c:35
968 msgid "(No result)"
969 msgstr "(Geen resultaat)"
970
971 #: src/libgpaste/ui/gpaste-ui-empty-item.c:49
972 msgid "(Empty)"
973 msgstr "(Leeg)"
974
975 #: src/libgpaste/ui/gpaste-ui-empty-item.c:60
976 msgid "(Couldn't connect to GPaste daemon)"
977 msgstr "(Het verbinden met de GPaste-daemon is mislukt)"
978
979 #: src/libgpaste/ui/gpaste-ui-new-item.c:31
980 #: src/libgpaste/ui/gpaste-ui-new-item.c:83
981 msgid "New"
982 msgstr "Nieuw"
983
984 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
985 msgid "Restart"
986 msgstr "Herstarten"
987
988 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
989 msgid "Do you really want to restart the daemon?"
990 msgstr "Weet u zeker dat u de daemon wilt herstarten?"
991
992 #: src/libgpaste/ui/gpaste-ui-reexec.c:55
993 msgid "Restart the daemon"
994 msgstr "Daemon herstarten"
995
996 #: src/libgpaste/ui/gpaste-ui-search.c:26
997 msgid "Search"
998 msgstr "Zoeken"
999
1000 #: src/libgpaste/ui/gpaste-ui-settings.c:32 src/ui/gpaste-ui.c:105
1001 msgid "GPaste Settings"
1002 msgstr "GPaste-instellingen"
1003
1004 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:64
1005 msgid "General"
1006 msgstr "Algemeen"
1007
1008 #: src/libgpaste/ui/gpaste-ui-switch.c:54
1009 msgid "Stop"
1010 msgstr "Stoppen"
1011
1012 #: src/libgpaste/ui/gpaste-ui-switch.c:54
1013 msgid "Do you really want to stop tracking clipboard changes?"
1014 msgstr "Weet u zeker dat u het bijhouden van klembordwijzigingen wilt stoppen?"
1015
1016 #: src/libgpaste/ui/gpaste-ui-upload-item.c:49
1017 msgid "Upload"
1018 msgstr "Uploaden"
1019958
1020959 #: src/libgpaste/util/gpaste-util.c:410
1021960 msgid "Do you really want to empty the history?"
1025964 msgid "Could not create history dir"
1026965 msgstr "Het creëren van de geschiedenismap is mislukt"
1027966
967 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
968 msgid "GPaste Settings"
969 msgstr "GPaste-instellingen"
970
1028971 #: src/ui/gpaste-ui.c:106
1029972 msgid "Keyboard Shortcuts"
1030973 msgstr "Sneltoetsen"
1036979 #: src/ui/gpaste-ui.c:108
1037980 msgid "Quit"
1038981 msgstr "Afsluiten"
982
983 #: src/ui/gpaste-ui-about.c:41
984 msgid "About"
985 msgstr "Over"
986
987 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
988 msgid "Backup"
989 msgstr "Back-uppen"
990
991 #: src/ui/gpaste-ui-backup-history.c:47
992 msgid "Under which name do you want to backup this history?"
993 msgstr "Onder welke naam wilt u de geschiedenis opslaan?"
994
995 #: src/ui/gpaste-ui-delete-history.c:25
996 msgid "Are you sure you want to delete this history?"
997 msgstr "Weet u zeker dat u de geschiedenis wilt verwijderen?"
998
999 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
1000 msgid "Edit"
1001 msgstr "Bewerken"
1002
1003 #: src/ui/gpaste-ui-empty-item.c:35
1004 msgid "(No result)"
1005 msgstr "(Geen resultaat)"
1006
1007 #: src/ui/gpaste-ui-empty-item.c:49
1008 msgid "(Empty)"
1009 msgstr "(Leeg)"
1010
1011 #: src/ui/gpaste-ui-empty-item.c:60
1012 msgid "(Couldn't connect to GPaste daemon)"
1013 msgstr "(Het verbinden met de GPaste-daemon is mislukt)"
1014
1015 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
1016 msgid "New"
1017 msgstr "Nieuw"
1018
1019 #: src/ui/gpaste-ui-reexec.c:29
1020 msgid "Restart"
1021 msgstr "Herstarten"
1022
1023 #: src/ui/gpaste-ui-reexec.c:29
1024 msgid "Do you really want to restart the daemon?"
1025 msgstr "Weet u zeker dat u de daemon wilt herstarten?"
1026
1027 #: src/ui/gpaste-ui-reexec.c:55
1028 msgid "Restart the daemon"
1029 msgstr "Daemon herstarten"
1030
1031 #: src/ui/gpaste-ui-search.c:26
1032 msgid "Search"
1033 msgstr "Zoeken"
1034
1035 #: src/ui/gpaste-ui-shortcuts-window.c:64
1036 msgid "General"
1037 msgstr "Algemeen"
1038
1039 #: src/ui/gpaste-ui-switch.c:54
1040 msgid "Stop"
1041 msgstr "Stoppen"
1042
1043 #: src/ui/gpaste-ui-switch.c:54
1044 msgid "Do you really want to stop tracking clipboard changes?"
1045 msgstr "Weet u zeker dat u het bijhouden van klembordwijzigingen wilt stoppen?"
1046
1047 #: src/ui/gpaste-ui-upload-item.c:49
1048 msgid "Upload"
1049 msgstr "Uploaden"
10391050
10401051 #~ msgid "number"
10411052 #~ msgstr "nummer"
66 msgstr ""
77 "Project-Id-Version: GPaste\n"
88 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
9 "POT-Creation-Date: 2021-03-08 22:16+0100\n"
10 "PO-Revision-Date: 2015-10-10 20:03-0300\n"
11 "Last-Translator: Elder Marco <eldermarco@gmail.com>\n"
12 "Language-Team: \n"
9 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
10 "PO-Revision-Date: 2021-04-13 01:26+0000\n"
11 "Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
12 "Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/"
13 "gpaste/gpaste/pt_BR/>\n"
1314 "Language: pt_BR\n"
1415 "MIME-Version: 1.0\n"
1516 "Content-Type: text/plain; charset=UTF-8\n"
1617 "Content-Transfer-Encoding: 8bit\n"
17 "X-Generator: Poedit 1.8.5\n"
18 "Plural-Forms: nplurals=2; plural=n > 1;\n"
19 "X-Generator: Weblate 4.6-dev\n"
1820
1921 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:5
2022 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:4
21 #, fuzzy
2223 msgid "GPaste"
23 msgstr "Applet do GPaste"
24 msgstr "GPaste"
2425
2526 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:6
2627 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:5
2930
3031 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:7
3132 msgid "Marc-Antoine Perennou"
32 msgstr ""
33 msgstr "Marc-Antoine Perennou"
3334
3435 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:13
3536 msgid ""
4445 "GPaste provides you with a graphical tool allowing you to manage everything "
4546 "easily."
4647 msgstr ""
47 "O GPaste fornece uma ferramenta gráfica que permite gerenciar tudo facilmente"
48 "O GPaste fornece uma ferramenta gráfica que permite gerenciar tudo "
49 "facilmente."
4850
4951 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:23
5052 msgid "The main UI"
51 msgstr ""
53 msgstr "A UI principal"
5254
5355 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:27
5456 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:31
5557 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:35
56 #, fuzzy
5758 msgid "The settings UI"
58 msgstr "Configurações do GPaste"
59 msgstr "A UI de configurações"
5960
6061 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:56
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:65
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
6363 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
6464 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:91
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:120
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:128
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:136
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:144
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:160
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:168
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:176
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:184
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:200
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
77 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
7678 msgid "This is a maintenance release. Changes:"
77 msgstr ""
79 msgstr "Este é um lançamento de manutenção. Alterações:"
7880
7981 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
80 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:114
82 msgid "fix a crash in memory usage checking"
83 msgstr ""
84
85 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
86 msgid "First release for GNOME 40. Changes:"
87 msgstr "Primeiro lançamento para o GNOME 40. Alterações:"
88
89 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
90 msgid "port to gnome-shell 40"
91 msgstr "port para gnome-shell 40"
92
93 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
94 msgid "placeholder for gnome-shell prefs"
95 msgstr "espaço reservado para preferências do gnome-shell"
96
97 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
98 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
8199 msgid "fix X11 keybinder outside of GNOME"
82 msgstr ""
83
84 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:58
100 msgstr "corrige associação de teclas X11 fora do GNOME"
101
102 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
85103 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
86104 msgstr ""
87
88 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
105 "melhor tratamento e relatório de uuids inválidos passados para gpaste-client"
106
107 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
89108 msgid ""
90109 "gpaste-client now has a --use-index argument for several subcommands to use "
91110 "index instead of uuid"
92111 msgstr ""
93
94 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:67
112 "gpaste-client agora tem um argumento --use-index para vários subcomandos "
113 "para usar index em vez de uuid"
114
115 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
95116 msgid "fix the make-password keybinding"
96 msgstr ""
97
98 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
99 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
117 msgstr "corrige a associação de teclas do make-password"
118
119 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
120 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
100121 msgid "updated translations"
101 msgstr ""
102
103 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
104 #, fuzzy
105 #| msgid "Enable the gnome-shell extension"
122 msgstr "traduções atualizadas"
123
124 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
106125 msgid "gnome-shell extension warning fixes"
107 msgstr "Habilitar a extensão do gnome-shell"
108
109 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
126 msgstr "correções de aviso de extensão do gnome-shell"
127
128 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
129 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
130 msgid "gnome-shell extension cosmetic updates"
131 msgstr "atualizações cosméticas de extensão do gnome-shell"
132
133 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
134 msgid "Disable images support by default (can be reenabled in preferences)"
135 msgstr ""
136 "Desabilita suporte a imagens por padrão (pode ser reabilitado nas "
137 "preferências)"
138
139 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
140 msgid "Search now includes passwords (using their names)"
141 msgstr "A pesquisa agora inclui senhas (usando seus nomes)"
142
143 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
144 msgid "systemd integration enhancements"
145 msgstr "melhorias de integração systemd"
146
147 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
148 msgid "First release for GNOME 3.38. Changes:"
149 msgstr "Primeiro lançamento para GNOME 3.38. Alterações:"
150
151 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
152 msgid "Drop the Tracking DBus signal"
153 msgstr "Descara o sinal Tracking DBus"
154
110155 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
111 #, fuzzy
112 #| msgid "Enable the gnome-shell extension"
113 msgid "gnome-shell extension cosmetic updates"
114 msgstr "Habilitar a extensão do gnome-shell"
115
116 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:93
117 msgid "Disable images support by default (can be reenabled in preferences)"
118 msgstr ""
119
120 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
121 msgid "Search now includes passwords (using their names)"
122 msgstr ""
123
124 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
125 msgid "systemd integration enhancements"
126 msgstr ""
127
128 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
129 msgid "First release for GNOME 3.38. Changes:"
130 msgstr ""
131
132 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
133 msgid "Drop the Tracking DBus signal"
134 msgstr ""
135
136 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:104
137156 msgid "Switch to uuids to identify items"
138 msgstr ""
139
140 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:105
157 msgstr "Alterna para uuids para identificar itens"
158
159 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
141160 msgid "Bump DBus interface to org.gnome.GPaste2"
142 msgstr ""
143
144 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:106
161 msgstr "Incrementa a interface DBus para org.gnome.GPaste2"
162
163 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
145164 msgid "Update to gnome-shell 3.38.0"
146 msgstr ""
147
148 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
149 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
165 msgstr "Atualiza para o gnome-shell 3.38.0"
166
167 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
168 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
169 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
170 msgid "Fix activating items using Ctrl-Number in gnome-shell"
171 msgstr "Corrige itens de ativação usando Ctrl-Número no gnome-shell"
172
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
174 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
175 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
176 msgid "Fix keybinding regrab with gnome-shell"
177 msgstr "Corrige nova captura de associação de teclas com gnome-shell"
178
179 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
180 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
181 msgid "Fix keybinding grab with gnome-shell"
182 msgstr "Corrige captura de associação de teclas com gnome-shell"
183
184 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
185 msgid "First release for GNOME 3.36. Changes:"
186 msgstr ""
187
188 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
189 msgid "Update to gnome-shell 3.36.0"
190 msgstr ""
191
150192 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
151 msgid "Fix activating items using Ctrl-Number in gnome-shell"
152 msgstr ""
153
154 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
155 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
156 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:203
157 msgid "Fix keybinding regrab with gnome-shell"
158 msgstr ""
159
160 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
161 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
162 msgid "Fix keybinding grab with gnome-shell"
163 msgstr ""
164
165 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:152
166 msgid "First release for GNOME 3.36. Changes:"
167 msgstr ""
168
169 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
170 msgid "Update to gnome-shell 3.36.0"
171 msgstr ""
172
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
174 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
193 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
175194 msgid "Compatibility with recent appstream-glib"
176195 msgstr ""
177196
178 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:192
197 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
179198 msgid "First release for GNOME 3.34. Changes:"
180199 msgstr ""
181200
182 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
201 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
183202 msgid "Update to gnome-shell 3.34.0"
184203 msgstr ""
185204
189208
190209 #: data/control-center/42-gpaste.control-center.xml.in:3
191210 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
192 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:73
211 #: src/ui/gpaste-ui-shortcuts-window.c:73
193212 #, fuzzy
194213 msgid "Launch the graphical tool"
195214 msgstr "Iniciar a ferramenta gráfica: "
196215
197216 #: data/control-center/42-gpaste.control-center.xml.in:4
198217 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
199 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:74
218 #: src/ui/gpaste-ui-shortcuts-window.c:74
200219 #, fuzzy
201220 msgid "Mark the active item as being a password"
202221 msgstr "Marcar o item ativo como sendo uma senha: "
203222
204223 #: data/control-center/42-gpaste.control-center.xml.in:5
205224 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
206 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:72
225 #: src/ui/gpaste-ui-shortcuts-window.c:72
207226 #, fuzzy
208227 msgid "Delete the active item from history"
209228 msgstr "Apagar o item ativo do histórico: "
210229
211230 #: data/control-center/42-gpaste.control-center.xml.in:6
212231 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
213 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:75
232 #: src/ui/gpaste-ui-shortcuts-window.c:75
214233 #, fuzzy
215234 msgid "Display the history"
216235 msgstr "Mostrar histórico: "
217236
218237 #: data/control-center/42-gpaste.control-center.xml.in:7
219238 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
220 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:76
239 #: src/ui/gpaste-ui-shortcuts-window.c:76
221240 #, fuzzy
222241 msgid "Sync the clipboard to the primary selection"
223242 msgstr "Sincronizar a área de transferência com a seleção primária: "
224243
225244 #: data/control-center/42-gpaste.control-center.xml.in:8
226245 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
227 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:77
246 #: src/ui/gpaste-ui-shortcuts-window.c:77
228247 #, fuzzy
229248 msgid "Sync the primary selection to the clipboard"
230249 msgstr "Sincronizar a seleção primária com a área de transferência: "
231250
232251 #: data/control-center/42-gpaste.control-center.xml.in:9
233252 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
234 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:78
253 #: src/ui/gpaste-ui-shortcuts-window.c:78
235254 #, fuzzy
236255 msgid "Upload the active item to a pastebin service"
237256 msgstr "Carregar o item ativo para um serviço de pastebin: "
532551 #: src/client/gpaste-client.c:157
533552 #, fuzzy
534553 #| msgid "print the history with indexes"
535 msgid "print the history with uuids"
554 msgid "print the history with UUIDs"
536555 msgstr "imprime o histórico com os índices"
537556
538557 #. Translators: help for gpaste history-size
641660 #| "merge the <number>th items from the history and add put the result in the "
642661 #| "clipboard"
643662 msgid ""
644 "merge the items matching the uuids from the history and put the result in "
663 "merge the items matching the UUIDs from the history and put the result in "
645664 "the clipboard"
646665 msgstr ""
647666 "faz um merge do <número>-ésimo item do histórico e coloca o resultado na "
757776
758777 #. Translators: help for --use-index
759778 #: src/client/gpaste-client.c:225
760 msgid "use the index of the item instead of its uuid"
779 msgid "use the index of the item instead of its UUID"
761780 msgstr ""
762781
763782 #: src/client/gpaste-client.c:228
822841
823842 #: src/client/gpaste-client.c:808
824843 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
825 #: src/libgpaste/ui/gpaste-ui-window.c:311
844 #: src/ui/gpaste-ui-window.c:311
826845 msgid "Couldn't connect to GPaste daemon"
827846 msgstr "Não foi possível se conectar ao daemon do GPaste"
828847
865884 msgstr ""
866885
867886 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
868 #: src/libgpaste/ui/gpaste-ui-switch.c:92
887 #: src/ui/gpaste-ui-switch.c:92
869888 msgid "Track clipboard changes"
870889 msgstr "Monitorar a área de transferência"
871890
934953
935954 #. translators: This is the name of a multi-history management action
936955 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
937 #: src/libgpaste/ui/gpaste-ui-panel.c:297
956 #: src/ui/gpaste-ui-panel.c:297
938957 msgid "Switch to"
939958 msgstr "Alternar para"
940959
941960 #. translators: This is the name of a multi-history management action
942961 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
943 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
944 #: src/libgpaste/ui/gpaste-ui-delete-history.c:65
945 #: src/libgpaste/ui/gpaste-ui-delete-item.c:49
962 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
963 #: src/ui/gpaste-ui-delete-item.c:49
946964 msgid "Delete"
947965 msgstr "Apagar"
948966
949 #: src/libgpaste/ui/gpaste-ui-about.c:41
950 msgid "About"
951 msgstr "Sobre"
952
953 #: src/libgpaste/ui/gpaste-ui-backup-history.c:43
954 #: src/libgpaste/ui/gpaste-ui-backup-history.c:140
955 msgid "Backup"
956 msgstr "Backup"
957
958 #: src/libgpaste/ui/gpaste-ui-backup-history.c:44
959 #: src/libgpaste/ui/gpaste-ui-edit-item.c:46
960 #: src/libgpaste/ui/gpaste-ui-new-item.c:32 src/libgpaste/util/gpaste-util.c:30
967 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
968 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
961969 msgid "Cancel"
962970 msgstr "Cancelar"
963971
964 #: src/libgpaste/ui/gpaste-ui-backup-history.c:47
965 msgid "Under which name do you want to backup this history?"
966 msgstr "Com qual nome você deseja salvar este histórico?"
967
968 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
969 msgid "Are you sure you want to delete this history?"
970 msgstr "Tem certeza que quer apagar este histórico?"
971
972 #: src/libgpaste/ui/gpaste-ui-edit-item.c:45
973 #: src/libgpaste/ui/gpaste-ui-edit-item.c:118
974 msgid "Edit"
975 msgstr "Editar"
976
977972 #. Translators: this is the translation for emptying the history
978 #: src/libgpaste/ui/gpaste-ui-empty-history.c:65
979 #: src/libgpaste/util/gpaste-util.c:410
973 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
980974 msgid "Empty"
981975 msgstr "Esvaziar"
982
983 #: src/libgpaste/ui/gpaste-ui-empty-item.c:35
984 msgid "(No result)"
985 msgstr ""
986
987 #: src/libgpaste/ui/gpaste-ui-empty-item.c:49
988 msgid "(Empty)"
989 msgstr "(Vazio)"
990
991 #: src/libgpaste/ui/gpaste-ui-empty-item.c:60
992 #, fuzzy
993 msgid "(Couldn't connect to GPaste daemon)"
994 msgstr "Não foi possível se conectar ao daemon do GPaste"
995
996 #: src/libgpaste/ui/gpaste-ui-new-item.c:31
997 #: src/libgpaste/ui/gpaste-ui-new-item.c:83
998 msgid "New"
999 msgstr ""
1000
1001 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
1002 msgid "Restart"
1003 msgstr "Reiniciar"
1004
1005 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
1006 msgid "Do you really want to restart the daemon?"
1007 msgstr "Você quer mesmo reiniciar o daemon?"
1008
1009 #: src/libgpaste/ui/gpaste-ui-reexec.c:55
1010 msgid "Restart the daemon"
1011 msgstr "Reiniciar o daemon"
1012
1013 #: src/libgpaste/ui/gpaste-ui-search.c:26
1014 msgid "Search"
1015 msgstr "Pesquisar"
1016
1017 #: src/libgpaste/ui/gpaste-ui-settings.c:32 src/ui/gpaste-ui.c:105
1018 msgid "GPaste Settings"
1019 msgstr "Configurações do GPaste"
1020
1021 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:64
1022 msgid "General"
1023 msgstr ""
1024
1025 #: src/libgpaste/ui/gpaste-ui-switch.c:54
1026 msgid "Stop"
1027 msgstr "Parar"
1028
1029 #: src/libgpaste/ui/gpaste-ui-switch.c:54
1030 msgid "Do you really want to stop tracking clipboard changes?"
1031 msgstr ""
1032 "Você quer mesmo parar o monitoramento de alterações na área de transferência?"
1033
1034 #: src/libgpaste/ui/gpaste-ui-upload-item.c:49
1035 msgid "Upload"
1036 msgstr "Carregar"
1037976
1038977 #: src/libgpaste/util/gpaste-util.c:410
1039978 msgid "Do you really want to empty the history?"
1043982 msgid "Could not create history dir"
1044983 msgstr "Não foi possível criar o diretório do histórico"
1045984
985 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
986 msgid "GPaste Settings"
987 msgstr "Configurações do GPaste"
988
1046989 #: src/ui/gpaste-ui.c:106
1047990 #, fuzzy
1048991 msgid "Keyboard Shortcuts"
1055998 #: src/ui/gpaste-ui.c:108
1056999 msgid "Quit"
10571000 msgstr "Sair"
1001
1002 #: src/ui/gpaste-ui-about.c:41
1003 msgid "About"
1004 msgstr "Sobre"
1005
1006 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
1007 msgid "Backup"
1008 msgstr "Backup"
1009
1010 #: src/ui/gpaste-ui-backup-history.c:47
1011 msgid "Under which name do you want to backup this history?"
1012 msgstr "Com qual nome você deseja salvar este histórico?"
1013
1014 #: src/ui/gpaste-ui-delete-history.c:25
1015 msgid "Are you sure you want to delete this history?"
1016 msgstr "Tem certeza que quer apagar este histórico?"
1017
1018 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
1019 msgid "Edit"
1020 msgstr "Editar"
1021
1022 #: src/ui/gpaste-ui-empty-item.c:35
1023 msgid "(No result)"
1024 msgstr ""
1025
1026 #: src/ui/gpaste-ui-empty-item.c:49
1027 msgid "(Empty)"
1028 msgstr "(Vazio)"
1029
1030 #: src/ui/gpaste-ui-empty-item.c:60
1031 #, fuzzy
1032 msgid "(Couldn't connect to GPaste daemon)"
1033 msgstr "Não foi possível se conectar ao daemon do GPaste"
1034
1035 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
1036 msgid "New"
1037 msgstr ""
1038
1039 #: src/ui/gpaste-ui-reexec.c:29
1040 msgid "Restart"
1041 msgstr "Reiniciar"
1042
1043 #: src/ui/gpaste-ui-reexec.c:29
1044 msgid "Do you really want to restart the daemon?"
1045 msgstr "Você quer mesmo reiniciar o daemon?"
1046
1047 #: src/ui/gpaste-ui-reexec.c:55
1048 msgid "Restart the daemon"
1049 msgstr "Reiniciar o daemon"
1050
1051 #: src/ui/gpaste-ui-search.c:26
1052 msgid "Search"
1053 msgstr "Pesquisar"
1054
1055 #: src/ui/gpaste-ui-shortcuts-window.c:64
1056 msgid "General"
1057 msgstr ""
1058
1059 #: src/ui/gpaste-ui-switch.c:54
1060 msgid "Stop"
1061 msgstr "Parar"
1062
1063 #: src/ui/gpaste-ui-switch.c:54
1064 msgid "Do you really want to stop tracking clipboard changes?"
1065 msgstr ""
1066 "Você quer mesmo parar o monitoramento de alterações na área de transferência?"
1067
1068 #: src/ui/gpaste-ui-upload-item.c:49
1069 msgid "Upload"
1070 msgstr "Carregar"
10581071
10591072 #~ msgid "number"
10601073 #~ msgstr "número"
0 # SOME DESCRIPTIVE TITLE.
1 # Copyright (C) YEAR Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2 # This file is distributed under the same license as the gpaste package.
3 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4 #
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: gpaste 3.38.5\n"
8 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
9 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
10 "PO-Revision-Date: 2021-02-18 20:50+0000\n"
11 "Last-Translator: Matej U <mateju@svn.gnome.org>\n"
12 "Language-Team: Slovenian <https://hosted.weblate.org/projects/gpaste/gpaste/"
13 "sl/>\n"
14 "Language: sl\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18 "Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
19 "%100==4 ? 2 : 3;\n"
20 "X-Generator: Weblate 4.5\n"
21
22 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:5
23 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:4
24 msgid "GPaste"
25 msgstr "GPaste"
26
27 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:6
28 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:5
29 msgid "Manage your clipboard history"
30 msgstr "Upravljanje z zgodovino odložišča"
31
32 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:7
33 msgid "Marc-Antoine Perennou"
34 msgstr "Marc-Antoine Perennou"
35
36 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:13
37 msgid ""
38 "GPaste is a clipboard managing system allowing you to track and manage your "
39 "clipboard history in a highly customizable way."
40 msgstr ""
41
42 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:16
43 msgid ""
44 "GPaste provides you with a graphical tool allowing you to manage everything "
45 "easily."
46 msgstr ""
47
48 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:23
49 msgid "The main UI"
50 msgstr "Glavni vmesnik"
51
52 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:27
53 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:31
54 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:35
55 msgid "The settings UI"
56 msgstr "Vmesnik nastavitev"
57
58 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
59 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
60 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
63 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
64 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
75 msgid "This is a maintenance release. Changes:"
76 msgstr "Nameščena je vzdrževalna različica s spremembami:"
77
78 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
79 msgid "fix a crash in memory usage checking"
80 msgstr ""
81
82 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
83 #, fuzzy
84 #| msgid "First release for GNOME 3.38. Changes:"
85 msgid "First release for GNOME 40. Changes:"
86 msgstr "Prva objava za GNOME 3.38. Spremembe:"
87
88 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
89 msgid "port to gnome-shell 40"
90 msgstr ""
91
92 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
93 msgid "placeholder for gnome-shell prefs"
94 msgstr ""
95
96 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
97 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
98 msgid "fix X11 keybinder outside of GNOME"
99 msgstr ""
100
101 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
102 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
103 msgstr ""
104 "boljše upravljanje in poročanje o neveljavnih določilih UUID, poslanih na "
105 "program gpaste-client"
106
107 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
108 msgid ""
109 "gpaste-client now has a --use-index argument for several subcommands to use "
110 "index instead of uuid"
111 msgstr ""
112
113 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
114 msgid "fix the make-password keybinding"
115 msgstr ""
116
117 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
118 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
119 msgid "updated translations"
120 msgstr ""
121
122 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
123 msgid "gnome-shell extension warning fixes"
124 msgstr ""
125
126 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
127 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
128 msgid "gnome-shell extension cosmetic updates"
129 msgstr ""
130
131 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
132 msgid "Disable images support by default (can be reenabled in preferences)"
133 msgstr ""
134
135 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
136 msgid "Search now includes passwords (using their names)"
137 msgstr ""
138
139 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
140 msgid "systemd integration enhancements"
141 msgstr ""
142
143 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
144 msgid "First release for GNOME 3.38. Changes:"
145 msgstr "Prva objava za GNOME 3.38. Spremembe:"
146
147 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
148 msgid "Drop the Tracking DBus signal"
149 msgstr ""
150
151 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
152 msgid "Switch to uuids to identify items"
153 msgstr ""
154
155 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
156 msgid "Bump DBus interface to org.gnome.GPaste2"
157 msgstr ""
158
159 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
160 msgid "Update to gnome-shell 3.38.0"
161 msgstr ""
162
163 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
164 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
165 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
166 msgid "Fix activating items using Ctrl-Number in gnome-shell"
167 msgstr ""
168
169 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
170 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
171 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
172 msgid "Fix keybinding regrab with gnome-shell"
173 msgstr ""
174
175 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
176 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
177 msgid "Fix keybinding grab with gnome-shell"
178 msgstr ""
179
180 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
181 msgid "First release for GNOME 3.36. Changes:"
182 msgstr ""
183
184 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
185 msgid "Update to gnome-shell 3.36.0"
186 msgstr ""
187
188 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
189 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
190 msgid "Compatibility with recent appstream-glib"
191 msgstr ""
192
193 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
194 msgid "First release for GNOME 3.34. Changes:"
195 msgstr ""
196
197 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
198 msgid "Update to gnome-shell 3.34.0"
199 msgstr ""
200
201 #: data/control-center/42-gpaste.control-center.xml.in:2
202 msgid "@GETTEXT_PACKAGE@"
203 msgstr ""
204
205 #: data/control-center/42-gpaste.control-center.xml.in:3
206 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
207 #: src/ui/gpaste-ui-shortcuts-window.c:73
208 msgid "Launch the graphical tool"
209 msgstr ""
210
211 #: data/control-center/42-gpaste.control-center.xml.in:4
212 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
213 #: src/ui/gpaste-ui-shortcuts-window.c:74
214 msgid "Mark the active item as being a password"
215 msgstr ""
216
217 #: data/control-center/42-gpaste.control-center.xml.in:5
218 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
219 #: src/ui/gpaste-ui-shortcuts-window.c:72
220 msgid "Delete the active item from history"
221 msgstr ""
222
223 #: data/control-center/42-gpaste.control-center.xml.in:6
224 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
225 #: src/ui/gpaste-ui-shortcuts-window.c:75
226 msgid "Display the history"
227 msgstr ""
228
229 #: data/control-center/42-gpaste.control-center.xml.in:7
230 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
231 #: src/ui/gpaste-ui-shortcuts-window.c:76
232 msgid "Sync the clipboard to the primary selection"
233 msgstr ""
234
235 #: data/control-center/42-gpaste.control-center.xml.in:8
236 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
237 #: src/ui/gpaste-ui-shortcuts-window.c:77
238 msgid "Sync the primary selection to the clipboard"
239 msgstr ""
240
241 #: data/control-center/42-gpaste.control-center.xml.in:9
242 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
243 #: src/ui/gpaste-ui-shortcuts-window.c:78
244 msgid "Upload the active item to a pastebin service"
245 msgstr ""
246
247 #: data/desktop/org.gnome.GPaste.Ui.desktop.in.in:6
248 msgid "Clipboard;Manager;Settings;Preferences;Configuration;"
249 msgstr ""
250
251 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:7
252 msgid "Max size of an element when displaying it"
253 msgstr ""
254
255 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:8
256 msgid ""
257 "The extra stuff of that element will be replaced by \"…\", and newlines by "
258 "\" \" when displaying from the applet, 0 to disable."
259 msgstr ""
260
261 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:15
262 msgid "Do we detect and replace growing lines in history?"
263 msgstr ""
264
265 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:16
266 msgid ""
267 "By default, selecting \"Here is\", then \"Here is an example\" will create "
268 "two entries in the history. With this feature enabled, the first one will be "
269 "replaced by the second one."
270 msgstr ""
271
272 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:24
273 msgid "The name of the current history"
274 msgstr ""
275
276 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:25
277 msgid "The default name is \"history\""
278 msgstr ""
279
280 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:32
281 msgid "Do we save the images copied to history, or only text?"
282 msgstr ""
283
284 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:33
285 msgid "By default, we're saving only text"
286 msgstr ""
287
288 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:40
289 msgid "Do we close the UI after selecting an item?"
290 msgstr ""
291
292 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:41
293 msgid "By default, we close it"
294 msgstr ""
295
296 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:48
297 msgid "The keyboard shortcut to launch the graphical interface"
298 msgstr ""
299
300 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:49
301 msgid ""
302 "By default, hitting ctrl + alt + g does that (\"<Ctrl><Alt>G\"). An empty "
303 "string here disables this functionnality."
304 msgstr ""
305
306 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:57
307 msgid "The keyboard shortcut to mark the active item as being a password"
308 msgstr ""
309
310 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:58
311 msgid ""
312 "By default, hitting ctrl + alt + s will mark the active item as being a "
313 "password (\"<Ctrl><Alt>S\"). An empty string here disables this "
314 "functionnality."
315 msgstr ""
316
317 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:67
318 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:208
319 msgid "Max displayed history size"
320 msgstr ""
321
322 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:68
323 msgid "Maximum number of items displayed in the history"
324 msgstr ""
325
326 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:76
327 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:215
328 msgid "Max history size"
329 msgstr ""
330
331 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:77
332 msgid "Maximum number of items in history"
333 msgstr ""
334
335 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:85
336 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:222
337 msgid "Max memory usage (MB)"
338 msgstr ""
339
340 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:86
341 msgid "Maximum amount of memory used to store contents"
342 msgstr ""
343
344 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:94
345 msgid "Max text item size"
346 msgstr ""
347
348 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:95
349 msgid "Maximum size of a text item. Anything out of this boundary is ignored."
350 msgstr ""
351
352 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:103
353 msgid "Min text item size"
354 msgstr ""
355
356 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:104
357 msgid "Minimum size of a text item. Anything out of this boundary is ignored."
358 msgstr ""
359
360 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:111
361 msgid "The keyboard shortcut to delete the first element in history"
362 msgstr ""
363
364 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:112
365 msgid ""
366 "By default, hitting ctrl + alt + v does that (\"<Ctrl><Alt>V\"). An empty "
367 "string here disables this functionnality."
368 msgstr ""
369
370 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:120
371 msgid "Does the primary selection affects history?"
372 msgstr ""
373
374 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:121
375 msgid "By default, only clipboard (ctrl+c) affects history."
376 msgstr ""
377
378 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:128
379 msgid ""
380 "Do we save all versions of selected rich text (e.g. html) or just the plain "
381 "text version?"
382 msgstr ""
383
384 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:129
385 msgid "By default, we're saving all"
386 msgstr ""
387
388 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:136
389 msgid "Do we save the history from one session to another?"
390 msgstr ""
391
392 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:137
393 msgid "By default, we're saving it"
394 msgstr ""
395
396 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:144
397 msgid "The keyboard shortcut to display the menu"
398 msgstr ""
399
400 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:145
401 msgid ""
402 "By default, hitting ctrl + alt + h displays the menu (\"<Ctrl><Alt>H\"). An "
403 "empty string here disables this functionnality."
404 msgstr ""
405
406 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:153
407 msgid "The keyboard shortcut to sync the clipboard to the primary selection"
408 msgstr ""
409
410 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:154
411 msgid ""
412 "By default, hitting ctrl + alt + o syncs them (\"<Ctrl><Alt>P\"). An empty "
413 "string here disables this functionnality."
414 msgstr ""
415
416 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:162
417 msgid "The keyboard shortcut to sync the primary selection to the clipboard"
418 msgstr ""
419
420 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:163
421 msgid ""
422 "By default, hitting ctrl + alt + p syncs them (\"<Ctrl><Alt>P\"). An empty "
423 "string here disables this functionnality."
424 msgstr ""
425
426 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:171
427 msgid "Are the primary selection and the clipboard synchronized?"
428 msgstr ""
429
430 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:172
431 msgid "By default, the primary selection and the clipboard are independent."
432 msgstr ""
433
434 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:179
435 msgid "Do we track the clipboard changes?"
436 msgstr ""
437
438 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:180
439 msgid "By default, we're tracking those changes."
440 msgstr ""
441
442 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:187
443 msgid ""
444 "Do we sync the daemon state with the gnome-shell extension's one? (disable "
445 "the daemon when disabling the extension)"
446 msgstr ""
447
448 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:188
449 msgid "By default, the daemon state keeps unchanged"
450 msgstr ""
451
452 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:195
453 msgid "Do we trim the textual items before adding them to history?"
454 msgstr ""
455
456 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:196
457 msgid ""
458 "Trimming means removing all trailing and ending spaces. By default, we're "
459 "letting them as-is."
460 msgstr ""
461
462 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:204
463 msgid ""
464 "The keyboard shortcut to upload the first element in history to a pastebin "
465 "service"
466 msgstr ""
467
468 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:205
469 msgid ""
470 "By default, hitting ctrl + alt + u does that (\"<Ctrl><Alt>U\"). An empty "
471 "string here disables this functionnality."
472 msgstr ""
473
474 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:213
475 msgid "Do we prompt for confirmation when emptying an history?"
476 msgstr ""
477
478 #: data/gsettings/org.gnome.GPaste.gschema.xml.in:214
479 msgid "By default, we do as it's a destructive action"
480 msgstr ""
481
482 #: src/client/gpaste-client.c:143 src/client/gpaste-client.c:437
483 msgid "Couldn't spawn"
484 msgstr ""
485
486 #: src/client/gpaste-client.c:155
487 #, c-format
488 msgid "Usage:\n"
489 msgstr "Uporaba:\n"
490
491 #. Translators: help for gpaste history
492 #: src/client/gpaste-client.c:157
493 #, fuzzy
494 #| msgid "print the history with uuids"
495 msgid "print the history with UUIDs"
496 msgstr "izpiši zgodovino z določili UUID"
497
498 #. Translators: help for gpaste history-size
499 #: src/client/gpaste-client.c:159
500 msgid "print the size of the history"
501 msgstr "izpiši velikost zgodovine"
502
503 #. Translators: help for gpaste get-history
504 #: src/client/gpaste-client.c:161
505 msgid "get the name of the current history"
506 msgstr "pridobi ime trenutne zgodovine"
507
508 #. Translators: help for gpaste backup-history <name>
509 #. Translators: help for gpaste switch-history <name>
510 #. Translators: help for gpaste delete-history <name>
511 #. Translators: help for gpaste add-password <name> <text>
512 #. Translators: help for gpaste set-password <uuid> <name>
513 #. Translators: help for gpaste delete-passworf <name>
514 #: src/client/gpaste-client.c:163 src/client/gpaste-client.c:165
515 #: src/client/gpaste-client.c:167 src/client/gpaste-client.c:173
516 #: src/client/gpaste-client.c:185 src/client/gpaste-client.c:189
517 msgid "name"
518 msgstr "ime"
519
520 #: src/client/gpaste-client.c:163
521 msgid "backup current history"
522 msgstr "ustvari kopijo trenutne zgodovine"
523
524 #: src/client/gpaste-client.c:165
525 msgid "switch to another history"
526 msgstr "preklopi na drugo zgodovino"
527
528 #: src/client/gpaste-client.c:167
529 msgid "delete a history"
530 msgstr "izbriši zgodovino"
531
532 #. Translators: help for gpaste list-histories
533 #: src/client/gpaste-client.c:169
534 msgid "list available histories"
535 msgstr "izpiši razpoložljive zgodovine"
536
537 #. Translators: help for gpaste add <text>
538 #: src/client/gpaste-client.c:171
539 msgid "text"
540 msgstr "besedilo"
541
542 #: src/client/gpaste-client.c:171
543 msgid "set text to clipboard"
544 msgstr "nastavi besedilo v odložišče"
545
546 #: src/client/gpaste-client.c:173
547 msgid "password"
548 msgstr "geslo"
549
550 #: src/client/gpaste-client.c:173
551 msgid "add the name - password couple to the clipboard"
552 msgstr "dodaj par ime/geslo v odložišče"
553
554 #. Translators: help for gpaste rename-password <old name> <new name>
555 #: src/client/gpaste-client.c:175
556 msgid "old name"
557 msgstr "staro ime"
558
559 #: src/client/gpaste-client.c:175
560 msgid "new name"
561 msgstr "novo ime"
562
563 #: src/client/gpaste-client.c:175
564 msgid "rename the password"
565 msgstr "preimenuj geslo"
566
567 #. Translators: help for gpaste get <uuid>
568 #: src/client/gpaste-client.c:177
569 msgid "get the item <uuid> from the history"
570 msgstr ""
571
572 #. Translators: help for gpaste select <uuid>
573 #: src/client/gpaste-client.c:179
574 msgid "set the item <uuid> from the history to the clipboard"
575 msgstr ""
576
577 #. Translators: help for gpaste replace <uuid> <contents>
578 #: src/client/gpaste-client.c:181
579 msgid "contents"
580 msgstr ""
581
582 #: src/client/gpaste-client.c:181
583 msgid ""
584 "replace the contents of the item <uuid> from the history with the provided "
585 "one"
586 msgstr ""
587
588 #. Translators: help for gpaste merge <uuid> … <uuid>
589 #: src/client/gpaste-client.c:183
590 msgid ""
591 "merge the items matching the UUIDs from the history and put the result in "
592 "the clipboard"
593 msgstr ""
594
595 #: src/client/gpaste-client.c:185
596 msgid "set the item <uuid> from the history as a password named <name>"
597 msgstr ""
598
599 #. Translators: help for gpaste delete <uuid>
600 #: src/client/gpaste-client.c:187
601 msgid "delete item <uuid> from the history"
602 msgstr ""
603
604 #: src/client/gpaste-client.c:189
605 msgid "delete the password <name> from the history"
606 msgstr ""
607
608 #. Translators: help for gpaste file <path>
609 #: src/client/gpaste-client.c:191
610 msgid "path"
611 msgstr ""
612
613 #: src/client/gpaste-client.c:191
614 msgid "put the content of the file at <path> into the clipboard"
615 msgstr ""
616
617 #. Translators: help for whatever | gpaste
618 #: src/client/gpaste-client.c:193
619 msgid "whatever"
620 msgstr ""
621
622 #: src/client/gpaste-client.c:193
623 msgid "set the output of whatever to clipboard"
624 msgstr ""
625
626 #. Translators: help for gpaste empty
627 #: src/client/gpaste-client.c:195
628 msgid "empty the history"
629 msgstr ""
630
631 #. Translators: help for gpaste start
632 #: src/client/gpaste-client.c:197
633 msgid "start tracking clipboard changes"
634 msgstr ""
635
636 #. Translators: help for gpaste stop
637 #: src/client/gpaste-client.c:199
638 msgid "stop tracking clipboard changes"
639 msgstr ""
640
641 #. Translators: help for gpaste quit
642 #: src/client/gpaste-client.c:201
643 msgid "alias for stop"
644 msgstr ""
645
646 #. Translators: help for gpaste daemon-reexec
647 #: src/client/gpaste-client.c:203
648 msgid "reexecute the daemon (after upgrading...)"
649 msgstr ""
650
651 #. Translators: help for gpaste settings
652 #: src/client/gpaste-client.c:205
653 msgid "launch the configuration tool"
654 msgstr ""
655
656 #. Translators: help for gpaste ui
657 #: src/client/gpaste-client.c:207
658 msgid "launch the graphical tool"
659 msgstr ""
660
661 #. Translators: help for gpaste show-history
662 #: src/client/gpaste-client.c:209
663 msgid "make the applet or extension display the history"
664 msgstr ""
665
666 #. Translators: help for gpaste upload
667 #: src/client/gpaste-client.c:211
668 msgid "upload the item <uuid> to a pastebin service"
669 msgstr ""
670
671 #. Translators: help for gpaste version
672 #: src/client/gpaste-client.c:213
673 msgid "display the version"
674 msgstr ""
675
676 #. Translators: help for gpaste daemon-version
677 #: src/client/gpaste-client.c:215
678 msgid "display the daemon version"
679 msgstr ""
680
681 #. Translators: help for gpaste help
682 #: src/client/gpaste-client.c:217
683 msgid "display this help"
684 msgstr ""
685
686 #. Translators: help for gpaste about
687 #: src/client/gpaste-client.c:219
688 msgid "display the about dialog"
689 msgstr ""
690
691 #: src/client/gpaste-client.c:222
692 #, c-format
693 msgid "Convenience options:"
694 msgstr ""
695
696 #. Translators: help for --use-index
697 #: src/client/gpaste-client.c:225
698 msgid "use the index of the item instead of its UUID"
699 msgstr ""
700
701 #: src/client/gpaste-client.c:228
702 #, c-format
703 msgid "Display options:"
704 msgstr ""
705
706 #. Translators: help for --oneline
707 #: src/client/gpaste-client.c:231
708 msgid "display each item on only one line"
709 msgstr ""
710
711 #. Translators: help for --raw
712 #: src/client/gpaste-client.c:233
713 msgid "display each item raw (without line numbers)"
714 msgstr ""
715
716 #. Translators: help for --reverse
717 #: src/client/gpaste-client.c:235
718 msgid "display the items in reverse order"
719 msgstr ""
720
721 #. Translators: help for --zero
722 #: src/client/gpaste-client.c:237
723 msgid "use a NUL character instead of a new line betweean each item"
724 msgstr ""
725
726 #: src/client/gpaste-client.c:240
727 #, c-format
728 msgid "Merge options:"
729 msgstr ""
730
731 #. Translators: help for --decoration <string>
732 #. Translators: help for --separator <string>
733 #: src/client/gpaste-client.c:243 src/client/gpaste-client.c:245
734 msgid "string"
735 msgstr ""
736
737 #: src/client/gpaste-client.c:243
738 msgid ""
739 "add the given decoration to the beginning and the end of each item before "
740 "merging"
741 msgstr ""
742
743 #: src/client/gpaste-client.c:245
744 msgid "add the given separator between each item when merging"
745 msgstr ""
746
747 #: src/client/gpaste-client.c:342
748 #, c-format
749 msgid "Successfully reexecuted the daemon\n"
750 msgstr ""
751
752 #: src/client/gpaste-client.c:491
753 msgid "Cannot add non utf8 data as text."
754 msgstr ""
755
756 #: src/client/gpaste-client.c:808
757 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
758 #: src/ui/gpaste-ui-window.c:311
759 msgid "Couldn't connect to GPaste daemon"
760 msgstr ""
761
762 #: src/daemon/gpaste-daemon.c:33
763 msgid "Stop signal received, exiting"
764 msgstr ""
765
766 #: src/daemon/gpaste-daemon.c:70
767 msgid "Could not acquire DBus name."
768 msgstr ""
769
770 #. This is the date format "month/day/year time"
771 #: src/libgpaste/core/gpaste-image-item.c:240
772 msgid "%m/%d/%y %T"
773 msgstr ""
774
775 #. This gets displayed in history when selecting an image
776 #: src/libgpaste/core/gpaste-image-item.c:242
777 #, c-format
778 msgid "[Image, %d x %d (%s)]"
779 msgstr ""
780
781 #. This is the prefix displayed in history to identify a password
782 #: src/libgpaste/core/gpaste-password-item.c:67
783 msgid "Password"
784 msgstr "Geslo"
785
786 #. This is the prefix displayed in history to identify selected files
787 #: src/libgpaste/core/gpaste-uris-item.c:104
788 msgid "[Files] "
789 msgstr "[Datoteke] "
790
791 #: src/libgpaste/gpaste-macros.h:98
792 msgid "Failed to register the gtk application"
793 msgstr ""
794
795 #: src/libgpaste/gpaste-macros.h:110
796 msgid "is already running."
797 msgstr ""
798
799 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
800 #: src/ui/gpaste-ui-switch.c:92
801 msgid "Track clipboard changes"
802 msgstr ""
803
804 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:122
805 msgid "Close UI on select"
806 msgstr ""
807
808 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:131
809 msgid "Enable the gnome-shell extension"
810 msgstr ""
811
812 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:137
813 msgid "Sync the daemon state with the extension's one"
814 msgstr ""
815
816 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:146
817 msgid "Primary selection affects history"
818 msgstr ""
819
820 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:152
821 msgid "Synchronize clipboard with primary selection"
822 msgstr ""
823
824 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:159
825 msgid "Images support"
826 msgstr ""
827
828 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:165
829 msgid "Trim items"
830 msgstr ""
831
832 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:171
833 msgid "Detect growing lines"
834 msgstr ""
835
836 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:178
837 msgid "Save history"
838 msgstr ""
839
840 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:201
841 msgid "Max element size when displaying"
842 msgstr ""
843
844 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:229
845 msgid "Max text item length"
846 msgstr ""
847
848 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:236
849 msgid "Min text item length"
850 msgstr ""
851
852 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:334
853 msgid "General behaviour"
854 msgstr ""
855
856 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:335
857 msgid "History settings"
858 msgstr ""
859
860 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:336
861 msgid "Keyboard shortcuts"
862 msgstr ""
863
864 #. translators: This is the name of a multi-history management action
865 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
866 #: src/ui/gpaste-ui-panel.c:297
867 msgid "Switch to"
868 msgstr ""
869
870 #. translators: This is the name of a multi-history management action
871 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
872 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
873 #: src/ui/gpaste-ui-delete-item.c:49
874 msgid "Delete"
875 msgstr ""
876
877 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
878 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
879 msgid "Cancel"
880 msgstr ""
881
882 #. Translators: this is the translation for emptying the history
883 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
884 msgid "Empty"
885 msgstr ""
886
887 #: src/libgpaste/util/gpaste-util.c:410
888 msgid "Do you really want to empty the history?"
889 msgstr ""
890
891 #: src/libgpaste/util/gpaste-util.c:709
892 msgid "Could not create history dir"
893 msgstr ""
894
895 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
896 msgid "GPaste Settings"
897 msgstr ""
898
899 #: src/ui/gpaste-ui.c:106
900 msgid "Keyboard Shortcuts"
901 msgstr ""
902
903 #: src/ui/gpaste-ui.c:107
904 msgid "About GPaste"
905 msgstr ""
906
907 #: src/ui/gpaste-ui.c:108
908 msgid "Quit"
909 msgstr ""
910
911 #: src/ui/gpaste-ui-about.c:41
912 msgid "About"
913 msgstr ""
914
915 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
916 msgid "Backup"
917 msgstr ""
918
919 #: src/ui/gpaste-ui-backup-history.c:47
920 msgid "Under which name do you want to backup this history?"
921 msgstr ""
922
923 #: src/ui/gpaste-ui-delete-history.c:25
924 msgid "Are you sure you want to delete this history?"
925 msgstr ""
926
927 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
928 msgid "Edit"
929 msgstr ""
930
931 #: src/ui/gpaste-ui-empty-item.c:35
932 msgid "(No result)"
933 msgstr ""
934
935 #: src/ui/gpaste-ui-empty-item.c:49
936 msgid "(Empty)"
937 msgstr ""
938
939 #: src/ui/gpaste-ui-empty-item.c:60
940 msgid "(Couldn't connect to GPaste daemon)"
941 msgstr ""
942
943 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
944 msgid "New"
945 msgstr ""
946
947 #: src/ui/gpaste-ui-reexec.c:29
948 msgid "Restart"
949 msgstr ""
950
951 #: src/ui/gpaste-ui-reexec.c:29
952 msgid "Do you really want to restart the daemon?"
953 msgstr ""
954
955 #: src/ui/gpaste-ui-reexec.c:55
956 msgid "Restart the daemon"
957 msgstr ""
958
959 #: src/ui/gpaste-ui-search.c:26
960 msgid "Search"
961 msgstr ""
962
963 #: src/ui/gpaste-ui-shortcuts-window.c:64
964 msgid "General"
965 msgstr ""
966
967 #: src/ui/gpaste-ui-switch.c:54
968 msgid "Stop"
969 msgstr ""
970
971 #: src/ui/gpaste-ui-switch.c:54
972 msgid "Do you really want to stop tracking clipboard changes?"
973 msgstr ""
974
975 #: src/ui/gpaste-ui-upload-item.c:49
976 msgid "Upload"
977 msgstr ""
+166
-155
po/sv.po less more
66 msgstr ""
77 "Project-Id-Version: GPaste\n"
88 "Report-Msgid-Bugs-To: Marc-Antoine@Perennou.com\n"
9 "POT-Creation-Date: 2021-03-08 22:16+0100\n"
9 "POT-Creation-Date: 2021-04-30 13:15+0200\n"
1010 "PO-Revision-Date: 2018-01-06 08:14+0100\n"
1111 "Last-Translator: Åke Engelbrektson <eson@svenskasprakfiler.se>\n"
1212 "Language-Team: Svenska Språkfiler <contactform@svenskasprakfiler.se>\n"
5858 msgstr "Inställnings-UI"
5959
6060 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:48
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:56
62 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:65
61 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:66
6362 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:74
6463 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:83
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:91
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:120
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:128
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:136
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:144
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:160
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:168
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:176
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:184
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:200
64 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:92
65 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
66 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:109
67 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
68 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
69 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
70 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
71 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
72 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
73 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
74 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
75 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
76 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:218
7677 msgid "This is a maintenance release. Changes:"
7778 msgstr ""
7879
7980 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:50
80 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:114
81 msgid "fix a crash in memory usage checking"
82 msgstr ""
83
84 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:57
85 msgid "First release for GNOME 40. Changes:"
86 msgstr ""
87
88 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
89 msgid "port to gnome-shell 40"
90 msgstr ""
91
92 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:60
93 msgid "placeholder for gnome-shell prefs"
94 msgstr ""
95
96 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
97 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:132
8198 msgid "fix X11 keybinder outside of GNOME"
8299 msgstr ""
83100
84 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:58
101 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
85102 msgid "better handling and reporting of invalid uuids passed to gpaste-client"
86103 msgstr ""
87104
88 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:59
105 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
89106 msgid ""
90107 "gpaste-client now has a --use-index argument for several subcommands to use "
91108 "index instead of uuid"
92109 msgstr ""
93110
94 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:67
111 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
95112 msgid "fix the make-password keybinding"
96113 msgstr ""
97114
98 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:68
99 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:77
115 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:86
116 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
100117 msgid "updated translations"
101118 msgstr ""
102119
103 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:76
120 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
104121 #, fuzzy
105122 #| msgid "Enable the gnome-shell extension"
106123 msgid "gnome-shell extension warning fixes"
107124 msgstr "Aktivera gnome-skaltillägget"
108125
109 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:85
110 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
126 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
127 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:140
111128 #, fuzzy
112129 #| msgid "Enable the gnome-shell extension"
113130 msgid "gnome-shell extension cosmetic updates"
114131 msgstr "Aktivera gnome-skaltillägget"
115132
116 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:93
133 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:111
117134 msgid "Disable images support by default (can be reenabled in preferences)"
118135 msgstr ""
119136
120 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:94
137 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:112
121138 msgid "Search now includes passwords (using their names)"
122139 msgstr ""
123140
124 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:95
141 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:113
125142 msgid "systemd integration enhancements"
126143 msgstr ""
127144
128 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:101
145 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:119
129146 msgid "First release for GNOME 3.38. Changes:"
130147 msgstr ""
131148
132 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:103
149 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:121
133150 msgid "Drop the Tracking DBus signal"
134151 msgstr ""
135152
136 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:104
153 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:122
137154 msgid "Switch to uuids to identify items"
138155 msgstr ""
139156
140 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:105
157 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:123
141158 msgid "Bump DBus interface to org.gnome.GPaste2"
142159 msgstr ""
143160
144 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:106
161 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:124
145162 msgid "Update to gnome-shell 3.38.0"
146163 msgstr ""
147164
148 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:130
149 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:162
165 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:148
166 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:180
167 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:222
168 msgid "Fix activating items using Ctrl-Number in gnome-shell"
169 msgstr ""
170
171 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:156
172 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:188
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:221
174 msgid "Fix keybinding regrab with gnome-shell"
175 msgstr ""
176
177 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:164
178 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:196
179 msgid "Fix keybinding grab with gnome-shell"
180 msgstr ""
181
182 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
183 msgid "First release for GNOME 3.36. Changes:"
184 msgstr ""
185
186 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:172
187 msgid "Update to gnome-shell 3.36.0"
188 msgstr ""
189
150190 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:204
151 msgid "Fix activating items using Ctrl-Number in gnome-shell"
152 msgstr ""
153
154 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:138
155 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:170
156 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:203
157 msgid "Fix keybinding regrab with gnome-shell"
158 msgstr ""
159
160 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:146
161 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:178
162 msgid "Fix keybinding grab with gnome-shell"
163 msgstr ""
164
165 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:152
166 msgid "First release for GNOME 3.36. Changes:"
167 msgstr ""
168
169 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:154
170 msgid "Update to gnome-shell 3.36.0"
171 msgstr ""
172
173 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:186
174 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:202
191 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:220
175192 msgid "Compatibility with recent appstream-glib"
176193 msgstr ""
177194
178 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:192
195 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:210
179196 msgid "First release for GNOME 3.34. Changes:"
180197 msgstr ""
181198
182 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:194
199 #: data/appstream/org.gnome.GPaste.Ui.appdata.xml.in:212
183200 msgid "Update to gnome-shell 3.34.0"
184201 msgstr ""
185202
189206
190207 #: data/control-center/42-gpaste.control-center.xml.in:3
191208 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:269
192 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:73
209 #: src/ui/gpaste-ui-shortcuts-window.c:73
193210 msgid "Launch the graphical tool"
194211 msgstr "Starta det grafiska verktyget"
195212
196213 #: data/control-center/42-gpaste.control-center.xml.in:4
197214 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:276
198 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:74
215 #: src/ui/gpaste-ui-shortcuts-window.c:74
199216 msgid "Mark the active item as being a password"
200217 msgstr "Märk den aktiva posten som varande lösenord"
201218
202219 #: data/control-center/42-gpaste.control-center.xml.in:5
203220 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:262
204 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:72
221 #: src/ui/gpaste-ui-shortcuts-window.c:72
205222 msgid "Delete the active item from history"
206223 msgstr "Ta bort aktiv post från historiken"
207224
208225 #: data/control-center/42-gpaste.control-center.xml.in:6
209226 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:283
210 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:75
227 #: src/ui/gpaste-ui-shortcuts-window.c:75
211228 msgid "Display the history"
212229 msgstr "Visa historiken"
213230
214231 #: data/control-center/42-gpaste.control-center.xml.in:7
215232 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:290
216 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:76
233 #: src/ui/gpaste-ui-shortcuts-window.c:76
217234 msgid "Sync the clipboard to the primary selection"
218235 msgstr "Synkronisera urklipp med primär markering"
219236
220237 #: data/control-center/42-gpaste.control-center.xml.in:8
221238 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:297
222 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:77
239 #: src/ui/gpaste-ui-shortcuts-window.c:77
223240 msgid "Sync the primary selection to the clipboard"
224241 msgstr "Synkronisera primär markering med urklipp"
225242
226243 #: data/control-center/42-gpaste.control-center.xml.in:9
227244 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:304
228 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:78
245 #: src/ui/gpaste-ui-shortcuts-window.c:78
229246 msgid "Upload the active item to a pastebin service"
230247 msgstr "Ladda upp aktiv post till en pastebin-tjänst"
231248
508525 #: src/client/gpaste-client.c:157
509526 #, fuzzy
510527 #| msgid "print the history with indexes"
511 msgid "print the history with uuids"
528 msgid "print the history with UUIDs"
512529 msgstr "Skriv ut historiken med index"
513530
514531 #. Translators: help for gpaste history-size
617634 #| "merge the <number>th items from the history and add put the result in the "
618635 #| "clipboard"
619636 msgid ""
620 "merge the items matching the uuids from the history and put the result in "
637 "merge the items matching the UUIDs from the history and put the result in "
621638 "the clipboard"
622639 msgstr ""
623640 "Sammanfoga de <number>:e posterna från historiken och skicka resultatet till "
734751
735752 #. Translators: help for --use-index
736753 #: src/client/gpaste-client.c:225
737 msgid "use the index of the item instead of its uuid"
754 msgid "use the index of the item instead of its UUID"
738755 msgstr ""
739756
740757 #: src/client/gpaste-client.c:228
797814
798815 #: src/client/gpaste-client.c:808
799816 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:319
800 #: src/libgpaste/ui/gpaste-ui-window.c:311
817 #: src/ui/gpaste-ui-window.c:311
801818 msgid "Couldn't connect to GPaste daemon"
802819 msgstr "Kunde inte ansluta till GPaste-tjänsten"
803820
839856 msgstr "körs redan."
840857
841858 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:116
842 #: src/libgpaste/ui/gpaste-ui-switch.c:92
859 #: src/ui/gpaste-ui-switch.c:92
843860 msgid "Track clipboard changes"
844861 msgstr "Övervaka urklippsändringar"
845862
905922
906923 #. translators: This is the name of a multi-history management action
907924 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:453
908 #: src/libgpaste/ui/gpaste-ui-panel.c:297
925 #: src/ui/gpaste-ui-panel.c:297
909926 msgid "Switch to"
910927 msgstr "Växla till"
911928
912929 #. translators: This is the name of a multi-history management action
913930 #: src/libgpaste/settings-ui/gpaste-settings-ui-stack.c:458
914 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
915 #: src/libgpaste/ui/gpaste-ui-delete-history.c:65
916 #: src/libgpaste/ui/gpaste-ui-delete-item.c:49
931 #: src/ui/gpaste-ui-delete-history.c:25 src/ui/gpaste-ui-delete-history.c:65
932 #: src/ui/gpaste-ui-delete-item.c:49
917933 msgid "Delete"
918934 msgstr "Ta bort"
919935
920 #: src/libgpaste/ui/gpaste-ui-about.c:41
921 msgid "About"
922 msgstr "Om"
923
924 #: src/libgpaste/ui/gpaste-ui-backup-history.c:43
925 #: src/libgpaste/ui/gpaste-ui-backup-history.c:140
926 msgid "Backup"
927 msgstr "Säkerhetskopiera"
928
929 #: src/libgpaste/ui/gpaste-ui-backup-history.c:44
930 #: src/libgpaste/ui/gpaste-ui-edit-item.c:46
931 #: src/libgpaste/ui/gpaste-ui-new-item.c:32 src/libgpaste/util/gpaste-util.c:30
936 #: src/libgpaste/util/gpaste-util.c:30 src/ui/gpaste-ui-backup-history.c:44
937 #: src/ui/gpaste-ui-edit-item.c:46 src/ui/gpaste-ui-new-item.c:32
932938 msgid "Cancel"
933939 msgstr "Avbryt"
934940
935 #: src/libgpaste/ui/gpaste-ui-backup-history.c:47
936 msgid "Under which name do you want to backup this history?"
937 msgstr "Under vilket namn vill du säkerhetskopiera historiken?"
938
939 #: src/libgpaste/ui/gpaste-ui-delete-history.c:25
940 msgid "Are you sure you want to delete this history?"
941 msgstr "Vill du verkligen ta bort denna historik?"
942
943 #: src/libgpaste/ui/gpaste-ui-edit-item.c:45
944 #: src/libgpaste/ui/gpaste-ui-edit-item.c:118
945 msgid "Edit"
946 msgstr "Redigera"
947
948941 #. Translators: this is the translation for emptying the history
949 #: src/libgpaste/ui/gpaste-ui-empty-history.c:65
950 #: src/libgpaste/util/gpaste-util.c:410
942 #: src/libgpaste/util/gpaste-util.c:410 src/ui/gpaste-ui-empty-history.c:65
951943 msgid "Empty"
952944 msgstr "Töm"
953
954 #: src/libgpaste/ui/gpaste-ui-empty-item.c:35
955 msgid "(No result)"
956 msgstr "(Inget resultat)"
957
958 #: src/libgpaste/ui/gpaste-ui-empty-item.c:49
959 msgid "(Empty)"
960 msgstr "(Tom)"
961
962 #: src/libgpaste/ui/gpaste-ui-empty-item.c:60
963 msgid "(Couldn't connect to GPaste daemon)"
964 msgstr "(Kunde inte ansluta till GPaste-tjänsten)"
965
966 #: src/libgpaste/ui/gpaste-ui-new-item.c:31
967 #: src/libgpaste/ui/gpaste-ui-new-item.c:83
968 msgid "New"
969 msgstr "Nytt"
970
971 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
972 msgid "Restart"
973 msgstr "Starta om"
974
975 #: src/libgpaste/ui/gpaste-ui-reexec.c:29
976 msgid "Do you really want to restart the daemon?"
977 msgstr "Vill du verkligen starta om tjänsten?"
978
979 #: src/libgpaste/ui/gpaste-ui-reexec.c:55
980 msgid "Restart the daemon"
981 msgstr "Starta om tjänsten"
982
983 #: src/libgpaste/ui/gpaste-ui-search.c:26
984 msgid "Search"
985 msgstr "Sök"
986
987 #: src/libgpaste/ui/gpaste-ui-settings.c:32 src/ui/gpaste-ui.c:105
988 msgid "GPaste Settings"
989 msgstr "GPaste Inställningar"
990
991 #: src/libgpaste/ui/gpaste-ui-shortcuts-window.c:64
992 msgid "General"
993 msgstr "Allmänt"
994
995 #: src/libgpaste/ui/gpaste-ui-switch.c:54
996 msgid "Stop"
997 msgstr "Stopp"
998
999 #: src/libgpaste/ui/gpaste-ui-switch.c:54
1000 msgid "Do you really want to stop tracking clipboard changes?"
1001 msgstr "Vill du verkligen sluta övervaka urklippsändringar?"
1002
1003 #: src/libgpaste/ui/gpaste-ui-upload-item.c:49
1004 msgid "Upload"
1005 msgstr "Ladda upp"
1006945
1007946 #: src/libgpaste/util/gpaste-util.c:410
1008947 msgid "Do you really want to empty the history?"
1012951 msgid "Could not create history dir"
1013952 msgstr "Kunde inte skapa historikmapp"
1014953
954 #: src/ui/gpaste-ui.c:105 src/ui/gpaste-ui-settings.c:32
955 msgid "GPaste Settings"
956 msgstr "GPaste Inställningar"
957
1015958 #: src/ui/gpaste-ui.c:106
1016959 msgid "Keyboard Shortcuts"
1017960 msgstr "Tangentbordsgenvägar"
1024967 msgid "Quit"
1025968 msgstr "Avsluta"
1026969
970 #: src/ui/gpaste-ui-about.c:41
971 msgid "About"
972 msgstr "Om"
973
974 #: src/ui/gpaste-ui-backup-history.c:43 src/ui/gpaste-ui-backup-history.c:140
975 msgid "Backup"
976 msgstr "Säkerhetskopiera"
977
978 #: src/ui/gpaste-ui-backup-history.c:47
979 msgid "Under which name do you want to backup this history?"
980 msgstr "Under vilket namn vill du säkerhetskopiera historiken?"
981
982 #: src/ui/gpaste-ui-delete-history.c:25
983 msgid "Are you sure you want to delete this history?"
984 msgstr "Vill du verkligen ta bort denna historik?"
985
986 #: src/ui/gpaste-ui-edit-item.c:45 src/ui/gpaste-ui-edit-item.c:118
987 msgid "Edit"
988 msgstr "Redigera"
989
990 #: src/ui/gpaste-ui-empty-item.c:35
991 msgid "(No result)"
992 msgstr "(Inget resultat)"
993
994 #: src/ui/gpaste-ui-empty-item.c:49
995 msgid "(Empty)"
996 msgstr "(Tom)"
997
998 #: src/ui/gpaste-ui-empty-item.c:60
999 msgid "(Couldn't connect to GPaste daemon)"
1000 msgstr "(Kunde inte ansluta till GPaste-tjänsten)"
1001
1002 #: src/ui/gpaste-ui-new-item.c:31 src/ui/gpaste-ui-new-item.c:83
1003 msgid "New"
1004 msgstr "Nytt"
1005
1006 #: src/ui/gpaste-ui-reexec.c:29
1007 msgid "Restart"
1008 msgstr "Starta om"
1009
1010 #: src/ui/gpaste-ui-reexec.c:29
1011 msgid "Do you really want to restart the daemon?"
1012 msgstr "Vill du verkligen starta om tjänsten?"
1013
1014 #: src/ui/gpaste-ui-reexec.c:55
1015 msgid "Restart the daemon"
1016 msgstr "Starta om tjänsten"
1017
1018 #: src/ui/gpaste-ui-search.c:26
1019 msgid "Search"
1020 msgstr "Sök"
1021
1022 #: src/ui/gpaste-ui-shortcuts-window.c:64
1023 msgid "General"
1024 msgstr "Allmänt"
1025
1026 #: src/ui/gpaste-ui-switch.c:54
1027 msgid "Stop"
1028 msgstr "Stopp"
1029
1030 #: src/ui/gpaste-ui-switch.c:54
1031 msgid "Do you really want to stop tracking clipboard changes?"
1032 msgstr "Vill du verkligen sluta övervaka urklippsändringar?"
1033
1034 #: src/ui/gpaste-ui-upload-item.c:49
1035 msgid "Upload"
1036 msgstr "Ladda upp"
1037
10271038 #~ msgid "number"
10281039 #~ msgstr "Nummer"
10291040
153153
154154 printf (_("Usage:\n"));
155155 /* Translators: help for gpaste history */
156 printf (" %s [history]: %s\n", progname, _("print the history with uuids"));
156 printf (" %s [history]: %s\n", progname, _("print the history with UUIDs"));
157157 /* Translators: help for gpaste history-size */
158158 printf (" %s history-size: %s\n", progname, _("print the size of the history"));
159159 /* Translators: help for gpaste get-history */
179179 /* Translators: help for gpaste replace <uuid> <contents> */
180180 printf (" %s replace <uuid> <%s>: %s\n", progname, _("contents"), _("replace the contents of the item <uuid> from the history with the provided one"));
181181 /* Translators: help for gpaste merge <uuid> … <uuid> */
182 printf (" %s merge <uuid> … <uuid>: %s\n", progname, _("merge the items matching the uuids from the history and put the result in the clipboard"));
182 printf (" %s merge <uuid> … <uuid>: %s\n", progname, _("merge the items matching the UUIDs from the history and put the result in the clipboard"));
183183 /* Translators: help for gpaste set-password <uuid> <name> */
184184 printf (" %s set-password <uuid> <%s>: %s\n", progname, _("name"), _("set the item <uuid> from the history as a password named <name>"));
185185 /* Translators: help for gpaste delete <uuid> */
221221 printf(_("Convenience options:"));
222222 printf("\n");
223223 /* Translators: help for --use-index */
224 printf(" --index: %s\n", _("use the index of the item instead of its uuid"));
224 printf(" --index: %s\n", _("use the index of the item instead of its UUID"));
225225
226226 printf("\n");
227227 printf(_("Display options:"));
00 {
11 "shell-version": [
2 "3.38"
2 "40.0"
33 ],
44 "uuid": "GPaste@gnome-shell-extensions.gnome.org",
55 "name": "GPaste",
33 * Copyright (c) 2010-2019, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
44 */
55
6 imports.gi.versions.Gtk = '4.0';
7
68 const Config = imports.misc.config;
79
810 const Gettext = imports.gettext;
911
10 const { GPaste } = imports.gi;
12 //const { GPaste } = imports.gi;
1113
1214 const ExtensionUtils = imports.misc.extensionUtils;
1315 const Me = ExtensionUtils.getCurrentExtension();
1820 Gettext.textdomain(domain);
1921 }
2022
23 function GPaste40PlaceHolder() {
24 const { GLib, Gtk } = imports.gi;
25 GLib.spawn_async(null, ["gpaste-client", "settings"], null, GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD, null);
26 return new Gtk.Label({ label: "Opened the GPaste settings." });
27 }
28
2129 function buildPrefsWidget() {
30 /*
2231 let widget = new GPaste.SettingsUiWidget({ margin: 12 });
2332 if (widget) {
2433 widget.show_all();
2534 }
35 */
36 let widget = GPaste40PlaceHolder();
2637 return widget;
2738 }
209209 {
210210 GList *biggest = g_paste_history_private_get_item_by_uuid (priv, priv->biggest_uuid, NULL);
211211
212 g_return_if_fail (biggest);
213
214 g_paste_history_private_remove (priv, biggest, TRUE);
212 if (biggest)
213 g_paste_history_private_remove (priv, biggest, TRUE);
214
215215 g_paste_history_private_elect_new_biggest (priv);
216216 }
217217 }
4141 { \
4242 *error = _error; \
4343 _error = NULL; \
44 return NULL; \
4544 } \
45 return NULL; \
4646 } \
4747 return (self) ? G_PASTE_##TYPE (self) : NULL
4848
7373 #include <gpaste-settings-ui-stack.h>
7474 #include <gpaste-settings-ui-widget.h>
7575
76 /* GPasteUi */
77 #include <gpaste-ui-about.h>
78 #include <gpaste-ui-backup-history.h>
79 #include <gpaste-ui-delete-item.h>
80 #include <gpaste-ui-delete-history.h>
81 #include <gpaste-ui-edit-item.h>
82 #include <gpaste-ui-empty-history.h>
83 #include <gpaste-ui-empty-item.h>
84 #include <gpaste-ui-header.h>
85 #include <gpaste-ui-history.h>
86 #include <gpaste-ui-history-action.h>
87 #include <gpaste-ui-history-actions.h>
88 #include <gpaste-ui-item.h>
89 #include <gpaste-ui-item-action.h>
90 #include <gpaste-ui-item-skeleton.h>
91 #include <gpaste-ui-panel.h>
92 #include <gpaste-ui-panel-history.h>
93 #include <gpaste-ui-reexec.h>
94 #include <gpaste-ui-search.h>
95 #include <gpaste-ui-search-bar.h>
96 #include <gpaste-ui-settings.h>
97 #include <gpaste-ui-shortcuts-window.h>
98 #include <gpaste-ui-switch.h>
99 #include <gpaste-ui-upload-item.h>
100 #include <gpaste-ui-window.h>
101
10276 #undef __G_PASTE_H_INSIDE__
10377
10478 #endif /*__G_PASTE_H__*/
253253 g_paste_settings_get_growing_lines;
254254 g_paste_settings_get_history_name;
255255 g_paste_settings_get_images_support;
256 g_paste_settings_get_launch_ui;
256257 g_paste_settings_get_make_password;
257258 g_paste_settings_get_max_displayed_history_size;
258259 g_paste_settings_get_max_history_size;
270271 g_paste_settings_get_track_extension_state;
271272 g_paste_settings_get_trim_items;
272273 g_paste_settings_get_type;
274 g_paste_settings_get_upload;
273275 g_paste_settings_new;
274276 g_paste_settings_reset_close_on_select;
275277 g_paste_settings_reset_element_size;
351353 g_paste_text_item_get_type;
352354 g_paste_text_item_new;
353355
354 g_paste_ui_about_get_type;
355 g_paste_ui_about_new;
356
357 g_paste_ui_backup_history_get_type;
358 g_paste_ui_backup_history_new;
359
360 g_paste_ui_delete_history_get_type;
361 g_paste_ui_delete_history_new;
362
363 g_paste_ui_delete_item_get_type;
364 g_paste_ui_delete_item_new;
365
366 g_paste_ui_edit_item_get_type;
367 g_paste_ui_edit_item_new;
368
369 g_paste_ui_empty_history_get_type;
370 g_paste_ui_empty_history_new;
371
372 g_paste_ui_empty_item_get_type;
373 g_paste_ui_empty_item_new;
374 g_paste_ui_empty_item_show_empty;
375 g_paste_ui_empty_item_show_no_result;
376
377 g_paste_ui_header_get_search_button;
378 g_paste_ui_header_get_type;
379 g_paste_ui_header_new;
380 g_paste_ui_header_show_prefs;
381
382 g_paste_ui_history_action_get_type;
383 g_paste_ui_history_action_new;
384 g_paste_ui_history_action_set_history;
385
386 g_paste_ui_history_actions_get_type;
387 g_paste_ui_history_actions_new;
388 g_paste_ui_history_actions_set_relative_to;
389
390 g_paste_ui_history_get_type;
391 g_paste_ui_history_new;
392 g_paste_ui_history_search;
393 g_paste_ui_history_select_first;
394
395 g_paste_ui_item_action_get_type;
396 g_paste_ui_item_action_new;
397 g_paste_ui_item_action_set_uuid;
398
399 g_paste_ui_item_activate;
400 g_paste_ui_item_get_type;
401 g_paste_ui_item_new;
402 g_paste_ui_item_refresh;
403 g_paste_ui_item_set_index;
404 g_paste_ui_item_set_uuid;
405
406 g_paste_ui_item_skeleton_get_label;
407 g_paste_ui_item_skeleton_get_type;
408 g_paste_ui_item_skeleton_new;
409 g_paste_ui_item_skeleton_set_activatable;
410 g_paste_ui_item_skeleton_set_editable;
411 g_paste_ui_item_skeleton_set_index_and_uuid;
412 g_paste_ui_item_skeleton_set_markup;
413 g_paste_ui_item_skeleton_set_text;
414 g_paste_ui_item_skeleton_set_uploadable;
415
416356 g_paste_ui_keybinding_get_type;
417357 g_paste_ui_keybinding_new;
418
419 g_paste_ui_new_item_get_type;
420 g_paste_ui_new_item_new;
421
422 g_paste_ui_panel_get_type;
423 g_paste_ui_panel_new;
424 g_paste_ui_panel_update_history_length;
425
426 g_paste_ui_panel_history_activate;
427 g_paste_ui_panel_history_get_history;
428 g_paste_ui_panel_history_get_type;
429 g_paste_ui_panel_history_new;
430 g_paste_ui_panel_history_set_length;
431
432 g_paste_ui_reexec_get_type;
433 g_paste_ui_reexec_new;
434
435 g_paste_ui_search_bar_get_entry;
436 g_paste_ui_search_bar_get_type;
437 g_paste_ui_search_bar_new;
438
439 g_paste_ui_search_get_type;
440 g_paste_ui_search_new;
441
442 g_paste_ui_settings_get_type;
443 g_paste_ui_settings_new;
444
445 g_paste_ui_shortcuts_window_get_type;
446 g_paste_ui_shortcuts_window_new;
447
448 g_paste_ui_switch_get_type;
449 g_paste_ui_switch_new;
450
451 g_paste_ui_upload_item_get_type;
452 g_paste_ui_upload_item_new;
453
454 g_paste_ui_window_empty_history;
455 g_paste_ui_window_get_type;
456 g_paste_ui_window_new;
457 g_paste_ui_window_search;
458 g_paste_ui_window_show_prefs;
459358
460359 g_paste_update_action_get_type;
461360 g_paste_update_target_get_type;
3232 'settings-ui/gpaste-settings-ui-stack.c',
3333 'settings-ui/gpaste-settings-ui-widget.c',
3434 'settings/gpaste-settings.c',
35 'ui/gpaste-ui-about.c',
36 'ui/gpaste-ui-backup-history.c',
37 'ui/gpaste-ui-delete-history.c',
38 'ui/gpaste-ui-delete-item.c',
39 'ui/gpaste-ui-edit-item.c',
40 'ui/gpaste-ui-empty-history.c',
41 'ui/gpaste-ui-empty-item.c',
42 'ui/gpaste-ui-header.c',
43 'ui/gpaste-ui-history-action.c',
44 'ui/gpaste-ui-history-actions.c',
45 'ui/gpaste-ui-history.c',
46 'ui/gpaste-ui-item-action.c',
47 'ui/gpaste-ui-item-skeleton.c',
48 'ui/gpaste-ui-item.c',
49 'ui/gpaste-ui-new-item.c',
50 'ui/gpaste-ui-panel-history.c',
51 'ui/gpaste-ui-panel.c',
52 'ui/gpaste-ui-reexec.c',
53 'ui/gpaste-ui-search-bar.c',
54 'ui/gpaste-ui-search.c',
55 'ui/gpaste-ui-settings.c',
56 'ui/gpaste-ui-shortcuts-window.c',
57 'ui/gpaste-ui-switch.c',
58 'ui/gpaste-ui-upload-item.c',
59 'ui/gpaste-ui-window.c',
6035 'util/gpaste-util.c',
6136 ]
6237
9974 'settings-ui/gpaste-settings-ui-stack.h',
10075 'settings-ui/gpaste-settings-ui-widget.h',
10176 'settings/gpaste-settings.h',
102 'ui/gpaste-ui-about.h',
103 'ui/gpaste-ui-backup-history.h',
104 'ui/gpaste-ui-delete-history.h',
105 'ui/gpaste-ui-delete-item.h',
106 'ui/gpaste-ui-edit-item.h',
107 'ui/gpaste-ui-empty-history.h',
108 'ui/gpaste-ui-empty-item.h',
109 'ui/gpaste-ui-header.h',
110 'ui/gpaste-ui-history-action.h',
111 'ui/gpaste-ui-history-actions.h',
112 'ui/gpaste-ui-history.h',
113 'ui/gpaste-ui-item-action.h',
114 'ui/gpaste-ui-item-skeleton.h',
115 'ui/gpaste-ui-item.h',
116 'ui/gpaste-ui-new-item.h',
117 'ui/gpaste-ui-panel-history.h',
118 'ui/gpaste-ui-panel.h',
119 'ui/gpaste-ui-reexec.h',
120 'ui/gpaste-ui-search-bar.h',
121 'ui/gpaste-ui-search.h',
122 'ui/gpaste-ui-settings.h',
123 'ui/gpaste-ui-shortcuts-window.h',
124 'ui/gpaste-ui-switch.h',
125 'ui/gpaste-ui-upload-item.h',
126 'ui/gpaste-ui-window.h',
12777 'util/gpaste-util.h',
12878 ]
12979
13888 'screensaver-client',
13989 'settings',
14090 'settings-ui',
141 'ui',
14291 'util',
14392 )
14493
+0
-66
src/libgpaste/ui/gpaste-ui-about.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-about.h>
7 #include <gpaste-util.h>
8
9 struct _GPasteUiAbout
10 {
11 GtkButton parent_instance;
12 };
13
14 typedef struct
15 {
16 GActionGroup *action_group;
17 } GPasteUiAboutPrivate;
18
19 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiAbout, ui_about, GTK_TYPE_BUTTON)
20
21 static void
22 g_paste_ui_about_clicked (GtkButton *button)
23 {
24 const GPasteUiAboutPrivate *priv = _g_paste_ui_about_get_instance_private (G_PASTE_UI_ABOUT (button));
25
26 g_action_group_activate_action (priv->action_group, "about", NULL);
27 }
28
29 static void
30 g_paste_ui_about_class_init (GPasteUiAboutClass *klass)
31 {
32 GTK_BUTTON_CLASS (klass)->clicked = g_paste_ui_about_clicked;
33 }
34
35 static void
36 g_paste_ui_about_init (GPasteUiAbout *self)
37 {
38 GtkWidget *widget = GTK_WIDGET (self);
39
40 gtk_widget_set_tooltip_text (widget, _("About"));
41 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
42 gtk_container_add (GTK_CONTAINER (self), gtk_image_new_from_icon_name ("dialog-information-symbolic", GTK_ICON_SIZE_BUTTON));
43 }
44
45 /**
46 * g_paste_ui_about_new:
47 * @app: The #GtkApplication
48 *
49 * Create a new instance of #GPasteUiAbout
50 *
51 * Returns: a newly allocated #GPasteUiAbout
52 * free it with g_object_unref
53 */
54 G_PASTE_VISIBLE GtkWidget *
55 g_paste_ui_about_new (GtkApplication *app)
56 {
57 g_return_val_if_fail (GTK_IS_APPLICATION (app), NULL);
58
59 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_ABOUT, NULL);
60 GPasteUiAboutPrivate *priv = g_paste_ui_about_get_instance_private (G_PASTE_UI_ABOUT (self));
61
62 priv->action_group = G_ACTION_GROUP (app);
63
64 return self;
65 }
+0
-26
src/libgpaste/ui/gpaste-ui-about.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_ABOUT_H__
11 #define __G_PASTE_UI_ABOUT_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_ABOUT (g_paste_ui_about_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiAbout, ui_about, UI_ABOUT, GtkButton)
20
21 GtkWidget *g_paste_ui_about_new (GtkApplication *app);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_ABOUT_H__*/
+0
-141
src/libgpaste/ui/gpaste-ui-backup-history.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-backup-history.h>
7 #include <gpaste-ui-history-actions.h>
8 #include <gpaste-util.h>
9
10 #include "gpaste-gtk-compat.h"
11
12 struct _GPasteUiBackupHistory
13 {
14 GPasteUiHistoryAction parent_instance;
15 };
16
17 G_PASTE_DEFINE_TYPE (UiBackupHistory, ui_backup_history, G_PASTE_TYPE_UI_HISTORY_ACTION)
18
19 enum
20 {
21 C_ACTIVATED,
22
23 C_LAST_SIGNAL
24 };
25
26 static void
27 on_entry_activated (GtkEntry *entry G_GNUC_UNUSED,
28 gpointer user_data)
29 {
30 GtkDialog *dialog = user_data;
31
32 gtk_dialog_response (dialog, GTK_RESPONSE_OK);
33 }
34
35 static gchar *
36 g_paste_ui_backup_history_confirm_dialog (GtkWindow *parent,
37 const gchar *history)
38 {
39 g_autofree gchar *default_name = g_strdup_printf ("%s_backup", history);
40 GtkWidget *dialog = gtk_dialog_new_with_buttons (PACKAGE_STRING, parent,
41 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_USE_HEADER_BAR,
42 _("Backup"), GTK_RESPONSE_OK,
43 _("Cancel"), GTK_RESPONSE_CANCEL,
44 NULL);
45 GtkDialog *d = GTK_DIALOG (dialog);
46 GtkWidget *label = gtk_label_new (_("Under which name do you want to backup this history?"));
47 GtkWidget *entry = gtk_entry_new ();
48 GtkEntry *e = GTK_ENTRY (entry);
49 GtkWidget *vbox = gtk_dialog_get_content_area (d);
50 GtkBox *box = GTK_BOX (vbox);
51
52 gtk_widget_set_margin_start (vbox, 2);
53 gtk_widget_set_margin_end (vbox, 2);
54 gtk_widget_set_margin_bottom (vbox, 2);
55
56 gtk_widget_set_vexpand (label, TRUE);
57 gtk_widget_set_valign (label, TRUE);
58 gtk_box_pack_start (box, label, TRUE, TRUE);
59 gtk_widget_show (label);
60
61 gtk_widget_set_vexpand (entry, TRUE);
62 gtk_widget_set_valign (entry, TRUE);
63 gtk_box_pack_start (box, entry, TRUE, TRUE);
64 gtk_entry_set_text (e, default_name);
65 gtk_widget_show (entry);
66
67 guint64 c_signals[C_LAST_SIGNAL] = {
68 [C_ACTIVATED] = g_signal_connect (G_OBJECT (entry),
69 "activate",
70 G_CALLBACK (on_entry_activated),
71 dialog)
72 };
73
74 gchar *backup = NULL;
75
76 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
77 {
78 const gchar *text = gtk_entry_get_text (e);
79
80 if (text && *text)
81 backup = g_strdup (text);
82 }
83
84 g_signal_handler_disconnect (entry, c_signals[C_ACTIVATED]);
85 gtk_widget_destroy (dialog);
86
87 return backup;
88 }
89
90 static gboolean
91 g_paste_ui_backup_history_activate (GPasteUiHistoryAction *self G_GNUC_UNUSED,
92 GPasteClient *client,
93 GPasteSettings *settings G_GNUC_UNUSED,
94 GtkWindow *rootwin,
95 const gchar *history)
96 {
97 g_autofree gchar *backup = g_paste_ui_backup_history_confirm_dialog (rootwin, history);
98
99 if (backup)
100 g_paste_client_backup_history (client, history, backup, NULL, NULL);
101
102 return TRUE;
103 }
104
105 static void
106 g_paste_ui_backup_history_class_init (GPasteUiBackupHistoryClass *klass)
107 {
108 G_PASTE_UI_HISTORY_ACTION_CLASS (klass)->activate = g_paste_ui_backup_history_activate;
109 }
110
111 static void
112 g_paste_ui_backup_history_init (GPasteUiBackupHistory *self G_GNUC_UNUSED)
113 {
114 }
115
116 /**
117 * g_paste_ui_backup_history_new:
118 * @client: a #GPasteClient
119 * @settings: a #GPasteSettings
120 * @actions: the #GPasteUiHistoryActions
121 * @rootwin: the root #GtkWindow
122 *
123 * Create a new instance of #GPasteUiBackupHistory
124 *
125 * Returns: a newly allocated #GPasteUiBackupHistory
126 * free it with g_object_unref
127 */
128 G_PASTE_VISIBLE GtkWidget *
129 g_paste_ui_backup_history_new (GPasteClient *client,
130 GPasteSettings *settings,
131 GtkWidget *actions,
132 GtkWindow *rootwin)
133 {
134 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
135 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
136 g_return_val_if_fail (_G_PASTE_IS_UI_HISTORY_ACTIONS (actions), NULL);
137 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
138
139 return g_paste_ui_history_action_new (G_PASTE_TYPE_UI_BACKUP_HISTORY, client, settings, actions, rootwin, _("Backup"));
140 }
+0
-29
src/libgpaste/ui/gpaste-ui-backup-history.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_BACKUP_HISTORY_H__
11 #define __G_PASTE_UI_BACKUP_HISTORY_H__
12
13 #include <gpaste-ui-history-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_BACKUP_HISTORY (g_paste_ui_backup_history_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiBackupHistory, ui_backup_history, UI_BACKUP_HISTORY, GPasteUiHistoryAction)
20
21 GtkWidget *g_paste_ui_backup_history_new (GPasteClient *client,
22 GPasteSettings *settings,
23 GtkWidget *actions,
24 GtkWindow *rootwin);
25
26 G_END_DECLS
27
28 #endif /*__G_PASTE_UI_BACKUP_HISTORY_H__*/
+0
-66
src/libgpaste/ui/gpaste-ui-delete-history.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-delete-history.h>
7 #include <gpaste-ui-history-actions.h>
8 #include <gpaste-util.h>
9
10 struct _GPasteUiDeleteHistory
11 {
12 GPasteUiHistoryAction parent_instance;
13 };
14
15 G_PASTE_DEFINE_TYPE (UiDeleteHistory, ui_delete_history, G_PASTE_TYPE_UI_HISTORY_ACTION)
16
17 static gboolean
18 g_paste_ui_delete_history_activate (GPasteUiHistoryAction *self G_GNUC_UNUSED,
19 GPasteClient *client,
20 GPasteSettings *settings G_GNUC_UNUSED,
21 GtkWindow *rootwin,
22 const gchar *history)
23 {
24 if (g_paste_util_confirm_dialog (rootwin, _("Delete"), _("Are you sure you want to delete this history?")))
25 g_paste_client_delete_history (client, history, NULL, NULL);
26
27 return TRUE;
28 }
29
30 static void
31 g_paste_ui_delete_history_class_init (GPasteUiDeleteHistoryClass *klass)
32 {
33 G_PASTE_UI_HISTORY_ACTION_CLASS (klass)->activate = g_paste_ui_delete_history_activate;
34 }
35
36 static void
37 g_paste_ui_delete_history_init (GPasteUiDeleteHistory *self G_GNUC_UNUSED)
38 {
39 }
40
41 /**
42 * g_paste_ui_delete_history_new:
43 * @client: a #GPasteClient
44 * @settings: a #GPasteSettings
45 * @actions: the #GPasteUiHistoryActions
46 * @rootwin: the root #GtkWindow
47 *
48 * Create a new instance of #GPasteUiDeleteHistory
49 *
50 * Returns: a newly allocated #GPasteUiDeleteHistory
51 * free it with g_object_unref
52 */
53 G_PASTE_VISIBLE GtkWidget *
54 g_paste_ui_delete_history_new (GPasteClient *client,
55 GPasteSettings *settings,
56 GtkWidget *actions,
57 GtkWindow *rootwin)
58 {
59 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
60 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
61 g_return_val_if_fail (_G_PASTE_IS_UI_HISTORY_ACTIONS (actions), NULL);
62 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
63
64 return g_paste_ui_history_action_new (G_PASTE_TYPE_UI_DELETE_HISTORY, client, settings, actions, rootwin, _("Delete"));
65 }
+0
-29
src/libgpaste/ui/gpaste-ui-delete-history.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_DELETE_HISTORY_H__
11 #define __G_PASTE_UI_DELETE_HISTORY_H__
12
13 #include <gpaste-ui-history-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_DELETE_HISTORY (g_paste_ui_delete_history_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiDeleteHistory, ui_delete_history, UI_DELETE_HISTORY, GPasteUiHistoryAction)
20
21 GtkWidget *g_paste_ui_delete_history_new (GPasteClient *client,
22 GPasteSettings *settings,
23 GtkWidget *actions,
24 GtkWindow *rootwin);
25
26 G_END_DECLS
27
28 #endif /*__G_PASTE_UI_DELETE_HISTORY_H__*/
+0
-50
src/libgpaste/ui/gpaste-ui-delete-item.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-delete-item.h>
7
8 struct _GPasteUiDeleteItem
9 {
10 GPasteUiItemAction parent_instance;
11 };
12
13 G_PASTE_DEFINE_TYPE (UiDeleteItem, ui_delete_item, G_PASTE_TYPE_UI_ITEM_ACTION)
14
15 static void
16 g_paste_ui_delete_item_activate (GPasteUiItemAction *self G_GNUC_UNUSED,
17 GPasteClient *client,
18 const gchar *uuid)
19 {
20 g_paste_client_delete (client, uuid, NULL, NULL);
21 }
22
23 static void
24 g_paste_ui_delete_item_class_init (GPasteUiDeleteItemClass *klass)
25 {
26 G_PASTE_UI_ITEM_ACTION_CLASS (klass)->activate = g_paste_ui_delete_item_activate;
27 }
28
29 static void
30 g_paste_ui_delete_item_init (GPasteUiDeleteItem *self G_GNUC_UNUSED)
31 {
32 }
33
34 /**
35 * g_paste_ui_delete_item_new:
36 * @client: a #GPasteClient
37 *
38 * Create a new instance of #GPasteUiDeleteItem
39 *
40 * Returns: a newly allocated #GPasteUiDeleteItem
41 * free it with g_object_unref
42 */
43 G_PASTE_VISIBLE GtkWidget *
44 g_paste_ui_delete_item_new (GPasteClient *client)
45 {
46 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
47
48 return g_paste_ui_item_action_new (G_PASTE_TYPE_UI_DELETE_ITEM, client, "edit-delete-symbolic", _("Delete"));
49 }
+0
-26
src/libgpaste/ui/gpaste-ui-delete-item.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_DELETE_ITEM_H__
11 #define __G_PASTE_UI_DELETE_ITEM_H__
12
13 #include <gpaste-ui-item-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_DELETE_ITEM (g_paste_ui_delete_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiDeleteItem, ui_delete_item, UI_DELETE_ITEM, GPasteUiItemAction)
20
21 GtkWidget *g_paste_ui_delete_item_new (GPasteClient *client);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_DELETE_ITEM_H__*/
+0
-124
src/libgpaste/ui/gpaste-ui-edit-item.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-edit-item.h>
7
8 #include "gpaste-gtk-compat.h"
9
10 struct _GPasteUiEditItem
11 {
12 GPasteUiItemAction parent_instance;
13 };
14
15 typedef struct
16 {
17 GtkWindow *rootwin;
18 } GPasteUiEditItemPrivate;
19
20 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiEditItem, ui_edit_item, G_PASTE_TYPE_UI_ITEM_ACTION)
21
22 typedef struct
23 {
24 GPasteUiEditItemPrivate *priv;
25 gchar *uuid;
26 } CallbackData;
27
28 static void
29 on_item_ready (GObject *source_object,
30 GAsyncResult *res,
31 gpointer user_data)
32 {
33 g_autofree CallbackData *data = user_data;
34 g_autofree gchar *uuid = data->uuid;
35 GPasteUiEditItemPrivate *priv = data->priv;
36 GPasteClient *client = G_PASTE_CLIENT (source_object);
37 g_autofree gchar *old_item = g_paste_client_get_raw_element_finish (client, res, NULL);
38
39 if (!old_item)
40 return;
41
42 GtkWidget *dialog = gtk_dialog_new_with_buttons (PACKAGE_STRING, priv->rootwin,
43 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_USE_HEADER_BAR,
44 _("Edit"), GTK_RESPONSE_OK,
45 _("Cancel"), GTK_RESPONSE_CANCEL,
46 NULL);
47 GtkDialog *d = GTK_DIALOG (dialog);
48 GtkWidget *text = gtk_text_view_new ();
49 GtkTextView *tv = GTK_TEXT_VIEW (text);
50 GtkTextBuffer *buf = gtk_text_view_get_buffer (tv);
51 GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
52 GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW (scroll);
53
54 gtk_text_view_set_wrap_mode (tv, GTK_WRAP_WORD);
55 gtk_text_buffer_set_text (buf, old_item, -1);
56 gtk_scrolled_window_set_min_content_height (sw, 300);
57 gtk_scrolled_window_set_min_content_width (sw, 600);
58 gtk_container_add (GTK_CONTAINER (sw), text);
59 gtk_widget_set_vexpand (scroll, TRUE);
60 gtk_widget_set_valign (scroll, TRUE);
61 gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (d)), scroll, TRUE, TRUE);
62 gtk_widget_show_all (scroll);
63
64 if (gtk_dialog_run (d) == GTK_RESPONSE_OK)
65 {
66 const gchar *txt;
67
68 g_object_get (G_OBJECT (buf), "text", &txt, NULL);
69 if (txt && *txt)
70 g_paste_client_replace (client, uuid, txt, NULL, NULL);
71 }
72
73 gtk_widget_destroy (dialog);
74 }
75
76 static void
77 g_paste_ui_edit_item_activate (GPasteUiItemAction *self,
78 GPasteClient *client,
79 const gchar *uuid)
80 {
81 CallbackData *data = g_malloc (sizeof (CallbackData));
82
83 data->priv = g_paste_ui_edit_item_get_instance_private (G_PASTE_UI_EDIT_ITEM (self));
84 data->uuid = g_strdup (uuid);
85
86 g_paste_client_get_raw_element (client, uuid, on_item_ready, data);
87 }
88
89 static void
90 g_paste_ui_edit_item_class_init (GPasteUiEditItemClass *klass)
91 {
92 G_PASTE_UI_ITEM_ACTION_CLASS (klass)->activate = g_paste_ui_edit_item_activate;
93 }
94
95 static void
96 g_paste_ui_edit_item_init (GPasteUiEditItem *self G_GNUC_UNUSED)
97 {
98 }
99
100 /**
101 * g_paste_ui_edit_item_new:
102 * @client: a #GPasteClient
103 * @rootwin: the root #GtkWindow
104 *
105 * Create a new instance of #GPasteUiEditItem
106 *
107 * Returns: a newly allocated #GPasteUiEditItem
108 * free it with g_object_unref
109 */
110 G_PASTE_VISIBLE GtkWidget *
111 g_paste_ui_edit_item_new (GPasteClient *client,
112 GtkWindow *rootwin)
113 {
114 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
115 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
116
117 GtkWidget *self = g_paste_ui_item_action_new (G_PASTE_TYPE_UI_EDIT_ITEM, client, "accessories-text-editor-symbolic", _("Edit"));
118 GPasteUiEditItemPrivate *priv = g_paste_ui_edit_item_get_instance_private (G_PASTE_UI_EDIT_ITEM (self));
119
120 priv->rootwin = rootwin;
121
122 return self;
123 }
+0
-27
src/libgpaste/ui/gpaste-ui-edit-item.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_EDIT_ITEM_H__
11 #define __G_PASTE_UI_EDIT_ITEM_H__
12
13 #include <gpaste-ui-item-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_EDIT_ITEM (g_paste_ui_edit_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiEditItem, ui_edit_item, UI_EDIT_ITEM, GPasteUiItemAction)
20
21 GtkWidget *g_paste_ui_edit_item_new (GPasteClient *client,
22 GtkWindow *rootwin);
23
24 G_END_DECLS
25
26 #endif /*__G_PASTE_UI_EDIT_ITEM_H__*/
+0
-66
src/libgpaste/ui/gpaste-ui-empty-history.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-empty-history.h>
7 #include <gpaste-ui-history-actions.h>
8 #include <gpaste-util.h>
9
10 struct _GPasteUiEmptyHistory
11 {
12 GPasteUiHistoryAction parent_instance;
13 };
14
15 G_PASTE_DEFINE_TYPE (UiEmptyHistory, ui_empty_history, G_PASTE_TYPE_UI_HISTORY_ACTION)
16
17 static gboolean
18 g_paste_ui_empty_history_activate (GPasteUiHistoryAction *self G_GNUC_UNUSED,
19 GPasteClient *client,
20 GPasteSettings *settings,
21 GtkWindow *rootwin,
22 const gchar *history)
23 {
24 g_paste_util_empty_history (rootwin, client, settings, history);
25
26 return TRUE;
27 }
28
29 static void
30 g_paste_ui_empty_history_class_init (GPasteUiEmptyHistoryClass *klass)
31 {
32 G_PASTE_UI_HISTORY_ACTION_CLASS (klass)->activate = g_paste_ui_empty_history_activate;
33 }
34
35 static void
36 g_paste_ui_empty_history_init (GPasteUiEmptyHistory *self G_GNUC_UNUSED)
37 {
38 }
39
40 /**
41 * g_paste_ui_empty_history_new:
42 * @client: a #GPasteClient instance
43 * @settings: a #GPasteSettings instance
44 * @actions: the #GPasteUiHistoryActions
45 * @rootwin: the main #GtkWindow
46 *
47 * Create a new instance of #GPasteUiEmptyHistory
48 *
49 * Returns: a newly allocated #GPasteUiEmptyHistory
50 * free it with g_object_unref
51 */
52 G_PASTE_VISIBLE GtkWidget *
53 g_paste_ui_empty_history_new (GPasteClient *client,
54 GPasteSettings *settings,
55 GtkWidget *actions,
56 GtkWindow *rootwin)
57 {
58 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
59 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
60 g_return_val_if_fail (_G_PASTE_IS_UI_HISTORY_ACTIONS (actions), NULL);
61 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
62
63 /* Translators: this is the translation for emptying the history */
64 return g_paste_ui_history_action_new (G_PASTE_TYPE_UI_EMPTY_HISTORY, client, settings, actions, rootwin, _("Empty"));
65 }
+0
-29
src/libgpaste/ui/gpaste-ui-empty-history.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_EMPTY_HISTORY_H__
11 #define __G_PASTE_UI_EMPTY_HISTORY_H__
12
13 #include <gpaste-ui-history-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_EMPTY_HISTORY (g_paste_ui_empty_history_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiEmptyHistory, ui_empty_history, UI_EMPTY_HISTORY, GPasteUiHistoryAction)
20
21 GtkWidget *g_paste_ui_empty_history_new (GPasteClient *client,
22 GPasteSettings *settings,
23 GtkWidget *actions,
24 GtkWindow *rootwin);
25
26 G_END_DECLS
27
28 #endif /*__G_PASTE_UI_EMPTY_HISTORY_H__*/
+0
-88
src/libgpaste/ui/gpaste-ui-empty-item.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-empty-item.h>
7
8 struct _GPasteUiEmptyItem
9 {
10 GPasteUiItemSkeleton parent_instance;
11 };
12
13 G_PASTE_DEFINE_TYPE (UiEmptyItem, ui_empty_item, G_PASTE_TYPE_UI_ITEM_SKELETON)
14
15 static void
16 g_paste_ui_empty_item_show_text (GPasteUiEmptyItem *self,
17 const gchar *text)
18 {
19 g_paste_ui_item_skeleton_set_text (G_PASTE_UI_ITEM_SKELETON (self), text);
20 gtk_widget_show (GTK_WIDGET (self));
21 }
22
23 /**
24 * g_paste_ui_empty_show_no_result:
25 * @self: a #GPasteUiEmptyItem instance
26 *
27 * Show a no result message
28 */
29 G_PASTE_VISIBLE void
30 g_paste_ui_empty_item_show_no_result (GPasteUiEmptyItem *self)
31 {
32 g_return_if_fail (G_PASTE_IS_UI_EMPTY_ITEM (self));
33
34 g_paste_ui_empty_item_show_text (self, _("(No result)"));
35 }
36
37 /**
38 * g_paste_ui_empty_show_empty:
39 * @self: a #GPasteUiEmptyItem instance
40 *
41 * Show an empty message
42 */
43 G_PASTE_VISIBLE void
44 g_paste_ui_empty_item_show_empty (GPasteUiEmptyItem *self)
45 {
46 g_return_if_fail (G_PASTE_IS_UI_EMPTY_ITEM (self));
47
48 g_paste_ui_empty_item_show_text (self, _("(Empty)"));
49 }
50
51 static void
52 g_paste_ui_empty_item_class_init (GPasteUiEmptyItemClass *klass G_GNUC_UNUSED)
53 {
54 }
55
56 static void
57 g_paste_ui_empty_item_init (GPasteUiEmptyItem *self)
58 {
59 g_paste_ui_item_skeleton_set_text (G_PASTE_UI_ITEM_SKELETON (self), _("(Couldn't connect to GPaste daemon)"));
60 }
61
62 /**
63 * g_paste_ui_empty_item_new:
64 * @client: a #GPasteClient instance
65 * @settings: a #GPasteSettings instance
66 * @rootwin: the root #GtkWindow
67 *
68 * Create a new instance of #GPasteUiEmptyItem
69 *
70 * Returns: a newly allocated #GPasteUiEmptyItem
71 * free it with g_object_unref
72 */
73 G_PASTE_VISIBLE GtkWidget *
74 g_paste_ui_empty_item_new (GPasteClient *client,
75 GPasteSettings *settings,
76 GtkWindow *rootwin)
77 {
78 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
79 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
80 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
81
82 GtkWidget *self = g_paste_ui_item_skeleton_new (G_PASTE_TYPE_UI_EMPTY_ITEM, client, settings, rootwin);
83
84 g_paste_ui_item_skeleton_set_activatable (G_PASTE_UI_ITEM_SKELETON (self), FALSE);
85
86 return self;
87 }
+0
-31
src/libgpaste/ui/gpaste-ui-empty-item.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_EMPTY_ITEM_H__
11 #define __G_PASTE_UI_EMPTY_ITEM_H__
12
13 #include <gpaste-ui-item-skeleton.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_EMPTY_ITEM (g_paste_ui_empty_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiEmptyItem, ui_empty_item, UI_EMPTY_ITEM, GPasteUiItemSkeleton)
20
21 void g_paste_ui_empty_item_show_no_result (GPasteUiEmptyItem *self);
22 void g_paste_ui_empty_item_show_empty (GPasteUiEmptyItem *self);
23
24 GtkWidget *g_paste_ui_empty_item_new (GPasteClient *client,
25 GPasteSettings *settings,
26 GtkWindow *rootwin);
27
28 G_END_DECLS
29
30 #endif /*__G_PASTE_UI_EMPTY_ITEM_H__*/
+0
-111
src/libgpaste/ui/gpaste-ui-header.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-about.h>
7 #include <gpaste-ui-header.h>
8 #include <gpaste-ui-new-item.h>
9 #include <gpaste-ui-reexec.h>
10 #include <gpaste-ui-search.h>
11 #include <gpaste-ui-settings.h>
12 #include <gpaste-ui-switch.h>
13
14 struct _GPasteUiHeader
15 {
16 GtkHeaderBar parent_instance;
17 };
18
19 typedef struct
20 {
21 GtkButton *settings;
22 GtkButton *search;
23 } GPasteUiHeaderPrivate;
24
25 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiHeader, ui_header, GTK_TYPE_HEADER_BAR)
26
27 /**
28 * g_paste_ui_header_show_prefs:
29 * @self: the #GPasteUiHeader
30 *
31 * Show the prefs pane
32 */
33 G_PASTE_VISIBLE void
34 g_paste_ui_header_show_prefs (const GPasteUiHeader *self)
35 {
36 g_return_if_fail (_G_PASTE_IS_UI_HEADER (self));
37
38 const GPasteUiHeaderPrivate *priv = _g_paste_ui_header_get_instance_private (self);
39
40 gtk_button_clicked (priv->settings);
41 }
42
43 /**
44 * g_paste_ui_header_get_search_button:
45 * @self: the #GPasteUiHeader
46 *
47 * Get the search button
48 *
49 * Returns: (transfer none): the #GPasteUISearch instance
50 */
51 G_PASTE_VISIBLE GtkButton *
52 g_paste_ui_header_get_search_button (const GPasteUiHeader *self)
53 {
54 g_return_val_if_fail (_G_PASTE_IS_UI_HEADER (self), NULL);
55
56 const GPasteUiHeaderPrivate *priv = _g_paste_ui_header_get_instance_private (self);
57
58 return priv->search;
59 }
60
61 static void
62 g_paste_ui_header_class_init (GPasteUiHeaderClass *klass G_GNUC_UNUSED)
63 {
64 }
65
66 static void
67 g_paste_ui_header_init (GPasteUiHeader *self)
68 {
69 GPasteUiHeaderPrivate *priv = g_paste_ui_header_get_instance_private (self);
70 GtkHeaderBar *header_bar = GTK_HEADER_BAR (self);
71 GtkWidget *settings = g_paste_ui_settings_new ();
72 GtkWidget *search = g_paste_ui_search_new ();
73
74 priv->settings = GTK_BUTTON (settings);
75 priv->search = GTK_BUTTON (search);
76
77 gtk_header_bar_set_title(header_bar, PACKAGE_STRING);
78 gtk_header_bar_set_show_close_button (header_bar, TRUE);
79 gtk_header_bar_pack_end (header_bar, settings);
80 gtk_header_bar_pack_end (header_bar, search);
81 }
82
83 /**
84 * g_paste_ui_header_new:
85 * @topwin: the main #GtkWindow
86 * @client: a #GPasteClient instance
87 *
88 * Create a new instance of #GPasteUiHeader
89 *
90 * Returns: a newly allocated #GPasteUiHeader
91 * free it with g_object_unref
92 */
93 G_PASTE_VISIBLE GtkWidget *
94 g_paste_ui_header_new (GtkWindow *topwin,
95 GPasteClient *client)
96 {
97 g_return_val_if_fail (GTK_IS_WINDOW (topwin), NULL);
98 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
99
100 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_HEADER, NULL);
101 GtkHeaderBar *bar = GTK_HEADER_BAR (self);
102
103 gtk_header_bar_pack_start (bar, g_paste_ui_switch_new (topwin, client));
104 gtk_header_bar_pack_start (bar, g_paste_ui_reexec_new (topwin, client));
105
106 gtk_header_bar_pack_end (bar, g_paste_ui_about_new (gtk_window_get_application (topwin)));
107 gtk_header_bar_pack_end (bar, g_paste_ui_new_item_new (topwin, client));
108
109 return self;
110 }
+0
-31
src/libgpaste/ui/gpaste-ui-header.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_HEADER_H__
11 #define __G_PASTE_UI_HEADER_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_HEADER (g_paste_ui_header_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiHeader, ui_header, UI_HEADER, GtkHeaderBar)
20
21 void g_paste_ui_header_show_prefs (const GPasteUiHeader *self);
22
23 GtkButton *g_paste_ui_header_get_search_button (const GPasteUiHeader *self);
24
25 GtkWidget *g_paste_ui_header_new (GtkWindow *topwin,
26 GPasteClient *client);
27
28 G_END_DECLS
29
30 #endif /*__G_PASTE_UI_HEADER_H__*/
+0
-143
src/libgpaste/ui/gpaste-ui-history-action.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-history-action.h>
7 #include <gpaste-ui-history-actions.h>
8
9 typedef struct
10 {
11 GPasteClient *client;
12 GPasteSettings *settings;
13 GPasteUiHistoryActions *actions;
14
15 GtkWindow *rootwin;
16
17 gchar *history;
18 } GPasteUiHistoryActionPrivate;
19
20 G_PASTE_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (UiHistoryAction, ui_history_action, GTK_TYPE_BUTTON)
21
22 /**
23 * g_paste_ui_history_action_set_history:
24 * @self: a #GPasteUiHistoryAction instance
25 * @history: the history to delete
26 *
27 * Set the history to delete
28 */
29 G_PASTE_VISIBLE void
30 g_paste_ui_history_action_set_history (GPasteUiHistoryAction *self,
31 const gchar *history)
32 {
33 g_return_if_fail (_G_PASTE_IS_UI_HISTORY_ACTION (self));
34
35 GPasteUiHistoryActionPrivate *priv = g_paste_ui_history_action_get_instance_private (G_PASTE_UI_HISTORY_ACTION (self));
36
37 g_free (priv->history);
38 priv->history = g_strdup (history);
39 }
40
41 static gboolean
42 g_paste_ui_history_action_button_press_event (GtkWidget *widget,
43 GdkEventButton *event G_GNUC_UNUSED)
44 {
45 GPasteUiHistoryAction *self = G_PASTE_UI_HISTORY_ACTION (widget);
46 GPasteUiHistoryActionClass *klass = G_PASTE_UI_HISTORY_ACTION_GET_CLASS (self);
47 const GPasteUiHistoryActionPrivate *priv = _g_paste_ui_history_action_get_instance_private (self);
48 gboolean ret;
49
50 if (priv->history && klass->activate)
51 ret = klass->activate (self, priv->client, priv->settings, priv->rootwin, priv->history);
52 else
53 ret = GTK_WIDGET_CLASS (g_paste_ui_history_action_parent_class)->button_press_event (widget, event);
54
55 g_paste_ui_history_actions_set_relative_to (priv->actions, NULL);
56
57 return ret;
58 }
59
60 static void
61 g_paste_ui_history_action_dispose (GObject *object)
62 {
63 GPasteUiHistoryActionPrivate *priv = g_paste_ui_history_action_get_instance_private (G_PASTE_UI_HISTORY_ACTION (object));
64
65 g_clear_object (&priv->client);
66 g_clear_object (&priv->settings);
67
68 G_OBJECT_CLASS (g_paste_ui_history_action_parent_class)->dispose (object);
69 }
70
71 static void
72 g_paste_ui_history_action_finalize (GObject *object)
73 {
74 const GPasteUiHistoryActionPrivate *priv = _g_paste_ui_history_action_get_instance_private (G_PASTE_UI_HISTORY_ACTION (object));
75
76 g_free (priv->history);
77
78 G_OBJECT_CLASS (g_paste_ui_history_action_parent_class)->finalize (object);
79 }
80
81 static void
82 g_paste_ui_history_action_class_init (GPasteUiHistoryActionClass *klass)
83 {
84 GObjectClass *object_class = G_OBJECT_CLASS (klass);
85
86 object_class->dispose = g_paste_ui_history_action_dispose;
87 object_class->finalize = g_paste_ui_history_action_finalize;
88
89 GTK_WIDGET_CLASS (klass)->button_press_event = g_paste_ui_history_action_button_press_event;
90 }
91
92 static void
93 g_paste_ui_history_action_init (GPasteUiHistoryAction *self)
94 {
95 GtkWidget *button = GTK_WIDGET (self);
96
97 gtk_widget_set_margin_start (button, 5);
98 gtk_widget_set_margin_end (button, 5);
99 }
100
101 /**
102 * g_paste_ui_history_action_new:
103 * @type: the type of the subclass to instantiate
104 * @client: a #GPasteClient
105 * @settings: a #GPasteSettings
106 * @actions: a #GPasteUiHistoryActions
107 * @rootwin: the main #GtkWindow
108 *
109 * Create a new instance of #GPasteUiHistoryAction
110 *
111 * Returns: a newly allocated #GPasteUiHistoryAction
112 * free it with g_object_unref
113 */
114 G_PASTE_VISIBLE GtkWidget *
115 g_paste_ui_history_action_new (GType type,
116 GPasteClient *client,
117 GPasteSettings *settings,
118 GtkWidget *actions,
119 GtkWindow *rootwin,
120 const gchar *label)
121 {
122 g_return_val_if_fail (g_type_is_a (type, G_PASTE_TYPE_UI_HISTORY_ACTION), NULL);
123 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
124 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
125 g_return_val_if_fail (_G_PASTE_IS_UI_HISTORY_ACTIONS (actions), NULL);
126 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
127
128 GtkWidget *self = gtk_widget_new (type,
129 "width-request", 200,
130 "height-request", 30,
131 NULL);
132 GPasteUiHistoryActionPrivate *priv = g_paste_ui_history_action_get_instance_private (G_PASTE_UI_HISTORY_ACTION (self));
133
134 priv->client = g_object_ref (client);
135 priv->settings = g_object_ref (settings);
136 priv->actions = G_PASTE_UI_HISTORY_ACTIONS (actions);
137 priv->rootwin = rootwin;
138
139 gtk_button_set_label (GTK_BUTTON (self), label);
140
141 return self;
142 }
+0
-47
src/libgpaste/ui/gpaste-ui-history-action.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_HISTORY_ACTION_H__
11 #define __G_PASTE_UI_HISTORY_ACTION_H__
12
13 #include <gpaste-client.h>
14 #include <gpaste-settings.h>
15
16 G_BEGIN_DECLS
17
18 #define G_PASTE_TYPE_UI_HISTORY_ACTION (g_paste_ui_history_action_get_type ())
19
20 G_PASTE_DERIVABLE_TYPE (UiHistoryAction, ui_history_action, UI_HISTORY_ACTION, GtkButton)
21
22 struct _GPasteUiHistoryActionClass
23 {
24 GtkButtonClass parent_class;
25
26 /*< pure virtual >*/
27 gboolean (*activate) (GPasteUiHistoryAction *self,
28 GPasteClient *client,
29 GPasteSettings *settings,
30 GtkWindow *rootwin,
31 const gchar *history);
32 };
33
34 void g_paste_ui_history_action_set_history (GPasteUiHistoryAction *self,
35 const gchar *history);
36
37 GtkWidget *g_paste_ui_history_action_new (GType type,
38 GPasteClient *client,
39 GPasteSettings *settings,
40 GtkWidget *actions,
41 GtkWindow *rootwin,
42 const gchar *label);
43
44 G_END_DECLS
45
46 #endif /*__G_PASTE_UI_HISTORY_ACTION_H__*/
+0
-139
src/libgpaste/ui/gpaste-ui-history-actions.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-backup-history.h>
7 #include <gpaste-ui-delete-history.h>
8 #include <gpaste-ui-empty-history.h>
9 #include <gpaste-ui-history-actions.h>
10
11 #include "gpaste-gtk-compat.h"
12
13 struct _GPasteUiHistoryActions
14 {
15 GtkPopover parent_instance;
16 };
17
18 typedef struct
19 {
20 GPasteClient *client;
21
22 GSList *actions;
23 } GPasteUiHistoryActionsPrivate;
24
25 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiHistoryActions, ui_history_actions, GTK_TYPE_POPOVER)
26
27 static void
28 action_set_history (gpointer data,
29 gpointer user_data)
30 {
31 GPasteUiHistoryAction *action = data;
32 const gchar *history = user_data;
33
34 g_paste_ui_history_action_set_history (action, history);
35 }
36
37 /**
38 * g_paste_ui_history_actions_set_relative_to:
39 * @self: the #GPasteUiHistoryActions
40 * @history: (nullable): a #GPasteUiPanelHistory instance
41 *
42 * Set which history we'll deal with
43 */
44 G_PASTE_VISIBLE void
45 g_paste_ui_history_actions_set_relative_to (GPasteUiHistoryActions *self,
46 GPasteUiPanelHistory *history)
47 {
48 g_return_if_fail (_G_PASTE_IS_UI_HISTORY_ACTIONS (self));
49 g_return_if_fail (!history || _G_PASTE_IS_UI_PANEL_HISTORY (history));
50
51 const GPasteUiHistoryActionsPrivate *priv = _g_paste_ui_history_actions_get_instance_private (self);
52 const gchar *h = (history) ? g_paste_ui_panel_history_get_history (history) : NULL;
53
54 g_slist_foreach (priv->actions, action_set_history, (gpointer) h);
55
56 if (history)
57 gtk_popover_set_relative_to (GTK_POPOVER (self), GTK_WIDGET (history));
58 else
59 gtk_widget_hide (GTK_WIDGET (self));
60 }
61
62 static void
63 add_action_to_box (gpointer data,
64 gpointer user_data)
65 {
66 GtkContainer *box = user_data;
67 GtkWidget *action = data;
68
69 gtk_container_add (box, action);
70 }
71
72 static void
73 g_paste_ui_history_actions_dispose (GObject *object)
74 {
75 GPasteUiHistoryActionsPrivate *priv = g_paste_ui_history_actions_get_instance_private (G_PASTE_UI_HISTORY_ACTIONS (object));
76
77 g_clear_object (&priv->client);
78
79 G_OBJECT_CLASS (g_paste_ui_history_actions_parent_class)->dispose (object);
80 }
81
82 static void
83 g_paste_ui_history_actions_class_init (GPasteUiHistoryActionsClass *klass)
84 {
85 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_history_actions_dispose;
86 }
87
88 static void
89 g_paste_ui_history_actions_init (GPasteUiHistoryActions *self G_GNUC_UNUSED)
90 {
91 }
92
93 /**
94 * g_paste_ui_history_actions_new:
95 * @client: a #GPasteClient instance
96 * @settings: a #GPasteSettings instance
97 * @rootwin: the root #GtkWindow
98 *
99 * Create a new instance of #GPasteUiHistoryActions
100 *
101 * Returns: a newly allocated #GPasteUiHistoryActions
102 * free it with g_object_unref
103 */
104 G_PASTE_VISIBLE GtkWidget *
105 g_paste_ui_history_actions_new (GPasteClient *client,
106 GPasteSettings *settings,
107 GtkWindow *rootwin)
108 {
109 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
110 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
111 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
112
113 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_HISTORY_ACTIONS,
114 "width-request", 200,
115 "height-request", 40,
116 NULL);
117 GPasteUiHistoryActionsPrivate *priv = g_paste_ui_history_actions_get_instance_private (G_PASTE_UI_HISTORY_ACTIONS (self));
118 GtkWidget *box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
119 GtkWidget *backup = g_paste_ui_backup_history_new (client, settings, self, rootwin);
120 GtkWidget *delete = g_paste_ui_delete_history_new (client, settings, self, rootwin);
121 GtkWidget *empty = g_paste_ui_empty_history_new (client, settings, self, rootwin);
122
123 priv->client = g_object_ref (client);
124 priv->actions = g_slist_append (priv->actions, backup);
125 priv->actions = g_slist_append (priv->actions, empty);
126 priv->actions = g_slist_append (priv->actions, delete);
127
128 gtk_popover_set_position (GTK_POPOVER (self), GTK_POS_RIGHT);
129
130 g_slist_foreach (priv->actions, add_action_to_box, box);
131 gtk_widget_set_margin_top (box, 5);
132 gtk_widget_set_margin_bottom (box, 5);
133 gtk_widget_show_all (box);
134
135 gtk_container_add (GTK_CONTAINER (self), box);
136
137 return self;
138 }
+0
-32
src/libgpaste/ui/gpaste-ui-history-actions.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_HISTORY_ACTIONS_H__
11 #define __G_PASTE_UI_HISTORY_ACTIONS_H__
12
13 #include <gpaste-settings.h>
14 #include <gpaste-ui-panel-history.h>
15
16 G_BEGIN_DECLS
17
18 #define G_PASTE_TYPE_UI_HISTORY_ACTIONS (g_paste_ui_history_actions_get_type ())
19
20 G_PASTE_FINAL_TYPE (UiHistoryActions, ui_history_actions, UI_HISTORY_ACTIONS, GtkPopover)
21
22 void g_paste_ui_history_actions_set_relative_to (GPasteUiHistoryActions *self,
23 GPasteUiPanelHistory *history);
24
25 GtkWidget *g_paste_ui_history_actions_new (GPasteClient *client,
26 GPasteSettings *settings,
27 GtkWindow *rootwin);
28
29 G_END_DECLS
30
31 #endif /*__G_PASTE_UI_HISTORY_ACTIONS_H__*/
+0
-431
src/libgpaste/ui/gpaste-ui-history.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-gsettings-keys.h>
7 #include <gpaste-ui-empty-item.h>
8 #include <gpaste-ui-history.h>
9 #include <gpaste-ui-item.h>
10 #include <gpaste-update-enums.h>
11
12 #include "gpaste-gtk-compat.h"
13
14 struct _GPasteUiHistory
15 {
16 GtkListBox parent_instance;
17 };
18
19 enum
20 {
21 C_SIZE,
22 C_UPDATE,
23
24 C_LAST_SIGNAL
25 };
26
27 typedef struct
28 {
29 GPasteClient *client;
30 GPasteSettings *settings;
31 GPasteUiPanel *panel;
32 GPasteUiEmptyItem *dummy_item;
33
34 GtkWindow *rootwin;
35
36 GSList *items;
37 guint64 size;
38 gint32 item_height;
39
40 gchar *search;
41 GStrv search_results;
42
43 guint64 c_signals[C_LAST_SIGNAL];
44 } GPasteUiHistoryPrivate;
45
46 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiHistory, ui_history, GTK_TYPE_LIST_BOX)
47
48 static void
49 on_row_activated (GtkListBox *history G_GNUC_UNUSED,
50 GtkListBoxRow *row)
51 {
52 g_paste_ui_item_activate (G_PASTE_UI_ITEM (row));
53 }
54
55 static void
56 g_paste_ui_history_add_item (gpointer data,
57 gpointer user_data)
58 {
59 GtkContainer *self = user_data;
60 GtkWidget *item = data;
61
62 g_object_ref (item);
63 gtk_container_add (self, item);
64 gtk_widget_show_all (item);
65 }
66
67 static void
68 g_paste_ui_history_add_list (GtkContainer *self,
69 GSList *list)
70 {
71 g_slist_foreach (list, g_paste_ui_history_add_item, self);
72 }
73
74 static void
75 g_paste_ui_history_remove (gpointer data,
76 gpointer user_data)
77 {
78 GtkWidget *item = data;
79 GtkContainer *self = user_data;
80
81 gtk_container_remove (self, item);
82 g_object_unref (item);
83 }
84
85 static void
86 g_paste_ui_history_drop_list (GtkContainer *self,
87 GSList *list)
88 {
89 g_slist_foreach (list, g_paste_ui_history_remove, self);
90 g_slist_free (list);
91 }
92
93 static void g_paste_ui_history_refresh (GPasteUiHistory *self,
94 guint64 from_index);
95
96 static void
97 g_paste_ui_history_update_height_request (GPasteSettings *settings,
98 const gchar *key G_GNUC_UNUSED,
99 gpointer user_data)
100 {
101 GPasteUiHistory *self = user_data;
102 const GPasteUiHistoryPrivate *priv = _g_paste_ui_history_get_instance_private (self);
103 guint64 new_size = g_paste_settings_get_max_displayed_history_size (settings);
104
105 if (priv->item_height)
106 g_object_set (G_OBJECT (self), "height-request", new_size * priv->item_height, NULL);
107
108 if (new_size != priv->size)
109 g_paste_ui_history_refresh (self, 0);
110 }
111
112 typedef struct {
113 GPasteUiHistory *self;
114 gchar *name;
115 guint64 from_index;
116 } OnUpdateCallbackData;
117
118 static void
119 g_paste_ui_history_refresh_history (GObject *source_object G_GNUC_UNUSED,
120 GAsyncResult *res,
121 gpointer user_data)
122 {
123 g_autofree OnUpdateCallbackData *data = user_data;
124 g_autofree gchar *name = data->name;
125 GPasteUiHistory *self = data->self;
126 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (self);
127
128 guint64 old_size = priv->size;
129 guint64 refreshTextBound = old_size;
130 guint64 new_size = g_paste_client_get_history_size_finish (priv->client, res, NULL);
131 guint64 max_size = g_paste_settings_get_max_displayed_history_size (priv->settings);
132
133 priv->size = MIN (new_size, max_size);
134
135 if (priv->size)
136 gtk_widget_hide (GTK_WIDGET (priv->dummy_item));
137 else
138 g_paste_ui_empty_item_show_empty (priv->dummy_item);
139
140 g_paste_ui_panel_update_history_length (priv->panel, name, new_size);
141
142 if (old_size < priv->size)
143 {
144 for (guint64 i = old_size; i < priv->size; ++i)
145 {
146 GtkWidget *item = g_paste_ui_item_new (priv->client, priv->settings, priv->rootwin, i);
147 priv->items = g_slist_append (priv->items, item);
148 }
149 g_paste_ui_history_add_list (GTK_CONTAINER (self), g_slist_nth (priv->items, old_size));
150 refreshTextBound = old_size;
151 }
152 else if (old_size > priv->size)
153 {
154 if (priv->size)
155 {
156 GSList *last = g_slist_nth (priv->items, priv->size - 1);
157 g_return_if_fail (last);
158 g_paste_ui_history_drop_list (GTK_CONTAINER (self), g_slist_next (last));
159 last->next = NULL;
160 }
161 else
162 {
163 g_paste_ui_history_drop_list (GTK_CONTAINER (self), priv->items);
164 priv->items = NULL;
165 }
166 refreshTextBound = priv->size;
167 }
168
169 GSList *item = priv->items;
170
171 for (guint64 i = 0; i < data->from_index; ++i)
172 item = g_slist_next (item);
173 for (guint64 i = data->from_index; i < refreshTextBound && item; ++i, item = g_slist_next (item))
174 g_paste_ui_item_set_index (item->data, i);
175
176 if (!priv->item_height)
177 {
178 gtk_widget_measure (GTK_WIDGET ((priv->items) ? priv->items->data : priv->dummy_item), GTK_ORIENTATION_VERTICAL, -1, NULL, &priv->item_height, NULL, NULL);
179 g_paste_ui_history_update_height_request (priv->settings, NULL, self);
180 }
181 }
182
183 static void
184 on_name_ready (GObject *source_object G_GNUC_UNUSED,
185 GAsyncResult *res,
186 gpointer user_data)
187 {
188 OnUpdateCallbackData *data = user_data;
189 const GPasteUiHistoryPrivate *priv = _g_paste_ui_history_get_instance_private (data->self);
190
191 data->name = g_paste_client_get_history_name_finish (priv->client, res, NULL);
192
193 g_paste_client_get_history_size (priv->client, data->name, g_paste_ui_history_refresh_history, data);
194 }
195
196 static void
197 g_paste_ui_history_refresh (GPasteUiHistory *self,
198 guint64 from_index)
199 {
200 const GPasteUiHistoryPrivate *priv = _g_paste_ui_history_get_instance_private (self);
201
202 if (priv->search)
203 {
204 g_paste_ui_history_search (self, priv->search);
205 }
206 else
207 {
208 OnUpdateCallbackData *data = g_new (OnUpdateCallbackData, 1);
209 data->self = self;
210 data->from_index = from_index;
211
212 g_paste_client_get_history_name (priv->client, on_name_ready, data);
213 }
214 }
215
216 static void
217 on_search_ready (GObject *source_object G_GNUC_UNUSED,
218 GAsyncResult *res,
219 gpointer user_data)
220 {
221 GPasteUiHistory *self = user_data;
222 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (self);
223 GSList *item = priv->items;
224
225 g_clear_pointer (&priv->search_results, g_strfreev);
226 priv->search_results = g_paste_client_search_finish (priv->client, res, NULL /* error */);
227 guint64 search_results_size = g_strv_length (priv->search_results);
228
229 if (priv->search_results)
230 {
231 if (search_results_size > priv->size)
232 search_results_size = priv->size;
233
234 for (guint64 i = 0; i < search_results_size; ++i, item = g_slist_next (item))
235 g_paste_ui_item_set_uuid (item->data, priv->search_results[i]);
236 }
237 else
238 {
239 g_paste_ui_empty_item_show_no_result (priv->dummy_item);
240 }
241
242 for (guint64 i = search_results_size; i < priv->size; ++i, item = g_slist_next (item))
243 g_paste_ui_item_set_index (item->data, (guint64) -1);
244 }
245
246 /**
247 * g_paste_ui_history_search:
248 * @self: a #GPasteUiHistory instance
249 * @search: the search
250 *
251 * Apply a search to a #GPasteUiHistory instance
252 */
253 G_PASTE_VISIBLE void
254 g_paste_ui_history_search (GPasteUiHistory *self,
255 const gchar *search)
256 {
257 g_return_if_fail (_G_PASTE_IS_UI_HISTORY (self));
258
259 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (self);
260
261 if (g_paste_str_equal (search, ""))
262 {
263 g_clear_pointer (&priv->search, g_free);
264 g_clear_pointer (&priv->search_results, g_strfreev);
265 g_paste_ui_history_refresh (self, 0);
266 }
267 else
268 {
269 if (search != priv->search)
270 {
271 g_free (priv->search);
272 priv->search = g_strdup (search);
273 }
274 g_paste_client_search (priv->client, search, on_search_ready, self);
275 }
276 }
277
278 /**
279 * g_paste_ui_history_select_first:
280 * @self: a #GPasteUiHistory instance
281 *
282 * Select the first element
283 *
284 * returns: whether anything was selected or not
285 */
286 G_PASTE_VISIBLE gboolean
287 g_paste_ui_history_select_first (GPasteUiHistory *self)
288 {
289 g_return_val_if_fail (_G_PASTE_IS_UI_HISTORY (self), FALSE);
290
291 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (self);
292
293 if (!priv->items)
294 return FALSE;
295
296 return g_paste_ui_item_activate (priv->items->data);
297 }
298
299 static void
300 g_paste_ui_history_on_update (GPasteClient *client G_GNUC_UNUSED,
301 GPasteUpdateAction action,
302 GPasteUpdateTarget target,
303 guint64 position,
304 gpointer user_data)
305 {
306 GPasteUiHistory *self = user_data;
307 const GPasteUiHistoryPrivate *priv = _g_paste_ui_history_get_instance_private (self);
308 gboolean refresh = FALSE;
309
310 switch (target)
311 {
312 case G_PASTE_UPDATE_TARGET_ALL:
313 refresh = TRUE;
314 break;
315 case G_PASTE_UPDATE_TARGET_POSITION:
316 switch (action)
317 {
318 case G_PASTE_UPDATE_ACTION_REPLACE:
319 g_paste_ui_item_refresh (g_slist_nth_data (priv->items, position));
320 break;
321 case G_PASTE_UPDATE_ACTION_REMOVE:
322 refresh = TRUE;
323 break;
324 default:
325 g_assert_not_reached ();
326 }
327 break;
328 default:
329 g_assert_not_reached ();
330 }
331
332 if (refresh)
333 g_paste_ui_history_refresh (self, position);
334 }
335
336 static void
337 g_paste_ui_history_dispose (GObject *object)
338 {
339 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (G_PASTE_UI_HISTORY (object));
340
341 if (priv->settings)
342 {
343 g_signal_handler_disconnect (priv->settings, priv->c_signals[C_SIZE]);
344 g_clear_object (&priv->settings);
345 }
346
347 if (priv->client)
348 {
349 g_signal_handler_disconnect (priv->client, priv->c_signals[C_UPDATE]);
350 g_clear_object (&priv->client);
351 }
352
353 G_OBJECT_CLASS (g_paste_ui_history_parent_class)->dispose (object);
354 }
355
356 static void
357 g_paste_ui_history_finalize (GObject *object)
358 {
359 const GPasteUiHistoryPrivate *priv = _g_paste_ui_history_get_instance_private (G_PASTE_UI_HISTORY (object));
360
361 g_free (priv->search);
362 g_strfreev (priv->search_results);
363
364 G_OBJECT_CLASS (g_paste_ui_history_parent_class)->finalize (object);
365 }
366
367 static void
368 g_paste_ui_history_class_init (GPasteUiHistoryClass *klass)
369 {
370 GObjectClass *object_class = G_OBJECT_CLASS (klass);
371
372 object_class->dispose = g_paste_ui_history_dispose;
373 object_class->finalize = g_paste_ui_history_finalize;
374
375 GTK_LIST_BOX_CLASS (klass)->row_activated = on_row_activated;
376 }
377
378 static void
379 g_paste_ui_history_init (GPasteUiHistory *self G_GNUC_UNUSED)
380 {
381 }
382
383 /**
384 * g_paste_ui_history_new:
385 * @client: a #GPasteClient instance
386 * @settings: a #GPasteSettings instance
387 * @panel: the #GPasteSettingsUiPanel
388 * @rootwin: the root #GtkWindow
389 *
390 * Create a new instance of #GPasteUiHistory
391 *
392 * Returns: a newly allocated #GPasteUiHistory
393 * free it with g_object_unref
394 */
395 G_PASTE_VISIBLE GtkWidget *
396 g_paste_ui_history_new (GPasteClient *client,
397 GPasteSettings *settings,
398 GPasteUiPanel *panel,
399 GtkWindow *rootwin)
400 {
401 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
402 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
403 g_return_val_if_fail (_G_PASTE_IS_UI_PANEL (panel), NULL);
404 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
405
406 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_HISTORY, NULL);
407 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (G_PASTE_UI_HISTORY (self));
408 GtkWidget *dummy_item = g_paste_ui_empty_item_new (client, settings, rootwin);
409
410 priv->client = g_object_ref (client);
411 priv->settings = g_object_ref (settings);
412 priv->dummy_item = G_PASTE_UI_EMPTY_ITEM (dummy_item);
413 priv->panel = panel;
414 priv->rootwin = rootwin;
415
416 gtk_container_add (GTK_CONTAINER (self), dummy_item);
417
418 priv->c_signals[C_SIZE] = g_signal_connect (settings,
419 "changed::" G_PASTE_MAX_DISPLAYED_HISTORY_SIZE_SETTING,
420 G_CALLBACK (g_paste_ui_history_update_height_request),
421 self);
422 priv->c_signals[C_UPDATE] = g_signal_connect (client,
423 "update",
424 G_CALLBACK (g_paste_ui_history_on_update),
425 self);
426
427 g_paste_ui_history_on_update (client, G_PASTE_UPDATE_ACTION_REPLACE, G_PASTE_UPDATE_TARGET_ALL, 0, self);
428
429 return self;
430 }
+0
-34
src/libgpaste/ui/gpaste-ui-history.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_HISTORY_H__
11 #define __G_PASTE_UI_HISTORY_H__
12
13 #include <gpaste-ui-panel.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_HISTORY (g_paste_ui_history_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiHistory, ui_history, UI_HISTORY, GtkListBox)
20
21 void g_paste_ui_history_search (GPasteUiHistory *self,
22 const gchar *search);
23
24 gboolean g_paste_ui_history_select_first (GPasteUiHistory *self);
25
26 GtkWidget *g_paste_ui_history_new (GPasteClient *client,
27 GPasteSettings *settings,
28 GPasteUiPanel *panel,
29 GtkWindow *rootwin);
30
31 G_END_DECLS
32
33 #endif /*__G_PASTE_UI_HISTORY_H__*/
+0
-108
src/libgpaste/ui/gpaste-ui-item-action.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-item-action.h>
7
8 typedef struct
9 {
10 GPasteClient *client;
11
12 gchar *uuid;
13 } GPasteUiItemActionPrivate;
14
15 G_PASTE_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (UiItemAction, ui_item_action, GTK_TYPE_BUTTON)
16
17 /**
18 * g_paste_ui_item_action_set_uuid:
19 * @self: a #GPasteUiItemAction instance
20 * @uuid: the uuid of the corresponding item
21 *
22 * Track a new uuid
23 */
24 G_PASTE_VISIBLE void
25 g_paste_ui_item_action_set_uuid (GPasteUiItemAction *self,
26 const gchar *uuid)
27 {
28 g_return_if_fail (_G_PASTE_IS_UI_ITEM_ACTION (self));
29
30 GPasteUiItemActionPrivate *priv = g_paste_ui_item_action_get_instance_private (self);
31 g_autofree gchar *old_uuid = priv->uuid;
32
33 priv->uuid = g_strdup (uuid);
34 }
35
36 static gboolean
37 g_paste_ui_item_action_button_press_event (GtkWidget *widget,
38 GdkEventButton *event G_GNUC_UNUSED)
39 {
40 GPasteUiItemAction *self = G_PASTE_UI_ITEM_ACTION (widget);
41 const GPasteUiItemActionPrivate *priv = _g_paste_ui_item_action_get_instance_private (self);
42 GPasteUiItemActionClass *klass = G_PASTE_UI_ITEM_ACTION_GET_CLASS (self);
43
44 if (klass->activate)
45 klass->activate (self, priv->client, priv->uuid);
46
47 return TRUE;
48 }
49
50 static void
51 g_paste_ui_item_action_dispose (GObject *object)
52 {
53 GPasteUiItemActionPrivate *priv = g_paste_ui_item_action_get_instance_private (G_PASTE_UI_ITEM_ACTION (object));
54
55 g_clear_object (&priv->client);
56 g_clear_pointer (&priv->uuid, g_free);
57
58 G_OBJECT_CLASS (g_paste_ui_item_action_parent_class)->dispose (object);
59 }
60
61 static void
62 g_paste_ui_item_action_class_init (GPasteUiItemActionClass *klass)
63 {
64 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_item_action_dispose;
65 GTK_WIDGET_CLASS (klass)->button_press_event = g_paste_ui_item_action_button_press_event;
66 }
67
68 static void
69 g_paste_ui_item_action_init (GPasteUiItemAction *self G_GNUC_UNUSED)
70 {
71 }
72
73 /**
74 * g_paste_ui_item_action_new:
75 * @type: the type of the subclass to instantiate
76 * @client: a #GPasteClient
77 * @icon_name: the name of the icon to use
78 * @tooltip: the tooltip to display
79 *
80 * Create a new instance of #GPasteUiItemAction
81 *
82 * Returns: a newly allocated #GPasteUiItemAction
83 * free it with g_object_unref
84 */
85 G_PASTE_VISIBLE GtkWidget *
86 g_paste_ui_item_action_new (GType type,
87 GPasteClient *client,
88 const gchar *icon_name,
89 const gchar *tooltip)
90 {
91 g_return_val_if_fail (g_type_is_a (type, G_PASTE_TYPE_UI_ITEM_ACTION), NULL);
92 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
93
94 GtkWidget *self = gtk_widget_new (type, NULL);
95 GPasteUiItemActionPrivate *priv = g_paste_ui_item_action_get_instance_private (G_PASTE_UI_ITEM_ACTION (self));
96 GtkWidget *icon = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
97
98 priv->client = g_object_ref (client);
99
100 gtk_widget_set_tooltip_text (self, tooltip);
101 gtk_widget_set_margin_start (icon, 5);
102 gtk_widget_set_margin_end (icon, 5);
103
104 gtk_container_add (GTK_CONTAINER (self), icon);
105
106 return self;
107 }
+0
-42
src/libgpaste/ui/gpaste-ui-item-action.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_ITEM_ACTION_H__
11 #define __G_PASTE_UI_ITEM_ACTION_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_ITEM_ACTION (g_paste_ui_item_action_get_type ())
18
19 G_PASTE_DERIVABLE_TYPE (UiItemAction, ui_item_action, UI_ITEM_ACTION, GtkButton)
20
21 struct _GPasteUiItemActionClass
22 {
23 GtkButtonClass parent_class;
24
25 /*< pure virtual >*/
26 void (*activate) (GPasteUiItemAction *self,
27 GPasteClient *client,
28 const gchar *uuid);
29 };
30
31 void g_paste_ui_item_action_set_uuid (GPasteUiItemAction *self,
32 const gchar *uuid);
33
34 GtkWidget *g_paste_ui_item_action_new (GType type,
35 GPasteClient *client,
36 const gchar *icon_name,
37 const gchar *tooltip);
38
39 G_END_DECLS
40
41 #endif /*__G_PASTE_UI_ITEM_ACTION_H__*/
+0
-339
src/libgpaste/ui/gpaste-ui-item-skeleton.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-gsettings-keys.h>
7 #include <gpaste-ui-delete-item.h>
8 #include <gpaste-ui-edit-item.h>
9 #include <gpaste-ui-item-skeleton.h>
10 #include <gpaste-ui-upload-item.h>
11
12 #include "gpaste-gtk-compat.h"
13
14 enum
15 {
16 C_SIZE,
17
18 C_LAST_SIGNAL
19 };
20
21 typedef struct
22 {
23 GPasteSettings *settings;
24
25 GSList *actions;
26 GtkWidget *edit;
27 GtkWidget *upload;
28
29 GtkLabel *index_label;
30 GtkLabel *label;
31
32 gboolean editable;
33 gboolean uploadable;
34
35 guint64 c_signals[C_LAST_SIGNAL];
36 } GPasteUiItemSkeletonPrivate;
37
38 G_PASTE_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (UiItemSkeleton, ui_item_skeleton, GTK_TYPE_LIST_BOX_ROW)
39
40 static void
41 g_paste_ui_item_skeleton_set_text_size (GPasteSettings *settings,
42 const gchar *key G_GNUC_UNUSED,
43 gpointer user_data)
44 {
45 GPasteUiItemSkeletonPrivate *priv = user_data;
46 guint64 size = g_paste_settings_get_element_size (settings);
47
48 gtk_label_set_width_chars (priv->label, size);
49 gtk_label_set_max_width_chars (priv->label, size);
50 }
51
52 static void
53 action_set_activatable (gpointer data,
54 gpointer user_data)
55 {
56 GtkWidget *w = data;
57 gboolean *a = user_data;
58
59 gtk_widget_set_sensitive (w, *a);
60 }
61
62 /**
63 * g_paste_ui_item_skeleton_set_activatable:
64 * @self: the #GPasteUiItemSkeleton instance
65 * @activatable: whether the item should now be activatable or not
66 *
67 * Mark the item as being activatable or not
68 */
69 G_PASTE_VISIBLE void
70 g_paste_ui_item_skeleton_set_activatable (GPasteUiItemSkeleton *self,
71 gboolean activatable)
72 {
73 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
74
75 const GPasteUiItemSkeletonPrivate *priv = _g_paste_ui_item_skeleton_get_instance_private (self);
76
77 gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (self), activatable);
78 gtk_widget_set_sensitive (GTK_WIDGET (priv->label), activatable);
79
80 g_slist_foreach (priv->actions, action_set_activatable, &activatable);
81
82 if (priv->edit)
83 gtk_widget_set_sensitive (priv->edit, activatable && priv->editable);
84 if (priv->upload)
85 gtk_widget_set_sensitive (priv->upload, activatable && priv->uploadable);
86 }
87
88 /**
89 * g_paste_ui_item_skeleton_set_editable:
90 * @self: the #GPasteUiItemSkeleton instance
91 * @editable: whether the item should now be editable or not
92 *
93 * Mark the item as being editable or not
94 */
95 G_PASTE_VISIBLE void
96 g_paste_ui_item_skeleton_set_editable (GPasteUiItemSkeleton *self,
97 gboolean editable)
98 {
99 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
100
101 GPasteUiItemSkeletonPrivate *priv = g_paste_ui_item_skeleton_get_instance_private (self);
102
103 priv->editable = editable;
104
105 gtk_widget_set_sensitive (priv->edit, editable);
106 }
107
108 /**
109 * g_paste_ui_item_skeleton_set_uploadable:
110 * @self: the #GPasteUiItemSkeleton instance
111 * @uploadable: whether the item should now be uploadable or not
112 *
113 * Mark the item as being uploadable or not
114 */
115 G_PASTE_VISIBLE void
116 g_paste_ui_item_skeleton_set_uploadable (GPasteUiItemSkeleton *self,
117 gboolean uploadable)
118 {
119 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
120
121 GPasteUiItemSkeletonPrivate *priv = g_paste_ui_item_skeleton_get_instance_private (self);
122
123 priv->uploadable = uploadable;
124
125 gtk_widget_set_sensitive (priv->upload, uploadable);
126 }
127
128 /**
129 * g_paste_ui_item_skeleton_set_text:
130 * @self: the #GPasteUiItemSkeleton instance
131 * @text: the new text for the label
132 *
133 * Changes the displayed text
134 */
135 G_PASTE_VISIBLE void
136 g_paste_ui_item_skeleton_set_text (GPasteUiItemSkeleton *self,
137 const gchar *text)
138 {
139 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
140 g_return_if_fail (g_utf8_validate (text, -1, NULL));
141
142 const GPasteUiItemSkeletonPrivate *priv = _g_paste_ui_item_skeleton_get_instance_private (self);
143
144 gtk_label_set_text (priv->label, text);
145 }
146
147 /**
148 * g_paste_ui_item_skeleton_set_markup:
149 * @self: the #GPasteUiItemSkeleton instance
150 * @markup: the new markup for the label
151 *
152 * Changes the displayed markup
153 */
154 G_PASTE_VISIBLE void
155 g_paste_ui_item_skeleton_set_markup (GPasteUiItemSkeleton *self,
156 const gchar *markup)
157 {
158 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
159 g_return_if_fail (g_utf8_validate (markup, -1, NULL));
160
161 const GPasteUiItemSkeletonPrivate *priv = _g_paste_ui_item_skeleton_get_instance_private (self);
162
163 gtk_label_set_markup (priv->label, markup);
164 }
165
166 static void
167 action_set_uuid (gpointer data,
168 gpointer user_data)
169 {
170 GPasteUiItemAction *a = data;
171 const gchar *uuid = user_data;
172
173 g_paste_ui_item_action_set_uuid (a, uuid);
174 }
175
176 /**
177 * g_paste_ui_item_skeleton_set_index_and_uuid:
178 * @self: the #GPasteUiItemSkeleton instance
179 * @index: the index of the new item to display
180 * @uuid: the uuid of the new item to display
181 *
182 * Changes the displayed item
183 */
184 G_PASTE_VISIBLE void
185 g_paste_ui_item_skeleton_set_index_and_uuid (GPasteUiItemSkeleton *self,
186 guint64 index,
187 const gchar *uuid)
188 {
189 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
190
191 const GPasteUiItemSkeletonPrivate *priv = _g_paste_ui_item_skeleton_get_instance_private (self);
192
193 if (index == (guint64) -1 || index == (guint64) -2)
194 {
195 gtk_label_set_text (priv->index_label, "");
196 }
197 else
198 {
199 g_autofree gchar *_index = g_strdup_printf("%" G_GUINT64_FORMAT, index);
200
201 gtk_label_set_text (priv->index_label, _index);
202 }
203
204 g_slist_foreach (priv->actions, action_set_uuid, (gpointer) uuid);
205 }
206
207 /**
208 * g_paste_ui_item_skeleton_get_label:
209 * @self: the #GPasteUiItemSkeleton instance
210 *
211 * Get the inner label
212 *
213 * Returns: (transfer none): The inner #GtkLabel
214 */
215 G_PASTE_VISIBLE GtkLabel *
216 g_paste_ui_item_skeleton_get_label (GPasteUiItemSkeleton *self)
217 {
218 g_return_val_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self), NULL);
219
220 const GPasteUiItemSkeletonPrivate *priv = _g_paste_ui_item_skeleton_get_instance_private (self);
221
222 return priv->label;
223 }
224
225 static void
226 add_action (gpointer data,
227 gpointer user_data)
228 {
229 GtkWidget *w = data;
230 GtkBox *b =user_data;
231
232 gtk_widget_set_halign (w, TRUE);
233 gtk_box_pack_end (b, w);
234 }
235
236 static void
237 g_paste_ui_item_skeleton_dispose (GObject *object)
238 {
239 GPasteUiItemSkeletonPrivate *priv = g_paste_ui_item_skeleton_get_instance_private (G_PASTE_UI_ITEM_SKELETON (object));
240
241 if (priv->settings)
242 {
243 g_signal_handler_disconnect (priv->settings, priv->c_signals[C_SIZE]);
244 g_clear_object (&priv->settings);
245 }
246
247 G_OBJECT_CLASS (g_paste_ui_item_skeleton_parent_class)->dispose (object);
248 }
249
250 static void
251 g_paste_ui_item_skeleton_class_init (GPasteUiItemSkeletonClass *klass)
252 {
253 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_item_skeleton_dispose;
254 }
255
256 static void
257 g_paste_ui_item_skeleton_init (GPasteUiItemSkeleton *self)
258 {
259 GPasteUiItemSkeletonPrivate *priv = g_paste_ui_item_skeleton_get_instance_private (self);
260
261 GtkWidget *index_label = gtk_label_new ("");
262 GtkWidget *label = gtk_label_new ("");
263
264 priv->index_label = GTK_LABEL (index_label);
265 priv->label = GTK_LABEL (label);
266 priv->editable = TRUE;
267
268 gtk_widget_set_margin_start (index_label, 5);
269 gtk_widget_set_margin_end (index_label, 5);
270 gtk_widget_set_margin_top (index_label, 5);
271 gtk_widget_set_margin_bottom (index_label, 5);
272 gtk_widget_set_sensitive (index_label, FALSE);
273 gtk_label_set_xalign (priv->index_label, 1.0);
274 gtk_label_set_width_chars (priv->index_label, 3);
275 gtk_label_set_max_width_chars (priv->index_label, 3);
276 gtk_label_set_selectable (priv->index_label, FALSE);
277 gtk_label_set_ellipsize (priv->label, PANGO_ELLIPSIZE_END);
278 gtk_label_set_xalign (priv->label, 0.0);
279
280 GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
281 gtk_widget_set_margin_start (hbox, 5);
282 gtk_widget_set_margin_end (hbox, 5);
283 gtk_widget_set_halign (index_label, TRUE);
284 gtk_box_pack_start (GTK_BOX (hbox), index_label, FALSE, TRUE);
285 gtk_widget_set_hexpand (label, TRUE);
286 gtk_widget_set_halign (label, TRUE);
287 gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE);
288
289 gtk_container_add (GTK_CONTAINER (self), hbox);
290 }
291
292 /**
293 * g_paste_ui_item_skeleton_new:
294 * @type: the type of the subclass
295 * @client: a #GPasteClient instance
296 * @settings: a #GPasteSettings instance
297 * @rootwin: the root #GtkWindow
298 *
299 * Create a new instance of #GPasteUiItemSkeleton
300 *
301 * Returns: a newly allocated #GPasteUiItemSkeleton
302 * free it with g_object_unref
303 */
304 G_PASTE_VISIBLE GtkWidget *
305 g_paste_ui_item_skeleton_new (GType type,
306 GPasteClient *client,
307 GPasteSettings *settings,
308 GtkWindow *rootwin)
309 {
310 g_return_val_if_fail (g_type_is_a (type, G_PASTE_TYPE_UI_ITEM_SKELETON), NULL);
311 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
312 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
313 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
314
315 GtkWidget *self = gtk_widget_new (type, "selectable", FALSE, NULL);
316 GPasteUiItemSkeletonPrivate *priv = g_paste_ui_item_skeleton_get_instance_private (G_PASTE_UI_ITEM_SKELETON (self));
317 GtkWidget *edit = g_paste_ui_edit_item_new (client, rootwin);
318 GtkWidget *upload = g_paste_ui_upload_item_new (client);
319 GtkWidget *delete = g_paste_ui_delete_item_new (client);
320
321 priv->settings = g_object_ref (settings);
322 priv->edit = edit;
323 priv->upload = upload;
324
325 priv->actions = g_slist_prepend (priv->actions, edit);
326 priv->actions = g_slist_prepend (priv->actions, upload);
327 priv->actions = g_slist_prepend (priv->actions, delete);
328
329 g_slist_foreach (priv->actions, add_action, gtk_bin_get_child (GTK_BIN (self)));
330
331 priv->c_signals[C_SIZE] = g_signal_connect (settings,
332 "changed::" G_PASTE_ELEMENT_SIZE_SETTING,
333 G_CALLBACK (g_paste_ui_item_skeleton_set_text_size),
334 priv);
335 g_paste_ui_item_skeleton_set_text_size (settings, NULL, priv);
336
337 return self;
338 }
+0
-53
src/libgpaste/ui/gpaste-ui-item-skeleton.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_ITEM_SKELETON_H__
11 #define __G_PASTE_UI_ITEM_SKELETON_H__
12
13 #include <gpaste-client.h>
14 #include <gpaste-settings.h>
15
16 G_BEGIN_DECLS
17
18 #define G_PASTE_TYPE_UI_ITEM_SKELETON (g_paste_ui_item_skeleton_get_type ())
19
20 G_PASTE_DERIVABLE_TYPE (UiItemSkeleton, ui_item_skeleton, UI_ITEM_SKELETON, GtkListBoxRow)
21
22 struct _GPasteUiItemSkeletonClass
23 {
24 GtkListBoxRowClass parent_class;
25 };
26
27 void g_paste_ui_item_skeleton_set_activatable (GPasteUiItemSkeleton *self,
28 gboolean activatable);
29 void g_paste_ui_item_skeleton_set_editable (GPasteUiItemSkeleton *self,
30 gboolean editable);
31 void g_paste_ui_item_skeleton_set_uploadable (GPasteUiItemSkeleton *self,
32 gboolean uploadable);
33
34 void g_paste_ui_item_skeleton_set_text (GPasteUiItemSkeleton *self,
35 const gchar *text);
36 void g_paste_ui_item_skeleton_set_markup (GPasteUiItemSkeleton *self,
37 const gchar *markup);
38
39 void g_paste_ui_item_skeleton_set_index_and_uuid (GPasteUiItemSkeleton *self,
40 guint64 index,
41 const gchar *uuid);
42
43 GtkLabel *g_paste_ui_item_skeleton_get_label (GPasteUiItemSkeleton *self);
44
45 GtkWidget *g_paste_ui_item_skeleton_new (GType type,
46 GPasteClient *client,
47 GPasteSettings *settings,
48 GtkWindow *rootwin);
49
50 G_END_DECLS
51
52 #endif /*__G_PASTE_UI_ITEM_SKELETON_H__*/
+0
-275
src/libgpaste/ui/gpaste-ui-item.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-item.h>
7 #include <gpaste-util.h>
8
9 struct _GPasteUiItem
10 {
11 GPasteUiItemSkeleton parent_instance;
12 };
13
14 typedef struct
15 {
16 GPasteClient *client;
17 GPasteSettings *settings;
18
19 GtkWindow *rootwin;
20
21 guint64 index;
22 gboolean fake_index;
23 gchar *uuid;
24
25 guint64 size_id;
26 } GPasteUiItemPrivate;
27
28 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiItem, ui_item, G_PASTE_TYPE_UI_ITEM_SKELETON)
29
30 /**
31 * g_paste_ui_item_activate:
32 * @self: a #GPasteUiItem instance
33 *
34 * Activate/Select the item
35 *
36 * returns: whether there was anything to select or not
37 */
38 G_PASTE_VISIBLE gboolean
39 g_paste_ui_item_activate (GPasteUiItem *self)
40 {
41 g_return_val_if_fail (_G_PASTE_IS_UI_ITEM (self), FALSE);
42
43 const GPasteUiItemPrivate *priv = _g_paste_ui_item_get_instance_private (self);
44
45 if (!priv->uuid)
46 return FALSE;
47
48 g_paste_client_select (priv->client, priv->uuid, NULL, NULL);
49
50 if (g_paste_settings_get_close_on_select (priv->settings))
51 gtk_window_close (priv->rootwin); /* Exit the application */
52
53 return TRUE;
54 }
55
56 static void
57 g_paste_ui_item_on_kind_ready (GObject *source_object G_GNUC_UNUSED,
58 GAsyncResult *res,
59 gpointer user_data)
60 {
61 GPasteUiItem *self = user_data;
62 const GPasteUiItemPrivate *priv = _g_paste_ui_item_get_instance_private (self);
63 g_autoptr (GError) error = NULL;
64 GPasteItemKind kind = g_paste_client_get_element_kind_finish (priv->client, res, &error);
65
66 if (error)
67 return;
68
69 GPasteUiItemSkeleton *sk = G_PASTE_UI_ITEM_SKELETON (self);
70
71 g_paste_ui_item_skeleton_set_editable (sk, kind == G_PASTE_ITEM_KIND_TEXT);
72 g_paste_ui_item_skeleton_set_uploadable (sk, kind == G_PASTE_ITEM_KIND_TEXT);
73 }
74
75 static void
76 _g_paste_ui_item_ready (GPasteUiItem *self,
77 const gchar *txt)
78 {
79 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (self);
80 g_autofree gchar *oneline = g_paste_util_replace (txt, "\n", " ");
81
82 g_paste_client_get_element_kind (priv->client, priv->uuid, g_paste_ui_item_on_kind_ready, self);
83 g_paste_ui_item_skeleton_set_index_and_uuid (G_PASTE_UI_ITEM_SKELETON (self), priv->index, priv->uuid);
84
85 if (!priv->index)
86 {
87 g_autofree gchar *markup = g_markup_printf_escaped ("<b>%s</b>", oneline);
88 g_paste_ui_item_skeleton_set_markup (G_PASTE_UI_ITEM_SKELETON (self), markup);
89 }
90 else
91 {
92 g_paste_ui_item_skeleton_set_text (G_PASTE_UI_ITEM_SKELETON (self), oneline);
93 }
94 }
95
96 static void
97 g_paste_ui_item_on_text_ready (GObject *source_object G_GNUC_UNUSED,
98 GAsyncResult *res,
99 gpointer user_data)
100 {
101 GPasteUiItem *self = user_data;
102 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (self);
103 g_autoptr (GError) error = NULL;
104 g_autofree gchar *txt = g_paste_client_get_element_finish (priv->client, res, &error);
105
106 if (!txt || error)
107 return;
108
109 _g_paste_ui_item_ready (self, txt);
110 }
111
112 static void
113 g_paste_ui_item_on_item_ready (GObject *source_object G_GNUC_UNUSED,
114 GAsyncResult *res,
115 gpointer user_data)
116 {
117 GPasteUiItem *self = user_data;
118 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (self);
119 g_autoptr (GError) error = NULL;
120 g_autoptr (GPasteClientItem) txt = g_paste_client_get_element_at_index_finish (priv->client, res, &error);
121
122 if (!txt || error)
123 return;
124
125 g_autofree gchar *uuid = priv->uuid;
126 priv->uuid = g_strdup (g_paste_client_item_get_uuid (txt));
127
128 _g_paste_ui_item_ready (self, g_paste_client_item_get_value (txt));
129 }
130
131 static void
132 g_paste_ui_item_reset_text (GPasteUiItem *self)
133 {
134 g_return_if_fail (_G_PASTE_IS_UI_ITEM (self));
135
136 const GPasteUiItemPrivate *priv = _g_paste_ui_item_get_instance_private (self);
137
138 if (priv->fake_index)
139 g_paste_client_get_element (priv->client, priv->uuid, g_paste_ui_item_on_text_ready, self);
140 else
141 g_paste_client_get_element_at_index (priv->client, priv->index, g_paste_ui_item_on_item_ready, self);
142 }
143
144 /**
145 * g_paste_ui_item_refresh:
146 * @self: a #GPasteUiItem instance
147 *
148 * Refresh the item
149 */
150 G_PASTE_VISIBLE void
151 g_paste_ui_item_refresh (GPasteUiItem *self)
152 {
153 g_return_if_fail (_G_PASTE_IS_UI_ITEM (self));
154
155 g_paste_ui_item_reset_text (self);
156 }
157
158 static void
159 _g_paste_ui_item_set_index (GPasteUiItem *self,
160 guint64 index,
161 gboolean fake_index)
162 {
163 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (self);
164
165 priv->index = index;
166 priv->fake_index = fake_index;
167
168 if (index != (guint64) -1)
169 {
170 g_paste_ui_item_reset_text (self);
171 gtk_widget_show (GTK_WIDGET (self));
172 }
173 else if (priv->uuid)
174 {
175 gtk_widget_hide (GTK_WIDGET (self));
176 }
177 }
178
179 /**
180 * g_paste_ui_item_set_index:
181 * @self: a #GPasteUiItem instance
182 * @index: the index of the corresponding item
183 *
184 * Track a new index
185 */
186 G_PASTE_VISIBLE void
187 g_paste_ui_item_set_index (GPasteUiItem *self,
188 guint64 index)
189 {
190 g_return_if_fail (_G_PASTE_IS_UI_ITEM (self));
191
192 _g_paste_ui_item_set_index (self, index, FALSE);
193 }
194
195 /**
196 * g_paste_ui_item_set_uuid:
197 * @self: a #GPasteUiItem instance
198 * @uuid: the uuid of the corresponding item
199 *
200 * Track a new uuid
201 */
202 G_PASTE_VISIBLE void
203 g_paste_ui_item_set_uuid (GPasteUiItem *self,
204 const gchar *uuid)
205 {
206 g_return_if_fail (_G_PASTE_IS_UI_ITEM (self));
207
208 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (self);
209 g_autofree gchar *_uuid = priv->uuid;
210
211 priv->uuid = g_strdup (uuid);
212
213 _g_paste_ui_item_set_index (self, (guint64) -2, TRUE);
214 }
215
216 static void
217 g_paste_ui_item_dispose (GObject *object)
218 {
219 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (G_PASTE_UI_ITEM (object));
220
221 g_clear_object (&priv->client);
222 g_clear_object (&priv->settings);
223 g_clear_pointer (&priv->uuid, g_free);
224
225 G_OBJECT_CLASS (g_paste_ui_item_parent_class)->dispose (object);
226 }
227
228 static void
229 g_paste_ui_item_class_init (GPasteUiItemClass *klass)
230 {
231 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_item_dispose;
232 }
233
234 static void
235 g_paste_ui_item_init (GPasteUiItem *self)
236 {
237 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (G_PASTE_UI_ITEM (self));
238
239 priv->index = (guint64) -1;
240 }
241
242 /**
243 * g_paste_ui_item_new:
244 * @client: a #GPasteClient instance
245 * @settings: a #GPasteSettings instance
246 * @rootwin: the root #GtkWindow
247 * @index: the index of the corresponding item
248 *
249 * Create a new instance of #GPasteUiItem
250 *
251 * Returns: a newly allocated #GPasteUiItem
252 * free it with g_object_unref
253 */
254 G_PASTE_VISIBLE GtkWidget *
255 g_paste_ui_item_new (GPasteClient *client,
256 GPasteSettings *settings,
257 GtkWindow *rootwin,
258 guint64 index)
259 {
260 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
261 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
262 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
263
264 GtkWidget *self = g_paste_ui_item_skeleton_new (G_PASTE_TYPE_UI_ITEM, client, settings, rootwin);
265 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (G_PASTE_UI_ITEM (self));
266
267 priv->client = g_object_ref (client);
268 priv->settings = g_object_ref (settings);
269 priv->rootwin = rootwin;
270
271 g_paste_ui_item_set_index (G_PASTE_UI_ITEM (self), index);
272
273 return self;
274 }
+0
-38
src/libgpaste/ui/gpaste-ui-item.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_ITEM_H__
11 #define __G_PASTE_UI_ITEM_H__
12
13 #include <gpaste-ui-item-skeleton.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_ITEM (g_paste_ui_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiItem, ui_item, UI_ITEM, GPasteUiItemSkeleton)
20
21 gboolean g_paste_ui_item_activate (GPasteUiItem *self);
22 void g_paste_ui_item_refresh (GPasteUiItem *self);
23
24 void g_paste_ui_item_set_index (GPasteUiItem *self,
25 guint64 index);
26
27 void g_paste_ui_item_set_uuid (GPasteUiItem *self,
28 const gchar *uuid);
29
30 GtkWidget *g_paste_ui_item_new (GPasteClient *client,
31 GPasteSettings *settings,
32 GtkWindow *rootwin,
33 guint64 index);
34
35 G_END_DECLS
36
37 #endif /*__G_PASTE_UI_ITEM_H__*/
+0
-112
src/libgpaste/ui/gpaste-ui-new-item.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-new-item.h>
7
8 #include "gpaste-gtk-compat.h"
9
10 struct _GPasteUiNewItem
11 {
12 GtkButton parent_instance;
13 };
14
15 typedef struct
16 {
17 GPasteClient *client;
18
19 GtkWindow *rootwin;
20 } GPasteUiNewItemPrivate;
21
22 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiNewItem, ui_new_item, GTK_TYPE_BUTTON)
23
24 static void
25 g_paste_ui_new_item_clicked (GtkButton *self)
26 {
27 const GPasteUiNewItemPrivate *priv = _g_paste_ui_new_item_get_instance_private (G_PASTE_UI_NEW_ITEM (self));
28 GtkWidget *dialog = gtk_dialog_new_with_buttons (PACKAGE_STRING, priv->rootwin,
29 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_USE_HEADER_BAR,
30 _("New"), GTK_RESPONSE_OK,
31 _("Cancel"), GTK_RESPONSE_CANCEL,
32 NULL);
33 GtkDialog *d = GTK_DIALOG (dialog);
34 GtkWidget *text = gtk_text_view_new ();
35 GtkTextView *tv = GTK_TEXT_VIEW (text);
36 GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
37 GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW (scroll);
38
39 gtk_text_view_set_wrap_mode (tv, GTK_WRAP_WORD);
40 gtk_scrolled_window_set_min_content_height (sw, 300);
41 gtk_scrolled_window_set_min_content_width (sw, 600);
42 gtk_container_add (GTK_CONTAINER (sw), text);
43 gtk_widget_set_vexpand (scroll, TRUE);
44 gtk_widget_set_valign (scroll, TRUE);
45 gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (d)), scroll, TRUE, TRUE);
46 gtk_widget_show_all (scroll);
47
48 if (gtk_dialog_run (d) == GTK_RESPONSE_OK)
49 {
50 const gchar *txt;
51
52 g_object_get (G_OBJECT (gtk_text_view_get_buffer (tv)), "text", &txt, NULL);
53 if (txt && *txt)
54 g_paste_client_add (priv->client, txt, NULL, NULL);
55 }
56
57 gtk_widget_destroy (dialog);
58 }
59
60 static void
61 g_paste_ui_new_item_dispose (GObject *object)
62 {
63 GPasteUiNewItemPrivate *priv = g_paste_ui_new_item_get_instance_private (G_PASTE_UI_NEW_ITEM (object));
64
65 g_clear_object (&priv->client);
66
67 G_OBJECT_CLASS (g_paste_ui_new_item_parent_class)->dispose (object);
68 }
69
70 static void
71 g_paste_ui_new_item_class_init (GPasteUiNewItemClass *klass)
72 {
73 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_new_item_dispose;
74 GTK_BUTTON_CLASS (klass)->clicked = g_paste_ui_new_item_clicked;
75 }
76
77 static void
78 g_paste_ui_new_item_init (GPasteUiNewItem *self)
79 {
80 GtkWidget *widget = GTK_WIDGET (self);
81
82 gtk_widget_set_tooltip_text (widget, _("New"));
83 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
84 gtk_container_add (GTK_CONTAINER (self), gtk_image_new_from_icon_name ("document-new-symbolic", GTK_ICON_SIZE_BUTTON));
85 }
86
87 /**
88 * g_paste_ui_new_item_new:
89 * @rootwin: the root #GtkWindow
90 * @client: a #GPasteClient
91 *
92 * Create a new instance of #GPasteUiNewItem
93 *
94 * Returns: a newly allocated #GPasteUiNewItem
95 * free it with g_object_unref
96 */
97 G_PASTE_VISIBLE GtkWidget *
98 g_paste_ui_new_item_new (GtkWindow *rootwin,
99 GPasteClient *client)
100 {
101 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
102 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
103
104 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_NEW_ITEM, NULL);
105 GPasteUiNewItemPrivate *priv = g_paste_ui_new_item_get_instance_private (G_PASTE_UI_NEW_ITEM (self));
106
107 priv->client = g_object_ref (client);
108 priv->rootwin = rootwin;
109
110 return self;
111 }
+0
-27
src/libgpaste/ui/gpaste-ui-new-item.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_NEW_ITEM_H__
11 #define __G_PASTE_UI_NEW_ITEM_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_NEW_ITEM (g_paste_ui_new_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiNewItem, ui_new_item, UI_NEW_ITEM, GtkButton)
20
21 GtkWidget *g_paste_ui_new_item_new (GtkWindow *rootwin,
22 GPasteClient *client);
23
24 G_END_DECLS
25
26 #endif /*__G_PASTE_UI_NEW_ITEM_H__*/
+0
-165
src/libgpaste/ui/gpaste-ui-panel-history.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-panel-history.h>
7
8 #include "gpaste-gtk-compat.h"
9
10 struct _GPasteUiPanelHistory
11 {
12 GtkListBoxRow parent_instance;
13 };
14
15 typedef struct
16 {
17 GPasteClient *client;
18
19 GtkLabel *index_label;
20 GtkLabel *label;
21
22 gchar *history;
23 } GPasteUiPanelHistoryPrivate;
24
25 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiPanelHistory, ui_panel_history, GTK_TYPE_LIST_BOX_ROW)
26
27 /**
28 * g_paste_ui_panel_history_activate:
29 * @self: a #GPasteUiPanelHistory instance
30 *
31 * Switch to this history
32 */
33 G_PASTE_VISIBLE void
34 g_paste_ui_panel_history_activate (GPasteUiPanelHistory *self)
35 {
36 g_return_if_fail (_G_PASTE_IS_UI_PANEL_HISTORY (self));
37
38 const GPasteUiPanelHistoryPrivate *priv = _g_paste_ui_panel_history_get_instance_private (self);
39
40 g_paste_client_switch_history (priv->client, priv->history, NULL, NULL);
41 }
42
43 /**
44 * g_paste_ui_panel_history_set_length:
45 * @self: a #GPasteUiPanelHistory instance
46 * @length: the length of the #GPasteHistory
47 *
48 * Update the index label of this history
49 */
50 G_PASTE_VISIBLE void
51 g_paste_ui_panel_history_set_length (GPasteUiPanelHistory *self,
52 guint64 length)
53 {
54 g_return_if_fail (_G_PASTE_IS_UI_PANEL_HISTORY (self));
55
56 const GPasteUiPanelHistoryPrivate *priv = _g_paste_ui_panel_history_get_instance_private (self);
57 g_autofree gchar *_length = g_strdup_printf("%" G_GUINT64_FORMAT, length);
58
59 gtk_label_set_text (priv->index_label, _length);
60 }
61
62 /**
63 * g_paste_ui_panel_history_get_history:
64 * @self: a #GPasteUiPanelHistory instance
65 *
66 * Get the underlying history name
67 *
68 * Returns: the name of the history
69 */
70 G_PASTE_VISIBLE const gchar *
71 g_paste_ui_panel_history_get_history (const GPasteUiPanelHistory *self)
72 {
73 g_return_val_if_fail (_G_PASTE_IS_UI_PANEL_HISTORY (self), NULL);
74
75 const GPasteUiPanelHistoryPrivate *priv = _g_paste_ui_panel_history_get_instance_private ((GPasteUiPanelHistory *) self);
76
77 return priv->history;
78 }
79
80 static void
81 on_size_ready (GObject *source_object,
82 GAsyncResult *res,
83 gpointer user_data)
84 {
85 GPasteUiPanelHistory *self = user_data;
86
87 g_paste_ui_panel_history_set_length (self, g_paste_client_get_history_size_finish (G_PASTE_CLIENT (source_object), res, NULL));
88 }
89
90 static void
91 g_paste_ui_panel_history_dispose (GObject *object)
92 {
93 GPasteUiPanelHistoryPrivate *priv = g_paste_ui_panel_history_get_instance_private (G_PASTE_UI_PANEL_HISTORY (object));
94
95 g_clear_object (&priv->client);
96
97 G_OBJECT_CLASS (g_paste_ui_panel_history_parent_class)->dispose (object);
98 }
99
100 static void
101 g_paste_ui_panel_history_class_init (GPasteUiPanelHistoryClass *klass)
102 {
103 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_panel_history_dispose;
104 }
105
106 static void
107 g_paste_ui_panel_history_init (GPasteUiPanelHistory *self)
108 {
109 GPasteUiPanelHistoryPrivate *priv = g_paste_ui_panel_history_get_instance_private (self);
110 GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
111 GtkBox *box = GTK_BOX (hbox);
112 GtkWidget *l = gtk_label_new ("");
113 GtkLabel *label = priv->label = GTK_LABEL (l);
114 GtkWidget *il = gtk_label_new ("");
115 GtkLabel *index_label = priv->index_label = GTK_LABEL (il);
116
117 gtk_widget_set_sensitive (il, FALSE);
118 gtk_label_set_xalign (index_label, 1.0);
119 gtk_label_set_width_chars (index_label, 3);
120 gtk_label_set_selectable (index_label, FALSE);
121
122 gtk_widget_set_margin_start (hbox, 5);
123 gtk_widget_set_margin_end (hbox, 5);
124
125 gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END);
126 gtk_box_pack_start (box, il, FALSE, FALSE);
127 gtk_widget_set_hexpand (l, TRUE);
128 gtk_widget_set_halign (l, TRUE);
129 gtk_box_pack_start (box, l, TRUE, TRUE);
130 gtk_container_add (GTK_CONTAINER (self), hbox);
131 }
132
133 /**
134 * g_paste_ui_panel_history_new:
135 * @client: a #GPasteClient instance
136 * @history: the history we represent
137 *
138 * Create a new instance of #GPasteUiPanelHistory
139 *
140 * Returns: a newly allocated #GPasteUiPanelHistory
141 * free it with g_object_unref
142 */
143 G_PASTE_VISIBLE GtkWidget *
144 g_paste_ui_panel_history_new (GPasteClient *client,
145 const gchar *history)
146 {
147 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
148 g_return_val_if_fail (g_utf8_validate (history, -1, NULL), NULL);
149
150 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_PANEL_HISTORY,
151 "width-request", 100,
152 "height-request", 50,
153 NULL);
154 GPasteUiPanelHistoryPrivate *priv = g_paste_ui_panel_history_get_instance_private (G_PASTE_UI_PANEL_HISTORY (self));
155
156 priv->client = g_object_ref (client);
157 priv->history = g_strdup (history);
158
159 gtk_label_set_text (priv->label, history);
160
161 g_paste_client_get_history_size (client, history, on_size_ready, self);
162
163 return self;
164 }
+0
-33
src/libgpaste/ui/gpaste-ui-panel-history.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_PANEL_HISTORY_H__
11 #define __G_PASTE_UI_PANEL_HISTORY_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_PANEL_HISTORY (g_paste_ui_panel_history_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiPanelHistory, ui_panel_history, UI_PANEL_HISTORY, GtkListBoxRow)
20
21 void g_paste_ui_panel_history_activate (GPasteUiPanelHistory *self);
22 void g_paste_ui_panel_history_set_length (GPasteUiPanelHistory *self,
23 guint64 length);
24
25 const gchar *g_paste_ui_panel_history_get_history (const GPasteUiPanelHistory *self);
26
27 GtkWidget *g_paste_ui_panel_history_new (GPasteClient *client,
28 const gchar *history);
29
30 G_END_DECLS
31
32 #endif /*__G_PASTE_UI_PANEL_HISTORY_H__*/
+0
-373
src/libgpaste/ui/gpaste-ui-panel.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-history-actions.h>
7 #include <gpaste-ui-panel.h>
8
9 #include "gpaste-gtk-compat.h"
10
11 struct _GPasteUiPanel
12 {
13 GtkBox parent_instance;
14 };
15
16 enum
17 {
18 C_ACTIVATED,
19 C_BUTTON_PRESSED,
20 C_DELETE_HISTORY,
21 C_EMPTY_HISTORY,
22 C_SWITCH_ACTIVATED,
23 C_SWITCH_CLICKED,
24 C_SWITCH_HISTORY,
25
26 C_LAST_SIGNAL
27 };
28
29 typedef struct
30 {
31 GPasteClient *client;
32 GPasteSettings *settings;
33 GPasteUiHistoryActions *actions;
34
35 GtkListBox *list_box;
36 GtkEntry *switch_entry;
37 GList *histories;
38
39 GtkWidget *search_entry;
40
41 guint64 c_signals[C_LAST_SIGNAL];
42 } GPasteUiPanelPrivate;
43
44 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiPanel, ui_panel, GTK_TYPE_BOX)
45
46 static gint32
47 history_equals (gconstpointer a,
48 gconstpointer b)
49 {
50 return !g_paste_str_equal (b, g_paste_ui_panel_history_get_history (a));
51 }
52
53 static GList *
54 history_find (GList *histories,
55 const gchar *history)
56 {
57 return g_list_find_custom (histories, history, history_equals);
58 }
59
60 /**
61 * g_paste_ui_panel_update_history_length:
62 * @self: a #GPasteUiPanel instance
63 * @history: the history to update
64 * @length: the new length
65 *
66 * Update the displayed length of the specified history
67 */
68 G_PASTE_VISIBLE void
69 g_paste_ui_panel_update_history_length (GPasteUiPanel *self,
70 const gchar *history,
71 guint64 length)
72 {
73 g_return_if_fail (_G_PASTE_IS_UI_PANEL (self));
74
75 const GPasteUiPanelPrivate *priv = _g_paste_ui_panel_get_instance_private (self);
76 GList *h = history_find (priv->histories, history);
77
78 if (h)
79 {
80 GPasteUiPanelHistory *hh = h->data;
81
82 g_paste_ui_panel_history_set_length (hh, length);
83 }
84 }
85
86 static void
87 on_history_deleted (GPasteClient *client G_GNUC_UNUSED,
88 const gchar *history,
89 gpointer user_data)
90 {
91 GPasteUiPanelPrivate *priv = user_data;
92
93 if (g_paste_str_equal (history, G_PASTE_DEFAULT_HISTORY))
94 return;
95
96 GList *h = history_find (priv->histories, history);
97
98 if (!h)
99 return;
100
101 priv->histories = g_list_remove_link (priv->histories, h);
102 gtk_container_remove (GTK_CONTAINER (priv->list_box), h->data);
103 }
104
105 static void
106 on_history_emptied (GPasteClient *client G_GNUC_UNUSED,
107 const gchar *history,
108 gpointer user_data)
109 {
110 GPasteUiPanel *self = user_data;
111
112 g_paste_ui_panel_update_history_length (self, history, 0);
113 }
114
115 static void
116 g_paste_ui_panel_add_history (GPasteUiPanelPrivate *priv,
117 const gchar *history,
118 gboolean select);
119
120 static void
121 on_history_switched (GPasteClient *client G_GNUC_UNUSED,
122 const gchar *history,
123 gpointer user_data)
124 {
125 GPasteUiPanelPrivate *priv = user_data;
126
127 g_paste_ui_panel_add_history (priv, history, TRUE);
128 }
129
130 static void
131 on_row_activated (GtkListBox *panel G_GNUC_UNUSED,
132 GtkListBoxRow *row,
133 gpointer user_data G_GNUC_UNUSED)
134 {
135 g_paste_ui_panel_history_activate (G_PASTE_UI_PANEL_HISTORY (row));
136 }
137
138 static void
139 g_paste_ui_panel_add_history (GPasteUiPanelPrivate *priv,
140 const gchar *history,
141 gboolean select)
142 {
143 GtkContainer *c = GTK_CONTAINER (priv->list_box);
144
145 GList *concurrent = history_find (priv->histories, history);
146 GtkListBoxRow *row;
147
148 if (concurrent)
149 {
150 row = concurrent->data;
151 }
152 else
153 {
154 GtkWidget *h = g_paste_ui_panel_history_new (priv->client, history);
155
156 g_object_ref (h);
157 gtk_container_add (c, h);
158 gtk_widget_show_all (h);
159
160 priv->histories = g_list_prepend (priv->histories, h);
161
162 row = GTK_LIST_BOX_ROW (h);
163 }
164
165 if (select)
166 gtk_list_box_select_row (priv->list_box, row);
167 }
168
169 typedef struct
170 {
171 GPasteUiPanelPrivate *priv;
172 gchar *name;
173 } HistoriesData;
174
175 static void
176 on_histories_ready (GObject *source_object G_GNUC_UNUSED,
177 GAsyncResult *res,
178 gpointer user_data)
179 {
180 g_autofree HistoriesData *data = user_data;
181 GPasteUiPanelPrivate *priv = data->priv;
182 g_auto (GStrv) histories = g_paste_client_list_histories_finish (priv->client, res, NULL);
183 g_autofree gchar *current = data->name;
184
185 g_paste_ui_panel_add_history (priv, G_PASTE_DEFAULT_HISTORY, g_paste_str_equal (G_PASTE_DEFAULT_HISTORY, current));
186 for (GStrv h = histories; *h; ++h)
187 g_paste_ui_panel_add_history (priv, *h, g_paste_str_equal (*h, current));
188 }
189
190 static void
191 on_name_ready (GObject *source_object G_GNUC_UNUSED,
192 GAsyncResult *res,
193 gpointer user_data)
194 {
195 GPasteUiPanelPrivate *priv = user_data;
196 gchar *name = g_paste_client_get_history_name_finish (priv->client, res, NULL);
197 HistoriesData *data = g_malloc (sizeof (HistoriesData));
198
199 data->priv = priv;
200 data->name = name;
201
202 g_paste_client_list_histories (priv->client, on_histories_ready, data);
203 }
204
205 static gboolean
206 g_paste_ui_panel_button_press_event (GtkWidget *widget G_GNUC_UNUSED,
207 GdkEventButton *event,
208 gpointer user_data)
209 {
210 GPasteUiPanelPrivate *priv = user_data;
211 GdkEvent *_event = (GdkEvent *) event;
212
213 if (gdk_event_triggers_context_menu (_event))
214 {
215 gdouble y;
216
217 if (!gdk_event_get_axis (_event, GDK_AXIS_Y, &y))
218 return FALSE;
219
220 g_paste_ui_history_actions_set_relative_to (priv->actions,
221 G_PASTE_UI_PANEL_HISTORY (gtk_list_box_get_row_at_y (priv->list_box, y)));
222 gtk_widget_show_all (GTK_WIDGET (priv->actions));
223 }
224
225 return FALSE;
226 }
227
228 static void
229 g_paste_ui_panel_switch_activated (GtkEntry *entry,
230 gpointer user_data)
231 {
232 GPasteUiPanelPrivate *priv = user_data;
233 const gchar *text = gtk_entry_get_text (entry);
234
235 g_paste_client_switch_history (priv->client, (text && *text) ? text : G_PASTE_DEFAULT_HISTORY, NULL, NULL);
236 gtk_entry_set_text (entry, "");
237
238 gtk_widget_grab_focus (priv->search_entry);
239 }
240
241 static void
242 g_paste_ui_panel_switch_clicked (GtkEntry *entry,
243 GtkEntryIconPosition icon_pos G_GNUC_UNUSED,
244 GdkEvent *event G_GNUC_UNUSED,
245 gpointer user_data)
246 {
247 g_paste_ui_panel_switch_activated (entry, user_data);
248 }
249
250 static void
251 g_paste_ui_panel_dispose (GObject *object)
252 {
253 GPasteUiPanelPrivate *priv = g_paste_ui_panel_get_instance_private (G_PASTE_UI_PANEL (object));
254
255 if (priv->c_signals[C_ACTIVATED])
256 {
257 g_signal_handler_disconnect (priv->list_box, priv->c_signals[C_ACTIVATED]);
258 g_signal_handler_disconnect (priv->list_box, priv->c_signals[C_BUTTON_PRESSED]);
259 g_signal_handler_disconnect (priv->switch_entry, priv->c_signals[C_SWITCH_ACTIVATED]);
260 g_signal_handler_disconnect (priv->switch_entry, priv->c_signals[C_SWITCH_CLICKED]);
261 priv->c_signals[C_ACTIVATED] = 0;
262 }
263
264 if (priv->client)
265 {
266 g_signal_handler_disconnect (priv->client, priv->c_signals[C_DELETE_HISTORY]);
267 g_signal_handler_disconnect (priv->client, priv->c_signals[C_EMPTY_HISTORY]);
268 g_signal_handler_disconnect (priv->client, priv->c_signals[C_SWITCH_HISTORY]);
269 g_clear_object (&priv->client);
270 }
271
272 g_clear_object (&priv->settings);
273
274 G_OBJECT_CLASS (g_paste_ui_panel_parent_class)->dispose (object);
275 }
276
277 static void
278 g_paste_ui_panel_class_init (GPasteUiPanelClass *klass)
279 {
280 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_panel_dispose;
281 }
282
283 static void
284 g_paste_ui_panel_init (GPasteUiPanel *self)
285 {
286 GPasteUiPanelPrivate *priv = g_paste_ui_panel_get_instance_private (self);
287 GtkWidget *list_box = gtk_list_box_new ();
288 GtkWidget *switch_entry = gtk_entry_new ();
289 GtkBox *box = GTK_BOX (self);
290
291 priv->list_box = GTK_LIST_BOX (list_box);
292 priv->switch_entry = GTK_ENTRY (switch_entry);
293
294 gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self)), GTK_STYLE_CLASS_SIDEBAR);
295 gtk_entry_set_icon_from_icon_name (priv->switch_entry, GTK_ENTRY_ICON_SECONDARY, "go-jump-symbolic");
296 gtk_widget_set_tooltip_text (switch_entry, _("Switch to"));
297 gtk_widget_set_margin_top (switch_entry, 5);
298 gtk_widget_set_margin_bottom (switch_entry, 5);
299 gtk_entry_set_placeholder_text (priv->switch_entry, G_PASTE_DEFAULT_HISTORY);
300
301 priv->c_signals[C_ACTIVATED] = g_signal_connect (G_OBJECT (priv->list_box),
302 "row-activated",
303 G_CALLBACK (on_row_activated),
304 NULL);
305 priv->c_signals[C_BUTTON_PRESSED] = g_signal_connect (G_OBJECT (list_box),
306 "button-press-event",
307 G_CALLBACK (g_paste_ui_panel_button_press_event),
308 priv);
309 priv->c_signals[C_SWITCH_ACTIVATED] = g_signal_connect (G_OBJECT (switch_entry),
310 "activate",
311 G_CALLBACK (g_paste_ui_panel_switch_activated),
312 priv);
313 priv->c_signals[C_SWITCH_CLICKED] = g_signal_connect (G_OBJECT (switch_entry),
314 "icon-press",
315 G_CALLBACK (g_paste_ui_panel_switch_clicked),
316 priv);
317
318 gtk_widget_set_valign (list_box, TRUE);
319 gtk_box_pack_start (box, list_box, FALSE, TRUE);
320 gtk_box_pack_start (box, switch_entry, FALSE, FALSE);
321 }
322
323 /**
324 * g_paste_ui_panel_new:
325 * @client: a #GPasteClient instance
326 * @settings: a #GPasteSettings instance
327 * @rootwin: the root #GtkWindow
328 * @search_entry: the #GtkSearchEntry
329 *
330 * Create a new instance of #GPasteUiPanel
331 *
332 * Returns: a newly allocated #GPasteUiPanel
333 * free it with g_object_unref
334 */
335 G_PASTE_VISIBLE GtkWidget *
336 g_paste_ui_panel_new (GPasteClient *client,
337 GPasteSettings *settings,
338 GtkWindow *rootwin,
339 GtkSearchEntry *search_entry)
340 {
341 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
342 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
343 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
344 g_return_val_if_fail (GTK_IS_SEARCH_ENTRY (search_entry), NULL);
345
346 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_PANEL,
347 "orientation", GTK_ORIENTATION_VERTICAL,
348 NULL);
349 GPasteUiPanelPrivate *priv = g_paste_ui_panel_get_instance_private (G_PASTE_UI_PANEL (self));
350
351 priv->client = g_object_ref (client);
352 priv->settings = g_object_ref (settings);
353 priv->actions = G_PASTE_UI_HISTORY_ACTIONS (g_paste_ui_history_actions_new (client, settings, rootwin));
354 priv->search_entry = GTK_WIDGET (search_entry);
355
356 priv->c_signals[C_DELETE_HISTORY] = g_signal_connect (priv->client,
357 "delete-history",
358 G_CALLBACK (on_history_deleted),
359 priv);
360 priv->c_signals[C_EMPTY_HISTORY] = g_signal_connect (priv->client,
361 "empty-history",
362 G_CALLBACK (on_history_emptied),
363 self);
364 priv->c_signals[C_SWITCH_HISTORY] = g_signal_connect (priv->client,
365 "switch-history",
366 G_CALLBACK (on_history_switched),
367 priv);
368
369 g_paste_client_get_history_name (client, on_name_ready, priv);
370
371 return self;
372 }
+0
-34
src/libgpaste/ui/gpaste-ui-panel.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_PANEL_H__
11 #define __G_PASTE_UI_PANEL_H__
12
13 #include <gpaste-client.h>
14 #include <gpaste-settings.h>
15
16 G_BEGIN_DECLS
17
18 #define G_PASTE_TYPE_UI_PANEL (g_paste_ui_panel_get_type ())
19
20 G_PASTE_FINAL_TYPE (UiPanel, ui_panel, UI_PANEL, GtkBox)
21
22 void g_paste_ui_panel_update_history_length (GPasteUiPanel *self,
23 const gchar *history,
24 guint64 length);
25
26 GtkWidget *g_paste_ui_panel_new (GPasteClient *client,
27 GPasteSettings *settings,
28 GtkWindow *rootwin,
29 GtkSearchEntry *search_entry);
30
31 G_END_DECLS
32
33 #endif /*__G_PASTE_UI_PANEL_H__*/
+0
-84
src/libgpaste/ui/gpaste-ui-reexec.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-reexec.h>
7 #include <gpaste-util.h>
8
9 struct _GPasteUiReexec
10 {
11 GtkButton parent_instance;
12 };
13
14 typedef struct
15 {
16 GPasteClient *client;
17
18 GtkWindow *topwin;
19 } GPasteUiReexecPrivate;
20
21 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiReexec, ui_reexec, GTK_TYPE_BUTTON)
22
23 static void
24 g_paste_ui_reexec_clicked (GtkButton *button)
25 {
26 const GPasteUiReexecPrivate *priv = _g_paste_ui_reexec_get_instance_private (G_PASTE_UI_REEXEC (button));
27
28 if (g_paste_util_confirm_dialog (priv->topwin, _("Restart"), _("Do you really want to restart the daemon?")))
29 g_paste_client_reexecute (priv->client, NULL, NULL);
30 }
31
32 static void
33 g_paste_ui_reexec_dispose (GObject *object)
34 {
35 GPasteUiReexecPrivate *priv = g_paste_ui_reexec_get_instance_private (G_PASTE_UI_REEXEC (object));
36
37 g_clear_object (&priv->client);
38
39 G_OBJECT_CLASS (g_paste_ui_reexec_parent_class)->dispose (object);
40 }
41
42 static void
43 g_paste_ui_reexec_class_init (GPasteUiReexecClass *klass)
44 {
45 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_reexec_dispose;
46 GTK_BUTTON_CLASS (klass)->clicked = g_paste_ui_reexec_clicked;
47 }
48
49 static void
50 g_paste_ui_reexec_init (GPasteUiReexec *self)
51 {
52 GtkWidget *widget = GTK_WIDGET (self);
53
54 gtk_widget_set_tooltip_text (widget, _("Restart the daemon"));
55 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
56 gtk_container_add (GTK_CONTAINER (self), gtk_image_new_from_icon_name ("view-refresh-symbolic", GTK_ICON_SIZE_BUTTON));
57 }
58
59 /**
60 * g_paste_ui_reexec_new:
61 * @topwin: the main #GtkWindow
62 * @client: a #GPasteClient instance
63 *
64 * Create a new instance of #GPasteUiReexec
65 *
66 * Returns: a newly allocated #GPasteUiReexec
67 * free it with g_object_unref
68 */
69 G_PASTE_VISIBLE GtkWidget *
70 g_paste_ui_reexec_new (GtkWindow *topwin,
71 GPasteClient *client)
72 {
73 g_return_val_if_fail (GTK_IS_WINDOW (topwin), NULL);
74 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
75
76 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_REEXEC,NULL);
77 GPasteUiReexecPrivate *priv = g_paste_ui_reexec_get_instance_private (G_PASTE_UI_REEXEC (self));
78
79 priv->topwin = topwin;
80 priv->client = g_object_ref (client);
81
82 return self;
83 }
+0
-27
src/libgpaste/ui/gpaste-ui-reexec.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_REEXEC_H__
11 #define __G_PASTE_UI_REEXEC_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_REEXEC (g_paste_ui_reexec_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiReexec, ui_reexec, UI_REEXEC, GtkButton)
20
21 GtkWidget *g_paste_ui_reexec_new (GtkWindow *topwin,
22 GPasteClient *client);
23
24 G_END_DECLS
25
26 #endif /*__G_PASTE_UI_REEXEC_H__*/
+0
-66
src/libgpaste/ui/gpaste-ui-search-bar.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-search-bar.h>
7
8 struct _GPasteUiSearchBar
9 {
10 GtkSearchBar parent_instance;
11 };
12
13 typedef struct
14 {
15 GtkSearchEntry *entry;
16 } GPasteUiSearchBarPrivate;
17
18 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiSearchBar, ui_search_bar, GTK_TYPE_SEARCH_BAR)
19
20 /**
21 * g_paste_ui_search_bar_get_entry:
22 *
23 * Get the #GtkSearchEntry
24 *
25 * Returns: (transfer none): the #GtkSearchEntry
26 */
27 G_PASTE_VISIBLE GtkSearchEntry *
28 g_paste_ui_search_bar_get_entry (const GPasteUiSearchBar *self)
29 {
30 g_return_val_if_fail (_G_PASTE_IS_UI_SEARCH_BAR (self), NULL);
31 const GPasteUiSearchBarPrivate *priv = _g_paste_ui_search_bar_get_instance_private (self);
32
33 return priv->entry;
34 }
35
36 static void
37 g_paste_ui_search_bar_class_init (GPasteUiSearchBarClass *klass G_GNUC_UNUSED)
38 {
39 }
40
41 static void
42 g_paste_ui_search_bar_init (GPasteUiSearchBar *self)
43 {
44 GPasteUiSearchBarPrivate *priv = g_paste_ui_search_bar_get_instance_private (self);
45 GtkWidget *entry = gtk_search_entry_new ();
46
47 priv->entry = GTK_SEARCH_ENTRY (entry);
48
49 gtk_container_add (GTK_CONTAINER (self), entry);
50 }
51
52 /**
53 * g_paste_ui_search_bar_new:
54 *
55 * Create a new instance of #GPasteUiSearchBar
56 *
57 * Returns: a newly allocated #GPasteUiSearchBar
58 * free it with g_object_unref
59 */
60 G_PASTE_VISIBLE GtkWidget *
61 g_paste_ui_search_bar_new (void)
62 {
63 return gtk_widget_new (G_PASTE_TYPE_UI_SEARCH_BAR,
64 NULL);
65 }
+0
-28
src/libgpaste/ui/gpaste-ui-search-bar.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_SEARCH_BAR_H__
11 #define __G_PASTE_UI_SEARCH_BAR_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_SEARCH_BAR (g_paste_ui_search_bar_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiSearchBar, ui_search_bar, UI_SEARCH_BAR, GtkSearchBar)
20
21 GtkSearchEntry *g_paste_ui_search_bar_get_entry (const GPasteUiSearchBar *self);
22
23 GtkWidget *g_paste_ui_search_bar_new (void);
24
25 G_END_DECLS
26
27 #endif /*__G_PASTE_UI_SEARCH_H__*/
+0
-43
src/libgpaste/ui/gpaste-ui-search.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-search.h>
7
8 struct _GPasteUiSearch
9 {
10 GtkToggleButton parent_instance;
11 };
12
13 G_PASTE_DEFINE_TYPE (UiSearch, ui_search, GTK_TYPE_TOGGLE_BUTTON)
14
15 static void
16 g_paste_ui_search_class_init (GPasteUiSearchClass *klass G_GNUC_UNUSED)
17 {
18 }
19
20 static void
21 g_paste_ui_search_init (GPasteUiSearch *self)
22 {
23 GtkWidget *widget = GTK_WIDGET (self);
24
25 gtk_widget_set_tooltip_text (widget, _("Search"));
26 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
27 gtk_container_add (GTK_CONTAINER (self), gtk_image_new_from_icon_name ("edit-find-symbolic", GTK_ICON_SIZE_BUTTON));
28 }
29
30 /**
31 * g_paste_ui_search_new:
32 *
33 * Create a new instance of #GPasteUiSearch
34 *
35 * Returns: a newly allocated #GPasteUiSearch
36 * free it with g_object_unref
37 */
38 G_PASTE_VISIBLE GtkWidget *
39 g_paste_ui_search_new (void)
40 {
41 return gtk_widget_new (G_PASTE_TYPE_UI_SEARCH, NULL);
42 }
+0
-26
src/libgpaste/ui/gpaste-ui-search.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_SEARCH_H__
11 #define __G_PASTE_UI_SEARCH_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_SEARCH (g_paste_ui_search_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiSearch, ui_search, UI_SEARCH, GtkToggleButton)
20
21 GtkWidget *g_paste_ui_search_new (void);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_SEARCH_H__*/
+0
-57
src/libgpaste/ui/gpaste-ui-settings.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-settings-ui-widget.h>
7 #include <gpaste-ui-settings.h>
8
9 #include "gpaste-gtk-compat.h"
10
11 struct _GPasteUiSettings
12 {
13 GtkMenuButton parent_instance;
14 };
15
16 G_PASTE_DEFINE_TYPE (UiSettings, ui_settings, GTK_TYPE_MENU_BUTTON)
17
18 static void
19 g_paste_ui_settings_class_init (GPasteUiSettingsClass *klass G_GNUC_UNUSED)
20 {
21 }
22
23 static void
24 g_paste_ui_settings_init (GPasteUiSettings *self)
25 {
26 GtkWidget *widget = GTK_WIDGET (self);
27 GtkMenuButton *menu = GTK_MENU_BUTTON (self);
28 GtkWidget *popover = gtk_popover_new (GTK_WIDGET (self));
29 GtkWidget *settings_widget = g_paste_settings_ui_widget_new ();
30
31 gtk_widget_set_tooltip_text (widget, _("GPaste Settings"));
32 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
33
34 gtk_widget_set_margin_top (settings_widget, 10);
35
36 gtk_menu_button_set_direction (menu, GTK_ARROW_NONE);
37 gtk_menu_button_set_use_popover (menu, TRUE);
38 gtk_menu_button_set_popover (menu, popover);
39
40 gtk_container_add (GTK_CONTAINER (popover), settings_widget);
41 gtk_widget_show_all (settings_widget);
42 }
43
44 /**
45 * g_paste_ui_settings_new:
46 *
47 * Create a new instance of #GPasteUiSettings
48 *
49 * Returns: a newly allocated #GPasteUiSettings
50 * free it with g_object_unref
51 */
52 G_PASTE_VISIBLE GtkWidget *
53 g_paste_ui_settings_new (void)
54 {
55 return gtk_widget_new (G_PASTE_TYPE_UI_SETTINGS, NULL);
56 }
+0
-26
src/libgpaste/ui/gpaste-ui-settings.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_SETTINGS_H__
11 #define __G_PASTE_UI_SETTINGS_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_SETTINGS (g_paste_ui_settings_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiSettings, ui_settings, UI_SETTINGS, GtkMenuButton)
20
21 GtkWidget *g_paste_ui_settings_new (void);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_SETTINGS_H__*/
+0
-81
src/libgpaste/ui/gpaste-ui-shortcuts-window.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-shortcuts-window.h>
7
8 struct _GPasteUiShortcutsWindow
9 {
10 GtkShortcutsWindow parent_instance;
11 };
12
13 G_PASTE_DEFINE_TYPE (UiShortcutsWindow, ui_shortcuts_window, GTK_TYPE_SHORTCUTS_WINDOW)
14
15 static void
16 g_paste_ui_shortcuts_window_class_init (GPasteUiShortcutsWindowClass *klass G_GNUC_UNUSED)
17 {
18 }
19
20 static void
21 g_paste_ui_shortcuts_window_init (GPasteUiShortcutsWindow *self G_GNUC_UNUSED)
22 {
23 }
24
25 static inline void
26 add_shortcut (GtkContainer *group,
27 const gchar *title,
28 const gchar *accelerator)
29 {
30 gtk_container_add (group, gtk_widget_new (GTK_TYPE_SHORTCUTS_SHORTCUT,
31 "visible", TRUE,
32 "title", title,
33 "accelerator", accelerator,
34 NULL));
35 }
36
37 /**
38 * g_paste_ui_shortcuts_window_new:
39 * @settings: a #GPasteSettings instance
40 *
41 * Create a new instance of #GPasteUiShortcutsWindow
42 *
43 * Returns: a newly allocated #GPasteUiShortcutsWindow
44 * free it with g_object_unref
45 */
46 G_PASTE_VISIBLE GtkWidget *
47 g_paste_ui_shortcuts_window_new (const GPasteSettings *settings)
48 {
49 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
50
51 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_SHORTCUTS_WINDOW,
52 "type", GTK_WINDOW_TOPLEVEL,
53 "window-position", GTK_WIN_POS_CENTER_ALWAYS,
54 "modal", TRUE,
55 "resizable", FALSE,
56 NULL);
57 GtkWidget *section = gtk_widget_new (GTK_TYPE_SHORTCUTS_SECTION,
58 "section-name", "shortcuts",
59 "visible", TRUE,
60 "max-height", 10,
61 NULL);
62 GtkWidget *general_group = gtk_widget_new (GTK_TYPE_SHORTCUTS_GROUP,
63 "title", _("General"),
64 "visible", TRUE,
65 NULL);
66 GtkContainer *ggroup = GTK_CONTAINER (general_group);
67
68 gtk_container_add (GTK_CONTAINER (self), section);
69 gtk_container_add (GTK_CONTAINER (section), general_group);
70
71 add_shortcut (ggroup, _("Delete the active item from history"), g_paste_settings_get_pop (settings));
72 add_shortcut (ggroup, _("Launch the graphical tool"), g_paste_settings_get_launch_ui (settings));
73 add_shortcut (ggroup, _("Mark the active item as being a password"), g_paste_settings_get_make_password (settings));
74 add_shortcut (ggroup, _("Display the history"), g_paste_settings_get_show_history (settings));
75 add_shortcut (ggroup, _("Sync the clipboard to the primary selection"), g_paste_settings_get_sync_clipboard_to_primary (settings));
76 add_shortcut (ggroup, _("Sync the primary selection to the clipboard"), g_paste_settings_get_sync_primary_to_clipboard (settings));
77 add_shortcut (ggroup, _("Upload the active item to a pastebin service"), g_paste_settings_get_upload (settings));
78
79 return self;
80 }
+0
-26
src/libgpaste/ui/gpaste-ui-shortcuts-window.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_SHORTCUTS_WINDOW_H__
11 #define __G_PASTE_UI_SHORTCUTS_WINDOW_H__
12
13 #include <gpaste-settings.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_SHORTCUTS_WINDOW (g_paste_ui_shortcuts_window_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiShortcutsWindow, ui_shortcuts_window, UI_SHORTCUTS_WINDOW, GtkShortcutsWindow)
20
21 GtkWidget *g_paste_ui_shortcuts_window_new (const GPasteSettings *settings);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_SHORTCUTS_WINDOW_H__*/
+0
-127
src/libgpaste/ui/gpaste-ui-switch.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-switch.h>
7 #include <gpaste-util.h>
8
9 struct _GPasteUiSwitch
10 {
11 GtkSwitch parent_instance;
12 };
13
14 enum
15 {
16 C_TRACKING,
17
18 C_LAST_SIGNAL
19 };
20
21 typedef struct
22 {
23 GPasteClient *client;
24
25 GtkWindow *topwin;
26
27 guint64 c_signals[C_LAST_SIGNAL];
28 } GPasteUiSwitchPrivate;
29
30 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiSwitch, ui_switch, GTK_TYPE_SWITCH)
31
32 static void
33 on_tracking_changed (GPasteClient *client G_GNUC_UNUSED,
34 gboolean state,
35 gpointer user_data)
36 {
37 GtkSwitch *sw = user_data;
38
39 gtk_switch_set_active (sw, state);
40 }
41
42 static gboolean
43 g_paste_ui_button_press_event (GtkWidget *widget,
44 GdkEventButton *event G_GNUC_UNUSED)
45 {
46 const GPasteUiSwitchPrivate *priv = _g_paste_ui_switch_get_instance_private (G_PASTE_UI_SWITCH (widget));
47 GtkSwitch *sw = GTK_SWITCH (widget);
48 gboolean track = !gtk_switch_get_active (sw);
49 gboolean changed = TRUE;
50
51 if (!track)
52 {
53 changed = g_paste_util_confirm_dialog (priv->topwin, _("Stop"), _("Do you really want to stop tracking clipboard changes?"));
54 track = !changed;
55 }
56
57 if (changed)
58 g_paste_client_track (priv->client, track, NULL, NULL);
59
60 return GDK_EVENT_STOP;
61 }
62
63 static void
64 g_paste_ui_switch_dispose (GObject *object)
65 {
66 GPasteUiSwitchPrivate *priv = g_paste_ui_switch_get_instance_private (G_PASTE_UI_SWITCH (object));
67
68 if (priv->c_signals[C_TRACKING])
69 {
70 g_signal_handler_disconnect (priv->client, priv->c_signals[C_TRACKING]);
71 priv->c_signals[C_TRACKING] = 0;
72 }
73
74 g_clear_object (&priv->client);
75
76 G_OBJECT_CLASS (g_paste_ui_switch_parent_class)->dispose (object);
77 }
78
79 static void
80 g_paste_ui_switch_class_init (GPasteUiSwitchClass *klass)
81 {
82 GTK_WIDGET_CLASS (klass)->button_press_event = g_paste_ui_button_press_event;
83 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_switch_dispose;
84 }
85
86 static void
87 g_paste_ui_switch_init (GPasteUiSwitch *self)
88 {
89 GtkWidget *widget = GTK_WIDGET (self);
90
91 gtk_widget_set_tooltip_text (widget, _("Track clipboard changes"));
92 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
93 }
94
95 /**
96 * g_paste_ui_switch_new:
97 * @topwin: the main #GtkWindow
98 * @client: a #GPasteClient instance
99 *
100 * Create a new instance of #GPasteUiSwitch
101 *
102 * Returns: a newly allocated #GPasteUiSwitch
103 * free it with g_object_unref
104 */
105 G_PASTE_VISIBLE GtkWidget *
106 g_paste_ui_switch_new (GtkWindow *topwin,
107 GPasteClient *client)
108 {
109 g_return_val_if_fail (GTK_IS_WINDOW (topwin), NULL);
110 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
111
112 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_SWITCH, NULL);
113 GPasteUiSwitchPrivate *priv = g_paste_ui_switch_get_instance_private (G_PASTE_UI_SWITCH (self));
114
115 priv->topwin = topwin;
116 priv->client = g_object_ref (client);
117
118 priv->c_signals[C_TRACKING] = g_signal_connect (G_OBJECT (priv->client),
119 "tracking",
120 G_CALLBACK (on_tracking_changed),
121 self);
122
123 gtk_switch_set_active (GTK_SWITCH (self), g_paste_client_is_active (client));
124
125 return self;
126 }
+0
-27
src/libgpaste/ui/gpaste-ui-switch.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_SWITCH_H__
11 #define __G_PASTE_UI_SWITCH_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_SWITCH (g_paste_ui_switch_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiSwitch, ui_switch, UI_SWITCH, GtkSwitch)
20
21 GtkWidget *g_paste_ui_switch_new (GtkWindow *topwin,
22 GPasteClient *client);
23
24 G_END_DECLS
25
26 #endif /*__G_PASTE_UI_SWITCH_H__*/
+0
-50
src/libgpaste/ui/gpaste-ui-upload-item.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-upload-item.h>
7
8 struct _GPasteUiUploadItem
9 {
10 GPasteUiItemAction parent_instance;
11 };
12
13 G_PASTE_DEFINE_TYPE (UiUploadItem, ui_upload_item, G_PASTE_TYPE_UI_ITEM_ACTION)
14
15 static void
16 g_paste_ui_upload_item_activate (GPasteUiItemAction *self G_GNUC_UNUSED,
17 GPasteClient *client,
18 const gchar *uuid)
19 {
20 g_paste_client_upload (client, uuid, NULL, NULL);
21 }
22
23 static void
24 g_paste_ui_upload_item_class_init (GPasteUiUploadItemClass *klass)
25 {
26 G_PASTE_UI_ITEM_ACTION_CLASS (klass)->activate = g_paste_ui_upload_item_activate;
27 }
28
29 static void
30 g_paste_ui_upload_item_init (GPasteUiUploadItem *self G_GNUC_UNUSED)
31 {
32 }
33
34 /**
35 * g_paste_ui_upload_item_new:
36 * @client: a #GPasteClient
37 *
38 * Create a new instance of #GPasteUiUploadItem
39 *
40 * Returns: a newly allocated #GPasteUiUploadItem
41 * free it with g_object_unref
42 */
43 G_PASTE_VISIBLE GtkWidget *
44 g_paste_ui_upload_item_new (GPasteClient *client)
45 {
46 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
47
48 return g_paste_ui_item_action_new (G_PASTE_TYPE_UI_UPLOAD_ITEM, client, "document-send-symbolic", _("Upload"));
49 }
+0
-26
src/libgpaste/ui/gpaste-ui-upload-item.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_UPLOAD_ITEM_H__
11 #define __G_PASTE_UI_UPLOAD_ITEM_H__
12
13 #include <gpaste-ui-item-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_UPLOAD_ITEM (g_paste_ui_upload_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiUploadItem, ui_upload_item, UI_UPLOAD_ITEM, GPasteUiItemAction)
20
21 GtkWidget *g_paste_ui_upload_item_new (GPasteClient *client);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_UPLOAD_ITEM_H__*/
+0
-375
src/libgpaste/ui/gpaste-ui-window.c less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-header.h>
7 #include <gpaste-ui-history.h>
8 #include <gpaste-ui-search-bar.h>
9 #include <gpaste-ui-window.h>
10 #include <gpaste-ui-shortcuts-window.h>
11 #include <gpaste-util.h>
12
13 #include "gpaste-gtk-compat.h"
14
15 struct _GPasteUiWindow
16 {
17 GtkApplicationWindow parent_instance;
18 };
19
20 enum
21 {
22 C_SEARCH,
23
24 C_LAST_SIGNAL
25 };
26
27 typedef struct
28 {
29 GPasteUiHeader *header;
30 GPasteUiHistory *history;
31 GPasteClient *client;
32 GPasteSettings *settings;
33
34 GtkSearchBar *search_bar;
35 GtkSearchEntry *search_entry;
36
37 gboolean initialized;
38
39 guint64 c_signals[C_LAST_SIGNAL];
40 } GPasteUiWindowPrivate;
41
42 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiWindow, ui_window, GTK_TYPE_APPLICATION_WINDOW)
43
44 static gboolean
45 _empty (gpointer user_data)
46 {
47 gpointer *data = (gpointer *) user_data;
48 GPasteUiWindow *self = data[0];
49 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (self);
50
51 if (!priv->initialized)
52 return G_SOURCE_CONTINUE;
53
54 g_autofree gchar *history = data[1];
55 g_free (data);
56
57 g_paste_util_empty_history (GTK_WINDOW (self), priv->client, priv->settings, history);
58
59 return G_SOURCE_REMOVE;
60 }
61
62 /**
63 * g_paste_ui_window_empty_history:
64 * @self: the #GPasteUiWindow
65 * @history: the history to empty
66 *
67 * Empty an history
68 */
69 G_PASTE_VISIBLE void
70 g_paste_ui_window_empty_history (GPasteUiWindow *self,
71 const gchar *history)
72 {
73 g_return_if_fail (_G_PASTE_IS_UI_WINDOW (self));
74 g_return_if_fail (g_utf8_validate (history, -1, NULL));
75
76 gpointer *data = g_new (gpointer, 2);
77 data[0] = self;
78 data[1] = g_strdup (history);
79
80 g_source_set_name_by_id (g_idle_add (_empty, data), "[GPaste] empty");
81 }
82
83 static gboolean
84 _search (gpointer user_data)
85 {
86 gpointer *data = (gpointer *) user_data;
87 GPasteUiWindowPrivate *priv = data[0];
88
89 if (!priv->initialized)
90 return G_SOURCE_CONTINUE;
91
92 g_autofree gchar *search = data[1];
93 g_free (data);
94
95 gtk_button_clicked (g_paste_ui_header_get_search_button (priv->header));
96 gtk_entry_set_text (GTK_ENTRY (priv->search_entry), search);
97
98 return G_SOURCE_REMOVE;
99 }
100
101 /**
102 * g_paste_ui_window_search:
103 * @self: the #GPasteUiWindow
104 * @search: the text to search
105 *
106 * Do a search
107 */
108 G_PASTE_VISIBLE void
109 g_paste_ui_window_search (GPasteUiWindow *self,
110 const gchar *search)
111 {
112 g_return_if_fail (_G_PASTE_IS_UI_WINDOW (self));
113 g_return_if_fail (g_utf8_validate (search, -1, NULL));
114
115 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (self);
116
117 gpointer *data = g_new (gpointer, 2);
118 data[0] = priv;
119 data[1] = g_strdup (search);
120
121 g_source_set_name_by_id (g_idle_add (_search, data), "[GPaste] search");
122 }
123
124 static gboolean
125 _show_prefs (gpointer user_data)
126 {
127 GPasteUiWindowPrivate *priv = user_data;
128
129 if (!priv->initialized)
130 return G_SOURCE_CONTINUE;
131
132 g_paste_ui_header_show_prefs (priv->header);
133
134 return G_SOURCE_REMOVE;
135 }
136
137 /**
138 * g_paste_ui_window_show_prefs:
139 * @self: the #GPasteUiWindow
140 *
141 * Show the prefs pane
142 */
143 G_PASTE_VISIBLE void
144 g_paste_ui_window_show_prefs (GPasteUiWindow *self)
145 {
146 g_return_if_fail (_G_PASTE_IS_UI_WINDOW (self));
147
148 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (self);
149
150 g_source_set_name_by_id (g_idle_add (_show_prefs, priv), "[GPaste] show_prefs");
151 }
152
153 static gboolean
154 on_key_press_event (GtkWidget *widget,
155 GdkEventKey *event)
156 {
157 const GPasteUiWindowPrivate *priv = _g_paste_ui_window_get_instance_private (G_PASTE_UI_WINDOW (widget));
158 GtkWidget *focus = gtk_window_get_focus (GTK_WINDOW (widget));
159 GdkEvent *_event = (GdkEvent *) event;
160 gboolean search_has_focus = focus == GTK_WIDGET (priv->search_entry);
161 gboolean search_in_progress = search_has_focus && gtk_entry_get_text_length (GTK_ENTRY (priv->search_entry));
162 gboolean forward_to_search = FALSE;
163 guint keyval;
164
165 if (gdk_event_get_keyval (_event, &keyval))
166 {
167 switch (keyval)
168 {
169 case GDK_KEY_Escape:
170 if (!search_in_progress)
171 {
172 gtk_window_close (GTK_WINDOW (widget));
173 return GDK_EVENT_STOP;
174 }
175 else
176 {
177 forward_to_search = TRUE;
178 }
179 break;
180 case GDK_KEY_Return:
181 case GDK_KEY_KP_Enter:
182 case GDK_KEY_ISO_Enter:
183 if (search_in_progress && g_paste_ui_history_select_first (priv->history))
184 return GDK_EVENT_STOP;
185 break;
186 default:
187 forward_to_search = TRUE;
188 break;
189 }
190 }
191
192 if (forward_to_search && gtk_search_bar_handle_event (priv->search_bar, _event))
193 return GDK_EVENT_STOP;
194
195 gboolean res = GTK_WIDGET_CLASS (g_paste_ui_window_parent_class)->key_press_event (widget, event);
196
197 if (res == GDK_EVENT_STOP || !forward_to_search || search_has_focus)
198 return res;
199
200 // fallback to explicitely focusing search to see if key can be handled
201 gtk_entry_grab_focus_without_selecting (GTK_ENTRY (priv->search_entry));
202
203 if (gtk_search_bar_handle_event (priv->search_bar, _event))
204 return GDK_EVENT_STOP;
205
206 if (GTK_WIDGET_CLASS (g_paste_ui_window_parent_class)->key_press_event (widget, event) == GDK_EVENT_STOP)
207 return GDK_EVENT_STOP;
208
209 gtk_widget_grab_focus (focus);
210
211 return res;
212 }
213
214 static void
215 on_search (GtkSearchEntry *entry,
216 gpointer user_data)
217 {
218 GPasteUiWindowPrivate *priv = user_data;
219
220 g_paste_ui_history_search (priv->history, gtk_entry_get_text (GTK_ENTRY (entry)));
221 }
222
223 static gboolean
224 focus_search (gpointer user_data)
225 {
226 GPasteUiWindow *self = user_data;
227 const GPasteUiWindowPrivate *priv = _g_paste_ui_window_get_instance_private (self);
228 GtkWindow *win = user_data;
229 GtkWidget *widget = user_data;
230
231 if (!GTK_IS_WIDGET (widget))
232 return G_SOURCE_REMOVE;
233
234 if (!gtk_widget_get_realized (widget))
235 return G_SOURCE_CONTINUE;
236
237 gtk_window_set_focus (win, GTK_WIDGET (priv->search_entry));
238
239 return G_SOURCE_REMOVE;
240 }
241
242 static void
243 g_paste_ui_window_dispose (GObject *object)
244 {
245 GPasteUiWindow *self = G_PASTE_UI_WINDOW (object);
246 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (self);
247
248 if (priv->c_signals[C_SEARCH])
249 {
250 GPasteUiSearchBar *search_bar = G_PASTE_UI_SEARCH_BAR (priv->search_bar);
251 GtkSearchEntry *entry = g_paste_ui_search_bar_get_entry (search_bar);
252
253 g_signal_handler_disconnect (entry, priv->c_signals[C_SEARCH]);
254 priv->c_signals[C_SEARCH] = 0;
255 }
256
257 g_clear_object (&priv->client);
258
259 G_OBJECT_CLASS (g_paste_ui_window_parent_class)->dispose (object);
260 }
261
262 static void
263 g_paste_ui_window_class_init (GPasteUiWindowClass *klass)
264 {
265 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_window_dispose;
266 GTK_WIDGET_CLASS (klass)->key_press_event = on_key_press_event;
267 }
268
269 static void
270 g_paste_ui_window_init (GPasteUiWindow *self)
271 {
272 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (self);
273 GtkWindow *win = GTK_WINDOW (self);
274 GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
275
276 gtk_widget_set_margin_start (vbox, 5);
277 gtk_widget_set_margin_end (vbox, 5);
278 gtk_widget_set_margin_bottom (vbox, 5);
279
280 GtkWidget *search_bar = g_paste_ui_search_bar_new ();
281 GtkContainer *box = GTK_CONTAINER (vbox);
282
283 priv->search_bar = GTK_SEARCH_BAR (search_bar);
284
285 gtk_container_add (GTK_CONTAINER (win), vbox);
286 gtk_box_pack_start (GTK_BOX (box), search_bar, FALSE, FALSE);
287
288 GtkSearchEntry *entry = priv->search_entry = g_paste_ui_search_bar_get_entry (G_PASTE_UI_SEARCH_BAR (search_bar));
289 priv->c_signals[C_SEARCH] = g_signal_connect (entry,
290 "search-changed",
291 G_CALLBACK (on_search),
292 priv);
293
294 g_source_set_name_by_id (g_idle_add (focus_search, self), "[GPaste] focus_search");
295 }
296
297 static void
298 on_client_ready (GObject *source_object G_GNUC_UNUSED,
299 GAsyncResult *res,
300 gpointer user_data)
301 {
302 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (user_data);
303 GtkWindow *win = GTK_WINDOW (user_data);
304 g_autoptr (GError) error = NULL;
305 g_autoptr (GPasteClient) client = g_paste_client_new_finish (res, &error);
306
307 if (error)
308 {
309 priv->initialized = TRUE;
310 g_critical ("%s: %s\n", _("Couldn't connect to GPaste daemon"), error->message);
311 gtk_window_close (win); /* will exit the application */
312 }
313
314 g_autoptr (GPasteSettings) settings = g_paste_settings_new ();
315 GtkWidget *header = g_paste_ui_header_new (win, client);
316 GtkWidget *panel = g_paste_ui_panel_new (client, settings, win, priv->search_entry);
317 GtkWidget *history = g_paste_ui_history_new (client, settings, G_PASTE_UI_PANEL (panel), win);
318 GPasteUiHeader *h = priv->header = G_PASTE_UI_HEADER (header);
319
320 priv->history = G_PASTE_UI_HISTORY (history);
321 priv->client = g_object_ref (client);
322 priv->settings = g_paste_settings_new();
323
324 gtk_window_set_titlebar (win, header);
325 gtk_application_window_set_help_overlay (GTK_APPLICATION_WINDOW (user_data), GTK_SHORTCUTS_WINDOW (g_paste_ui_shortcuts_window_new (settings)));
326
327 GtkContainer *vbox = GTK_CONTAINER (gtk_bin_get_child (GTK_BIN (win)));
328 GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
329 GtkBox *box = GTK_BOX (hbox);
330
331 gtk_box_set_spacing (box, 2);
332 gtk_box_pack_start (box, panel, FALSE, FALSE);
333 gtk_box_pack_start (box, gtk_separator_new (GTK_ORIENTATION_VERTICAL), FALSE, FALSE);
334 gtk_widget_set_hexpand (history, TRUE);
335 gtk_widget_set_halign (history, TRUE);
336 gtk_box_pack_start (box, history, TRUE, TRUE);
337 gtk_widget_set_vexpand (hbox, TRUE);
338 gtk_widget_set_valign (hbox, TRUE);
339 gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE);
340
341 g_object_bind_property (g_paste_ui_header_get_search_button (h), "active",
342 gtk_container_get_children (vbox)->data, "search-mode-enabled",
343 G_BINDING_BIDIRECTIONAL);
344
345 gtk_widget_show_all (GTK_WIDGET (win));
346 priv->initialized = TRUE;
347 }
348
349 /**
350 * g_paste_ui_window_new:
351 * @app: the #GtkApplication
352 *
353 * Create a new instance of #GPasteUiWindow
354 *
355 * Returns: a newly allocated #GPasteUiWindow
356 * free it with g_object_unref
357 */
358 G_PASTE_VISIBLE GtkWidget *
359 g_paste_ui_window_new (GtkApplication *app)
360 {
361 g_return_val_if_fail (GTK_IS_APPLICATION (app), NULL);
362
363 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_WINDOW,
364 "application", app,
365 "type", GTK_WINDOW_TOPLEVEL,
366 "window-position", GTK_WIN_POS_CENTER_ALWAYS,
367 "resizable", FALSE,
368 "icon-name", G_PASTE_ICON_NAME,
369 NULL);
370
371 g_paste_client_new (on_client_ready, self);
372
373 return self;
374 }
+0
-32
src/libgpaste/ui/gpaste-ui-window.h less more
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_WINDOW_H__
11 #define __G_PASTE_UI_WINDOW_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_WINDOW (g_paste_ui_window_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiWindow, ui_window, UI_WINDOW, GtkApplicationWindow)
20
21 void g_paste_ui_window_empty_history (GPasteUiWindow *self,
22 const gchar *history);
23 void g_paste_ui_window_search (GPasteUiWindow *self,
24 const gchar *search);
25 void g_paste_ui_window_show_prefs (GPasteUiWindow *self);
26
27 GtkWidget *g_paste_ui_window_new (GtkApplication *app);
28
29 G_END_DECLS
30
31 #endif /*__G_PASTE_UI_WINDOW_H__*/
5151 %D%/libgpaste/settings-ui/gpaste-settings-ui-panel.h \
5252 %D%/libgpaste/settings-ui/gpaste-settings-ui-stack.h \
5353 %D%/libgpaste/settings-ui/gpaste-settings-ui-widget.h \
54 %D%/libgpaste/ui/gpaste-ui-about.h \
55 %D%/libgpaste/ui/gpaste-ui-backup-history.h \
56 %D%/libgpaste/ui/gpaste-ui-delete-history.h \
57 %D%/libgpaste/ui/gpaste-ui-delete-item.h \
58 %D%/libgpaste/ui/gpaste-ui-edit-item.h \
59 %D%/libgpaste/ui/gpaste-ui-empty-history.h \
60 %D%/libgpaste/ui/gpaste-ui-empty-item.h \
61 %D%/libgpaste/ui/gpaste-ui-header.h \
62 %D%/libgpaste/ui/gpaste-ui-history.h \
63 %D%/libgpaste/ui/gpaste-ui-history-action.h \
64 %D%/libgpaste/ui/gpaste-ui-history-actions.h \
65 %D%/libgpaste/ui/gpaste-ui-item.h \
66 %D%/libgpaste/ui/gpaste-ui-item-action.h \
67 %D%/libgpaste/ui/gpaste-ui-item-skeleton.h \
68 %D%/libgpaste/ui/gpaste-ui-new-item.h \
69 %D%/libgpaste/ui/gpaste-ui-panel.h \
70 %D%/libgpaste/ui/gpaste-ui-panel-history.h \
71 %D%/libgpaste/ui/gpaste-ui-reexec.h \
72 %D%/libgpaste/ui/gpaste-ui-search.h \
73 %D%/libgpaste/ui/gpaste-ui-search-bar.h \
74 %D%/libgpaste/ui/gpaste-ui-settings.h \
75 %D%/libgpaste/ui/gpaste-ui-shortcuts-window.h \
76 %D%/libgpaste/ui/gpaste-ui-switch.h \
77 %D%/libgpaste/ui/gpaste-ui-upload-item.h \
78 %D%/libgpaste/ui/gpaste-ui-window.h \
7954 $(NULL)
8055
8156 lib_libgpaste_la_source_files = \
11388 %D%/libgpaste/settings-ui/gpaste-settings-ui-panel.c \
11489 %D%/libgpaste/settings-ui/gpaste-settings-ui-stack.c \
11590 %D%/libgpaste/settings-ui/gpaste-settings-ui-widget.c \
116 %D%/libgpaste/ui/gpaste-ui-about.c \
117 %D%/libgpaste/ui/gpaste-ui-backup-history.c \
118 %D%/libgpaste/ui/gpaste-ui-delete-history.c \
119 %D%/libgpaste/ui/gpaste-ui-delete-item.c \
120 %D%/libgpaste/ui/gpaste-ui-edit-item.c \
121 %D%/libgpaste/ui/gpaste-ui-empty-history.c \
122 %D%/libgpaste/ui/gpaste-ui-empty-item.c \
123 %D%/libgpaste/ui/gpaste-ui-header.c \
124 %D%/libgpaste/ui/gpaste-ui-history.c \
125 %D%/libgpaste/ui/gpaste-ui-history-action.c \
126 %D%/libgpaste/ui/gpaste-ui-history-actions.c \
127 %D%/libgpaste/ui/gpaste-ui-item.c \
128 %D%/libgpaste/ui/gpaste-ui-item-action.c \
129 %D%/libgpaste/ui/gpaste-ui-item-skeleton.c \
130 %D%/libgpaste/ui/gpaste-ui-new-item.c \
131 %D%/libgpaste/ui/gpaste-ui-panel.c \
132 %D%/libgpaste/ui/gpaste-ui-panel-history.c \
133 %D%/libgpaste/ui/gpaste-ui-reexec.c \
134 %D%/libgpaste/ui/gpaste-ui-search.c \
135 %D%/libgpaste/ui/gpaste-ui-search-bar.c \
136 %D%/libgpaste/ui/gpaste-ui-settings.c \
137 %D%/libgpaste/ui/gpaste-ui-shortcuts-window.c \
138 %D%/libgpaste/ui/gpaste-ui-switch.c \
139 %D%/libgpaste/ui/gpaste-ui-upload-item.c \
140 %D%/libgpaste/ui/gpaste-ui-window.c \
14191 %D%/libgpaste/util/gpaste-util.c \
14292 $(NULL)
14393
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-about.h>
7 #include <gpaste-util.h>
8
9 struct _GPasteUiAbout
10 {
11 GtkButton parent_instance;
12 };
13
14 typedef struct
15 {
16 GActionGroup *action_group;
17 } GPasteUiAboutPrivate;
18
19 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiAbout, ui_about, GTK_TYPE_BUTTON)
20
21 static void
22 g_paste_ui_about_clicked (GtkButton *button)
23 {
24 const GPasteUiAboutPrivate *priv = _g_paste_ui_about_get_instance_private (G_PASTE_UI_ABOUT (button));
25
26 g_action_group_activate_action (priv->action_group, "about", NULL);
27 }
28
29 static void
30 g_paste_ui_about_class_init (GPasteUiAboutClass *klass)
31 {
32 GTK_BUTTON_CLASS (klass)->clicked = g_paste_ui_about_clicked;
33 }
34
35 static void
36 g_paste_ui_about_init (GPasteUiAbout *self)
37 {
38 GtkWidget *widget = GTK_WIDGET (self);
39
40 gtk_widget_set_tooltip_text (widget, _("About"));
41 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
42 gtk_container_add (GTK_CONTAINER (self), gtk_image_new_from_icon_name ("dialog-information-symbolic", GTK_ICON_SIZE_BUTTON));
43 }
44
45 /**
46 * g_paste_ui_about_new:
47 * @app: The #GtkApplication
48 *
49 * Create a new instance of #GPasteUiAbout
50 *
51 * Returns: a newly allocated #GPasteUiAbout
52 * free it with g_object_unref
53 */
54 G_PASTE_VISIBLE GtkWidget *
55 g_paste_ui_about_new (GtkApplication *app)
56 {
57 g_return_val_if_fail (GTK_IS_APPLICATION (app), NULL);
58
59 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_ABOUT, NULL);
60 GPasteUiAboutPrivate *priv = g_paste_ui_about_get_instance_private (G_PASTE_UI_ABOUT (self));
61
62 priv->action_group = G_ACTION_GROUP (app);
63
64 return self;
65 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_ABOUT_H__
11 #define __G_PASTE_UI_ABOUT_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_ABOUT (g_paste_ui_about_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiAbout, ui_about, UI_ABOUT, GtkButton)
20
21 GtkWidget *g_paste_ui_about_new (GtkApplication *app);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_ABOUT_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-backup-history.h>
7 #include <gpaste-ui-history-actions.h>
8 #include <gpaste-util.h>
9
10 #include "gpaste-gtk-compat.h"
11
12 struct _GPasteUiBackupHistory
13 {
14 GPasteUiHistoryAction parent_instance;
15 };
16
17 G_PASTE_DEFINE_TYPE (UiBackupHistory, ui_backup_history, G_PASTE_TYPE_UI_HISTORY_ACTION)
18
19 enum
20 {
21 C_ACTIVATED,
22
23 C_LAST_SIGNAL
24 };
25
26 static void
27 on_entry_activated (GtkEntry *entry G_GNUC_UNUSED,
28 gpointer user_data)
29 {
30 GtkDialog *dialog = user_data;
31
32 gtk_dialog_response (dialog, GTK_RESPONSE_OK);
33 }
34
35 static gchar *
36 g_paste_ui_backup_history_confirm_dialog (GtkWindow *parent,
37 const gchar *history)
38 {
39 g_autofree gchar *default_name = g_strdup_printf ("%s_backup", history);
40 GtkWidget *dialog = gtk_dialog_new_with_buttons (PACKAGE_STRING, parent,
41 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_USE_HEADER_BAR,
42 _("Backup"), GTK_RESPONSE_OK,
43 _("Cancel"), GTK_RESPONSE_CANCEL,
44 NULL);
45 GtkDialog *d = GTK_DIALOG (dialog);
46 GtkWidget *label = gtk_label_new (_("Under which name do you want to backup this history?"));
47 GtkWidget *entry = gtk_entry_new ();
48 GtkEntry *e = GTK_ENTRY (entry);
49 GtkWidget *vbox = gtk_dialog_get_content_area (d);
50 GtkBox *box = GTK_BOX (vbox);
51
52 gtk_widget_set_margin_start (vbox, 2);
53 gtk_widget_set_margin_end (vbox, 2);
54 gtk_widget_set_margin_bottom (vbox, 2);
55
56 gtk_widget_set_vexpand (label, TRUE);
57 gtk_widget_set_valign (label, TRUE);
58 gtk_box_pack_start (box, label, TRUE, TRUE);
59 gtk_widget_show (label);
60
61 gtk_widget_set_vexpand (entry, TRUE);
62 gtk_widget_set_valign (entry, TRUE);
63 gtk_box_pack_start (box, entry, TRUE, TRUE);
64 gtk_entry_set_text (e, default_name);
65 gtk_widget_show (entry);
66
67 guint64 c_signals[C_LAST_SIGNAL] = {
68 [C_ACTIVATED] = g_signal_connect (G_OBJECT (entry),
69 "activate",
70 G_CALLBACK (on_entry_activated),
71 dialog)
72 };
73
74 gchar *backup = NULL;
75
76 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
77 {
78 const gchar *text = gtk_entry_get_text (e);
79
80 if (text && *text)
81 backup = g_strdup (text);
82 }
83
84 g_signal_handler_disconnect (entry, c_signals[C_ACTIVATED]);
85 gtk_widget_destroy (dialog);
86
87 return backup;
88 }
89
90 static gboolean
91 g_paste_ui_backup_history_activate (GPasteUiHistoryAction *self G_GNUC_UNUSED,
92 GPasteClient *client,
93 GPasteSettings *settings G_GNUC_UNUSED,
94 GtkWindow *rootwin,
95 const gchar *history)
96 {
97 g_autofree gchar *backup = g_paste_ui_backup_history_confirm_dialog (rootwin, history);
98
99 if (backup)
100 g_paste_client_backup_history (client, history, backup, NULL, NULL);
101
102 return TRUE;
103 }
104
105 static void
106 g_paste_ui_backup_history_class_init (GPasteUiBackupHistoryClass *klass)
107 {
108 G_PASTE_UI_HISTORY_ACTION_CLASS (klass)->activate = g_paste_ui_backup_history_activate;
109 }
110
111 static void
112 g_paste_ui_backup_history_init (GPasteUiBackupHistory *self G_GNUC_UNUSED)
113 {
114 }
115
116 /**
117 * g_paste_ui_backup_history_new:
118 * @client: a #GPasteClient
119 * @settings: a #GPasteSettings
120 * @actions: the #GPasteUiHistoryActions
121 * @rootwin: the root #GtkWindow
122 *
123 * Create a new instance of #GPasteUiBackupHistory
124 *
125 * Returns: a newly allocated #GPasteUiBackupHistory
126 * free it with g_object_unref
127 */
128 G_PASTE_VISIBLE GtkWidget *
129 g_paste_ui_backup_history_new (GPasteClient *client,
130 GPasteSettings *settings,
131 GtkWidget *actions,
132 GtkWindow *rootwin)
133 {
134 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
135 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
136 g_return_val_if_fail (_G_PASTE_IS_UI_HISTORY_ACTIONS (actions), NULL);
137 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
138
139 return g_paste_ui_history_action_new (G_PASTE_TYPE_UI_BACKUP_HISTORY, client, settings, actions, rootwin, _("Backup"));
140 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_BACKUP_HISTORY_H__
11 #define __G_PASTE_UI_BACKUP_HISTORY_H__
12
13 #include <gpaste-ui-history-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_BACKUP_HISTORY (g_paste_ui_backup_history_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiBackupHistory, ui_backup_history, UI_BACKUP_HISTORY, GPasteUiHistoryAction)
20
21 GtkWidget *g_paste_ui_backup_history_new (GPasteClient *client,
22 GPasteSettings *settings,
23 GtkWidget *actions,
24 GtkWindow *rootwin);
25
26 G_END_DECLS
27
28 #endif /*__G_PASTE_UI_BACKUP_HISTORY_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-delete-history.h>
7 #include <gpaste-ui-history-actions.h>
8 #include <gpaste-util.h>
9
10 struct _GPasteUiDeleteHistory
11 {
12 GPasteUiHistoryAction parent_instance;
13 };
14
15 G_PASTE_DEFINE_TYPE (UiDeleteHistory, ui_delete_history, G_PASTE_TYPE_UI_HISTORY_ACTION)
16
17 static gboolean
18 g_paste_ui_delete_history_activate (GPasteUiHistoryAction *self G_GNUC_UNUSED,
19 GPasteClient *client,
20 GPasteSettings *settings G_GNUC_UNUSED,
21 GtkWindow *rootwin,
22 const gchar *history)
23 {
24 if (g_paste_util_confirm_dialog (rootwin, _("Delete"), _("Are you sure you want to delete this history?")))
25 g_paste_client_delete_history (client, history, NULL, NULL);
26
27 return TRUE;
28 }
29
30 static void
31 g_paste_ui_delete_history_class_init (GPasteUiDeleteHistoryClass *klass)
32 {
33 G_PASTE_UI_HISTORY_ACTION_CLASS (klass)->activate = g_paste_ui_delete_history_activate;
34 }
35
36 static void
37 g_paste_ui_delete_history_init (GPasteUiDeleteHistory *self G_GNUC_UNUSED)
38 {
39 }
40
41 /**
42 * g_paste_ui_delete_history_new:
43 * @client: a #GPasteClient
44 * @settings: a #GPasteSettings
45 * @actions: the #GPasteUiHistoryActions
46 * @rootwin: the root #GtkWindow
47 *
48 * Create a new instance of #GPasteUiDeleteHistory
49 *
50 * Returns: a newly allocated #GPasteUiDeleteHistory
51 * free it with g_object_unref
52 */
53 G_PASTE_VISIBLE GtkWidget *
54 g_paste_ui_delete_history_new (GPasteClient *client,
55 GPasteSettings *settings,
56 GtkWidget *actions,
57 GtkWindow *rootwin)
58 {
59 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
60 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
61 g_return_val_if_fail (_G_PASTE_IS_UI_HISTORY_ACTIONS (actions), NULL);
62 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
63
64 return g_paste_ui_history_action_new (G_PASTE_TYPE_UI_DELETE_HISTORY, client, settings, actions, rootwin, _("Delete"));
65 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_DELETE_HISTORY_H__
11 #define __G_PASTE_UI_DELETE_HISTORY_H__
12
13 #include <gpaste-ui-history-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_DELETE_HISTORY (g_paste_ui_delete_history_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiDeleteHistory, ui_delete_history, UI_DELETE_HISTORY, GPasteUiHistoryAction)
20
21 GtkWidget *g_paste_ui_delete_history_new (GPasteClient *client,
22 GPasteSettings *settings,
23 GtkWidget *actions,
24 GtkWindow *rootwin);
25
26 G_END_DECLS
27
28 #endif /*__G_PASTE_UI_DELETE_HISTORY_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-delete-item.h>
7
8 struct _GPasteUiDeleteItem
9 {
10 GPasteUiItemAction parent_instance;
11 };
12
13 G_PASTE_DEFINE_TYPE (UiDeleteItem, ui_delete_item, G_PASTE_TYPE_UI_ITEM_ACTION)
14
15 static void
16 g_paste_ui_delete_item_activate (GPasteUiItemAction *self G_GNUC_UNUSED,
17 GPasteClient *client,
18 const gchar *uuid)
19 {
20 g_paste_client_delete (client, uuid, NULL, NULL);
21 }
22
23 static void
24 g_paste_ui_delete_item_class_init (GPasteUiDeleteItemClass *klass)
25 {
26 G_PASTE_UI_ITEM_ACTION_CLASS (klass)->activate = g_paste_ui_delete_item_activate;
27 }
28
29 static void
30 g_paste_ui_delete_item_init (GPasteUiDeleteItem *self G_GNUC_UNUSED)
31 {
32 }
33
34 /**
35 * g_paste_ui_delete_item_new:
36 * @client: a #GPasteClient
37 *
38 * Create a new instance of #GPasteUiDeleteItem
39 *
40 * Returns: a newly allocated #GPasteUiDeleteItem
41 * free it with g_object_unref
42 */
43 G_PASTE_VISIBLE GtkWidget *
44 g_paste_ui_delete_item_new (GPasteClient *client)
45 {
46 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
47
48 return g_paste_ui_item_action_new (G_PASTE_TYPE_UI_DELETE_ITEM, client, "edit-delete-symbolic", _("Delete"));
49 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_DELETE_ITEM_H__
11 #define __G_PASTE_UI_DELETE_ITEM_H__
12
13 #include <gpaste-ui-item-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_DELETE_ITEM (g_paste_ui_delete_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiDeleteItem, ui_delete_item, UI_DELETE_ITEM, GPasteUiItemAction)
20
21 GtkWidget *g_paste_ui_delete_item_new (GPasteClient *client);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_DELETE_ITEM_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-edit-item.h>
7
8 #include "gpaste-gtk-compat.h"
9
10 struct _GPasteUiEditItem
11 {
12 GPasteUiItemAction parent_instance;
13 };
14
15 typedef struct
16 {
17 GtkWindow *rootwin;
18 } GPasteUiEditItemPrivate;
19
20 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiEditItem, ui_edit_item, G_PASTE_TYPE_UI_ITEM_ACTION)
21
22 typedef struct
23 {
24 GPasteUiEditItemPrivate *priv;
25 gchar *uuid;
26 } CallbackData;
27
28 static void
29 on_item_ready (GObject *source_object,
30 GAsyncResult *res,
31 gpointer user_data)
32 {
33 g_autofree CallbackData *data = user_data;
34 g_autofree gchar *uuid = data->uuid;
35 GPasteUiEditItemPrivate *priv = data->priv;
36 GPasteClient *client = G_PASTE_CLIENT (source_object);
37 g_autofree gchar *old_item = g_paste_client_get_raw_element_finish (client, res, NULL);
38
39 if (!old_item)
40 return;
41
42 GtkWidget *dialog = gtk_dialog_new_with_buttons (PACKAGE_STRING, priv->rootwin,
43 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_USE_HEADER_BAR,
44 _("Edit"), GTK_RESPONSE_OK,
45 _("Cancel"), GTK_RESPONSE_CANCEL,
46 NULL);
47 GtkDialog *d = GTK_DIALOG (dialog);
48 GtkWidget *text = gtk_text_view_new ();
49 GtkTextView *tv = GTK_TEXT_VIEW (text);
50 GtkTextBuffer *buf = gtk_text_view_get_buffer (tv);
51 GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
52 GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW (scroll);
53
54 gtk_text_view_set_wrap_mode (tv, GTK_WRAP_WORD);
55 gtk_text_buffer_set_text (buf, old_item, -1);
56 gtk_scrolled_window_set_min_content_height (sw, 300);
57 gtk_scrolled_window_set_min_content_width (sw, 600);
58 gtk_container_add (GTK_CONTAINER (sw), text);
59 gtk_widget_set_vexpand (scroll, TRUE);
60 gtk_widget_set_valign (scroll, TRUE);
61 gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (d)), scroll, TRUE, TRUE);
62 gtk_widget_show_all (scroll);
63
64 if (gtk_dialog_run (d) == GTK_RESPONSE_OK)
65 {
66 const gchar *txt;
67
68 g_object_get (G_OBJECT (buf), "text", &txt, NULL);
69 if (txt && *txt)
70 g_paste_client_replace (client, uuid, txt, NULL, NULL);
71 }
72
73 gtk_widget_destroy (dialog);
74 }
75
76 static void
77 g_paste_ui_edit_item_activate (GPasteUiItemAction *self,
78 GPasteClient *client,
79 const gchar *uuid)
80 {
81 CallbackData *data = g_malloc (sizeof (CallbackData));
82
83 data->priv = g_paste_ui_edit_item_get_instance_private (G_PASTE_UI_EDIT_ITEM (self));
84 data->uuid = g_strdup (uuid);
85
86 g_paste_client_get_raw_element (client, uuid, on_item_ready, data);
87 }
88
89 static void
90 g_paste_ui_edit_item_class_init (GPasteUiEditItemClass *klass)
91 {
92 G_PASTE_UI_ITEM_ACTION_CLASS (klass)->activate = g_paste_ui_edit_item_activate;
93 }
94
95 static void
96 g_paste_ui_edit_item_init (GPasteUiEditItem *self G_GNUC_UNUSED)
97 {
98 }
99
100 /**
101 * g_paste_ui_edit_item_new:
102 * @client: a #GPasteClient
103 * @rootwin: the root #GtkWindow
104 *
105 * Create a new instance of #GPasteUiEditItem
106 *
107 * Returns: a newly allocated #GPasteUiEditItem
108 * free it with g_object_unref
109 */
110 G_PASTE_VISIBLE GtkWidget *
111 g_paste_ui_edit_item_new (GPasteClient *client,
112 GtkWindow *rootwin)
113 {
114 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
115 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
116
117 GtkWidget *self = g_paste_ui_item_action_new (G_PASTE_TYPE_UI_EDIT_ITEM, client, "accessories-text-editor-symbolic", _("Edit"));
118 GPasteUiEditItemPrivate *priv = g_paste_ui_edit_item_get_instance_private (G_PASTE_UI_EDIT_ITEM (self));
119
120 priv->rootwin = rootwin;
121
122 return self;
123 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_EDIT_ITEM_H__
11 #define __G_PASTE_UI_EDIT_ITEM_H__
12
13 #include <gpaste-ui-item-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_EDIT_ITEM (g_paste_ui_edit_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiEditItem, ui_edit_item, UI_EDIT_ITEM, GPasteUiItemAction)
20
21 GtkWidget *g_paste_ui_edit_item_new (GPasteClient *client,
22 GtkWindow *rootwin);
23
24 G_END_DECLS
25
26 #endif /*__G_PASTE_UI_EDIT_ITEM_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-empty-history.h>
7 #include <gpaste-ui-history-actions.h>
8 #include <gpaste-util.h>
9
10 struct _GPasteUiEmptyHistory
11 {
12 GPasteUiHistoryAction parent_instance;
13 };
14
15 G_PASTE_DEFINE_TYPE (UiEmptyHistory, ui_empty_history, G_PASTE_TYPE_UI_HISTORY_ACTION)
16
17 static gboolean
18 g_paste_ui_empty_history_activate (GPasteUiHistoryAction *self G_GNUC_UNUSED,
19 GPasteClient *client,
20 GPasteSettings *settings,
21 GtkWindow *rootwin,
22 const gchar *history)
23 {
24 g_paste_util_empty_history (rootwin, client, settings, history);
25
26 return TRUE;
27 }
28
29 static void
30 g_paste_ui_empty_history_class_init (GPasteUiEmptyHistoryClass *klass)
31 {
32 G_PASTE_UI_HISTORY_ACTION_CLASS (klass)->activate = g_paste_ui_empty_history_activate;
33 }
34
35 static void
36 g_paste_ui_empty_history_init (GPasteUiEmptyHistory *self G_GNUC_UNUSED)
37 {
38 }
39
40 /**
41 * g_paste_ui_empty_history_new:
42 * @client: a #GPasteClient instance
43 * @settings: a #GPasteSettings instance
44 * @actions: the #GPasteUiHistoryActions
45 * @rootwin: the main #GtkWindow
46 *
47 * Create a new instance of #GPasteUiEmptyHistory
48 *
49 * Returns: a newly allocated #GPasteUiEmptyHistory
50 * free it with g_object_unref
51 */
52 G_PASTE_VISIBLE GtkWidget *
53 g_paste_ui_empty_history_new (GPasteClient *client,
54 GPasteSettings *settings,
55 GtkWidget *actions,
56 GtkWindow *rootwin)
57 {
58 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
59 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
60 g_return_val_if_fail (_G_PASTE_IS_UI_HISTORY_ACTIONS (actions), NULL);
61 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
62
63 /* Translators: this is the translation for emptying the history */
64 return g_paste_ui_history_action_new (G_PASTE_TYPE_UI_EMPTY_HISTORY, client, settings, actions, rootwin, _("Empty"));
65 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_EMPTY_HISTORY_H__
11 #define __G_PASTE_UI_EMPTY_HISTORY_H__
12
13 #include <gpaste-ui-history-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_EMPTY_HISTORY (g_paste_ui_empty_history_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiEmptyHistory, ui_empty_history, UI_EMPTY_HISTORY, GPasteUiHistoryAction)
20
21 GtkWidget *g_paste_ui_empty_history_new (GPasteClient *client,
22 GPasteSettings *settings,
23 GtkWidget *actions,
24 GtkWindow *rootwin);
25
26 G_END_DECLS
27
28 #endif /*__G_PASTE_UI_EMPTY_HISTORY_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-empty-item.h>
7
8 struct _GPasteUiEmptyItem
9 {
10 GPasteUiItemSkeleton parent_instance;
11 };
12
13 G_PASTE_DEFINE_TYPE (UiEmptyItem, ui_empty_item, G_PASTE_TYPE_UI_ITEM_SKELETON)
14
15 static void
16 g_paste_ui_empty_item_show_text (GPasteUiEmptyItem *self,
17 const gchar *text)
18 {
19 g_paste_ui_item_skeleton_set_text (G_PASTE_UI_ITEM_SKELETON (self), text);
20 gtk_widget_show (GTK_WIDGET (self));
21 }
22
23 /**
24 * g_paste_ui_empty_show_no_result:
25 * @self: a #GPasteUiEmptyItem instance
26 *
27 * Show a no result message
28 */
29 G_PASTE_VISIBLE void
30 g_paste_ui_empty_item_show_no_result (GPasteUiEmptyItem *self)
31 {
32 g_return_if_fail (G_PASTE_IS_UI_EMPTY_ITEM (self));
33
34 g_paste_ui_empty_item_show_text (self, _("(No result)"));
35 }
36
37 /**
38 * g_paste_ui_empty_show_empty:
39 * @self: a #GPasteUiEmptyItem instance
40 *
41 * Show an empty message
42 */
43 G_PASTE_VISIBLE void
44 g_paste_ui_empty_item_show_empty (GPasteUiEmptyItem *self)
45 {
46 g_return_if_fail (G_PASTE_IS_UI_EMPTY_ITEM (self));
47
48 g_paste_ui_empty_item_show_text (self, _("(Empty)"));
49 }
50
51 static void
52 g_paste_ui_empty_item_class_init (GPasteUiEmptyItemClass *klass G_GNUC_UNUSED)
53 {
54 }
55
56 static void
57 g_paste_ui_empty_item_init (GPasteUiEmptyItem *self)
58 {
59 g_paste_ui_item_skeleton_set_text (G_PASTE_UI_ITEM_SKELETON (self), _("(Couldn't connect to GPaste daemon)"));
60 }
61
62 /**
63 * g_paste_ui_empty_item_new:
64 * @client: a #GPasteClient instance
65 * @settings: a #GPasteSettings instance
66 * @rootwin: the root #GtkWindow
67 *
68 * Create a new instance of #GPasteUiEmptyItem
69 *
70 * Returns: a newly allocated #GPasteUiEmptyItem
71 * free it with g_object_unref
72 */
73 G_PASTE_VISIBLE GtkWidget *
74 g_paste_ui_empty_item_new (GPasteClient *client,
75 GPasteSettings *settings,
76 GtkWindow *rootwin)
77 {
78 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
79 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
80 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
81
82 GtkWidget *self = g_paste_ui_item_skeleton_new (G_PASTE_TYPE_UI_EMPTY_ITEM, client, settings, rootwin);
83
84 g_paste_ui_item_skeleton_set_activatable (G_PASTE_UI_ITEM_SKELETON (self), FALSE);
85
86 return self;
87 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_EMPTY_ITEM_H__
11 #define __G_PASTE_UI_EMPTY_ITEM_H__
12
13 #include <gpaste-ui-item-skeleton.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_EMPTY_ITEM (g_paste_ui_empty_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiEmptyItem, ui_empty_item, UI_EMPTY_ITEM, GPasteUiItemSkeleton)
20
21 void g_paste_ui_empty_item_show_no_result (GPasteUiEmptyItem *self);
22 void g_paste_ui_empty_item_show_empty (GPasteUiEmptyItem *self);
23
24 GtkWidget *g_paste_ui_empty_item_new (GPasteClient *client,
25 GPasteSettings *settings,
26 GtkWindow *rootwin);
27
28 G_END_DECLS
29
30 #endif /*__G_PASTE_UI_EMPTY_ITEM_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-about.h>
7 #include <gpaste-ui-header.h>
8 #include <gpaste-ui-new-item.h>
9 #include <gpaste-ui-reexec.h>
10 #include <gpaste-ui-search.h>
11 #include <gpaste-ui-settings.h>
12 #include <gpaste-ui-switch.h>
13
14 struct _GPasteUiHeader
15 {
16 GtkHeaderBar parent_instance;
17 };
18
19 typedef struct
20 {
21 GtkButton *settings;
22 GtkButton *search;
23 } GPasteUiHeaderPrivate;
24
25 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiHeader, ui_header, GTK_TYPE_HEADER_BAR)
26
27 /**
28 * g_paste_ui_header_show_prefs:
29 * @self: the #GPasteUiHeader
30 *
31 * Show the prefs pane
32 */
33 G_PASTE_VISIBLE void
34 g_paste_ui_header_show_prefs (const GPasteUiHeader *self)
35 {
36 g_return_if_fail (_G_PASTE_IS_UI_HEADER (self));
37
38 const GPasteUiHeaderPrivate *priv = _g_paste_ui_header_get_instance_private (self);
39
40 gtk_button_clicked (priv->settings);
41 }
42
43 /**
44 * g_paste_ui_header_get_search_button:
45 * @self: the #GPasteUiHeader
46 *
47 * Get the search button
48 *
49 * Returns: (transfer none): the #GPasteUISearch instance
50 */
51 G_PASTE_VISIBLE GtkButton *
52 g_paste_ui_header_get_search_button (const GPasteUiHeader *self)
53 {
54 g_return_val_if_fail (_G_PASTE_IS_UI_HEADER (self), NULL);
55
56 const GPasteUiHeaderPrivate *priv = _g_paste_ui_header_get_instance_private (self);
57
58 return priv->search;
59 }
60
61 static void
62 g_paste_ui_header_class_init (GPasteUiHeaderClass *klass G_GNUC_UNUSED)
63 {
64 }
65
66 static void
67 g_paste_ui_header_init (GPasteUiHeader *self)
68 {
69 GPasteUiHeaderPrivate *priv = g_paste_ui_header_get_instance_private (self);
70 GtkHeaderBar *header_bar = GTK_HEADER_BAR (self);
71 GtkWidget *settings = g_paste_ui_settings_new ();
72 GtkWidget *search = g_paste_ui_search_new ();
73
74 priv->settings = GTK_BUTTON (settings);
75 priv->search = GTK_BUTTON (search);
76
77 gtk_header_bar_set_title(header_bar, PACKAGE_STRING);
78 gtk_header_bar_set_show_close_button (header_bar, TRUE);
79 gtk_header_bar_pack_end (header_bar, settings);
80 gtk_header_bar_pack_end (header_bar, search);
81 }
82
83 /**
84 * g_paste_ui_header_new:
85 * @topwin: the main #GtkWindow
86 * @client: a #GPasteClient instance
87 *
88 * Create a new instance of #GPasteUiHeader
89 *
90 * Returns: a newly allocated #GPasteUiHeader
91 * free it with g_object_unref
92 */
93 G_PASTE_VISIBLE GtkWidget *
94 g_paste_ui_header_new (GtkWindow *topwin,
95 GPasteClient *client)
96 {
97 g_return_val_if_fail (GTK_IS_WINDOW (topwin), NULL);
98 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
99
100 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_HEADER, NULL);
101 GtkHeaderBar *bar = GTK_HEADER_BAR (self);
102
103 gtk_header_bar_pack_start (bar, g_paste_ui_switch_new (topwin, client));
104 gtk_header_bar_pack_start (bar, g_paste_ui_reexec_new (topwin, client));
105
106 gtk_header_bar_pack_end (bar, g_paste_ui_about_new (gtk_window_get_application (topwin)));
107 gtk_header_bar_pack_end (bar, g_paste_ui_new_item_new (topwin, client));
108
109 return self;
110 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_HEADER_H__
11 #define __G_PASTE_UI_HEADER_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_HEADER (g_paste_ui_header_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiHeader, ui_header, UI_HEADER, GtkHeaderBar)
20
21 void g_paste_ui_header_show_prefs (const GPasteUiHeader *self);
22
23 GtkButton *g_paste_ui_header_get_search_button (const GPasteUiHeader *self);
24
25 GtkWidget *g_paste_ui_header_new (GtkWindow *topwin,
26 GPasteClient *client);
27
28 G_END_DECLS
29
30 #endif /*__G_PASTE_UI_HEADER_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-history-action.h>
7 #include <gpaste-ui-history-actions.h>
8
9 typedef struct
10 {
11 GPasteClient *client;
12 GPasteSettings *settings;
13 GPasteUiHistoryActions *actions;
14
15 GtkWindow *rootwin;
16
17 gchar *history;
18 } GPasteUiHistoryActionPrivate;
19
20 G_PASTE_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (UiHistoryAction, ui_history_action, GTK_TYPE_BUTTON)
21
22 /**
23 * g_paste_ui_history_action_set_history:
24 * @self: a #GPasteUiHistoryAction instance
25 * @history: the history to delete
26 *
27 * Set the history to delete
28 */
29 G_PASTE_VISIBLE void
30 g_paste_ui_history_action_set_history (GPasteUiHistoryAction *self,
31 const gchar *history)
32 {
33 g_return_if_fail (_G_PASTE_IS_UI_HISTORY_ACTION (self));
34
35 GPasteUiHistoryActionPrivate *priv = g_paste_ui_history_action_get_instance_private (G_PASTE_UI_HISTORY_ACTION (self));
36
37 g_free (priv->history);
38 priv->history = g_strdup (history);
39 }
40
41 static gboolean
42 g_paste_ui_history_action_button_press_event (GtkWidget *widget,
43 GdkEventButton *event G_GNUC_UNUSED)
44 {
45 GPasteUiHistoryAction *self = G_PASTE_UI_HISTORY_ACTION (widget);
46 GPasteUiHistoryActionClass *klass = G_PASTE_UI_HISTORY_ACTION_GET_CLASS (self);
47 const GPasteUiHistoryActionPrivate *priv = _g_paste_ui_history_action_get_instance_private (self);
48 gboolean ret;
49
50 if (priv->history && klass->activate)
51 ret = klass->activate (self, priv->client, priv->settings, priv->rootwin, priv->history);
52 else
53 ret = GTK_WIDGET_CLASS (g_paste_ui_history_action_parent_class)->button_press_event (widget, event);
54
55 g_paste_ui_history_actions_set_relative_to (priv->actions, NULL);
56
57 return ret;
58 }
59
60 static void
61 g_paste_ui_history_action_dispose (GObject *object)
62 {
63 GPasteUiHistoryActionPrivate *priv = g_paste_ui_history_action_get_instance_private (G_PASTE_UI_HISTORY_ACTION (object));
64
65 g_clear_object (&priv->client);
66 g_clear_object (&priv->settings);
67
68 G_OBJECT_CLASS (g_paste_ui_history_action_parent_class)->dispose (object);
69 }
70
71 static void
72 g_paste_ui_history_action_finalize (GObject *object)
73 {
74 const GPasteUiHistoryActionPrivate *priv = _g_paste_ui_history_action_get_instance_private (G_PASTE_UI_HISTORY_ACTION (object));
75
76 g_free (priv->history);
77
78 G_OBJECT_CLASS (g_paste_ui_history_action_parent_class)->finalize (object);
79 }
80
81 static void
82 g_paste_ui_history_action_class_init (GPasteUiHistoryActionClass *klass)
83 {
84 GObjectClass *object_class = G_OBJECT_CLASS (klass);
85
86 object_class->dispose = g_paste_ui_history_action_dispose;
87 object_class->finalize = g_paste_ui_history_action_finalize;
88
89 GTK_WIDGET_CLASS (klass)->button_press_event = g_paste_ui_history_action_button_press_event;
90 }
91
92 static void
93 g_paste_ui_history_action_init (GPasteUiHistoryAction *self)
94 {
95 GtkWidget *button = GTK_WIDGET (self);
96
97 gtk_widget_set_margin_start (button, 5);
98 gtk_widget_set_margin_end (button, 5);
99 }
100
101 /**
102 * g_paste_ui_history_action_new:
103 * @type: the type of the subclass to instantiate
104 * @client: a #GPasteClient
105 * @settings: a #GPasteSettings
106 * @actions: a #GPasteUiHistoryActions
107 * @rootwin: the main #GtkWindow
108 *
109 * Create a new instance of #GPasteUiHistoryAction
110 *
111 * Returns: a newly allocated #GPasteUiHistoryAction
112 * free it with g_object_unref
113 */
114 G_PASTE_VISIBLE GtkWidget *
115 g_paste_ui_history_action_new (GType type,
116 GPasteClient *client,
117 GPasteSettings *settings,
118 GtkWidget *actions,
119 GtkWindow *rootwin,
120 const gchar *label)
121 {
122 g_return_val_if_fail (g_type_is_a (type, G_PASTE_TYPE_UI_HISTORY_ACTION), NULL);
123 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
124 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
125 g_return_val_if_fail (_G_PASTE_IS_UI_HISTORY_ACTIONS (actions), NULL);
126 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
127
128 GtkWidget *self = gtk_widget_new (type,
129 "width-request", 200,
130 "height-request", 30,
131 NULL);
132 GPasteUiHistoryActionPrivate *priv = g_paste_ui_history_action_get_instance_private (G_PASTE_UI_HISTORY_ACTION (self));
133
134 priv->client = g_object_ref (client);
135 priv->settings = g_object_ref (settings);
136 priv->actions = G_PASTE_UI_HISTORY_ACTIONS (actions);
137 priv->rootwin = rootwin;
138
139 gtk_button_set_label (GTK_BUTTON (self), label);
140
141 return self;
142 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_HISTORY_ACTION_H__
11 #define __G_PASTE_UI_HISTORY_ACTION_H__
12
13 #include <gpaste-client.h>
14 #include <gpaste-settings.h>
15
16 G_BEGIN_DECLS
17
18 #define G_PASTE_TYPE_UI_HISTORY_ACTION (g_paste_ui_history_action_get_type ())
19
20 G_PASTE_DERIVABLE_TYPE (UiHistoryAction, ui_history_action, UI_HISTORY_ACTION, GtkButton)
21
22 struct _GPasteUiHistoryActionClass
23 {
24 GtkButtonClass parent_class;
25
26 /*< pure virtual >*/
27 gboolean (*activate) (GPasteUiHistoryAction *self,
28 GPasteClient *client,
29 GPasteSettings *settings,
30 GtkWindow *rootwin,
31 const gchar *history);
32 };
33
34 void g_paste_ui_history_action_set_history (GPasteUiHistoryAction *self,
35 const gchar *history);
36
37 GtkWidget *g_paste_ui_history_action_new (GType type,
38 GPasteClient *client,
39 GPasteSettings *settings,
40 GtkWidget *actions,
41 GtkWindow *rootwin,
42 const gchar *label);
43
44 G_END_DECLS
45
46 #endif /*__G_PASTE_UI_HISTORY_ACTION_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-backup-history.h>
7 #include <gpaste-ui-delete-history.h>
8 #include <gpaste-ui-empty-history.h>
9 #include <gpaste-ui-history-actions.h>
10
11 #include "gpaste-gtk-compat.h"
12
13 struct _GPasteUiHistoryActions
14 {
15 GtkPopover parent_instance;
16 };
17
18 typedef struct
19 {
20 GPasteClient *client;
21
22 GSList *actions;
23 } GPasteUiHistoryActionsPrivate;
24
25 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiHistoryActions, ui_history_actions, GTK_TYPE_POPOVER)
26
27 static void
28 action_set_history (gpointer data,
29 gpointer user_data)
30 {
31 GPasteUiHistoryAction *action = data;
32 const gchar *history = user_data;
33
34 g_paste_ui_history_action_set_history (action, history);
35 }
36
37 /**
38 * g_paste_ui_history_actions_set_relative_to:
39 * @self: the #GPasteUiHistoryActions
40 * @history: (nullable): a #GPasteUiPanelHistory instance
41 *
42 * Set which history we'll deal with
43 */
44 G_PASTE_VISIBLE void
45 g_paste_ui_history_actions_set_relative_to (GPasteUiHistoryActions *self,
46 GPasteUiPanelHistory *history)
47 {
48 g_return_if_fail (_G_PASTE_IS_UI_HISTORY_ACTIONS (self));
49 g_return_if_fail (!history || _G_PASTE_IS_UI_PANEL_HISTORY (history));
50
51 const GPasteUiHistoryActionsPrivate *priv = _g_paste_ui_history_actions_get_instance_private (self);
52 const gchar *h = (history) ? g_paste_ui_panel_history_get_history (history) : NULL;
53
54 g_slist_foreach (priv->actions, action_set_history, (gpointer) h);
55
56 if (history)
57 gtk_popover_set_relative_to (GTK_POPOVER (self), GTK_WIDGET (history));
58 else
59 gtk_widget_hide (GTK_WIDGET (self));
60 }
61
62 static void
63 add_action_to_box (gpointer data,
64 gpointer user_data)
65 {
66 GtkContainer *box = user_data;
67 GtkWidget *action = data;
68
69 gtk_container_add (box, action);
70 }
71
72 static void
73 g_paste_ui_history_actions_dispose (GObject *object)
74 {
75 GPasteUiHistoryActionsPrivate *priv = g_paste_ui_history_actions_get_instance_private (G_PASTE_UI_HISTORY_ACTIONS (object));
76
77 g_clear_object (&priv->client);
78
79 G_OBJECT_CLASS (g_paste_ui_history_actions_parent_class)->dispose (object);
80 }
81
82 static void
83 g_paste_ui_history_actions_class_init (GPasteUiHistoryActionsClass *klass)
84 {
85 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_history_actions_dispose;
86 }
87
88 static void
89 g_paste_ui_history_actions_init (GPasteUiHistoryActions *self G_GNUC_UNUSED)
90 {
91 }
92
93 /**
94 * g_paste_ui_history_actions_new:
95 * @client: a #GPasteClient instance
96 * @settings: a #GPasteSettings instance
97 * @rootwin: the root #GtkWindow
98 *
99 * Create a new instance of #GPasteUiHistoryActions
100 *
101 * Returns: a newly allocated #GPasteUiHistoryActions
102 * free it with g_object_unref
103 */
104 G_PASTE_VISIBLE GtkWidget *
105 g_paste_ui_history_actions_new (GPasteClient *client,
106 GPasteSettings *settings,
107 GtkWindow *rootwin)
108 {
109 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
110 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
111 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
112
113 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_HISTORY_ACTIONS,
114 "width-request", 200,
115 "height-request", 40,
116 NULL);
117 GPasteUiHistoryActionsPrivate *priv = g_paste_ui_history_actions_get_instance_private (G_PASTE_UI_HISTORY_ACTIONS (self));
118 GtkWidget *box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
119 GtkWidget *backup = g_paste_ui_backup_history_new (client, settings, self, rootwin);
120 GtkWidget *delete = g_paste_ui_delete_history_new (client, settings, self, rootwin);
121 GtkWidget *empty = g_paste_ui_empty_history_new (client, settings, self, rootwin);
122
123 priv->client = g_object_ref (client);
124 priv->actions = g_slist_append (priv->actions, backup);
125 priv->actions = g_slist_append (priv->actions, empty);
126 priv->actions = g_slist_append (priv->actions, delete);
127
128 gtk_popover_set_position (GTK_POPOVER (self), GTK_POS_RIGHT);
129
130 g_slist_foreach (priv->actions, add_action_to_box, box);
131 gtk_widget_set_margin_top (box, 5);
132 gtk_widget_set_margin_bottom (box, 5);
133 gtk_widget_show_all (box);
134
135 gtk_container_add (GTK_CONTAINER (self), box);
136
137 return self;
138 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_HISTORY_ACTIONS_H__
11 #define __G_PASTE_UI_HISTORY_ACTIONS_H__
12
13 #include <gpaste-settings.h>
14 #include <gpaste-ui-panel-history.h>
15
16 G_BEGIN_DECLS
17
18 #define G_PASTE_TYPE_UI_HISTORY_ACTIONS (g_paste_ui_history_actions_get_type ())
19
20 G_PASTE_FINAL_TYPE (UiHistoryActions, ui_history_actions, UI_HISTORY_ACTIONS, GtkPopover)
21
22 void g_paste_ui_history_actions_set_relative_to (GPasteUiHistoryActions *self,
23 GPasteUiPanelHistory *history);
24
25 GtkWidget *g_paste_ui_history_actions_new (GPasteClient *client,
26 GPasteSettings *settings,
27 GtkWindow *rootwin);
28
29 G_END_DECLS
30
31 #endif /*__G_PASTE_UI_HISTORY_ACTIONS_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-gsettings-keys.h>
7 #include <gpaste-ui-empty-item.h>
8 #include <gpaste-ui-history.h>
9 #include <gpaste-ui-item.h>
10 #include <gpaste-update-enums.h>
11
12 #include "gpaste-gtk-compat.h"
13
14 struct _GPasteUiHistory
15 {
16 GtkListBox parent_instance;
17 };
18
19 enum
20 {
21 C_SIZE,
22 C_UPDATE,
23
24 C_LAST_SIGNAL
25 };
26
27 typedef struct
28 {
29 GPasteClient *client;
30 GPasteSettings *settings;
31 GPasteUiPanel *panel;
32 GPasteUiEmptyItem *dummy_item;
33
34 GtkWindow *rootwin;
35
36 GSList *items;
37 guint64 size;
38 gint32 item_height;
39
40 gchar *search;
41 GStrv search_results;
42
43 guint64 c_signals[C_LAST_SIGNAL];
44 } GPasteUiHistoryPrivate;
45
46 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiHistory, ui_history, GTK_TYPE_LIST_BOX)
47
48 static void
49 on_row_activated (GtkListBox *history G_GNUC_UNUSED,
50 GtkListBoxRow *row)
51 {
52 g_paste_ui_item_activate (G_PASTE_UI_ITEM (row));
53 }
54
55 static void
56 g_paste_ui_history_add_item (gpointer data,
57 gpointer user_data)
58 {
59 GtkContainer *self = user_data;
60 GtkWidget *item = data;
61
62 g_object_ref (item);
63 gtk_container_add (self, item);
64 gtk_widget_show_all (item);
65 }
66
67 static void
68 g_paste_ui_history_add_list (GtkContainer *self,
69 GSList *list)
70 {
71 g_slist_foreach (list, g_paste_ui_history_add_item, self);
72 }
73
74 static void
75 g_paste_ui_history_remove (gpointer data,
76 gpointer user_data)
77 {
78 GtkWidget *item = data;
79 GtkContainer *self = user_data;
80
81 gtk_container_remove (self, item);
82 g_object_unref (item);
83 }
84
85 static void
86 g_paste_ui_history_drop_list (GtkContainer *self,
87 GSList *list)
88 {
89 g_slist_foreach (list, g_paste_ui_history_remove, self);
90 g_slist_free (list);
91 }
92
93 static void g_paste_ui_history_refresh (GPasteUiHistory *self,
94 guint64 from_index);
95
96 static void
97 g_paste_ui_history_update_height_request (GPasteSettings *settings,
98 const gchar *key G_GNUC_UNUSED,
99 gpointer user_data)
100 {
101 GPasteUiHistory *self = user_data;
102 const GPasteUiHistoryPrivate *priv = _g_paste_ui_history_get_instance_private (self);
103 guint64 new_size = g_paste_settings_get_max_displayed_history_size (settings);
104
105 if (priv->item_height)
106 g_object_set (G_OBJECT (self), "height-request", new_size * priv->item_height, NULL);
107
108 if (new_size != priv->size)
109 g_paste_ui_history_refresh (self, 0);
110 }
111
112 typedef struct {
113 GPasteUiHistory *self;
114 gchar *name;
115 guint64 from_index;
116 } OnUpdateCallbackData;
117
118 static void
119 g_paste_ui_history_refresh_history (GObject *source_object G_GNUC_UNUSED,
120 GAsyncResult *res,
121 gpointer user_data)
122 {
123 g_autofree OnUpdateCallbackData *data = user_data;
124 g_autofree gchar *name = data->name;
125 GPasteUiHistory *self = data->self;
126 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (self);
127
128 guint64 old_size = priv->size;
129 guint64 refreshTextBound = old_size;
130 guint64 new_size = g_paste_client_get_history_size_finish (priv->client, res, NULL);
131 guint64 max_size = g_paste_settings_get_max_displayed_history_size (priv->settings);
132
133 priv->size = MIN (new_size, max_size);
134
135 if (priv->size)
136 gtk_widget_hide (GTK_WIDGET (priv->dummy_item));
137 else
138 g_paste_ui_empty_item_show_empty (priv->dummy_item);
139
140 g_paste_ui_panel_update_history_length (priv->panel, name, new_size);
141
142 if (old_size < priv->size)
143 {
144 for (guint64 i = old_size; i < priv->size; ++i)
145 {
146 GtkWidget *item = g_paste_ui_item_new (priv->client, priv->settings, priv->rootwin, i);
147 priv->items = g_slist_append (priv->items, item);
148 }
149 g_paste_ui_history_add_list (GTK_CONTAINER (self), g_slist_nth (priv->items, old_size));
150 refreshTextBound = old_size;
151 }
152 else if (old_size > priv->size)
153 {
154 if (priv->size)
155 {
156 GSList *last = g_slist_nth (priv->items, priv->size - 1);
157 g_return_if_fail (last);
158 g_paste_ui_history_drop_list (GTK_CONTAINER (self), g_slist_next (last));
159 last->next = NULL;
160 }
161 else
162 {
163 g_paste_ui_history_drop_list (GTK_CONTAINER (self), priv->items);
164 priv->items = NULL;
165 }
166 refreshTextBound = priv->size;
167 }
168
169 GSList *item = priv->items;
170
171 for (guint64 i = 0; i < data->from_index; ++i)
172 item = g_slist_next (item);
173 for (guint64 i = data->from_index; i < refreshTextBound && item; ++i, item = g_slist_next (item))
174 g_paste_ui_item_set_index (item->data, i);
175
176 if (!priv->item_height)
177 {
178 gtk_widget_measure (GTK_WIDGET ((priv->items) ? priv->items->data : priv->dummy_item), GTK_ORIENTATION_VERTICAL, -1, NULL, &priv->item_height, NULL, NULL);
179 g_paste_ui_history_update_height_request (priv->settings, NULL, self);
180 }
181 }
182
183 static void
184 on_name_ready (GObject *source_object G_GNUC_UNUSED,
185 GAsyncResult *res,
186 gpointer user_data)
187 {
188 OnUpdateCallbackData *data = user_data;
189 const GPasteUiHistoryPrivate *priv = _g_paste_ui_history_get_instance_private (data->self);
190
191 data->name = g_paste_client_get_history_name_finish (priv->client, res, NULL);
192
193 g_paste_client_get_history_size (priv->client, data->name, g_paste_ui_history_refresh_history, data);
194 }
195
196 static void
197 g_paste_ui_history_refresh (GPasteUiHistory *self,
198 guint64 from_index)
199 {
200 const GPasteUiHistoryPrivate *priv = _g_paste_ui_history_get_instance_private (self);
201
202 if (priv->search)
203 {
204 g_paste_ui_history_search (self, priv->search);
205 }
206 else
207 {
208 OnUpdateCallbackData *data = g_new (OnUpdateCallbackData, 1);
209 data->self = self;
210 data->from_index = from_index;
211
212 g_paste_client_get_history_name (priv->client, on_name_ready, data);
213 }
214 }
215
216 static void
217 on_search_ready (GObject *source_object G_GNUC_UNUSED,
218 GAsyncResult *res,
219 gpointer user_data)
220 {
221 GPasteUiHistory *self = user_data;
222 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (self);
223 GSList *item = priv->items;
224
225 g_clear_pointer (&priv->search_results, g_strfreev);
226 priv->search_results = g_paste_client_search_finish (priv->client, res, NULL /* error */);
227 guint64 search_results_size = g_strv_length (priv->search_results);
228
229 if (priv->search_results)
230 {
231 if (search_results_size > priv->size)
232 search_results_size = priv->size;
233
234 for (guint64 i = 0; i < search_results_size; ++i, item = g_slist_next (item))
235 g_paste_ui_item_set_uuid (item->data, priv->search_results[i]);
236 }
237 else
238 {
239 g_paste_ui_empty_item_show_no_result (priv->dummy_item);
240 }
241
242 for (guint64 i = search_results_size; i < priv->size; ++i, item = g_slist_next (item))
243 g_paste_ui_item_set_index (item->data, (guint64) -1);
244 }
245
246 /**
247 * g_paste_ui_history_search:
248 * @self: a #GPasteUiHistory instance
249 * @search: the search
250 *
251 * Apply a search to a #GPasteUiHistory instance
252 */
253 G_PASTE_VISIBLE void
254 g_paste_ui_history_search (GPasteUiHistory *self,
255 const gchar *search)
256 {
257 g_return_if_fail (_G_PASTE_IS_UI_HISTORY (self));
258
259 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (self);
260
261 if (g_paste_str_equal (search, ""))
262 {
263 g_clear_pointer (&priv->search, g_free);
264 g_clear_pointer (&priv->search_results, g_strfreev);
265 g_paste_ui_history_refresh (self, 0);
266 }
267 else
268 {
269 if (search != priv->search)
270 {
271 g_free (priv->search);
272 priv->search = g_strdup (search);
273 }
274 g_paste_client_search (priv->client, search, on_search_ready, self);
275 }
276 }
277
278 /**
279 * g_paste_ui_history_select_first:
280 * @self: a #GPasteUiHistory instance
281 *
282 * Select the first element
283 *
284 * returns: whether anything was selected or not
285 */
286 G_PASTE_VISIBLE gboolean
287 g_paste_ui_history_select_first (GPasteUiHistory *self)
288 {
289 g_return_val_if_fail (_G_PASTE_IS_UI_HISTORY (self), FALSE);
290
291 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (self);
292
293 if (!priv->items)
294 return FALSE;
295
296 return g_paste_ui_item_activate (priv->items->data);
297 }
298
299 static void
300 g_paste_ui_history_on_update (GPasteClient *client G_GNUC_UNUSED,
301 GPasteUpdateAction action,
302 GPasteUpdateTarget target,
303 guint64 position,
304 gpointer user_data)
305 {
306 GPasteUiHistory *self = user_data;
307 const GPasteUiHistoryPrivate *priv = _g_paste_ui_history_get_instance_private (self);
308 gboolean refresh = FALSE;
309
310 switch (target)
311 {
312 case G_PASTE_UPDATE_TARGET_ALL:
313 refresh = TRUE;
314 break;
315 case G_PASTE_UPDATE_TARGET_POSITION:
316 switch (action)
317 {
318 case G_PASTE_UPDATE_ACTION_REPLACE:
319 g_paste_ui_item_refresh (g_slist_nth_data (priv->items, position));
320 break;
321 case G_PASTE_UPDATE_ACTION_REMOVE:
322 refresh = TRUE;
323 break;
324 default:
325 g_assert_not_reached ();
326 }
327 break;
328 default:
329 g_assert_not_reached ();
330 }
331
332 if (refresh)
333 g_paste_ui_history_refresh (self, position);
334 }
335
336 static void
337 g_paste_ui_history_dispose (GObject *object)
338 {
339 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (G_PASTE_UI_HISTORY (object));
340
341 if (priv->settings)
342 {
343 g_signal_handler_disconnect (priv->settings, priv->c_signals[C_SIZE]);
344 g_clear_object (&priv->settings);
345 }
346
347 if (priv->client)
348 {
349 g_signal_handler_disconnect (priv->client, priv->c_signals[C_UPDATE]);
350 g_clear_object (&priv->client);
351 }
352
353 G_OBJECT_CLASS (g_paste_ui_history_parent_class)->dispose (object);
354 }
355
356 static void
357 g_paste_ui_history_finalize (GObject *object)
358 {
359 const GPasteUiHistoryPrivate *priv = _g_paste_ui_history_get_instance_private (G_PASTE_UI_HISTORY (object));
360
361 g_free (priv->search);
362 g_strfreev (priv->search_results);
363
364 G_OBJECT_CLASS (g_paste_ui_history_parent_class)->finalize (object);
365 }
366
367 static void
368 g_paste_ui_history_class_init (GPasteUiHistoryClass *klass)
369 {
370 GObjectClass *object_class = G_OBJECT_CLASS (klass);
371
372 object_class->dispose = g_paste_ui_history_dispose;
373 object_class->finalize = g_paste_ui_history_finalize;
374
375 GTK_LIST_BOX_CLASS (klass)->row_activated = on_row_activated;
376 }
377
378 static void
379 g_paste_ui_history_init (GPasteUiHistory *self G_GNUC_UNUSED)
380 {
381 }
382
383 /**
384 * g_paste_ui_history_new:
385 * @client: a #GPasteClient instance
386 * @settings: a #GPasteSettings instance
387 * @panel: the #GPasteSettingsUiPanel
388 * @rootwin: the root #GtkWindow
389 *
390 * Create a new instance of #GPasteUiHistory
391 *
392 * Returns: a newly allocated #GPasteUiHistory
393 * free it with g_object_unref
394 */
395 G_PASTE_VISIBLE GtkWidget *
396 g_paste_ui_history_new (GPasteClient *client,
397 GPasteSettings *settings,
398 GPasteUiPanel *panel,
399 GtkWindow *rootwin)
400 {
401 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
402 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
403 g_return_val_if_fail (_G_PASTE_IS_UI_PANEL (panel), NULL);
404 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
405
406 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_HISTORY, NULL);
407 GPasteUiHistoryPrivate *priv = g_paste_ui_history_get_instance_private (G_PASTE_UI_HISTORY (self));
408 GtkWidget *dummy_item = g_paste_ui_empty_item_new (client, settings, rootwin);
409
410 priv->client = g_object_ref (client);
411 priv->settings = g_object_ref (settings);
412 priv->dummy_item = G_PASTE_UI_EMPTY_ITEM (dummy_item);
413 priv->panel = panel;
414 priv->rootwin = rootwin;
415
416 gtk_container_add (GTK_CONTAINER (self), dummy_item);
417
418 priv->c_signals[C_SIZE] = g_signal_connect (settings,
419 "changed::" G_PASTE_MAX_DISPLAYED_HISTORY_SIZE_SETTING,
420 G_CALLBACK (g_paste_ui_history_update_height_request),
421 self);
422 priv->c_signals[C_UPDATE] = g_signal_connect (client,
423 "update",
424 G_CALLBACK (g_paste_ui_history_on_update),
425 self);
426
427 g_paste_ui_history_on_update (client, G_PASTE_UPDATE_ACTION_REPLACE, G_PASTE_UPDATE_TARGET_ALL, 0, self);
428
429 return self;
430 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_HISTORY_H__
11 #define __G_PASTE_UI_HISTORY_H__
12
13 #include <gpaste-ui-panel.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_HISTORY (g_paste_ui_history_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiHistory, ui_history, UI_HISTORY, GtkListBox)
20
21 void g_paste_ui_history_search (GPasteUiHistory *self,
22 const gchar *search);
23
24 gboolean g_paste_ui_history_select_first (GPasteUiHistory *self);
25
26 GtkWidget *g_paste_ui_history_new (GPasteClient *client,
27 GPasteSettings *settings,
28 GPasteUiPanel *panel,
29 GtkWindow *rootwin);
30
31 G_END_DECLS
32
33 #endif /*__G_PASTE_UI_HISTORY_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-item-action.h>
7
8 typedef struct
9 {
10 GPasteClient *client;
11
12 gchar *uuid;
13 } GPasteUiItemActionPrivate;
14
15 G_PASTE_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (UiItemAction, ui_item_action, GTK_TYPE_BUTTON)
16
17 /**
18 * g_paste_ui_item_action_set_uuid:
19 * @self: a #GPasteUiItemAction instance
20 * @uuid: the uuid of the corresponding item
21 *
22 * Track a new uuid
23 */
24 G_PASTE_VISIBLE void
25 g_paste_ui_item_action_set_uuid (GPasteUiItemAction *self,
26 const gchar *uuid)
27 {
28 g_return_if_fail (_G_PASTE_IS_UI_ITEM_ACTION (self));
29
30 GPasteUiItemActionPrivate *priv = g_paste_ui_item_action_get_instance_private (self);
31 g_autofree gchar *old_uuid = priv->uuid;
32
33 priv->uuid = g_strdup (uuid);
34 }
35
36 static gboolean
37 g_paste_ui_item_action_button_press_event (GtkWidget *widget,
38 GdkEventButton *event G_GNUC_UNUSED)
39 {
40 GPasteUiItemAction *self = G_PASTE_UI_ITEM_ACTION (widget);
41 const GPasteUiItemActionPrivate *priv = _g_paste_ui_item_action_get_instance_private (self);
42 GPasteUiItemActionClass *klass = G_PASTE_UI_ITEM_ACTION_GET_CLASS (self);
43
44 if (klass->activate)
45 klass->activate (self, priv->client, priv->uuid);
46
47 return TRUE;
48 }
49
50 static void
51 g_paste_ui_item_action_dispose (GObject *object)
52 {
53 GPasteUiItemActionPrivate *priv = g_paste_ui_item_action_get_instance_private (G_PASTE_UI_ITEM_ACTION (object));
54
55 g_clear_object (&priv->client);
56 g_clear_pointer (&priv->uuid, g_free);
57
58 G_OBJECT_CLASS (g_paste_ui_item_action_parent_class)->dispose (object);
59 }
60
61 static void
62 g_paste_ui_item_action_class_init (GPasteUiItemActionClass *klass)
63 {
64 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_item_action_dispose;
65 GTK_WIDGET_CLASS (klass)->button_press_event = g_paste_ui_item_action_button_press_event;
66 }
67
68 static void
69 g_paste_ui_item_action_init (GPasteUiItemAction *self G_GNUC_UNUSED)
70 {
71 }
72
73 /**
74 * g_paste_ui_item_action_new:
75 * @type: the type of the subclass to instantiate
76 * @client: a #GPasteClient
77 * @icon_name: the name of the icon to use
78 * @tooltip: the tooltip to display
79 *
80 * Create a new instance of #GPasteUiItemAction
81 *
82 * Returns: a newly allocated #GPasteUiItemAction
83 * free it with g_object_unref
84 */
85 G_PASTE_VISIBLE GtkWidget *
86 g_paste_ui_item_action_new (GType type,
87 GPasteClient *client,
88 const gchar *icon_name,
89 const gchar *tooltip)
90 {
91 g_return_val_if_fail (g_type_is_a (type, G_PASTE_TYPE_UI_ITEM_ACTION), NULL);
92 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
93
94 GtkWidget *self = gtk_widget_new (type, NULL);
95 GPasteUiItemActionPrivate *priv = g_paste_ui_item_action_get_instance_private (G_PASTE_UI_ITEM_ACTION (self));
96 GtkWidget *icon = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
97
98 priv->client = g_object_ref (client);
99
100 gtk_widget_set_tooltip_text (self, tooltip);
101 gtk_widget_set_margin_start (icon, 5);
102 gtk_widget_set_margin_end (icon, 5);
103
104 gtk_container_add (GTK_CONTAINER (self), icon);
105
106 return self;
107 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_ITEM_ACTION_H__
11 #define __G_PASTE_UI_ITEM_ACTION_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_ITEM_ACTION (g_paste_ui_item_action_get_type ())
18
19 G_PASTE_DERIVABLE_TYPE (UiItemAction, ui_item_action, UI_ITEM_ACTION, GtkButton)
20
21 struct _GPasteUiItemActionClass
22 {
23 GtkButtonClass parent_class;
24
25 /*< pure virtual >*/
26 void (*activate) (GPasteUiItemAction *self,
27 GPasteClient *client,
28 const gchar *uuid);
29 };
30
31 void g_paste_ui_item_action_set_uuid (GPasteUiItemAction *self,
32 const gchar *uuid);
33
34 GtkWidget *g_paste_ui_item_action_new (GType type,
35 GPasteClient *client,
36 const gchar *icon_name,
37 const gchar *tooltip);
38
39 G_END_DECLS
40
41 #endif /*__G_PASTE_UI_ITEM_ACTION_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-gsettings-keys.h>
7 #include <gpaste-ui-delete-item.h>
8 #include <gpaste-ui-edit-item.h>
9 #include <gpaste-ui-item-skeleton.h>
10 #include <gpaste-ui-upload-item.h>
11
12 #include "gpaste-gtk-compat.h"
13
14 enum
15 {
16 C_SIZE,
17
18 C_LAST_SIGNAL
19 };
20
21 typedef struct
22 {
23 GPasteSettings *settings;
24
25 GSList *actions;
26 GtkWidget *edit;
27 GtkWidget *upload;
28
29 GtkLabel *index_label;
30 GtkLabel *label;
31
32 gboolean editable;
33 gboolean uploadable;
34
35 guint64 c_signals[C_LAST_SIGNAL];
36 } GPasteUiItemSkeletonPrivate;
37
38 G_PASTE_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (UiItemSkeleton, ui_item_skeleton, GTK_TYPE_LIST_BOX_ROW)
39
40 static void
41 g_paste_ui_item_skeleton_set_text_size (GPasteSettings *settings,
42 const gchar *key G_GNUC_UNUSED,
43 gpointer user_data)
44 {
45 GPasteUiItemSkeletonPrivate *priv = user_data;
46 guint64 size = g_paste_settings_get_element_size (settings);
47
48 gtk_label_set_width_chars (priv->label, size);
49 gtk_label_set_max_width_chars (priv->label, size);
50 }
51
52 static void
53 action_set_activatable (gpointer data,
54 gpointer user_data)
55 {
56 GtkWidget *w = data;
57 gboolean *a = user_data;
58
59 gtk_widget_set_sensitive (w, *a);
60 }
61
62 /**
63 * g_paste_ui_item_skeleton_set_activatable:
64 * @self: the #GPasteUiItemSkeleton instance
65 * @activatable: whether the item should now be activatable or not
66 *
67 * Mark the item as being activatable or not
68 */
69 G_PASTE_VISIBLE void
70 g_paste_ui_item_skeleton_set_activatable (GPasteUiItemSkeleton *self,
71 gboolean activatable)
72 {
73 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
74
75 const GPasteUiItemSkeletonPrivate *priv = _g_paste_ui_item_skeleton_get_instance_private (self);
76
77 gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (self), activatable);
78 gtk_widget_set_sensitive (GTK_WIDGET (priv->label), activatable);
79
80 g_slist_foreach (priv->actions, action_set_activatable, &activatable);
81
82 if (priv->edit)
83 gtk_widget_set_sensitive (priv->edit, activatable && priv->editable);
84 if (priv->upload)
85 gtk_widget_set_sensitive (priv->upload, activatable && priv->uploadable);
86 }
87
88 /**
89 * g_paste_ui_item_skeleton_set_editable:
90 * @self: the #GPasteUiItemSkeleton instance
91 * @editable: whether the item should now be editable or not
92 *
93 * Mark the item as being editable or not
94 */
95 G_PASTE_VISIBLE void
96 g_paste_ui_item_skeleton_set_editable (GPasteUiItemSkeleton *self,
97 gboolean editable)
98 {
99 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
100
101 GPasteUiItemSkeletonPrivate *priv = g_paste_ui_item_skeleton_get_instance_private (self);
102
103 priv->editable = editable;
104
105 gtk_widget_set_sensitive (priv->edit, editable);
106 }
107
108 /**
109 * g_paste_ui_item_skeleton_set_uploadable:
110 * @self: the #GPasteUiItemSkeleton instance
111 * @uploadable: whether the item should now be uploadable or not
112 *
113 * Mark the item as being uploadable or not
114 */
115 G_PASTE_VISIBLE void
116 g_paste_ui_item_skeleton_set_uploadable (GPasteUiItemSkeleton *self,
117 gboolean uploadable)
118 {
119 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
120
121 GPasteUiItemSkeletonPrivate *priv = g_paste_ui_item_skeleton_get_instance_private (self);
122
123 priv->uploadable = uploadable;
124
125 gtk_widget_set_sensitive (priv->upload, uploadable);
126 }
127
128 /**
129 * g_paste_ui_item_skeleton_set_text:
130 * @self: the #GPasteUiItemSkeleton instance
131 * @text: the new text for the label
132 *
133 * Changes the displayed text
134 */
135 G_PASTE_VISIBLE void
136 g_paste_ui_item_skeleton_set_text (GPasteUiItemSkeleton *self,
137 const gchar *text)
138 {
139 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
140 g_return_if_fail (g_utf8_validate (text, -1, NULL));
141
142 const GPasteUiItemSkeletonPrivate *priv = _g_paste_ui_item_skeleton_get_instance_private (self);
143
144 gtk_label_set_text (priv->label, text);
145 }
146
147 /**
148 * g_paste_ui_item_skeleton_set_markup:
149 * @self: the #GPasteUiItemSkeleton instance
150 * @markup: the new markup for the label
151 *
152 * Changes the displayed markup
153 */
154 G_PASTE_VISIBLE void
155 g_paste_ui_item_skeleton_set_markup (GPasteUiItemSkeleton *self,
156 const gchar *markup)
157 {
158 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
159 g_return_if_fail (g_utf8_validate (markup, -1, NULL));
160
161 const GPasteUiItemSkeletonPrivate *priv = _g_paste_ui_item_skeleton_get_instance_private (self);
162
163 gtk_label_set_markup (priv->label, markup);
164 }
165
166 static void
167 action_set_uuid (gpointer data,
168 gpointer user_data)
169 {
170 GPasteUiItemAction *a = data;
171 const gchar *uuid = user_data;
172
173 g_paste_ui_item_action_set_uuid (a, uuid);
174 }
175
176 /**
177 * g_paste_ui_item_skeleton_set_index_and_uuid:
178 * @self: the #GPasteUiItemSkeleton instance
179 * @index: the index of the new item to display
180 * @uuid: the uuid of the new item to display
181 *
182 * Changes the displayed item
183 */
184 G_PASTE_VISIBLE void
185 g_paste_ui_item_skeleton_set_index_and_uuid (GPasteUiItemSkeleton *self,
186 guint64 index,
187 const gchar *uuid)
188 {
189 g_return_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self));
190
191 const GPasteUiItemSkeletonPrivate *priv = _g_paste_ui_item_skeleton_get_instance_private (self);
192
193 if (index == (guint64) -1 || index == (guint64) -2)
194 {
195 gtk_label_set_text (priv->index_label, "");
196 }
197 else
198 {
199 g_autofree gchar *_index = g_strdup_printf("%" G_GUINT64_FORMAT, index);
200
201 gtk_label_set_text (priv->index_label, _index);
202 }
203
204 g_slist_foreach (priv->actions, action_set_uuid, (gpointer) uuid);
205 }
206
207 /**
208 * g_paste_ui_item_skeleton_get_label:
209 * @self: the #GPasteUiItemSkeleton instance
210 *
211 * Get the inner label
212 *
213 * Returns: (transfer none): The inner #GtkLabel
214 */
215 G_PASTE_VISIBLE GtkLabel *
216 g_paste_ui_item_skeleton_get_label (GPasteUiItemSkeleton *self)
217 {
218 g_return_val_if_fail (_G_PASTE_IS_UI_ITEM_SKELETON (self), NULL);
219
220 const GPasteUiItemSkeletonPrivate *priv = _g_paste_ui_item_skeleton_get_instance_private (self);
221
222 return priv->label;
223 }
224
225 static void
226 add_action (gpointer data,
227 gpointer user_data)
228 {
229 GtkWidget *w = data;
230 GtkBox *b =user_data;
231
232 gtk_widget_set_halign (w, TRUE);
233 gtk_box_pack_end (b, w);
234 }
235
236 static void
237 g_paste_ui_item_skeleton_dispose (GObject *object)
238 {
239 GPasteUiItemSkeletonPrivate *priv = g_paste_ui_item_skeleton_get_instance_private (G_PASTE_UI_ITEM_SKELETON (object));
240
241 if (priv->settings)
242 {
243 g_signal_handler_disconnect (priv->settings, priv->c_signals[C_SIZE]);
244 g_clear_object (&priv->settings);
245 }
246
247 G_OBJECT_CLASS (g_paste_ui_item_skeleton_parent_class)->dispose (object);
248 }
249
250 static void
251 g_paste_ui_item_skeleton_class_init (GPasteUiItemSkeletonClass *klass)
252 {
253 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_item_skeleton_dispose;
254 }
255
256 static void
257 g_paste_ui_item_skeleton_init (GPasteUiItemSkeleton *self)
258 {
259 GPasteUiItemSkeletonPrivate *priv = g_paste_ui_item_skeleton_get_instance_private (self);
260
261 GtkWidget *index_label = gtk_label_new ("");
262 GtkWidget *label = gtk_label_new ("");
263
264 priv->index_label = GTK_LABEL (index_label);
265 priv->label = GTK_LABEL (label);
266 priv->editable = TRUE;
267
268 gtk_widget_set_margin_start (index_label, 5);
269 gtk_widget_set_margin_end (index_label, 5);
270 gtk_widget_set_margin_top (index_label, 5);
271 gtk_widget_set_margin_bottom (index_label, 5);
272 gtk_widget_set_sensitive (index_label, FALSE);
273 gtk_label_set_xalign (priv->index_label, 1.0);
274 gtk_label_set_width_chars (priv->index_label, 3);
275 gtk_label_set_max_width_chars (priv->index_label, 3);
276 gtk_label_set_selectable (priv->index_label, FALSE);
277 gtk_label_set_ellipsize (priv->label, PANGO_ELLIPSIZE_END);
278 gtk_label_set_xalign (priv->label, 0.0);
279
280 GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
281 gtk_widget_set_margin_start (hbox, 5);
282 gtk_widget_set_margin_end (hbox, 5);
283 gtk_widget_set_halign (index_label, TRUE);
284 gtk_box_pack_start (GTK_BOX (hbox), index_label, FALSE, TRUE);
285 gtk_widget_set_hexpand (label, TRUE);
286 gtk_widget_set_halign (label, TRUE);
287 gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE);
288
289 gtk_container_add (GTK_CONTAINER (self), hbox);
290 }
291
292 /**
293 * g_paste_ui_item_skeleton_new:
294 * @type: the type of the subclass
295 * @client: a #GPasteClient instance
296 * @settings: a #GPasteSettings instance
297 * @rootwin: the root #GtkWindow
298 *
299 * Create a new instance of #GPasteUiItemSkeleton
300 *
301 * Returns: a newly allocated #GPasteUiItemSkeleton
302 * free it with g_object_unref
303 */
304 G_PASTE_VISIBLE GtkWidget *
305 g_paste_ui_item_skeleton_new (GType type,
306 GPasteClient *client,
307 GPasteSettings *settings,
308 GtkWindow *rootwin)
309 {
310 g_return_val_if_fail (g_type_is_a (type, G_PASTE_TYPE_UI_ITEM_SKELETON), NULL);
311 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
312 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
313 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
314
315 GtkWidget *self = gtk_widget_new (type, "selectable", FALSE, NULL);
316 GPasteUiItemSkeletonPrivate *priv = g_paste_ui_item_skeleton_get_instance_private (G_PASTE_UI_ITEM_SKELETON (self));
317 GtkWidget *edit = g_paste_ui_edit_item_new (client, rootwin);
318 GtkWidget *upload = g_paste_ui_upload_item_new (client);
319 GtkWidget *delete = g_paste_ui_delete_item_new (client);
320
321 priv->settings = g_object_ref (settings);
322 priv->edit = edit;
323 priv->upload = upload;
324
325 priv->actions = g_slist_prepend (priv->actions, edit);
326 priv->actions = g_slist_prepend (priv->actions, upload);
327 priv->actions = g_slist_prepend (priv->actions, delete);
328
329 g_slist_foreach (priv->actions, add_action, gtk_bin_get_child (GTK_BIN (self)));
330
331 priv->c_signals[C_SIZE] = g_signal_connect (settings,
332 "changed::" G_PASTE_ELEMENT_SIZE_SETTING,
333 G_CALLBACK (g_paste_ui_item_skeleton_set_text_size),
334 priv);
335 g_paste_ui_item_skeleton_set_text_size (settings, NULL, priv);
336
337 return self;
338 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_ITEM_SKELETON_H__
11 #define __G_PASTE_UI_ITEM_SKELETON_H__
12
13 #include <gpaste-client.h>
14 #include <gpaste-settings.h>
15
16 G_BEGIN_DECLS
17
18 #define G_PASTE_TYPE_UI_ITEM_SKELETON (g_paste_ui_item_skeleton_get_type ())
19
20 G_PASTE_DERIVABLE_TYPE (UiItemSkeleton, ui_item_skeleton, UI_ITEM_SKELETON, GtkListBoxRow)
21
22 struct _GPasteUiItemSkeletonClass
23 {
24 GtkListBoxRowClass parent_class;
25 };
26
27 void g_paste_ui_item_skeleton_set_activatable (GPasteUiItemSkeleton *self,
28 gboolean activatable);
29 void g_paste_ui_item_skeleton_set_editable (GPasteUiItemSkeleton *self,
30 gboolean editable);
31 void g_paste_ui_item_skeleton_set_uploadable (GPasteUiItemSkeleton *self,
32 gboolean uploadable);
33
34 void g_paste_ui_item_skeleton_set_text (GPasteUiItemSkeleton *self,
35 const gchar *text);
36 void g_paste_ui_item_skeleton_set_markup (GPasteUiItemSkeleton *self,
37 const gchar *markup);
38
39 void g_paste_ui_item_skeleton_set_index_and_uuid (GPasteUiItemSkeleton *self,
40 guint64 index,
41 const gchar *uuid);
42
43 GtkLabel *g_paste_ui_item_skeleton_get_label (GPasteUiItemSkeleton *self);
44
45 GtkWidget *g_paste_ui_item_skeleton_new (GType type,
46 GPasteClient *client,
47 GPasteSettings *settings,
48 GtkWindow *rootwin);
49
50 G_END_DECLS
51
52 #endif /*__G_PASTE_UI_ITEM_SKELETON_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-item.h>
7 #include <gpaste-util.h>
8
9 struct _GPasteUiItem
10 {
11 GPasteUiItemSkeleton parent_instance;
12 };
13
14 typedef struct
15 {
16 GPasteClient *client;
17 GPasteSettings *settings;
18
19 GtkWindow *rootwin;
20
21 guint64 index;
22 gboolean fake_index;
23 gchar *uuid;
24
25 guint64 size_id;
26 } GPasteUiItemPrivate;
27
28 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiItem, ui_item, G_PASTE_TYPE_UI_ITEM_SKELETON)
29
30 /**
31 * g_paste_ui_item_activate:
32 * @self: a #GPasteUiItem instance
33 *
34 * Activate/Select the item
35 *
36 * returns: whether there was anything to select or not
37 */
38 G_PASTE_VISIBLE gboolean
39 g_paste_ui_item_activate (GPasteUiItem *self)
40 {
41 g_return_val_if_fail (_G_PASTE_IS_UI_ITEM (self), FALSE);
42
43 const GPasteUiItemPrivate *priv = _g_paste_ui_item_get_instance_private (self);
44
45 if (!priv->uuid)
46 return FALSE;
47
48 g_paste_client_select (priv->client, priv->uuid, NULL, NULL);
49
50 if (g_paste_settings_get_close_on_select (priv->settings))
51 gtk_window_close (priv->rootwin); /* Exit the application */
52
53 return TRUE;
54 }
55
56 static void
57 g_paste_ui_item_on_kind_ready (GObject *source_object G_GNUC_UNUSED,
58 GAsyncResult *res,
59 gpointer user_data)
60 {
61 GPasteUiItem *self = user_data;
62 const GPasteUiItemPrivate *priv = _g_paste_ui_item_get_instance_private (self);
63 g_autoptr (GError) error = NULL;
64 GPasteItemKind kind = g_paste_client_get_element_kind_finish (priv->client, res, &error);
65
66 if (error)
67 return;
68
69 GPasteUiItemSkeleton *sk = G_PASTE_UI_ITEM_SKELETON (self);
70
71 g_paste_ui_item_skeleton_set_editable (sk, kind == G_PASTE_ITEM_KIND_TEXT);
72 g_paste_ui_item_skeleton_set_uploadable (sk, kind == G_PASTE_ITEM_KIND_TEXT);
73 }
74
75 static void
76 _g_paste_ui_item_ready (GPasteUiItem *self,
77 const gchar *txt)
78 {
79 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (self);
80 g_autofree gchar *oneline = g_paste_util_replace (txt, "\n", " ");
81
82 g_paste_client_get_element_kind (priv->client, priv->uuid, g_paste_ui_item_on_kind_ready, self);
83 g_paste_ui_item_skeleton_set_index_and_uuid (G_PASTE_UI_ITEM_SKELETON (self), priv->index, priv->uuid);
84
85 if (!priv->index)
86 {
87 g_autofree gchar *markup = g_markup_printf_escaped ("<b>%s</b>", oneline);
88 g_paste_ui_item_skeleton_set_markup (G_PASTE_UI_ITEM_SKELETON (self), markup);
89 }
90 else
91 {
92 g_paste_ui_item_skeleton_set_text (G_PASTE_UI_ITEM_SKELETON (self), oneline);
93 }
94 }
95
96 static void
97 g_paste_ui_item_on_text_ready (GObject *source_object G_GNUC_UNUSED,
98 GAsyncResult *res,
99 gpointer user_data)
100 {
101 GPasteUiItem *self = user_data;
102 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (self);
103 g_autoptr (GError) error = NULL;
104 g_autofree gchar *txt = g_paste_client_get_element_finish (priv->client, res, &error);
105
106 if (!txt || error)
107 return;
108
109 _g_paste_ui_item_ready (self, txt);
110 }
111
112 static void
113 g_paste_ui_item_on_item_ready (GObject *source_object G_GNUC_UNUSED,
114 GAsyncResult *res,
115 gpointer user_data)
116 {
117 GPasteUiItem *self = user_data;
118 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (self);
119 g_autoptr (GError) error = NULL;
120 g_autoptr (GPasteClientItem) txt = g_paste_client_get_element_at_index_finish (priv->client, res, &error);
121
122 if (!txt || error)
123 return;
124
125 g_autofree gchar *uuid = priv->uuid;
126 priv->uuid = g_strdup (g_paste_client_item_get_uuid (txt));
127
128 _g_paste_ui_item_ready (self, g_paste_client_item_get_value (txt));
129 }
130
131 static void
132 g_paste_ui_item_reset_text (GPasteUiItem *self)
133 {
134 g_return_if_fail (_G_PASTE_IS_UI_ITEM (self));
135
136 const GPasteUiItemPrivate *priv = _g_paste_ui_item_get_instance_private (self);
137
138 if (priv->fake_index)
139 g_paste_client_get_element (priv->client, priv->uuid, g_paste_ui_item_on_text_ready, self);
140 else
141 g_paste_client_get_element_at_index (priv->client, priv->index, g_paste_ui_item_on_item_ready, self);
142 }
143
144 /**
145 * g_paste_ui_item_refresh:
146 * @self: a #GPasteUiItem instance
147 *
148 * Refresh the item
149 */
150 G_PASTE_VISIBLE void
151 g_paste_ui_item_refresh (GPasteUiItem *self)
152 {
153 g_return_if_fail (_G_PASTE_IS_UI_ITEM (self));
154
155 g_paste_ui_item_reset_text (self);
156 }
157
158 static void
159 _g_paste_ui_item_set_index (GPasteUiItem *self,
160 guint64 index,
161 gboolean fake_index)
162 {
163 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (self);
164
165 priv->index = index;
166 priv->fake_index = fake_index;
167
168 if (index != (guint64) -1)
169 {
170 g_paste_ui_item_reset_text (self);
171 gtk_widget_show (GTK_WIDGET (self));
172 }
173 else if (priv->uuid)
174 {
175 gtk_widget_hide (GTK_WIDGET (self));
176 }
177 }
178
179 /**
180 * g_paste_ui_item_set_index:
181 * @self: a #GPasteUiItem instance
182 * @index: the index of the corresponding item
183 *
184 * Track a new index
185 */
186 G_PASTE_VISIBLE void
187 g_paste_ui_item_set_index (GPasteUiItem *self,
188 guint64 index)
189 {
190 g_return_if_fail (_G_PASTE_IS_UI_ITEM (self));
191
192 _g_paste_ui_item_set_index (self, index, FALSE);
193 }
194
195 /**
196 * g_paste_ui_item_set_uuid:
197 * @self: a #GPasteUiItem instance
198 * @uuid: the uuid of the corresponding item
199 *
200 * Track a new uuid
201 */
202 G_PASTE_VISIBLE void
203 g_paste_ui_item_set_uuid (GPasteUiItem *self,
204 const gchar *uuid)
205 {
206 g_return_if_fail (_G_PASTE_IS_UI_ITEM (self));
207
208 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (self);
209 g_autofree gchar *_uuid = priv->uuid;
210
211 priv->uuid = g_strdup (uuid);
212
213 _g_paste_ui_item_set_index (self, (guint64) -2, TRUE);
214 }
215
216 static void
217 g_paste_ui_item_dispose (GObject *object)
218 {
219 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (G_PASTE_UI_ITEM (object));
220
221 g_clear_object (&priv->client);
222 g_clear_object (&priv->settings);
223 g_clear_pointer (&priv->uuid, g_free);
224
225 G_OBJECT_CLASS (g_paste_ui_item_parent_class)->dispose (object);
226 }
227
228 static void
229 g_paste_ui_item_class_init (GPasteUiItemClass *klass)
230 {
231 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_item_dispose;
232 }
233
234 static void
235 g_paste_ui_item_init (GPasteUiItem *self)
236 {
237 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (G_PASTE_UI_ITEM (self));
238
239 priv->index = (guint64) -1;
240 }
241
242 /**
243 * g_paste_ui_item_new:
244 * @client: a #GPasteClient instance
245 * @settings: a #GPasteSettings instance
246 * @rootwin: the root #GtkWindow
247 * @index: the index of the corresponding item
248 *
249 * Create a new instance of #GPasteUiItem
250 *
251 * Returns: a newly allocated #GPasteUiItem
252 * free it with g_object_unref
253 */
254 G_PASTE_VISIBLE GtkWidget *
255 g_paste_ui_item_new (GPasteClient *client,
256 GPasteSettings *settings,
257 GtkWindow *rootwin,
258 guint64 index)
259 {
260 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
261 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
262 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
263
264 GtkWidget *self = g_paste_ui_item_skeleton_new (G_PASTE_TYPE_UI_ITEM, client, settings, rootwin);
265 GPasteUiItemPrivate *priv = g_paste_ui_item_get_instance_private (G_PASTE_UI_ITEM (self));
266
267 priv->client = g_object_ref (client);
268 priv->settings = g_object_ref (settings);
269 priv->rootwin = rootwin;
270
271 g_paste_ui_item_set_index (G_PASTE_UI_ITEM (self), index);
272
273 return self;
274 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_ITEM_H__
11 #define __G_PASTE_UI_ITEM_H__
12
13 #include <gpaste-ui-item-skeleton.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_ITEM (g_paste_ui_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiItem, ui_item, UI_ITEM, GPasteUiItemSkeleton)
20
21 gboolean g_paste_ui_item_activate (GPasteUiItem *self);
22 void g_paste_ui_item_refresh (GPasteUiItem *self);
23
24 void g_paste_ui_item_set_index (GPasteUiItem *self,
25 guint64 index);
26
27 void g_paste_ui_item_set_uuid (GPasteUiItem *self,
28 const gchar *uuid);
29
30 GtkWidget *g_paste_ui_item_new (GPasteClient *client,
31 GPasteSettings *settings,
32 GtkWindow *rootwin,
33 guint64 index);
34
35 G_END_DECLS
36
37 #endif /*__G_PASTE_UI_ITEM_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-new-item.h>
7
8 #include "gpaste-gtk-compat.h"
9
10 struct _GPasteUiNewItem
11 {
12 GtkButton parent_instance;
13 };
14
15 typedef struct
16 {
17 GPasteClient *client;
18
19 GtkWindow *rootwin;
20 } GPasteUiNewItemPrivate;
21
22 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiNewItem, ui_new_item, GTK_TYPE_BUTTON)
23
24 static void
25 g_paste_ui_new_item_clicked (GtkButton *self)
26 {
27 const GPasteUiNewItemPrivate *priv = _g_paste_ui_new_item_get_instance_private (G_PASTE_UI_NEW_ITEM (self));
28 GtkWidget *dialog = gtk_dialog_new_with_buttons (PACKAGE_STRING, priv->rootwin,
29 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_USE_HEADER_BAR,
30 _("New"), GTK_RESPONSE_OK,
31 _("Cancel"), GTK_RESPONSE_CANCEL,
32 NULL);
33 GtkDialog *d = GTK_DIALOG (dialog);
34 GtkWidget *text = gtk_text_view_new ();
35 GtkTextView *tv = GTK_TEXT_VIEW (text);
36 GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
37 GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW (scroll);
38
39 gtk_text_view_set_wrap_mode (tv, GTK_WRAP_WORD);
40 gtk_scrolled_window_set_min_content_height (sw, 300);
41 gtk_scrolled_window_set_min_content_width (sw, 600);
42 gtk_container_add (GTK_CONTAINER (sw), text);
43 gtk_widget_set_vexpand (scroll, TRUE);
44 gtk_widget_set_valign (scroll, TRUE);
45 gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (d)), scroll, TRUE, TRUE);
46 gtk_widget_show_all (scroll);
47
48 if (gtk_dialog_run (d) == GTK_RESPONSE_OK)
49 {
50 const gchar *txt;
51
52 g_object_get (G_OBJECT (gtk_text_view_get_buffer (tv)), "text", &txt, NULL);
53 if (txt && *txt)
54 g_paste_client_add (priv->client, txt, NULL, NULL);
55 }
56
57 gtk_widget_destroy (dialog);
58 }
59
60 static void
61 g_paste_ui_new_item_dispose (GObject *object)
62 {
63 GPasteUiNewItemPrivate *priv = g_paste_ui_new_item_get_instance_private (G_PASTE_UI_NEW_ITEM (object));
64
65 g_clear_object (&priv->client);
66
67 G_OBJECT_CLASS (g_paste_ui_new_item_parent_class)->dispose (object);
68 }
69
70 static void
71 g_paste_ui_new_item_class_init (GPasteUiNewItemClass *klass)
72 {
73 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_new_item_dispose;
74 GTK_BUTTON_CLASS (klass)->clicked = g_paste_ui_new_item_clicked;
75 }
76
77 static void
78 g_paste_ui_new_item_init (GPasteUiNewItem *self)
79 {
80 GtkWidget *widget = GTK_WIDGET (self);
81
82 gtk_widget_set_tooltip_text (widget, _("New"));
83 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
84 gtk_container_add (GTK_CONTAINER (self), gtk_image_new_from_icon_name ("document-new-symbolic", GTK_ICON_SIZE_BUTTON));
85 }
86
87 /**
88 * g_paste_ui_new_item_new:
89 * @rootwin: the root #GtkWindow
90 * @client: a #GPasteClient
91 *
92 * Create a new instance of #GPasteUiNewItem
93 *
94 * Returns: a newly allocated #GPasteUiNewItem
95 * free it with g_object_unref
96 */
97 G_PASTE_VISIBLE GtkWidget *
98 g_paste_ui_new_item_new (GtkWindow *rootwin,
99 GPasteClient *client)
100 {
101 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
102 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
103
104 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_NEW_ITEM, NULL);
105 GPasteUiNewItemPrivate *priv = g_paste_ui_new_item_get_instance_private (G_PASTE_UI_NEW_ITEM (self));
106
107 priv->client = g_object_ref (client);
108 priv->rootwin = rootwin;
109
110 return self;
111 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_NEW_ITEM_H__
11 #define __G_PASTE_UI_NEW_ITEM_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_NEW_ITEM (g_paste_ui_new_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiNewItem, ui_new_item, UI_NEW_ITEM, GtkButton)
20
21 GtkWidget *g_paste_ui_new_item_new (GtkWindow *rootwin,
22 GPasteClient *client);
23
24 G_END_DECLS
25
26 #endif /*__G_PASTE_UI_NEW_ITEM_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-panel-history.h>
7
8 #include "gpaste-gtk-compat.h"
9
10 struct _GPasteUiPanelHistory
11 {
12 GtkListBoxRow parent_instance;
13 };
14
15 typedef struct
16 {
17 GPasteClient *client;
18
19 GtkLabel *index_label;
20 GtkLabel *label;
21
22 gchar *history;
23 } GPasteUiPanelHistoryPrivate;
24
25 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiPanelHistory, ui_panel_history, GTK_TYPE_LIST_BOX_ROW)
26
27 /**
28 * g_paste_ui_panel_history_activate:
29 * @self: a #GPasteUiPanelHistory instance
30 *
31 * Switch to this history
32 */
33 G_PASTE_VISIBLE void
34 g_paste_ui_panel_history_activate (GPasteUiPanelHistory *self)
35 {
36 g_return_if_fail (_G_PASTE_IS_UI_PANEL_HISTORY (self));
37
38 const GPasteUiPanelHistoryPrivate *priv = _g_paste_ui_panel_history_get_instance_private (self);
39
40 g_paste_client_switch_history (priv->client, priv->history, NULL, NULL);
41 }
42
43 /**
44 * g_paste_ui_panel_history_set_length:
45 * @self: a #GPasteUiPanelHistory instance
46 * @length: the length of the #GPasteHistory
47 *
48 * Update the index label of this history
49 */
50 G_PASTE_VISIBLE void
51 g_paste_ui_panel_history_set_length (GPasteUiPanelHistory *self,
52 guint64 length)
53 {
54 g_return_if_fail (_G_PASTE_IS_UI_PANEL_HISTORY (self));
55
56 const GPasteUiPanelHistoryPrivate *priv = _g_paste_ui_panel_history_get_instance_private (self);
57 g_autofree gchar *_length = g_strdup_printf("%" G_GUINT64_FORMAT, length);
58
59 gtk_label_set_text (priv->index_label, _length);
60 }
61
62 /**
63 * g_paste_ui_panel_history_get_history:
64 * @self: a #GPasteUiPanelHistory instance
65 *
66 * Get the underlying history name
67 *
68 * Returns: the name of the history
69 */
70 G_PASTE_VISIBLE const gchar *
71 g_paste_ui_panel_history_get_history (const GPasteUiPanelHistory *self)
72 {
73 g_return_val_if_fail (_G_PASTE_IS_UI_PANEL_HISTORY (self), NULL);
74
75 const GPasteUiPanelHistoryPrivate *priv = _g_paste_ui_panel_history_get_instance_private ((GPasteUiPanelHistory *) self);
76
77 return priv->history;
78 }
79
80 static void
81 on_size_ready (GObject *source_object,
82 GAsyncResult *res,
83 gpointer user_data)
84 {
85 GPasteUiPanelHistory *self = user_data;
86
87 g_paste_ui_panel_history_set_length (self, g_paste_client_get_history_size_finish (G_PASTE_CLIENT (source_object), res, NULL));
88 }
89
90 static void
91 g_paste_ui_panel_history_dispose (GObject *object)
92 {
93 GPasteUiPanelHistoryPrivate *priv = g_paste_ui_panel_history_get_instance_private (G_PASTE_UI_PANEL_HISTORY (object));
94
95 g_clear_object (&priv->client);
96
97 G_OBJECT_CLASS (g_paste_ui_panel_history_parent_class)->dispose (object);
98 }
99
100 static void
101 g_paste_ui_panel_history_class_init (GPasteUiPanelHistoryClass *klass)
102 {
103 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_panel_history_dispose;
104 }
105
106 static void
107 g_paste_ui_panel_history_init (GPasteUiPanelHistory *self)
108 {
109 GPasteUiPanelHistoryPrivate *priv = g_paste_ui_panel_history_get_instance_private (self);
110 GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
111 GtkBox *box = GTK_BOX (hbox);
112 GtkWidget *l = gtk_label_new ("");
113 GtkLabel *label = priv->label = GTK_LABEL (l);
114 GtkWidget *il = gtk_label_new ("");
115 GtkLabel *index_label = priv->index_label = GTK_LABEL (il);
116
117 gtk_widget_set_sensitive (il, FALSE);
118 gtk_label_set_xalign (index_label, 1.0);
119 gtk_label_set_width_chars (index_label, 3);
120 gtk_label_set_selectable (index_label, FALSE);
121
122 gtk_widget_set_margin_start (hbox, 5);
123 gtk_widget_set_margin_end (hbox, 5);
124
125 gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END);
126 gtk_box_pack_start (box, il, FALSE, FALSE);
127 gtk_widget_set_hexpand (l, TRUE);
128 gtk_widget_set_halign (l, TRUE);
129 gtk_box_pack_start (box, l, TRUE, TRUE);
130 gtk_container_add (GTK_CONTAINER (self), hbox);
131 }
132
133 /**
134 * g_paste_ui_panel_history_new:
135 * @client: a #GPasteClient instance
136 * @history: the history we represent
137 *
138 * Create a new instance of #GPasteUiPanelHistory
139 *
140 * Returns: a newly allocated #GPasteUiPanelHistory
141 * free it with g_object_unref
142 */
143 G_PASTE_VISIBLE GtkWidget *
144 g_paste_ui_panel_history_new (GPasteClient *client,
145 const gchar *history)
146 {
147 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
148 g_return_val_if_fail (g_utf8_validate (history, -1, NULL), NULL);
149
150 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_PANEL_HISTORY,
151 "width-request", 100,
152 "height-request", 50,
153 NULL);
154 GPasteUiPanelHistoryPrivate *priv = g_paste_ui_panel_history_get_instance_private (G_PASTE_UI_PANEL_HISTORY (self));
155
156 priv->client = g_object_ref (client);
157 priv->history = g_strdup (history);
158
159 gtk_label_set_text (priv->label, history);
160
161 g_paste_client_get_history_size (client, history, on_size_ready, self);
162
163 return self;
164 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_PANEL_HISTORY_H__
11 #define __G_PASTE_UI_PANEL_HISTORY_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_PANEL_HISTORY (g_paste_ui_panel_history_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiPanelHistory, ui_panel_history, UI_PANEL_HISTORY, GtkListBoxRow)
20
21 void g_paste_ui_panel_history_activate (GPasteUiPanelHistory *self);
22 void g_paste_ui_panel_history_set_length (GPasteUiPanelHistory *self,
23 guint64 length);
24
25 const gchar *g_paste_ui_panel_history_get_history (const GPasteUiPanelHistory *self);
26
27 GtkWidget *g_paste_ui_panel_history_new (GPasteClient *client,
28 const gchar *history);
29
30 G_END_DECLS
31
32 #endif /*__G_PASTE_UI_PANEL_HISTORY_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-history-actions.h>
7 #include <gpaste-ui-panel.h>
8
9 #include "gpaste-gtk-compat.h"
10
11 struct _GPasteUiPanel
12 {
13 GtkBox parent_instance;
14 };
15
16 enum
17 {
18 C_ACTIVATED,
19 C_BUTTON_PRESSED,
20 C_DELETE_HISTORY,
21 C_EMPTY_HISTORY,
22 C_SWITCH_ACTIVATED,
23 C_SWITCH_CLICKED,
24 C_SWITCH_HISTORY,
25
26 C_LAST_SIGNAL
27 };
28
29 typedef struct
30 {
31 GPasteClient *client;
32 GPasteSettings *settings;
33 GPasteUiHistoryActions *actions;
34
35 GtkListBox *list_box;
36 GtkEntry *switch_entry;
37 GList *histories;
38
39 GtkWidget *search_entry;
40
41 guint64 c_signals[C_LAST_SIGNAL];
42 } GPasteUiPanelPrivate;
43
44 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiPanel, ui_panel, GTK_TYPE_BOX)
45
46 static gint32
47 history_equals (gconstpointer a,
48 gconstpointer b)
49 {
50 return !g_paste_str_equal (b, g_paste_ui_panel_history_get_history (a));
51 }
52
53 static GList *
54 history_find (GList *histories,
55 const gchar *history)
56 {
57 return g_list_find_custom (histories, history, history_equals);
58 }
59
60 /**
61 * g_paste_ui_panel_update_history_length:
62 * @self: a #GPasteUiPanel instance
63 * @history: the history to update
64 * @length: the new length
65 *
66 * Update the displayed length of the specified history
67 */
68 G_PASTE_VISIBLE void
69 g_paste_ui_panel_update_history_length (GPasteUiPanel *self,
70 const gchar *history,
71 guint64 length)
72 {
73 g_return_if_fail (_G_PASTE_IS_UI_PANEL (self));
74
75 const GPasteUiPanelPrivate *priv = _g_paste_ui_panel_get_instance_private (self);
76 GList *h = history_find (priv->histories, history);
77
78 if (h)
79 {
80 GPasteUiPanelHistory *hh = h->data;
81
82 g_paste_ui_panel_history_set_length (hh, length);
83 }
84 }
85
86 static void
87 on_history_deleted (GPasteClient *client G_GNUC_UNUSED,
88 const gchar *history,
89 gpointer user_data)
90 {
91 GPasteUiPanelPrivate *priv = user_data;
92
93 if (g_paste_str_equal (history, G_PASTE_DEFAULT_HISTORY))
94 return;
95
96 GList *h = history_find (priv->histories, history);
97
98 if (!h)
99 return;
100
101 priv->histories = g_list_remove_link (priv->histories, h);
102 gtk_container_remove (GTK_CONTAINER (priv->list_box), h->data);
103 }
104
105 static void
106 on_history_emptied (GPasteClient *client G_GNUC_UNUSED,
107 const gchar *history,
108 gpointer user_data)
109 {
110 GPasteUiPanel *self = user_data;
111
112 g_paste_ui_panel_update_history_length (self, history, 0);
113 }
114
115 static void
116 g_paste_ui_panel_add_history (GPasteUiPanelPrivate *priv,
117 const gchar *history,
118 gboolean select);
119
120 static void
121 on_history_switched (GPasteClient *client G_GNUC_UNUSED,
122 const gchar *history,
123 gpointer user_data)
124 {
125 GPasteUiPanelPrivate *priv = user_data;
126
127 g_paste_ui_panel_add_history (priv, history, TRUE);
128 }
129
130 static void
131 on_row_activated (GtkListBox *panel G_GNUC_UNUSED,
132 GtkListBoxRow *row,
133 gpointer user_data G_GNUC_UNUSED)
134 {
135 g_paste_ui_panel_history_activate (G_PASTE_UI_PANEL_HISTORY (row));
136 }
137
138 static void
139 g_paste_ui_panel_add_history (GPasteUiPanelPrivate *priv,
140 const gchar *history,
141 gboolean select)
142 {
143 GtkContainer *c = GTK_CONTAINER (priv->list_box);
144
145 GList *concurrent = history_find (priv->histories, history);
146 GtkListBoxRow *row;
147
148 if (concurrent)
149 {
150 row = concurrent->data;
151 }
152 else
153 {
154 GtkWidget *h = g_paste_ui_panel_history_new (priv->client, history);
155
156 g_object_ref (h);
157 gtk_container_add (c, h);
158 gtk_widget_show_all (h);
159
160 priv->histories = g_list_prepend (priv->histories, h);
161
162 row = GTK_LIST_BOX_ROW (h);
163 }
164
165 if (select)
166 gtk_list_box_select_row (priv->list_box, row);
167 }
168
169 typedef struct
170 {
171 GPasteUiPanelPrivate *priv;
172 gchar *name;
173 } HistoriesData;
174
175 static void
176 on_histories_ready (GObject *source_object G_GNUC_UNUSED,
177 GAsyncResult *res,
178 gpointer user_data)
179 {
180 g_autofree HistoriesData *data = user_data;
181 GPasteUiPanelPrivate *priv = data->priv;
182 g_auto (GStrv) histories = g_paste_client_list_histories_finish (priv->client, res, NULL);
183 g_autofree gchar *current = data->name;
184
185 g_paste_ui_panel_add_history (priv, G_PASTE_DEFAULT_HISTORY, g_paste_str_equal (G_PASTE_DEFAULT_HISTORY, current));
186 for (GStrv h = histories; *h; ++h)
187 g_paste_ui_panel_add_history (priv, *h, g_paste_str_equal (*h, current));
188 }
189
190 static void
191 on_name_ready (GObject *source_object G_GNUC_UNUSED,
192 GAsyncResult *res,
193 gpointer user_data)
194 {
195 GPasteUiPanelPrivate *priv = user_data;
196 gchar *name = g_paste_client_get_history_name_finish (priv->client, res, NULL);
197 HistoriesData *data = g_malloc (sizeof (HistoriesData));
198
199 data->priv = priv;
200 data->name = name;
201
202 g_paste_client_list_histories (priv->client, on_histories_ready, data);
203 }
204
205 static gboolean
206 g_paste_ui_panel_button_press_event (GtkWidget *widget G_GNUC_UNUSED,
207 GdkEventButton *event,
208 gpointer user_data)
209 {
210 GPasteUiPanelPrivate *priv = user_data;
211 GdkEvent *_event = (GdkEvent *) event;
212
213 if (gdk_event_triggers_context_menu (_event))
214 {
215 gdouble y;
216
217 if (!gdk_event_get_axis (_event, GDK_AXIS_Y, &y))
218 return FALSE;
219
220 g_paste_ui_history_actions_set_relative_to (priv->actions,
221 G_PASTE_UI_PANEL_HISTORY (gtk_list_box_get_row_at_y (priv->list_box, y)));
222 gtk_widget_show_all (GTK_WIDGET (priv->actions));
223 }
224
225 return FALSE;
226 }
227
228 static void
229 g_paste_ui_panel_switch_activated (GtkEntry *entry,
230 gpointer user_data)
231 {
232 GPasteUiPanelPrivate *priv = user_data;
233 const gchar *text = gtk_entry_get_text (entry);
234
235 g_paste_client_switch_history (priv->client, (text && *text) ? text : G_PASTE_DEFAULT_HISTORY, NULL, NULL);
236 gtk_entry_set_text (entry, "");
237
238 gtk_widget_grab_focus (priv->search_entry);
239 }
240
241 static void
242 g_paste_ui_panel_switch_clicked (GtkEntry *entry,
243 GtkEntryIconPosition icon_pos G_GNUC_UNUSED,
244 GdkEvent *event G_GNUC_UNUSED,
245 gpointer user_data)
246 {
247 g_paste_ui_panel_switch_activated (entry, user_data);
248 }
249
250 static void
251 g_paste_ui_panel_dispose (GObject *object)
252 {
253 GPasteUiPanelPrivate *priv = g_paste_ui_panel_get_instance_private (G_PASTE_UI_PANEL (object));
254
255 if (priv->c_signals[C_ACTIVATED])
256 {
257 g_signal_handler_disconnect (priv->list_box, priv->c_signals[C_ACTIVATED]);
258 g_signal_handler_disconnect (priv->list_box, priv->c_signals[C_BUTTON_PRESSED]);
259 g_signal_handler_disconnect (priv->switch_entry, priv->c_signals[C_SWITCH_ACTIVATED]);
260 g_signal_handler_disconnect (priv->switch_entry, priv->c_signals[C_SWITCH_CLICKED]);
261 priv->c_signals[C_ACTIVATED] = 0;
262 }
263
264 if (priv->client)
265 {
266 g_signal_handler_disconnect (priv->client, priv->c_signals[C_DELETE_HISTORY]);
267 g_signal_handler_disconnect (priv->client, priv->c_signals[C_EMPTY_HISTORY]);
268 g_signal_handler_disconnect (priv->client, priv->c_signals[C_SWITCH_HISTORY]);
269 g_clear_object (&priv->client);
270 }
271
272 g_clear_object (&priv->settings);
273
274 G_OBJECT_CLASS (g_paste_ui_panel_parent_class)->dispose (object);
275 }
276
277 static void
278 g_paste_ui_panel_class_init (GPasteUiPanelClass *klass)
279 {
280 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_panel_dispose;
281 }
282
283 static void
284 g_paste_ui_panel_init (GPasteUiPanel *self)
285 {
286 GPasteUiPanelPrivate *priv = g_paste_ui_panel_get_instance_private (self);
287 GtkWidget *list_box = gtk_list_box_new ();
288 GtkWidget *switch_entry = gtk_entry_new ();
289 GtkBox *box = GTK_BOX (self);
290
291 priv->list_box = GTK_LIST_BOX (list_box);
292 priv->switch_entry = GTK_ENTRY (switch_entry);
293
294 gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self)), GTK_STYLE_CLASS_SIDEBAR);
295 gtk_entry_set_icon_from_icon_name (priv->switch_entry, GTK_ENTRY_ICON_SECONDARY, "go-jump-symbolic");
296 gtk_widget_set_tooltip_text (switch_entry, _("Switch to"));
297 gtk_widget_set_margin_top (switch_entry, 5);
298 gtk_widget_set_margin_bottom (switch_entry, 5);
299 gtk_entry_set_placeholder_text (priv->switch_entry, G_PASTE_DEFAULT_HISTORY);
300
301 priv->c_signals[C_ACTIVATED] = g_signal_connect (G_OBJECT (priv->list_box),
302 "row-activated",
303 G_CALLBACK (on_row_activated),
304 NULL);
305 priv->c_signals[C_BUTTON_PRESSED] = g_signal_connect (G_OBJECT (list_box),
306 "button-press-event",
307 G_CALLBACK (g_paste_ui_panel_button_press_event),
308 priv);
309 priv->c_signals[C_SWITCH_ACTIVATED] = g_signal_connect (G_OBJECT (switch_entry),
310 "activate",
311 G_CALLBACK (g_paste_ui_panel_switch_activated),
312 priv);
313 priv->c_signals[C_SWITCH_CLICKED] = g_signal_connect (G_OBJECT (switch_entry),
314 "icon-press",
315 G_CALLBACK (g_paste_ui_panel_switch_clicked),
316 priv);
317
318 gtk_widget_set_valign (list_box, TRUE);
319 gtk_box_pack_start (box, list_box, FALSE, TRUE);
320 gtk_box_pack_start (box, switch_entry, FALSE, FALSE);
321 }
322
323 /**
324 * g_paste_ui_panel_new:
325 * @client: a #GPasteClient instance
326 * @settings: a #GPasteSettings instance
327 * @rootwin: the root #GtkWindow
328 * @search_entry: the #GtkSearchEntry
329 *
330 * Create a new instance of #GPasteUiPanel
331 *
332 * Returns: a newly allocated #GPasteUiPanel
333 * free it with g_object_unref
334 */
335 G_PASTE_VISIBLE GtkWidget *
336 g_paste_ui_panel_new (GPasteClient *client,
337 GPasteSettings *settings,
338 GtkWindow *rootwin,
339 GtkSearchEntry *search_entry)
340 {
341 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
342 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
343 g_return_val_if_fail (GTK_IS_WINDOW (rootwin), NULL);
344 g_return_val_if_fail (GTK_IS_SEARCH_ENTRY (search_entry), NULL);
345
346 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_PANEL,
347 "orientation", GTK_ORIENTATION_VERTICAL,
348 NULL);
349 GPasteUiPanelPrivate *priv = g_paste_ui_panel_get_instance_private (G_PASTE_UI_PANEL (self));
350
351 priv->client = g_object_ref (client);
352 priv->settings = g_object_ref (settings);
353 priv->actions = G_PASTE_UI_HISTORY_ACTIONS (g_paste_ui_history_actions_new (client, settings, rootwin));
354 priv->search_entry = GTK_WIDGET (search_entry);
355
356 priv->c_signals[C_DELETE_HISTORY] = g_signal_connect (priv->client,
357 "delete-history",
358 G_CALLBACK (on_history_deleted),
359 priv);
360 priv->c_signals[C_EMPTY_HISTORY] = g_signal_connect (priv->client,
361 "empty-history",
362 G_CALLBACK (on_history_emptied),
363 self);
364 priv->c_signals[C_SWITCH_HISTORY] = g_signal_connect (priv->client,
365 "switch-history",
366 G_CALLBACK (on_history_switched),
367 priv);
368
369 g_paste_client_get_history_name (client, on_name_ready, priv);
370
371 return self;
372 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_PANEL_H__
11 #define __G_PASTE_UI_PANEL_H__
12
13 #include <gpaste-client.h>
14 #include <gpaste-settings.h>
15
16 G_BEGIN_DECLS
17
18 #define G_PASTE_TYPE_UI_PANEL (g_paste_ui_panel_get_type ())
19
20 G_PASTE_FINAL_TYPE (UiPanel, ui_panel, UI_PANEL, GtkBox)
21
22 void g_paste_ui_panel_update_history_length (GPasteUiPanel *self,
23 const gchar *history,
24 guint64 length);
25
26 GtkWidget *g_paste_ui_panel_new (GPasteClient *client,
27 GPasteSettings *settings,
28 GtkWindow *rootwin,
29 GtkSearchEntry *search_entry);
30
31 G_END_DECLS
32
33 #endif /*__G_PASTE_UI_PANEL_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-reexec.h>
7 #include <gpaste-util.h>
8
9 struct _GPasteUiReexec
10 {
11 GtkButton parent_instance;
12 };
13
14 typedef struct
15 {
16 GPasteClient *client;
17
18 GtkWindow *topwin;
19 } GPasteUiReexecPrivate;
20
21 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiReexec, ui_reexec, GTK_TYPE_BUTTON)
22
23 static void
24 g_paste_ui_reexec_clicked (GtkButton *button)
25 {
26 const GPasteUiReexecPrivate *priv = _g_paste_ui_reexec_get_instance_private (G_PASTE_UI_REEXEC (button));
27
28 if (g_paste_util_confirm_dialog (priv->topwin, _("Restart"), _("Do you really want to restart the daemon?")))
29 g_paste_client_reexecute (priv->client, NULL, NULL);
30 }
31
32 static void
33 g_paste_ui_reexec_dispose (GObject *object)
34 {
35 GPasteUiReexecPrivate *priv = g_paste_ui_reexec_get_instance_private (G_PASTE_UI_REEXEC (object));
36
37 g_clear_object (&priv->client);
38
39 G_OBJECT_CLASS (g_paste_ui_reexec_parent_class)->dispose (object);
40 }
41
42 static void
43 g_paste_ui_reexec_class_init (GPasteUiReexecClass *klass)
44 {
45 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_reexec_dispose;
46 GTK_BUTTON_CLASS (klass)->clicked = g_paste_ui_reexec_clicked;
47 }
48
49 static void
50 g_paste_ui_reexec_init (GPasteUiReexec *self)
51 {
52 GtkWidget *widget = GTK_WIDGET (self);
53
54 gtk_widget_set_tooltip_text (widget, _("Restart the daemon"));
55 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
56 gtk_container_add (GTK_CONTAINER (self), gtk_image_new_from_icon_name ("view-refresh-symbolic", GTK_ICON_SIZE_BUTTON));
57 }
58
59 /**
60 * g_paste_ui_reexec_new:
61 * @topwin: the main #GtkWindow
62 * @client: a #GPasteClient instance
63 *
64 * Create a new instance of #GPasteUiReexec
65 *
66 * Returns: a newly allocated #GPasteUiReexec
67 * free it with g_object_unref
68 */
69 G_PASTE_VISIBLE GtkWidget *
70 g_paste_ui_reexec_new (GtkWindow *topwin,
71 GPasteClient *client)
72 {
73 g_return_val_if_fail (GTK_IS_WINDOW (topwin), NULL);
74 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
75
76 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_REEXEC,NULL);
77 GPasteUiReexecPrivate *priv = g_paste_ui_reexec_get_instance_private (G_PASTE_UI_REEXEC (self));
78
79 priv->topwin = topwin;
80 priv->client = g_object_ref (client);
81
82 return self;
83 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_REEXEC_H__
11 #define __G_PASTE_UI_REEXEC_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_REEXEC (g_paste_ui_reexec_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiReexec, ui_reexec, UI_REEXEC, GtkButton)
20
21 GtkWidget *g_paste_ui_reexec_new (GtkWindow *topwin,
22 GPasteClient *client);
23
24 G_END_DECLS
25
26 #endif /*__G_PASTE_UI_REEXEC_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-search-bar.h>
7
8 struct _GPasteUiSearchBar
9 {
10 GtkSearchBar parent_instance;
11 };
12
13 typedef struct
14 {
15 GtkSearchEntry *entry;
16 } GPasteUiSearchBarPrivate;
17
18 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiSearchBar, ui_search_bar, GTK_TYPE_SEARCH_BAR)
19
20 /**
21 * g_paste_ui_search_bar_get_entry:
22 *
23 * Get the #GtkSearchEntry
24 *
25 * Returns: (transfer none): the #GtkSearchEntry
26 */
27 G_PASTE_VISIBLE GtkSearchEntry *
28 g_paste_ui_search_bar_get_entry (const GPasteUiSearchBar *self)
29 {
30 g_return_val_if_fail (_G_PASTE_IS_UI_SEARCH_BAR (self), NULL);
31 const GPasteUiSearchBarPrivate *priv = _g_paste_ui_search_bar_get_instance_private (self);
32
33 return priv->entry;
34 }
35
36 static void
37 g_paste_ui_search_bar_class_init (GPasteUiSearchBarClass *klass G_GNUC_UNUSED)
38 {
39 }
40
41 static void
42 g_paste_ui_search_bar_init (GPasteUiSearchBar *self)
43 {
44 GPasteUiSearchBarPrivate *priv = g_paste_ui_search_bar_get_instance_private (self);
45 GtkWidget *entry = gtk_search_entry_new ();
46
47 priv->entry = GTK_SEARCH_ENTRY (entry);
48
49 gtk_container_add (GTK_CONTAINER (self), entry);
50 }
51
52 /**
53 * g_paste_ui_search_bar_new:
54 *
55 * Create a new instance of #GPasteUiSearchBar
56 *
57 * Returns: a newly allocated #GPasteUiSearchBar
58 * free it with g_object_unref
59 */
60 G_PASTE_VISIBLE GtkWidget *
61 g_paste_ui_search_bar_new (void)
62 {
63 return gtk_widget_new (G_PASTE_TYPE_UI_SEARCH_BAR,
64 NULL);
65 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_SEARCH_BAR_H__
11 #define __G_PASTE_UI_SEARCH_BAR_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_SEARCH_BAR (g_paste_ui_search_bar_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiSearchBar, ui_search_bar, UI_SEARCH_BAR, GtkSearchBar)
20
21 GtkSearchEntry *g_paste_ui_search_bar_get_entry (const GPasteUiSearchBar *self);
22
23 GtkWidget *g_paste_ui_search_bar_new (void);
24
25 G_END_DECLS
26
27 #endif /*__G_PASTE_UI_SEARCH_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-search.h>
7
8 struct _GPasteUiSearch
9 {
10 GtkToggleButton parent_instance;
11 };
12
13 G_PASTE_DEFINE_TYPE (UiSearch, ui_search, GTK_TYPE_TOGGLE_BUTTON)
14
15 static void
16 g_paste_ui_search_class_init (GPasteUiSearchClass *klass G_GNUC_UNUSED)
17 {
18 }
19
20 static void
21 g_paste_ui_search_init (GPasteUiSearch *self)
22 {
23 GtkWidget *widget = GTK_WIDGET (self);
24
25 gtk_widget_set_tooltip_text (widget, _("Search"));
26 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
27 gtk_container_add (GTK_CONTAINER (self), gtk_image_new_from_icon_name ("edit-find-symbolic", GTK_ICON_SIZE_BUTTON));
28 }
29
30 /**
31 * g_paste_ui_search_new:
32 *
33 * Create a new instance of #GPasteUiSearch
34 *
35 * Returns: a newly allocated #GPasteUiSearch
36 * free it with g_object_unref
37 */
38 G_PASTE_VISIBLE GtkWidget *
39 g_paste_ui_search_new (void)
40 {
41 return gtk_widget_new (G_PASTE_TYPE_UI_SEARCH, NULL);
42 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_SEARCH_H__
11 #define __G_PASTE_UI_SEARCH_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_SEARCH (g_paste_ui_search_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiSearch, ui_search, UI_SEARCH, GtkToggleButton)
20
21 GtkWidget *g_paste_ui_search_new (void);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_SEARCH_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-settings-ui-widget.h>
7 #include <gpaste-ui-settings.h>
8
9 #include "gpaste-gtk-compat.h"
10
11 struct _GPasteUiSettings
12 {
13 GtkMenuButton parent_instance;
14 };
15
16 G_PASTE_DEFINE_TYPE (UiSettings, ui_settings, GTK_TYPE_MENU_BUTTON)
17
18 static void
19 g_paste_ui_settings_class_init (GPasteUiSettingsClass *klass G_GNUC_UNUSED)
20 {
21 }
22
23 static void
24 g_paste_ui_settings_init (GPasteUiSettings *self)
25 {
26 GtkWidget *widget = GTK_WIDGET (self);
27 GtkMenuButton *menu = GTK_MENU_BUTTON (self);
28 GtkWidget *popover = gtk_popover_new (GTK_WIDGET (self));
29 GtkWidget *settings_widget = g_paste_settings_ui_widget_new ();
30
31 gtk_widget_set_tooltip_text (widget, _("GPaste Settings"));
32 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
33
34 gtk_widget_set_margin_top (settings_widget, 10);
35
36 gtk_menu_button_set_direction (menu, GTK_ARROW_NONE);
37 gtk_menu_button_set_use_popover (menu, TRUE);
38 gtk_menu_button_set_popover (menu, popover);
39
40 gtk_container_add (GTK_CONTAINER (popover), settings_widget);
41 gtk_widget_show_all (settings_widget);
42 }
43
44 /**
45 * g_paste_ui_settings_new:
46 *
47 * Create a new instance of #GPasteUiSettings
48 *
49 * Returns: a newly allocated #GPasteUiSettings
50 * free it with g_object_unref
51 */
52 G_PASTE_VISIBLE GtkWidget *
53 g_paste_ui_settings_new (void)
54 {
55 return gtk_widget_new (G_PASTE_TYPE_UI_SETTINGS, NULL);
56 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_SETTINGS_H__
11 #define __G_PASTE_UI_SETTINGS_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_SETTINGS (g_paste_ui_settings_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiSettings, ui_settings, UI_SETTINGS, GtkMenuButton)
20
21 GtkWidget *g_paste_ui_settings_new (void);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_SETTINGS_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-shortcuts-window.h>
7
8 struct _GPasteUiShortcutsWindow
9 {
10 GtkShortcutsWindow parent_instance;
11 };
12
13 G_PASTE_DEFINE_TYPE (UiShortcutsWindow, ui_shortcuts_window, GTK_TYPE_SHORTCUTS_WINDOW)
14
15 static void
16 g_paste_ui_shortcuts_window_class_init (GPasteUiShortcutsWindowClass *klass G_GNUC_UNUSED)
17 {
18 }
19
20 static void
21 g_paste_ui_shortcuts_window_init (GPasteUiShortcutsWindow *self G_GNUC_UNUSED)
22 {
23 }
24
25 static inline void
26 add_shortcut (GtkContainer *group,
27 const gchar *title,
28 const gchar *accelerator)
29 {
30 gtk_container_add (group, gtk_widget_new (GTK_TYPE_SHORTCUTS_SHORTCUT,
31 "visible", TRUE,
32 "title", title,
33 "accelerator", accelerator,
34 NULL));
35 }
36
37 /**
38 * g_paste_ui_shortcuts_window_new:
39 * @settings: a #GPasteSettings instance
40 *
41 * Create a new instance of #GPasteUiShortcutsWindow
42 *
43 * Returns: a newly allocated #GPasteUiShortcutsWindow
44 * free it with g_object_unref
45 */
46 G_PASTE_VISIBLE GtkWidget *
47 g_paste_ui_shortcuts_window_new (const GPasteSettings *settings)
48 {
49 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), NULL);
50
51 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_SHORTCUTS_WINDOW,
52 "type", GTK_WINDOW_TOPLEVEL,
53 "window-position", GTK_WIN_POS_CENTER_ALWAYS,
54 "modal", TRUE,
55 "resizable", FALSE,
56 NULL);
57 GtkWidget *section = gtk_widget_new (GTK_TYPE_SHORTCUTS_SECTION,
58 "section-name", "shortcuts",
59 "visible", TRUE,
60 "max-height", 10,
61 NULL);
62 GtkWidget *general_group = gtk_widget_new (GTK_TYPE_SHORTCUTS_GROUP,
63 "title", _("General"),
64 "visible", TRUE,
65 NULL);
66 GtkContainer *ggroup = GTK_CONTAINER (general_group);
67
68 gtk_container_add (GTK_CONTAINER (self), section);
69 gtk_container_add (GTK_CONTAINER (section), general_group);
70
71 add_shortcut (ggroup, _("Delete the active item from history"), g_paste_settings_get_pop (settings));
72 add_shortcut (ggroup, _("Launch the graphical tool"), g_paste_settings_get_launch_ui (settings));
73 add_shortcut (ggroup, _("Mark the active item as being a password"), g_paste_settings_get_make_password (settings));
74 add_shortcut (ggroup, _("Display the history"), g_paste_settings_get_show_history (settings));
75 add_shortcut (ggroup, _("Sync the clipboard to the primary selection"), g_paste_settings_get_sync_clipboard_to_primary (settings));
76 add_shortcut (ggroup, _("Sync the primary selection to the clipboard"), g_paste_settings_get_sync_primary_to_clipboard (settings));
77 add_shortcut (ggroup, _("Upload the active item to a pastebin service"), g_paste_settings_get_upload (settings));
78
79 return self;
80 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_SHORTCUTS_WINDOW_H__
11 #define __G_PASTE_UI_SHORTCUTS_WINDOW_H__
12
13 #include <gpaste-settings.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_SHORTCUTS_WINDOW (g_paste_ui_shortcuts_window_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiShortcutsWindow, ui_shortcuts_window, UI_SHORTCUTS_WINDOW, GtkShortcutsWindow)
20
21 GtkWidget *g_paste_ui_shortcuts_window_new (const GPasteSettings *settings);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_SHORTCUTS_WINDOW_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-switch.h>
7 #include <gpaste-util.h>
8
9 struct _GPasteUiSwitch
10 {
11 GtkSwitch parent_instance;
12 };
13
14 enum
15 {
16 C_TRACKING,
17
18 C_LAST_SIGNAL
19 };
20
21 typedef struct
22 {
23 GPasteClient *client;
24
25 GtkWindow *topwin;
26
27 guint64 c_signals[C_LAST_SIGNAL];
28 } GPasteUiSwitchPrivate;
29
30 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiSwitch, ui_switch, GTK_TYPE_SWITCH)
31
32 static void
33 on_tracking_changed (GPasteClient *client G_GNUC_UNUSED,
34 gboolean state,
35 gpointer user_data)
36 {
37 GtkSwitch *sw = user_data;
38
39 gtk_switch_set_active (sw, state);
40 }
41
42 static gboolean
43 g_paste_ui_button_press_event (GtkWidget *widget,
44 GdkEventButton *event G_GNUC_UNUSED)
45 {
46 const GPasteUiSwitchPrivate *priv = _g_paste_ui_switch_get_instance_private (G_PASTE_UI_SWITCH (widget));
47 GtkSwitch *sw = GTK_SWITCH (widget);
48 gboolean track = !gtk_switch_get_active (sw);
49 gboolean changed = TRUE;
50
51 if (!track)
52 {
53 changed = g_paste_util_confirm_dialog (priv->topwin, _("Stop"), _("Do you really want to stop tracking clipboard changes?"));
54 track = !changed;
55 }
56
57 if (changed)
58 g_paste_client_track (priv->client, track, NULL, NULL);
59
60 return GDK_EVENT_STOP;
61 }
62
63 static void
64 g_paste_ui_switch_dispose (GObject *object)
65 {
66 GPasteUiSwitchPrivate *priv = g_paste_ui_switch_get_instance_private (G_PASTE_UI_SWITCH (object));
67
68 if (priv->c_signals[C_TRACKING])
69 {
70 g_signal_handler_disconnect (priv->client, priv->c_signals[C_TRACKING]);
71 priv->c_signals[C_TRACKING] = 0;
72 }
73
74 g_clear_object (&priv->client);
75
76 G_OBJECT_CLASS (g_paste_ui_switch_parent_class)->dispose (object);
77 }
78
79 static void
80 g_paste_ui_switch_class_init (GPasteUiSwitchClass *klass)
81 {
82 GTK_WIDGET_CLASS (klass)->button_press_event = g_paste_ui_button_press_event;
83 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_switch_dispose;
84 }
85
86 static void
87 g_paste_ui_switch_init (GPasteUiSwitch *self)
88 {
89 GtkWidget *widget = GTK_WIDGET (self);
90
91 gtk_widget_set_tooltip_text (widget, _("Track clipboard changes"));
92 gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
93 }
94
95 /**
96 * g_paste_ui_switch_new:
97 * @topwin: the main #GtkWindow
98 * @client: a #GPasteClient instance
99 *
100 * Create a new instance of #GPasteUiSwitch
101 *
102 * Returns: a newly allocated #GPasteUiSwitch
103 * free it with g_object_unref
104 */
105 G_PASTE_VISIBLE GtkWidget *
106 g_paste_ui_switch_new (GtkWindow *topwin,
107 GPasteClient *client)
108 {
109 g_return_val_if_fail (GTK_IS_WINDOW (topwin), NULL);
110 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
111
112 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_SWITCH, NULL);
113 GPasteUiSwitchPrivate *priv = g_paste_ui_switch_get_instance_private (G_PASTE_UI_SWITCH (self));
114
115 priv->topwin = topwin;
116 priv->client = g_object_ref (client);
117
118 priv->c_signals[C_TRACKING] = g_signal_connect (G_OBJECT (priv->client),
119 "tracking",
120 G_CALLBACK (on_tracking_changed),
121 self);
122
123 gtk_switch_set_active (GTK_SWITCH (self), g_paste_client_is_active (client));
124
125 return self;
126 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_SWITCH_H__
11 #define __G_PASTE_UI_SWITCH_H__
12
13 #include <gpaste-client.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_SWITCH (g_paste_ui_switch_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiSwitch, ui_switch, UI_SWITCH, GtkSwitch)
20
21 GtkWidget *g_paste_ui_switch_new (GtkWindow *topwin,
22 GPasteClient *client);
23
24 G_END_DECLS
25
26 #endif /*__G_PASTE_UI_SWITCH_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-upload-item.h>
7
8 struct _GPasteUiUploadItem
9 {
10 GPasteUiItemAction parent_instance;
11 };
12
13 G_PASTE_DEFINE_TYPE (UiUploadItem, ui_upload_item, G_PASTE_TYPE_UI_ITEM_ACTION)
14
15 static void
16 g_paste_ui_upload_item_activate (GPasteUiItemAction *self G_GNUC_UNUSED,
17 GPasteClient *client,
18 const gchar *uuid)
19 {
20 g_paste_client_upload (client, uuid, NULL, NULL);
21 }
22
23 static void
24 g_paste_ui_upload_item_class_init (GPasteUiUploadItemClass *klass)
25 {
26 G_PASTE_UI_ITEM_ACTION_CLASS (klass)->activate = g_paste_ui_upload_item_activate;
27 }
28
29 static void
30 g_paste_ui_upload_item_init (GPasteUiUploadItem *self G_GNUC_UNUSED)
31 {
32 }
33
34 /**
35 * g_paste_ui_upload_item_new:
36 * @client: a #GPasteClient
37 *
38 * Create a new instance of #GPasteUiUploadItem
39 *
40 * Returns: a newly allocated #GPasteUiUploadItem
41 * free it with g_object_unref
42 */
43 G_PASTE_VISIBLE GtkWidget *
44 g_paste_ui_upload_item_new (GPasteClient *client)
45 {
46 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), NULL);
47
48 return g_paste_ui_item_action_new (G_PASTE_TYPE_UI_UPLOAD_ITEM, client, "document-send-symbolic", _("Upload"));
49 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_UPLOAD_ITEM_H__
11 #define __G_PASTE_UI_UPLOAD_ITEM_H__
12
13 #include <gpaste-ui-item-action.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_UPLOAD_ITEM (g_paste_ui_upload_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiUploadItem, ui_upload_item, UI_UPLOAD_ITEM, GPasteUiItemAction)
20
21 GtkWidget *g_paste_ui_upload_item_new (GPasteClient *client);
22
23 G_END_DECLS
24
25 #endif /*__G_PASTE_UI_UPLOAD_ITEM_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-ui-header.h>
7 #include <gpaste-ui-history.h>
8 #include <gpaste-ui-search-bar.h>
9 #include <gpaste-ui-window.h>
10 #include <gpaste-ui-shortcuts-window.h>
11 #include <gpaste-util.h>
12
13 #include "gpaste-gtk-compat.h"
14
15 struct _GPasteUiWindow
16 {
17 GtkApplicationWindow parent_instance;
18 };
19
20 enum
21 {
22 C_SEARCH,
23
24 C_LAST_SIGNAL
25 };
26
27 typedef struct
28 {
29 GPasteUiHeader *header;
30 GPasteUiHistory *history;
31 GPasteClient *client;
32 GPasteSettings *settings;
33
34 GtkSearchBar *search_bar;
35 GtkSearchEntry *search_entry;
36
37 gboolean initialized;
38
39 guint64 c_signals[C_LAST_SIGNAL];
40 } GPasteUiWindowPrivate;
41
42 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (UiWindow, ui_window, GTK_TYPE_APPLICATION_WINDOW)
43
44 static gboolean
45 _empty (gpointer user_data)
46 {
47 gpointer *data = (gpointer *) user_data;
48 GPasteUiWindow *self = data[0];
49 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (self);
50
51 if (!priv->initialized)
52 return G_SOURCE_CONTINUE;
53
54 g_autofree gchar *history = data[1];
55 g_free (data);
56
57 g_paste_util_empty_history (GTK_WINDOW (self), priv->client, priv->settings, history);
58
59 return G_SOURCE_REMOVE;
60 }
61
62 /**
63 * g_paste_ui_window_empty_history:
64 * @self: the #GPasteUiWindow
65 * @history: the history to empty
66 *
67 * Empty an history
68 */
69 G_PASTE_VISIBLE void
70 g_paste_ui_window_empty_history (GPasteUiWindow *self,
71 const gchar *history)
72 {
73 g_return_if_fail (_G_PASTE_IS_UI_WINDOW (self));
74 g_return_if_fail (g_utf8_validate (history, -1, NULL));
75
76 gpointer *data = g_new (gpointer, 2);
77 data[0] = self;
78 data[1] = g_strdup (history);
79
80 g_source_set_name_by_id (g_idle_add (_empty, data), "[GPaste] empty");
81 }
82
83 static gboolean
84 _search (gpointer user_data)
85 {
86 gpointer *data = (gpointer *) user_data;
87 GPasteUiWindowPrivate *priv = data[0];
88
89 if (!priv->initialized)
90 return G_SOURCE_CONTINUE;
91
92 g_autofree gchar *search = data[1];
93 g_free (data);
94
95 gtk_button_clicked (g_paste_ui_header_get_search_button (priv->header));
96 gtk_entry_set_text (GTK_ENTRY (priv->search_entry), search);
97
98 return G_SOURCE_REMOVE;
99 }
100
101 /**
102 * g_paste_ui_window_search:
103 * @self: the #GPasteUiWindow
104 * @search: the text to search
105 *
106 * Do a search
107 */
108 G_PASTE_VISIBLE void
109 g_paste_ui_window_search (GPasteUiWindow *self,
110 const gchar *search)
111 {
112 g_return_if_fail (_G_PASTE_IS_UI_WINDOW (self));
113 g_return_if_fail (g_utf8_validate (search, -1, NULL));
114
115 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (self);
116
117 gpointer *data = g_new (gpointer, 2);
118 data[0] = priv;
119 data[1] = g_strdup (search);
120
121 g_source_set_name_by_id (g_idle_add (_search, data), "[GPaste] search");
122 }
123
124 static gboolean
125 _show_prefs (gpointer user_data)
126 {
127 GPasteUiWindowPrivate *priv = user_data;
128
129 if (!priv->initialized)
130 return G_SOURCE_CONTINUE;
131
132 g_paste_ui_header_show_prefs (priv->header);
133
134 return G_SOURCE_REMOVE;
135 }
136
137 /**
138 * g_paste_ui_window_show_prefs:
139 * @self: the #GPasteUiWindow
140 *
141 * Show the prefs pane
142 */
143 G_PASTE_VISIBLE void
144 g_paste_ui_window_show_prefs (GPasteUiWindow *self)
145 {
146 g_return_if_fail (_G_PASTE_IS_UI_WINDOW (self));
147
148 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (self);
149
150 g_source_set_name_by_id (g_idle_add (_show_prefs, priv), "[GPaste] show_prefs");
151 }
152
153 static gboolean
154 on_key_press_event (GtkWidget *widget,
155 GdkEventKey *event)
156 {
157 const GPasteUiWindowPrivate *priv = _g_paste_ui_window_get_instance_private (G_PASTE_UI_WINDOW (widget));
158 GtkWidget *focus = gtk_window_get_focus (GTK_WINDOW (widget));
159 GdkEvent *_event = (GdkEvent *) event;
160 gboolean search_has_focus = focus == GTK_WIDGET (priv->search_entry);
161 gboolean search_in_progress = search_has_focus && gtk_entry_get_text_length (GTK_ENTRY (priv->search_entry));
162 gboolean forward_to_search = FALSE;
163 guint keyval;
164
165 if (gdk_event_get_keyval (_event, &keyval))
166 {
167 switch (keyval)
168 {
169 case GDK_KEY_Escape:
170 if (!search_in_progress)
171 {
172 gtk_window_close (GTK_WINDOW (widget));
173 return GDK_EVENT_STOP;
174 }
175 else
176 {
177 forward_to_search = TRUE;
178 }
179 break;
180 case GDK_KEY_Return:
181 case GDK_KEY_KP_Enter:
182 case GDK_KEY_ISO_Enter:
183 if (search_in_progress && g_paste_ui_history_select_first (priv->history))
184 return GDK_EVENT_STOP;
185 break;
186 default:
187 forward_to_search = TRUE;
188 break;
189 }
190 }
191
192 if (forward_to_search && gtk_search_bar_handle_event (priv->search_bar, _event))
193 return GDK_EVENT_STOP;
194
195 gboolean res = GTK_WIDGET_CLASS (g_paste_ui_window_parent_class)->key_press_event (widget, event);
196
197 if (res == GDK_EVENT_STOP || !forward_to_search || search_has_focus)
198 return res;
199
200 // fallback to explicitely focusing search to see if key can be handled
201 gtk_entry_grab_focus_without_selecting (GTK_ENTRY (priv->search_entry));
202
203 if (gtk_search_bar_handle_event (priv->search_bar, _event))
204 return GDK_EVENT_STOP;
205
206 if (GTK_WIDGET_CLASS (g_paste_ui_window_parent_class)->key_press_event (widget, event) == GDK_EVENT_STOP)
207 return GDK_EVENT_STOP;
208
209 gtk_widget_grab_focus (focus);
210
211 return res;
212 }
213
214 static void
215 on_search (GtkSearchEntry *entry,
216 gpointer user_data)
217 {
218 GPasteUiWindowPrivate *priv = user_data;
219
220 g_paste_ui_history_search (priv->history, gtk_entry_get_text (GTK_ENTRY (entry)));
221 }
222
223 static gboolean
224 focus_search (gpointer user_data)
225 {
226 GPasteUiWindow *self = user_data;
227 const GPasteUiWindowPrivate *priv = _g_paste_ui_window_get_instance_private (self);
228 GtkWindow *win = user_data;
229 GtkWidget *widget = user_data;
230
231 if (!GTK_IS_WIDGET (widget))
232 return G_SOURCE_REMOVE;
233
234 if (!gtk_widget_get_realized (widget))
235 return G_SOURCE_CONTINUE;
236
237 gtk_window_set_focus (win, GTK_WIDGET (priv->search_entry));
238
239 return G_SOURCE_REMOVE;
240 }
241
242 static void
243 g_paste_ui_window_dispose (GObject *object)
244 {
245 GPasteUiWindow *self = G_PASTE_UI_WINDOW (object);
246 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (self);
247
248 if (priv->c_signals[C_SEARCH])
249 {
250 GPasteUiSearchBar *search_bar = G_PASTE_UI_SEARCH_BAR (priv->search_bar);
251 GtkSearchEntry *entry = g_paste_ui_search_bar_get_entry (search_bar);
252
253 g_signal_handler_disconnect (entry, priv->c_signals[C_SEARCH]);
254 priv->c_signals[C_SEARCH] = 0;
255 }
256
257 g_clear_object (&priv->client);
258
259 G_OBJECT_CLASS (g_paste_ui_window_parent_class)->dispose (object);
260 }
261
262 static void
263 g_paste_ui_window_class_init (GPasteUiWindowClass *klass)
264 {
265 G_OBJECT_CLASS (klass)->dispose = g_paste_ui_window_dispose;
266 GTK_WIDGET_CLASS (klass)->key_press_event = on_key_press_event;
267 }
268
269 static void
270 g_paste_ui_window_init (GPasteUiWindow *self)
271 {
272 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (self);
273 GtkWindow *win = GTK_WINDOW (self);
274 GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
275
276 gtk_widget_set_margin_start (vbox, 5);
277 gtk_widget_set_margin_end (vbox, 5);
278 gtk_widget_set_margin_bottom (vbox, 5);
279
280 GtkWidget *search_bar = g_paste_ui_search_bar_new ();
281 GtkContainer *box = GTK_CONTAINER (vbox);
282
283 priv->search_bar = GTK_SEARCH_BAR (search_bar);
284
285 gtk_container_add (GTK_CONTAINER (win), vbox);
286 gtk_box_pack_start (GTK_BOX (box), search_bar, FALSE, FALSE);
287
288 GtkSearchEntry *entry = priv->search_entry = g_paste_ui_search_bar_get_entry (G_PASTE_UI_SEARCH_BAR (search_bar));
289 priv->c_signals[C_SEARCH] = g_signal_connect (entry,
290 "search-changed",
291 G_CALLBACK (on_search),
292 priv);
293
294 g_source_set_name_by_id (g_idle_add (focus_search, self), "[GPaste] focus_search");
295 }
296
297 static void
298 on_client_ready (GObject *source_object G_GNUC_UNUSED,
299 GAsyncResult *res,
300 gpointer user_data)
301 {
302 GPasteUiWindowPrivate *priv = g_paste_ui_window_get_instance_private (user_data);
303 GtkWindow *win = GTK_WINDOW (user_data);
304 g_autoptr (GError) error = NULL;
305 g_autoptr (GPasteClient) client = g_paste_client_new_finish (res, &error);
306
307 if (error)
308 {
309 priv->initialized = TRUE;
310 g_critical ("%s: %s\n", _("Couldn't connect to GPaste daemon"), error->message);
311 gtk_window_close (win); /* will exit the application */
312 }
313
314 g_autoptr (GPasteSettings) settings = g_paste_settings_new ();
315 GtkWidget *header = g_paste_ui_header_new (win, client);
316 GtkWidget *panel = g_paste_ui_panel_new (client, settings, win, priv->search_entry);
317 GtkWidget *history = g_paste_ui_history_new (client, settings, G_PASTE_UI_PANEL (panel), win);
318 GPasteUiHeader *h = priv->header = G_PASTE_UI_HEADER (header);
319
320 priv->history = G_PASTE_UI_HISTORY (history);
321 priv->client = g_object_ref (client);
322 priv->settings = g_paste_settings_new();
323
324 gtk_window_set_titlebar (win, header);
325 gtk_application_window_set_help_overlay (GTK_APPLICATION_WINDOW (user_data), GTK_SHORTCUTS_WINDOW (g_paste_ui_shortcuts_window_new (settings)));
326
327 GtkContainer *vbox = GTK_CONTAINER (gtk_bin_get_child (GTK_BIN (win)));
328 GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
329 GtkBox *box = GTK_BOX (hbox);
330
331 gtk_box_set_spacing (box, 2);
332 gtk_box_pack_start (box, panel, FALSE, FALSE);
333 gtk_box_pack_start (box, gtk_separator_new (GTK_ORIENTATION_VERTICAL), FALSE, FALSE);
334 gtk_widget_set_hexpand (history, TRUE);
335 gtk_widget_set_halign (history, TRUE);
336 gtk_box_pack_start (box, history, TRUE, TRUE);
337 gtk_widget_set_vexpand (hbox, TRUE);
338 gtk_widget_set_valign (hbox, TRUE);
339 gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE);
340
341 g_object_bind_property (g_paste_ui_header_get_search_button (h), "active",
342 gtk_container_get_children (vbox)->data, "search-mode-enabled",
343 G_BINDING_BIDIRECTIONAL);
344
345 gtk_widget_show_all (GTK_WIDGET (win));
346 priv->initialized = TRUE;
347 }
348
349 /**
350 * g_paste_ui_window_new:
351 * @app: the #GtkApplication
352 *
353 * Create a new instance of #GPasteUiWindow
354 *
355 * Returns: a newly allocated #GPasteUiWindow
356 * free it with g_object_unref
357 */
358 G_PASTE_VISIBLE GtkWidget *
359 g_paste_ui_window_new (GtkApplication *app)
360 {
361 g_return_val_if_fail (GTK_IS_APPLICATION (app), NULL);
362
363 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_UI_WINDOW,
364 "application", app,
365 "type", GTK_WINDOW_TOPLEVEL,
366 "window-position", GTK_WIN_POS_CENTER_ALWAYS,
367 "resizable", FALSE,
368 "icon-name", G_PASTE_ICON_NAME,
369 NULL);
370
371 g_paste_client_new (on_client_ready, self);
372
373 return self;
374 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UI_WINDOW_H__
11 #define __G_PASTE_UI_WINDOW_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_UI_WINDOW (g_paste_ui_window_get_type ())
18
19 G_PASTE_FINAL_TYPE (UiWindow, ui_window, UI_WINDOW, GtkApplicationWindow)
20
21 void g_paste_ui_window_empty_history (GPasteUiWindow *self,
22 const gchar *history);
23 void g_paste_ui_window_search (GPasteUiWindow *self,
24 const gchar *search);
25 void g_paste_ui_window_show_prefs (GPasteUiWindow *self);
26
27 GtkWidget *g_paste_ui_window_new (GtkApplication *app);
28
29 G_END_DECLS
30
31 #endif /*__G_PASTE_UI_WINDOW_H__*/
00 gpaste_ui_sources = [
1 'gpaste-ui-about.c',
2 'gpaste-ui-backup-history.c',
3 'gpaste-ui-delete-history.c',
4 'gpaste-ui-delete-item.c',
5 'gpaste-ui-edit-item.c',
6 'gpaste-ui-empty-history.c',
7 'gpaste-ui-empty-item.c',
8 'gpaste-ui-header.c',
9 'gpaste-ui-history-action.c',
10 'gpaste-ui-history-actions.c',
11 'gpaste-ui-history.c',
12 'gpaste-ui-item-action.c',
13 'gpaste-ui-item-skeleton.c',
14 'gpaste-ui-item.c',
15 'gpaste-ui-new-item.c',
16 'gpaste-ui-panel-history.c',
17 'gpaste-ui-panel.c',
18 'gpaste-ui-reexec.c',
19 'gpaste-ui-search-bar.c',
20 'gpaste-ui-search.c',
21 'gpaste-ui-settings.c',
22 'gpaste-ui-shortcuts-window.c',
23 'gpaste-ui-switch.c',
24 'gpaste-ui-upload-item.c',
25 'gpaste-ui-window.c',
126 'gpaste-ui.c',
27 'tmp/gpaste-client.c',
28 'tmp/gpaste-client-item.c',
29 'tmp/gpaste-util.c',
30 'tmp/gpaste-settings.c',
31 'tmp/gpaste-update-enums.c',
32 'tmp/gpaste-settings-ui-panel.c',
33 'tmp/gpaste-settings-ui-stack.c',
34 'tmp/gpaste-settings-ui-widget.c',
35 'tmp/gpaste-item-enums.c'
236 ]
337
38 gpaste_ui_headers = [
39 'gpaste-ui-about.h',
40 'gpaste-ui-backup-history.h',
41 'gpaste-ui-delete-history.h',
42 'gpaste-ui-delete-item.h',
43 'gpaste-ui-edit-item.h',
44 'gpaste-ui-empty-history.h',
45 'gpaste-ui-empty-item.h',
46 'gpaste-ui-header.h',
47 'gpaste-ui-history-action.h',
48 'gpaste-ui-history-actions.h',
49 'gpaste-ui-history.h',
50 'gpaste-ui-item-action.h',
51 'gpaste-ui-item-skeleton.h',
52 'gpaste-ui-item.h',
53 'gpaste-ui-new-item.h',
54 'gpaste-ui-panel-history.h',
55 'gpaste-ui-panel.h',
56 'gpaste-ui-reexec.h',
57 'gpaste-ui-search-bar.h',
58 'gpaste-ui-search.h',
59 'gpaste-ui-settings.h',
60 'gpaste-ui-shortcuts-window.h',
61 'gpaste-ui-switch.h',
62 'gpaste-ui-upload-item.h',
63 'gpaste-ui-window.h',
64 'tmp/gpaste-client.h',
65 'tmp/gpaste-client-item.h',
66 'tmp/gpaste-util.h',
67 'tmp/gpaste-settings.h',
68 'tmp/gpaste-update-enums.h',
69 'tmp/gpaste-settings-ui-panel.h',
70 'tmp/gpaste-settings-ui-stack.h',
71 'tmp/gpaste-settings-ui-widget.h',
72 'tmp/gpaste-item-enums.h'
73 ]
74
75 gpaste_ui_headers_dep = declare_dependency(
76 include_directories: include_directories('tmp', '../libgpaste'),
77 sources: gpaste_ui_headers,
78 )
79
80 tmp_inc = include_directories('tmp')
481 executable(
582 'gpaste-ui',
683 sources: gpaste_ui_sources,
784 install: true,
8 dependencies: [ glib_dep, gtk_dep, libgpaste_internal_dep ],
85 dependencies: [ glib_dep, gtk3_dep, gpaste_ui_headers_dep ],
986 install_dir: join_paths(get_option('libexecdir'), 'gpaste'),
10 )
87 )
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-client-item.h>
7
8 struct _GPasteClientItem
9 {
10 GObject parent_instance;
11 };
12
13 typedef struct
14 {
15 gchar *uuid;
16 gchar *value;
17 } GPasteClientItemPrivate;
18
19 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (ClientItem, client_item, G_TYPE_OBJECT)
20
21 /**
22 * g_paste_client_item_get_uuid:
23 * @self: a #GPasteClientItem instance
24 *
25 * Returns the uuid of the item
26 */
27 G_PASTE_VISIBLE const gchar *
28 g_paste_client_item_get_uuid (const GPasteClientItem *self)
29 {
30 g_return_val_if_fail (_G_PASTE_IS_CLIENT_ITEM (self), NULL);
31
32 const GPasteClientItemPrivate *priv = _g_paste_client_item_get_instance_private (self);
33
34 return priv->uuid;;
35 }
36
37 /**
38 * g_paste_client_item_get_value:
39 * @self: a #GPasteClientItem instance
40 *
41 * Returns the value of the item
42 */
43 G_PASTE_VISIBLE const gchar *
44 g_paste_client_item_get_value (const GPasteClientItem *self)
45 {
46 g_return_val_if_fail (_G_PASTE_IS_CLIENT_ITEM (self), NULL);
47
48 const GPasteClientItemPrivate *priv = _g_paste_client_item_get_instance_private (self);
49
50 return priv->value;
51 }
52
53 static void
54 g_paste_client_item_finalize (GObject *object)
55 {
56 GPasteClientItemPrivate *priv = g_paste_client_item_get_instance_private (G_PASTE_CLIENT_ITEM (object));
57
58 g_free (priv->uuid);
59 g_free (priv->value);
60 }
61
62 static void
63 g_paste_client_item_class_init (GPasteClientItemClass *klass)
64 {
65 G_OBJECT_CLASS (klass)->finalize = g_paste_client_item_finalize;
66 }
67
68 static void
69 g_paste_client_item_init (GPasteClientItem *self G_GNUC_UNUSED)
70 {
71 }
72
73 /**
74 * g_paste_client_item_new:
75 * @uuid: the uuid of the item
76 * @value: the value of the item
77 *
78 * Create a new instance of #GPasteClientItem
79 *
80 * Returns: (transfer full): a newly allocated #GPasteClientItem
81 * free it with g_object_unref
82 */
83 G_PASTE_VISIBLE GPasteClientItem *
84 g_paste_client_item_new (const gchar *uuid,
85 const gchar *value)
86 {
87 g_return_val_if_fail (g_uuid_string_is_valid (uuid), NULL);
88 g_return_val_if_fail (g_utf8_validate (value, -1, NULL), NULL);
89
90 GPasteClientItem *self = g_object_new (G_PASTE_TYPE_CLIENT_ITEM, NULL);
91 GPasteClientItemPrivate *priv = g_paste_client_item_get_instance_private (self);
92
93 priv->uuid = g_strdup (uuid);
94 priv->value = g_strdup (value);
95
96 return self;
97 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_CLIENT_ITEM_H__
11 #define __G_PASTE_CLIENT_ITEM_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_CLIENT_ITEM (g_paste_client_item_get_type ())
18
19 G_PASTE_FINAL_TYPE (ClientItem, client_item, CLIENT_ITEM, GObject)
20
21 const gchar *g_paste_client_item_get_uuid (const GPasteClientItem *self);
22 const gchar *g_paste_client_item_get_value (const GPasteClientItem *self);
23
24 GPasteClientItem *g_paste_client_item_new (const gchar *uuid,
25 const gchar *value);
26
27 G_END_DECLS
28
29 #endif /*__G_PASTE_CLIENT_ITEM_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include "gpaste-gdbus-macros.h"
7
8 #include <gpaste-update-enums.h>
9
10 struct _GPasteClient
11 {
12 GDBusProxy parent_instance;
13 };
14
15 G_PASTE_DEFINE_TYPE (Client, client, G_TYPE_DBUS_PROXY)
16
17 enum
18 {
19 DELETE_HISTORY,
20 EMPTY_HISTORY,
21 SHOW_HISTORY,
22 SWITCH_HISTORY,
23 TRACKING,
24 UPDATE,
25
26 LAST_SIGNAL
27 };
28
29 static guint64 signals[LAST_SIGNAL] = { 0 };
30
31 /*******************/
32 /* Methods / Async */
33 /*******************/
34
35 #define DBUS_CALL_NO_PARAM_ASYNC(method) \
36 DBUS_CALL_NO_PARAM_ASYNC_BASE (CLIENT, G_PASTE_DAEMON_##method)
37
38 #define DBUS_CALL_ONE_PARAM_ASYNC(method, param_type, param_name) \
39 DBUS_CALL_ONE_PARAM_ASYNC_BASE (CLIENT, param_type, param_name, G_PASTE_DAEMON_##method)
40
41 #define DBUS_CALL_ONE_PARAMV_ASYNC(method, paramv) \
42 DBUS_CALL_ONE_PARAMV_ASYNC_BASE (CLIENT, paramv, G_PASTE_DAEMON_##method)
43
44 #define DBUS_CALL_TWO_PARAMS_ASYNC(method, params) \
45 DBUS_CALL_TWO_PARAMS_ASYNC_BASE (CLIENT, params, G_PASTE_DAEMON_##method)
46
47 #define DBUS_CALL_THREE_PARAMS_ASYNC(method, params) \
48 DBUS_CALL_THREE_PARAMS_ASYNC_BASE (CLIENT, params, G_PASTE_DAEMON_##method)
49
50 /****************************/
51 /* Methods / Async - Finish */
52 /****************************/
53
54 #define DBUS_ASYNC_FINISH_NO_RETURN \
55 DBUS_ASYNC_FINISH_NO_RETURN_BASE (CLIENT)
56
57 #define DBUS_ASYNC_FINISH_RET_STRING \
58 DBUS_ASYNC_FINISH_RET_STRING_BASE (CLIENT)
59
60 #define DBUS_ASYNC_FINISH_RET_ITEM \
61 DBUS_ASYNC_FINISH_RET_ITEM_BASE (CLIENT)
62
63 #define DBUS_ASYNC_FINISH_RET_STRV \
64 DBUS_ASYNC_FINISH_RET_STRV_BASE (CLIENT)
65
66 #define DBUS_ASYNC_FINISH_RET_ITEMS \
67 DBUS_ASYNC_FINISH_RET_ITEMS_BASE (CLIENT)
68
69 #define DBUS_ASYNC_FINISH_RET_UINT64 \
70 DBUS_ASYNC_FINISH_RET_UINT64_BASE (CLIENT)
71
72 /******************/
73 /* Methods / Sync */
74 /******************/
75
76 #define DBUS_CALL_NO_PARAM_NO_RETURN(method) \
77 DBUS_CALL_NO_PARAM_NO_RETURN_BASE (CLIENT, G_PASTE_DAEMON_##method)
78
79 #define DBUS_CALL_NO_PARAM_RET_STRING(method) \
80 DBUS_CALL_NO_PARAM_RET_STRING_BASE (CLIENT, G_PASTE_DAEMON_##method)
81
82 #define DBUS_CALL_NO_PARAM_RET_STRV(method) \
83 DBUS_CALL_NO_PARAM_RET_STRV_BASE (CLIENT, G_PASTE_DAEMON_##method)
84
85 #define DBUS_CALL_NO_PARAM_RET_ITEMS(method) \
86 DBUS_CALL_NO_PARAM_RET_ITEMS_BASE (CLIENT, G_PASTE_DAEMON_##method)
87
88 #define DBUS_CALL_ONE_PARAM_NO_RETURN(method, param_type, param_name) \
89 DBUS_CALL_ONE_PARAM_NO_RETURN_BASE (CLIENT, param_type, param_name, G_PASTE_DAEMON_##method)
90
91 #define DBUS_CALL_ONE_PARAM_RET_UINT64(method, param_type, param_name) \
92 DBUS_CALL_ONE_PARAM_RET_UINT64_BASE (CLIENT, param_type, param_name, G_PASTE_DAEMON_##method)
93
94 #define DBUS_CALL_ONE_PARAM_RET_STRING(method, param_type, param_name) \
95 DBUS_CALL_ONE_PARAM_RET_STRING_BASE (CLIENT, param_type, param_name, G_PASTE_DAEMON_##method)
96
97 #define DBUS_CALL_ONE_PARAM_RET_STRV(method, param_type, param_name) \
98 DBUS_CALL_ONE_PARAM_RET_STRV_BASE (CLIENT, param_type, param_name, G_PASTE_DAEMON_##method)
99
100 #define DBUS_CALL_ONE_PARAM_RET_ITEM(method, param_type, param_name) \
101 DBUS_CALL_ONE_PARAM_RET_ITEM_BASE (CLIENT, param_type, param_name, G_PASTE_DAEMON_##method)
102
103 #define DBUS_CALL_ONE_PARAMV_RET_ITEMS(method, paramv) \
104 DBUS_CALL_ONE_PARAMV_RET_ITEMS_BASE (CLIENT, G_PASTE_DAEMON_##method, paramv)
105
106 #define DBUS_CALL_TWO_PARAMS_NO_RETURN(method, params) \
107 DBUS_CALL_TWO_PARAMS_NO_RETURN_BASE (CLIENT, params, G_PASTE_DAEMON_##method)
108
109 #define DBUS_CALL_THREE_PARAMS_NO_RETURN(method, params) \
110 DBUS_CALL_THREE_PARAMS_NO_RETURN_BASE (CLIENT, params, G_PASTE_DAEMON_##method)
111
112 /**************/
113 /* Properties */
114 /**************/
115
116 #define DBUS_GET_BOOLEAN_PROPERTY(property) \
117 DBUS_GET_BOOLEAN_PROPERTY_BASE (CLIENT, G_PASTE_DAEMON_PROP_##property)
118
119 #define DBUS_GET_STRING_PROPERTY(property) \
120 DBUS_GET_STRING_PROPERTY_BASE (CLIENT, G_PASTE_DAEMON_PROP_##property)
121
122 /***********/
123 /* Signals */
124 /***********/
125
126 #define HANDLE_SIGNAL(sig) \
127 if (g_paste_str_equal (signal_name, G_PASTE_DAEMON_SIG_##sig)) \
128 { \
129 g_signal_emit (self, \
130 signals[sig], \
131 0, /* detail */ \
132 NULL); \
133 }
134 #define HANDLE_SIGNAL_WITH_DATA(sig, ans_type, get_data) \
135 if (g_paste_str_equal (signal_name, G_PASTE_DAEMON_SIG_##sig)) \
136 { \
137 GVariantIter params_iter; \
138 g_variant_iter_init (&params_iter, parameters); \
139 g_autoptr (GVariant) variant = g_variant_iter_next_value (&params_iter); \
140 ans_type answer = get_data; \
141 g_signal_emit (self, \
142 signals[sig], \
143 0, /* detail */ \
144 answer, \
145 NULL); \
146 }
147
148 #define NEW_SIGNAL(name) \
149 g_signal_new (name, \
150 G_PASTE_TYPE_CLIENT, \
151 G_SIGNAL_RUN_LAST, \
152 0, /* class offset */ \
153 NULL, /* accumulator */ \
154 NULL, /* accumulator data */ \
155 g_cclosure_marshal_VOID__VOID, \
156 G_TYPE_NONE, \
157 0) /* number of params */
158 #define NEW_SIGNAL_WITH_DATA(name, type) \
159 g_signal_new (name, \
160 G_PASTE_TYPE_CLIENT, \
161 G_SIGNAL_RUN_LAST, \
162 0, /* class offset */ \
163 NULL, /* accumulator */ \
164 NULL, /* accumulator data */ \
165 g_cclosure_marshal_VOID__##type, \
166 G_TYPE_NONE, \
167 1, \
168 G_TYPE_##type)
169 #define NEW_SIGNAL_WITH_DATA_GENERIC(name, type) \
170 g_signal_new (name, \
171 G_PASTE_TYPE_CLIENT, \
172 G_SIGNAL_RUN_LAST, \
173 0, /* class offset */ \
174 NULL, /* accumulator */ \
175 NULL, /* accumulator data */ \
176 g_cclosure_marshal_generic, \
177 G_TYPE_NONE, \
178 1, \
179 G_TYPE_##type)
180
181 /******************/
182 /* Methods / Sync */
183 /******************/
184
185 /**
186 * g_paste_client_about_sync:
187 * @self: a #GPasteClient instance
188 * @error: a #GError
189 *
190 * Display the about dialog
191 */
192 G_PASTE_VISIBLE void
193 g_paste_client_about_sync (GPasteClient *self,
194 GError **error)
195 {
196 DBUS_CALL_NO_PARAM_NO_RETURN (ABOUT);
197 }
198
199 /**
200 * g_paste_client_add_sync:
201 * @self: a #GPasteClient instance
202 * @text: the text to add
203 * @error: a #GError
204 *
205 * Add an item to the #GPasteDaemon
206 */
207 G_PASTE_VISIBLE void
208 g_paste_client_add_sync (GPasteClient *self,
209 const gchar *text,
210 GError **error)
211 {
212 DBUS_CALL_ONE_PARAM_NO_RETURN (ADD, string, text);
213 }
214
215 /**
216 * g_paste_client_add_file_sync:
217 * @self: a #GPasteClient instance
218 * @file: the file to add
219 * @error: a #GError
220 *
221 * Add the file contents to the #GPasteDaemon
222 */
223 G_PASTE_VISIBLE void
224 g_paste_client_add_file_sync (GPasteClient *self,
225 const gchar *file,
226 GError **error)
227 {
228 g_autofree gchar *absolute_path = NULL;
229
230 if (!g_path_is_absolute (file))
231 {
232 g_autofree gchar *current_dir = g_get_current_dir ();
233 absolute_path = g_build_filename (current_dir, file, NULL);
234 }
235
236 DBUS_CALL_ONE_PARAM_NO_RETURN (ADD_FILE, string, ((absolute_path) ? absolute_path : file));
237 }
238
239 /**
240 * g_paste_client_add_password_sync:
241 * @self: a #GPasteClient instance
242 * @name: the name to identify the password to add
243 * @password: the password to add
244 * @error: a #GError
245 *
246 * Add the password to the #GPasteDaemon
247 */
248 G_PASTE_VISIBLE void
249 g_paste_client_add_password_sync (GPasteClient *self,
250 const gchar *name,
251 const gchar *password,
252 GError **error)
253 {
254 GVariant *params[] = {
255 g_variant_new_string (name),
256 g_variant_new_string (password)
257 };
258
259 DBUS_CALL_TWO_PARAMS_NO_RETURN (ADD_PASSWORD, params);
260 }
261
262 /**
263 * g_paste_client_backup_history_sync:
264 * @self: a #GPasteClient instance
265 * @history: the name of the history
266 * @backup: the name of the backup
267 * @error: a #GError
268 *
269 * Backup the current history
270 */
271 G_PASTE_VISIBLE void
272 g_paste_client_backup_history_sync (GPasteClient *self,
273 const gchar *history,
274 const gchar *backup,
275 GError **error)
276 {
277 GVariant *params[] = {
278 g_variant_new_string (history),
279 g_variant_new_string (backup)
280 };
281
282 DBUS_CALL_TWO_PARAMS_NO_RETURN (BACKUP_HISTORY, params);
283 }
284
285 /**
286 * g_paste_client_delete_sync:
287 * @self: a #GPasteClient instance
288 * @uuid: the uuid of the element we want to delete
289 * @error: a #GError
290 *
291 * Delete an item from the #GPasteDaemon
292 */
293 G_PASTE_VISIBLE void
294 g_paste_client_delete_sync (GPasteClient *self,
295 const gchar *uuid,
296 GError **error)
297 {
298 DBUS_CALL_ONE_PARAM_NO_RETURN (DELETE, string, uuid);
299 }
300
301 /**
302 * g_paste_client_delete_history_sync:
303 * @self: a #GPasteClient instance
304 * @name: the name of the history to delete
305 * @error: a #GError
306 *
307 * Delete an history
308 */
309 G_PASTE_VISIBLE void
310 g_paste_client_delete_history_sync (GPasteClient *self,
311 const gchar *name,
312 GError **error)
313 {
314 DBUS_CALL_ONE_PARAM_NO_RETURN (DELETE_HISTORY, string, name);
315 }
316
317 /**
318 * g_paste_client_delete_password_sync:
319 * @self: a #GPasteClient instance
320 * @name: the name of the password to delete
321 * @error: a #GError
322 *
323 * Delete the password from the #GPasteDaemon
324 */
325 G_PASTE_VISIBLE void
326 g_paste_client_delete_password_sync (GPasteClient *self,
327 const gchar *name,
328 GError **error)
329 {
330 DBUS_CALL_ONE_PARAM_NO_RETURN (DELETE_PASSWORD, string, name);
331 }
332
333 /**
334 * g_paste_client_empty_history_sync:
335 * @self: a #GPasteClient instance
336 * @name: the name of the history to empty
337 * @error: a #GError
338 *
339 * Empty the history from the #GPasteDaemon
340 */
341 G_PASTE_VISIBLE void
342 g_paste_client_empty_history_sync (GPasteClient *self,
343 const gchar *name,
344 GError **error)
345 {
346 DBUS_CALL_ONE_PARAM_NO_RETURN (EMPTY_HISTORY, string, name);
347 }
348
349 /**
350 * g_paste_client_get_element_sync:
351 * @self: a #GPasteClient instance
352 * @uuid: the uuid of the element we want to get
353 * @error: a #GError
354 *
355 * Get an item from the #GPasteDaemon
356 *
357 * Returns: (transfer full): a newly allocated string
358 */
359 G_PASTE_VISIBLE gchar *
360 g_paste_client_get_element_sync (GPasteClient *self,
361 const gchar *uuid,
362 GError **error)
363 {
364 DBUS_CALL_ONE_PARAM_RET_STRING (GET_ELEMENT, string, uuid);
365 }
366
367 /**
368 * g_paste_client_get_element_at_index_sync:
369 * @self: a #GPasteClient instance
370 * @index: the index of the element we want to get
371 * @error: a #GError
372 *
373 * Get an item from the #GPasteDaemon
374 *
375 * Returns: (transfer full): a new #GPasteClientItem
376 */
377 G_PASTE_VISIBLE GPasteClientItem *
378 g_paste_client_get_element_at_index_sync (GPasteClient *self,
379 guint64 index,
380 GError **error)
381 {
382 DBUS_CALL_ONE_PARAM_RET_ITEM (GET_ELEMENT_AT_INDEX, uint64, index);
383 }
384
385 static gchar *
386 _g_paste_client_get_element_kind_sync (GPasteClient *self,
387 const gchar *uuid,
388 GError **error)
389 {
390 DBUS_CALL_ONE_PARAM_RET_STRING (GET_ELEMENT_KIND, string, uuid);
391 }
392
393 /**
394 * g_paste_client_get_element_kind_sync:
395 * @self: a #GPasteClient instance
396 * @uuid: the uuid of the element we want to get
397 * @error: a #GError
398 *
399 * Get the kind of an item from the #GPasteDaemon
400 *
401 * Returns: The #GPasteItemKind
402 */
403 G_PASTE_VISIBLE GPasteItemKind
404 g_paste_client_get_element_kind_sync (GPasteClient *self,
405 const gchar *uuid,
406 GError **error)
407 {
408 g_autofree gchar *kind = _g_paste_client_get_element_kind_sync (self, uuid, error);
409 GEnumValue *k = (kind) ? g_enum_get_value_by_nick (g_type_class_peek (G_PASTE_TYPE_ITEM_KIND), kind) : NULL;
410
411 return (k) ? k->value : G_PASTE_ITEM_KIND_INVALID;
412 }
413
414 /**
415 * g_paste_client_get_elements_sync:
416 * @self: a #GPasteClient instance
417 * @uuids: (array length=n_uuids): the uuids of the elements we want to get
418 * @n_uuids: the number of uuids
419 * @error: a #GError
420 *
421 * Get some items from the #GPasteDaemon
422 *
423 * Returns: (element-type GPasteClientItem) (transfer full): a newly allocated array of string
424 */
425 G_PASTE_VISIBLE GList *
426 g_paste_client_get_elements_sync (GPasteClient *self,
427 const gchar **uuids,
428 guint64 n_uuids,
429 GError **error)
430 {
431 GVariant *param = g_variant_new_strv (uuids, n_uuids);
432 DBUS_CALL_ONE_PARAMV_RET_ITEMS (GET_ELEMENTS, param);
433 }
434
435 /**
436 * g_paste_client_get_history_sync:
437 * @self: a #GPasteClient instance
438 * @error: a #GError
439 *
440 * Get the history from the #GPasteDaemon
441 *
442 * Returns: (element-type GPasteClientItem) (transfer full): a newly allocated array of string
443 */
444 G_PASTE_VISIBLE GList *
445 g_paste_client_get_history_sync (GPasteClient *self,
446 GError **error)
447 {
448 DBUS_CALL_NO_PARAM_RET_ITEMS (GET_HISTORY);
449 }
450
451 /**
452 * g_paste_client_get_history_name_sync:
453 * @self: a #GPasteClient instance
454 * @error: a #GError
455 *
456 * Get the name of the history from the #GPasteDaemon
457 *
458 * Returns: (transfer full): a newly allocated string
459 */
460 G_PASTE_VISIBLE gchar *
461 g_paste_client_get_history_name_sync (GPasteClient *self,
462 GError **error)
463 {
464 DBUS_CALL_NO_PARAM_RET_STRING (GET_HISTORY_NAME);
465 }
466
467 /**
468 * g_paste_client_get_history_size_sync:
469 * @self: a #GPasteClient instance
470 * @name: the name of the history
471 * @error: a #GError
472 *
473 * Get the history size from the #GPasteDaemon
474 *
475 * Returns: the size of the history
476 */
477 G_PASTE_VISIBLE guint64
478 g_paste_client_get_history_size_sync (GPasteClient *self,
479 const gchar *name,
480 GError **error)
481 {
482 DBUS_CALL_ONE_PARAM_RET_UINT64 (GET_HISTORY_SIZE, string, name);
483 }
484
485 /**
486 * g_paste_client_get_raw_element_sync:
487 * @self: a #GPasteClient instance
488 * @uuid: the uuid of the element we want to get
489 * @error: a #GError
490 *
491 * Get an item from the #GPasteDaemon
492 *
493 * Returns: (transfer full): a newly allocated string
494 */
495 G_PASTE_VISIBLE gchar *
496 g_paste_client_get_raw_element_sync (GPasteClient *self,
497 const gchar *uuid,
498 GError **error)
499 {
500 DBUS_CALL_ONE_PARAM_RET_STRING (GET_RAW_ELEMENT, string, uuid);
501 }
502
503 /**
504 * g_paste_client_get_raw_history_sync:
505 * @self: a #GPasteClient instance
506 * @error: a #GError
507 *
508 * Get the history from the #GPasteDaemon
509 *
510 * Returns: (element-type GPasteClientItem) (transfer full): a newly allocated array of string
511 */
512 G_PASTE_VISIBLE GList *
513 g_paste_client_get_raw_history_sync (GPasteClient *self,
514 GError **error)
515 {
516 DBUS_CALL_NO_PARAM_RET_ITEMS (GET_RAW_HISTORY);
517 }
518
519 /**
520 * g_paste_client_list_histories_sync:
521 * @self: a #GPasteClient instance
522 * @error: a #GError
523 *
524 * List all available hisotries
525 *
526 * Returns: (transfer full): a newly allocated array of string
527 */
528 G_PASTE_VISIBLE GStrv
529 g_paste_client_list_histories_sync (GPasteClient *self,
530 GError **error)
531 {
532 DBUS_CALL_NO_PARAM_RET_STRV (LIST_HISTORIES);
533 }
534
535 /**
536 * g_paste_client_merge_sync:
537 * @self: a #GPasteClient instance
538 * @decoration: (nullable): the decoration to apply to each entry
539 * @separator: (nullable): the separator to add between each entry
540 * @uuids: (array length=n_uuids): the uuids of the elements we want to get
541 * @n_uuids: the number of uuids
542 * @error: a #GError
543 *
544 * Merge some history entries
545 *
546 * If decoration is " and separator is , and entries are foo bar baz
547 * result will be "foo","bar","baz"
548 */
549 G_PASTE_VISIBLE void
550 g_paste_client_merge_sync (GPasteClient *self,
551 const gchar *decoration,
552 const gchar *separator,
553 const gchar **uuids,
554 guint64 n_uuids,
555 GError **error)
556 {
557 GVariant *params[] = {
558 g_variant_new_string (decoration ? decoration : ""),
559 g_variant_new_string (separator ? separator : ""),
560 g_variant_new_strv (uuids, n_uuids)
561 };
562
563 DBUS_CALL_THREE_PARAMS_NO_RETURN (MERGE, params);
564 }
565
566 /**
567 * g_paste_client_on_extension_state_changed_sync:
568 * @self: a #GPasteClient instance
569 * @state: the new state of the extension
570 * @error: a #GError
571 *
572 * Call this when the extension changes its state
573 */
574 G_PASTE_VISIBLE void
575 g_paste_client_on_extension_state_changed_sync (GPasteClient *self,
576 gboolean state,
577 GError **error)
578 {
579 DBUS_CALL_ONE_PARAM_NO_RETURN (ON_EXTENSION_STATE_CHANGED, boolean, state);
580 }
581
582 /**
583 * g_paste_client_reexecute_sync:
584 * @self: a #GPasteClient instance
585 * @error: a #GError
586 *
587 * Reexecute the #GPasteDaemon
588 */
589 G_PASTE_VISIBLE void
590 g_paste_client_reexecute_sync (GPasteClient *self,
591 GError **error)
592 {
593 DBUS_CALL_NO_PARAM_NO_RETURN (REEXECUTE);
594 }
595
596 /**
597 * g_paste_client_rename_password_sync:
598 * @self: a #GPasteClient instance
599 * @old_name: the name of the password to rename
600 * @new_name: the new name to give it
601 * @error: a #GError
602 *
603 * Rename the password in the #GPasteDaemon
604 */
605 G_PASTE_VISIBLE void
606 g_paste_client_rename_password_sync (GPasteClient *self,
607 const gchar *old_name,
608 const gchar *new_name,
609 GError **error)
610 {
611 GVariant *params[] = {
612 g_variant_new_string (old_name),
613 g_variant_new_string (new_name)
614 };
615
616 DBUS_CALL_TWO_PARAMS_NO_RETURN (RENAME_PASSWORD, params);
617 }
618
619 /**
620 * g_paste_client_replace_sync:
621 * @self: a #GPasteClient instance
622 * @uuid: the uuid of the element we want to replace
623 * @contents: the replacement contents
624 * @error: a #GError
625 *
626 * Replace the contents of an item
627 */
628 G_PASTE_VISIBLE void
629 g_paste_client_replace_sync (GPasteClient *self,
630 const gchar *uuid,
631 const gchar *contents,
632 GError **error)
633 {
634 GVariant *params[] = {
635 g_variant_new_string (uuid),
636 g_variant_new_string (contents)
637 };
638
639 DBUS_CALL_TWO_PARAMS_NO_RETURN (REPLACE, params);
640 }
641
642 /**
643 * g_paste_client_search_sync:
644 * @self: a #GPasteClient instance
645 * @pattern: the pattern to look for in history
646 * @error: a #GError
647 *
648 * Search for items matching @pattern in history
649 *
650 * Returns: (transfer full): The uuids of the matching items
651 */
652 G_PASTE_VISIBLE GStrv
653 g_paste_client_search_sync (GPasteClient *self,
654 const gchar *pattern,
655 GError **error)
656 {
657 DBUS_CALL_ONE_PARAM_RET_STRV (SEARCH, string, pattern);
658 }
659
660 /**
661 * g_paste_client_select_sync:
662 * @self: a #GPasteClient instance
663 * @uuid: the uuid of the element we want to select
664 * @error: a #GError
665 *
666 * Select an item from the #GPasteDaemon
667 */
668 G_PASTE_VISIBLE void
669 g_paste_client_select_sync (GPasteClient *self,
670 const gchar *uuid,
671 GError **error)
672 {
673 DBUS_CALL_ONE_PARAM_NO_RETURN (SELECT, string, uuid);
674 }
675
676 /**
677 * g_paste_client_set_password_sync:
678 * @self: a #GPasteClient instance
679 * @uuid: the uuid of the element we want to set as password
680 * @name: the name to identify the password
681 * @error: a #GError
682 *
683 * Set the item as password
684 */
685 G_PASTE_VISIBLE void
686 g_paste_client_set_password_sync (GPasteClient *self,
687 const gchar *uuid,
688 const gchar *name,
689 GError **error)
690 {
691 GVariant *params[] = {
692 g_variant_new_string (uuid),
693 g_variant_new_string (name)
694 };
695
696 DBUS_CALL_TWO_PARAMS_NO_RETURN (SET_PASSWORD, params);
697 }
698
699 /**
700 * g_paste_client_show_history_sync:
701 * @self: a #GPasteClient instance
702 * @error: a #GError
703 *
704 * Emit the ShowHistory signal
705 */
706 G_PASTE_VISIBLE void
707 g_paste_client_show_history_sync (GPasteClient *self,
708 GError **error)
709 {
710 DBUS_CALL_NO_PARAM_NO_RETURN (SHOW_HISTORY);
711 }
712 /**
713 * g_paste_client_switch_history_sync:
714 * @self: a #GPasteClient instance
715 * @name: the name of the history to switch to
716 * @error: a #GError
717 *
718 * Switch to another history
719 */
720 G_PASTE_VISIBLE void
721 g_paste_client_switch_history_sync (GPasteClient *self,
722 const gchar *name,
723 GError **error)
724 {
725 DBUS_CALL_ONE_PARAM_NO_RETURN (SWITCH_HISTORY, string, name);
726 }
727
728 /**
729 * g_paste_client_track_sync:
730 * @self: a #GPasteClient instance
731 * @state: the new tracking state of the #GPasteDaemon
732 * @error: a #GError
733 *
734 * Change the tracking state of the #GPasteDaemon
735 */
736 G_PASTE_VISIBLE void
737 g_paste_client_track_sync (GPasteClient *self,
738 gboolean state,
739 GError **error)
740 {
741 DBUS_CALL_ONE_PARAM_NO_RETURN (TRACK, boolean, state);
742 }
743
744 /**
745 * g_paste_client_upload_sync:
746 * @self: a #GPasteClient instance
747 * @uuid: the uuid of the element we want to upload
748 * @error: a #GError
749 *
750 * Upload an item to a pastebin service
751 */
752 G_PASTE_VISIBLE void
753 g_paste_client_upload_sync (GPasteClient *self,
754 const gchar *uuid,
755 GError **error)
756 {
757 DBUS_CALL_ONE_PARAM_NO_RETURN (UPLOAD, string, uuid);
758 }
759
760 /*******************/
761 /* Methods / Async */
762 /*******************/
763
764 /**
765 * g_paste_client_about:
766 * @self: a #GPasteClient instance
767 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
768 * care about the result of the method invocation.
769 * @user_data: (nullable): The data to pass to @callback.
770 *
771 * Display the about dialog
772 */
773 G_PASTE_VISIBLE void
774 g_paste_client_about (GPasteClient *self,
775 GAsyncReadyCallback callback,
776 gpointer user_data)
777 {
778 DBUS_CALL_NO_PARAM_ASYNC (ABOUT);
779 }
780
781 /**
782 * g_paste_client_add:
783 * @self: a #GPasteClient instance
784 * @text: the text to add
785 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
786 * care about the result of the method invocation.
787 * @user_data: (nullable): The data to pass to @callback.
788 *
789 * Add an item to the #GPasteDaemon
790 */
791 G_PASTE_VISIBLE void
792 g_paste_client_add (GPasteClient *self,
793 const gchar *text,
794 GAsyncReadyCallback callback,
795 gpointer user_data)
796 {
797 DBUS_CALL_ONE_PARAM_ASYNC (ADD, string, text);
798 }
799
800 /**
801 * g_paste_client_add_file:
802 * @self: a #GPasteClient instance
803 * @file: the file to add
804 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
805 * care about the result of the method invocation.
806 * @user_data: (nullable): The data to pass to @callback.
807 *
808 * Add the file contents to the #GPasteDaemon
809 */
810 G_PASTE_VISIBLE void
811 g_paste_client_add_file (GPasteClient *self,
812 const gchar *file,
813 GAsyncReadyCallback callback,
814 gpointer user_data)
815 {
816 g_autofree gchar *absolute_path = NULL;
817
818 if (!g_path_is_absolute (file))
819 {
820 g_autofree gchar *current_dir = g_get_current_dir ();
821 absolute_path = g_build_filename (current_dir, file, NULL);
822 }
823
824 DBUS_CALL_ONE_PARAM_ASYNC (ADD_FILE, string, ((absolute_path) ? absolute_path : file));
825 }
826
827 /**
828 * g_paste_client_add_password:
829 * @self: a #GPasteClient instance
830 * @name: the name to identify the password to add
831 * @password: the password to add
832 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
833 * care about the result of the method invocation.
834 * @user_data: (nullable): The data to pass to @callback.
835 *
836 * Add the password to the #GPasteDaemon
837 */
838 G_PASTE_VISIBLE void
839 g_paste_client_add_password (GPasteClient *self,
840 const gchar *name,
841 const gchar *password,
842 GAsyncReadyCallback callback,
843 gpointer user_data)
844 {
845 GVariant *params[] = {
846 g_variant_new_string (name),
847 g_variant_new_string (password)
848 };
849
850 DBUS_CALL_TWO_PARAMS_ASYNC (ADD_PASSWORD, params);
851 }
852
853 /**
854 * g_paste_client_backup_history:
855 * @self: a #GPasteClient instance
856 * @history: the name of the history
857 * @backup: the name of the backup
858 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
859 * care about the result of the method invocation.
860 * @user_data: (nullable): The data to pass to @callback.
861 *
862 * Backup the current history
863 */
864 G_PASTE_VISIBLE void
865 g_paste_client_backup_history (GPasteClient *self,
866 const gchar *history,
867 const gchar *backup,
868 GAsyncReadyCallback callback,
869 gpointer user_data)
870 {
871 GVariant *params[] = {
872 g_variant_new_string (history),
873 g_variant_new_string (backup)
874 };
875
876 DBUS_CALL_TWO_PARAMS_ASYNC (BACKUP_HISTORY, params);
877 }
878
879 /**
880 * g_paste_client_delete:
881 * @self: a #GPasteClient instance
882 * @uuid: the uuid of the element we want to delete
883 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
884 * care about the result of the method invocation.
885 * @user_data: (nullable): The data to pass to @callback.
886 *
887 * Delete an item from the #GPasteDaemon
888 */
889 G_PASTE_VISIBLE void
890 g_paste_client_delete (GPasteClient *self,
891 const gchar *uuid,
892 GAsyncReadyCallback callback,
893 gpointer user_data)
894 {
895 DBUS_CALL_ONE_PARAM_ASYNC (DELETE, string, uuid);
896 }
897
898 /**
899 * g_paste_client_delete_history:
900 * @self: a #GPasteClient instance
901 * @name: the name of the history to delete
902 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
903 * care about the result of the method invocation.
904 * @user_data: (nullable): The data to pass to @callback.
905 *
906 * Delete an history
907 */
908 G_PASTE_VISIBLE void
909 g_paste_client_delete_history (GPasteClient *self,
910 const gchar *name,
911 GAsyncReadyCallback callback,
912 gpointer user_data)
913 {
914 DBUS_CALL_ONE_PARAM_ASYNC (DELETE_HISTORY, string, name);
915 }
916
917 /**
918 * g_paste_client_delete_password:
919 * @self: a #GPasteClient instance
920 * @name: the name of the password to delete
921 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
922 * care about the result of the method invocation.
923 * @user_data: The data to pass to @callback.
924 *
925 * Delete the password from the #GPasteDaemon
926 */
927 G_PASTE_VISIBLE void
928 g_paste_client_delete_password (GPasteClient *self,
929 const gchar *name,
930 GAsyncReadyCallback callback,
931 gpointer user_data)
932 {
933 DBUS_CALL_ONE_PARAM_ASYNC (DELETE_PASSWORD, string, name);
934 }
935
936 /**
937 * g_paste_client_empty_history:
938 * @self: a #GPasteClient instance
939 * @name: the name of the history to empty
940 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
941 * care about the result of the method invocation.
942 * @user_data: (nullable): The data to pass to @callback.
943 *
944 * Empty the history from the #GPasteDaemon
945 */
946 G_PASTE_VISIBLE void
947 g_paste_client_empty_history (GPasteClient *self,
948 const gchar *name,
949 GAsyncReadyCallback callback,
950 gpointer user_data)
951 {
952 DBUS_CALL_ONE_PARAM_ASYNC (EMPTY_HISTORY, string, name);
953 }
954
955 /**
956 * g_paste_client_get_element:
957 * @self: a #GPasteClient instance
958 * @uuid: the uuid of the element we want to get
959 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
960 * care about the result of the method invocation.
961 * @user_data: (nullable): The data to pass to @callback.
962 *
963 * Get an item from the #GPasteDaemon
964 */
965 G_PASTE_VISIBLE void
966 g_paste_client_get_element (GPasteClient *self,
967 const gchar *uuid,
968 GAsyncReadyCallback callback,
969 gpointer user_data)
970 {
971 DBUS_CALL_ONE_PARAM_ASYNC (GET_ELEMENT, string, uuid);
972 }
973
974 /**
975 * g_paste_client_get_element_at_index:
976 * @self: a #GPasteClient instance
977 * @index: the index of the element we want to get
978 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
979 * care about the result of the method invocation.
980 * @user_data: (nullable): The data to pass to @callback.
981 *
982 * Get an item from the #GPasteDaemon
983 */
984 G_PASTE_VISIBLE void
985 g_paste_client_get_element_at_index (GPasteClient *self,
986 guint64 index,
987 GAsyncReadyCallback callback,
988 gpointer user_data)
989 {
990 DBUS_CALL_ONE_PARAM_ASYNC (GET_ELEMENT_AT_INDEX, uint64, index);
991 }
992
993 /**
994 * g_paste_client_get_element_kind:
995 * @self: a #GPasteClient instance
996 * @uuid: the uuid of the element we want to get
997 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
998 * care about the result of the method invocation.
999 * @user_data: (nullable): The data to pass to @callback.
1000 *
1001 * Get the kind of an item from the #GPasteDaemon
1002 */
1003 G_PASTE_VISIBLE void
1004 g_paste_client_get_element_kind (GPasteClient *self,
1005 const gchar *uuid,
1006 GAsyncReadyCallback callback,
1007 gpointer user_data)
1008 {
1009 DBUS_CALL_ONE_PARAM_ASYNC (GET_ELEMENT_KIND, string, uuid);
1010 }
1011
1012 /**
1013 * g_paste_client_get_elements:
1014 * @self: a #GPasteClient instance
1015 * @uuids: (array length=n_uuids): the uuids of the elements we want to get
1016 * @n_uuids: the number of uuids
1017 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1018 * care about the result of the method invocation.
1019 * @user_data: (nullable): The data to pass to @callback.
1020 *
1021 * Get some items from the #GPasteDaemon
1022 */
1023 G_PASTE_VISIBLE void
1024 g_paste_client_get_elements (GPasteClient *self,
1025 const gchar **uuids,
1026 guint64 n_uuids,
1027 GAsyncReadyCallback callback,
1028 gpointer user_data)
1029 {
1030 GVariant *param = g_variant_new_strv (uuids, n_uuids);
1031 DBUS_CALL_ONE_PARAMV_ASYNC (GET_ELEMENTS, param);
1032 }
1033
1034 /**
1035 * g_paste_client_get_history:
1036 * @self: a #GPasteClient instance
1037 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1038 * care about the result of the method invocation.
1039 * @user_data: (nullable): The data to pass to @callback.
1040 *
1041 * Get the history from the #GPasteDaemon
1042 */
1043 G_PASTE_VISIBLE void
1044 g_paste_client_get_history (GPasteClient *self,
1045 GAsyncReadyCallback callback,
1046 gpointer user_data)
1047 {
1048 DBUS_CALL_NO_PARAM_ASYNC (GET_HISTORY);
1049 }
1050
1051 /**
1052 * g_paste_client_get_history_name:
1053 * @self: a #GPasteClient instance
1054 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1055 * care about the result of the method invocation.
1056 * @user_data: (nullable): The data to pass to @callback.
1057 *
1058 * Get the name of the history from the #GPasteDaemon
1059 */
1060 G_PASTE_VISIBLE void
1061 g_paste_client_get_history_name (GPasteClient *self,
1062 GAsyncReadyCallback callback,
1063 gpointer user_data)
1064 {
1065 DBUS_CALL_NO_PARAM_ASYNC (GET_HISTORY_NAME);
1066 }
1067
1068 /**
1069 * g_paste_client_get_history_size:
1070 * @self: a #GPasteClient instance
1071 * @name: the name of the history
1072 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1073 * care about the result of the method invocation.
1074 * @user_data: (nullable): The data to pass to @callback.
1075 *
1076 * Get the history isize from the #GPasteDaemon
1077 */
1078 G_PASTE_VISIBLE void
1079 g_paste_client_get_history_size (GPasteClient *self,
1080 const gchar *name,
1081 GAsyncReadyCallback callback,
1082 gpointer user_data)
1083 {
1084 DBUS_CALL_ONE_PARAM_ASYNC (GET_HISTORY_SIZE, string, name);
1085 }
1086
1087 /**
1088 * g_paste_client_get_raw_element:
1089 * @self: a #GPasteClient instance
1090 * @uuid: the uuid of the element we want to get
1091 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1092 * care about the result of the method invocation.
1093 * @user_data: (nullable): The data to pass to @callback.
1094 *
1095 * Get an item from the #GPasteDaemon
1096 */
1097 G_PASTE_VISIBLE void
1098 g_paste_client_get_raw_element (GPasteClient *self,
1099 const gchar *uuid,
1100 GAsyncReadyCallback callback,
1101 gpointer user_data)
1102 {
1103 DBUS_CALL_ONE_PARAM_ASYNC (GET_RAW_ELEMENT, string, uuid);
1104 }
1105
1106 /**
1107 * g_paste_client_get_raw_history:
1108 * @self: a #GPasteClient instance
1109 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1110 * care about the result of the method invocation.
1111 * @user_data: (nullable): The data to pass to @callback.
1112 *
1113 * Get the history from the #GPasteDaemon
1114 */
1115 G_PASTE_VISIBLE void
1116 g_paste_client_get_raw_history (GPasteClient *self,
1117 GAsyncReadyCallback callback,
1118 gpointer user_data)
1119 {
1120 DBUS_CALL_NO_PARAM_ASYNC (GET_RAW_HISTORY);
1121 }
1122
1123 /**
1124 * g_paste_client_list_histories:
1125 * @self: a #GPasteClient instance
1126 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1127 * care about the result of the method invocation.
1128 * @user_data: (nullable): The data to pass to @callback.
1129 *
1130 * List all available hisotries
1131 */
1132 G_PASTE_VISIBLE void
1133 g_paste_client_list_histories (GPasteClient *self,
1134 GAsyncReadyCallback callback,
1135 gpointer user_data)
1136 {
1137 DBUS_CALL_NO_PARAM_ASYNC (LIST_HISTORIES);
1138 }
1139
1140 /**
1141 * g_paste_client_merge:
1142 * @self: a #GPasteClient instance
1143 * @decoration: (nullable): the decoration to apply to each entry
1144 * @separator: (nullable): the separator to add between each entry
1145 * @uuids: (array length=n_uuids): the uuids of the elements we want to get
1146 * @n_uuids: the number of uuids
1147 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1148 * care about the result of the method invocation.
1149 * @user_data: (nullable): The data to pass to @callback.
1150 *
1151 * Merge some history entries
1152 *
1153 * If decoration is " and separator is , and entries are foo bar baz
1154 * result will be "foo","bar","baz"
1155 */
1156 G_PASTE_VISIBLE void
1157 g_paste_client_merge (GPasteClient *self,
1158 const gchar *decoration,
1159 const gchar *separator,
1160 const gchar **uuids,
1161 guint64 n_uuids,
1162 GAsyncReadyCallback callback,
1163 gpointer user_data)
1164 {
1165 GVariant *params[] = {
1166 g_variant_new_string (decoration ? decoration : ""),
1167 g_variant_new_string (separator ? separator : ""),
1168 g_variant_new_strv (uuids, n_uuids)
1169 };
1170
1171 DBUS_CALL_THREE_PARAMS_ASYNC (MERGE, params);
1172 }
1173
1174 /**
1175 * g_paste_client_on_extension_state_changed:
1176 * @self: a #GPasteClient instance
1177 * @state: the new state of the extension
1178 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1179 * care about the result of the method invocation.
1180 * @user_data: (nullable): The data to pass to @callback.
1181 *
1182 * Call this when the extension changes its state
1183 */
1184 G_PASTE_VISIBLE void
1185 g_paste_client_on_extension_state_changed (GPasteClient *self,
1186 gboolean state,
1187 GAsyncReadyCallback callback,
1188 gpointer user_data)
1189 {
1190 DBUS_CALL_ONE_PARAM_ASYNC (ON_EXTENSION_STATE_CHANGED, boolean, state);
1191 }
1192
1193 /**
1194 * g_paste_client_reexecute:
1195 * @self: a #GPasteClient instance
1196 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1197 * care about the result of the method invocation.
1198 * @user_data: (nullable): The data to pass to @callback.
1199 *
1200 * Reexecute the #GPasteDaemon
1201 */
1202 G_PASTE_VISIBLE void
1203 g_paste_client_reexecute (GPasteClient *self,
1204 GAsyncReadyCallback callback,
1205 gpointer user_data)
1206 {
1207 DBUS_CALL_NO_PARAM_ASYNC (REEXECUTE);
1208 }
1209
1210 /**
1211 * g_paste_client_rename_password:
1212 * @self: a #GPasteClient instance
1213 * @old_name: the old name of the password to rename
1214 * @new_name: the new name to give it
1215 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1216 * care about the result of the method invocation.
1217 * @user_data: The data to pass to @callback.
1218 *
1219 * Rename the password in the #GPasteDaemon
1220 */
1221 G_PASTE_VISIBLE void
1222 g_paste_client_rename_password (GPasteClient *self,
1223 const gchar *old_name,
1224 const gchar *new_name,
1225 GAsyncReadyCallback callback,
1226 gpointer user_data)
1227 {
1228 GVariant *params[] = {
1229 g_variant_new_string (old_name),
1230 g_variant_new_string (new_name)
1231 };
1232
1233 DBUS_CALL_TWO_PARAMS_ASYNC (RENAME_PASSWORD, params);
1234 }
1235
1236 /**
1237 * g_paste_client_replace:
1238 * @self: a #GPasteClient instance
1239 * @uuid: the uuid of the element we want to replace
1240 * @contents: the replacement contents
1241 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1242 * care about the result of the method invocation.
1243 * @user_data: The data to pass to @callback.
1244 *
1245 * Replace the contents of an item
1246 */
1247 G_PASTE_VISIBLE void
1248 g_paste_client_replace (GPasteClient *self,
1249 const gchar *uuid,
1250 const gchar *contents,
1251 GAsyncReadyCallback callback,
1252 gpointer user_data)
1253 {
1254 GVariant *params[] = {
1255 g_variant_new_string (uuid),
1256 g_variant_new_string (contents)
1257 };
1258
1259 DBUS_CALL_TWO_PARAMS_ASYNC (REPLACE, params);
1260 }
1261
1262 /**
1263 * g_paste_client_search:
1264 * @self: a #GPasteClient instance
1265 * @pattern: the pattern to look for in history
1266 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1267 * care about the result of the method invocation.
1268 * @user_data: (nullable): The data to pass to @callback.
1269 *
1270 * Search for items matching @pattern in history
1271 */
1272 G_PASTE_VISIBLE void
1273 g_paste_client_search (GPasteClient *self,
1274 const gchar *pattern,
1275 GAsyncReadyCallback callback,
1276 gpointer user_data)
1277 {
1278 DBUS_CALL_ONE_PARAM_ASYNC (SEARCH, string, pattern);
1279 }
1280
1281 /**
1282 * g_paste_client_select:
1283 * @self: a #GPasteClient instance
1284 * @uuid: the uuid of the element we want to select
1285 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1286 * care about the result of the method invocation.
1287 * @user_data: (nullable): The data to pass to @callback.
1288 *
1289 * Select an item from the #GPasteDaemon
1290 */
1291 G_PASTE_VISIBLE void
1292 g_paste_client_select (GPasteClient *self,
1293 const gchar *uuid,
1294 GAsyncReadyCallback callback,
1295 gpointer user_data)
1296 {
1297 DBUS_CALL_ONE_PARAM_ASYNC (SELECT, string, uuid);
1298 }
1299
1300 /**
1301 * g_paste_client_set_password:
1302 * @self: a #GPasteClient instance
1303 * @uuid: the uuid of the element we want to set as password
1304 * @name: the name to identify the password
1305 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1306 * care about the result of the method invocation.
1307 * @user_data: The data to pass to @callback.
1308 *
1309 * Set the item as password
1310 */
1311 G_PASTE_VISIBLE void
1312 g_paste_client_set_password (GPasteClient *self,
1313 const gchar *uuid,
1314 const gchar *name,
1315 GAsyncReadyCallback callback,
1316 gpointer user_data)
1317 {
1318 GVariant *params[] = {
1319 g_variant_new_string (uuid),
1320 g_variant_new_string (name)
1321 };
1322
1323 DBUS_CALL_TWO_PARAMS_ASYNC (SET_PASSWORD, params);
1324 }
1325
1326 /**
1327 * g_paste_client_show_history:
1328 * @self: a #GPasteClient instance
1329 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1330 * care about the result of the method invocation.
1331 * @user_data: (nullable): The data to pass to @callback.
1332 *
1333 * Emit the ShowHistory signal
1334 */
1335 G_PASTE_VISIBLE void
1336 g_paste_client_show_history (GPasteClient *self,
1337 GAsyncReadyCallback callback,
1338 gpointer user_data)
1339 {
1340 DBUS_CALL_NO_PARAM_ASYNC (SHOW_HISTORY);
1341 }
1342
1343 /**
1344 * g_paste_client_switch_history:
1345 * @self: a #GPasteClient instance
1346 * @name: the name of the history to switch to
1347 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1348 * care about the result of the method invocation.
1349 * @user_data: (nullable):The data to pass to @callback.
1350 *
1351 * Switch to another history
1352 */
1353 G_PASTE_VISIBLE void
1354 g_paste_client_switch_history (GPasteClient *self,
1355 const gchar *name,
1356 GAsyncReadyCallback callback,
1357 gpointer user_data)
1358 {
1359 DBUS_CALL_ONE_PARAM_ASYNC (SWITCH_HISTORY, string, name);
1360 }
1361
1362 /**
1363 * g_paste_client_track:
1364 * @self: a #GPasteClient instance
1365 * @state: the new tracking state of the #GPasteDaemon
1366 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1367 * care about the result of the method invocation.
1368 * @user_data: (nullable): The data to pass to @callback.
1369 *
1370 * Change the tracking state of the #GPasteDaemon
1371 */
1372 G_PASTE_VISIBLE void
1373 g_paste_client_track (GPasteClient *self,
1374 gboolean state,
1375 GAsyncReadyCallback callback,
1376 gpointer user_data)
1377 {
1378 DBUS_CALL_ONE_PARAM_ASYNC (TRACK, boolean, state);
1379 }
1380
1381 /**
1382 * g_paste_client_upload:
1383 * @self: a #GPasteClient instance
1384 * @uuid: the uuid of the element we want to upload
1385 * @callback: (nullable): A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
1386 * care about the result of the method invocation.
1387 * @user_data: (nullable): The data to pass to @callback.
1388 *
1389 * Upload an item to a pastebin service
1390 */
1391 G_PASTE_VISIBLE void
1392 g_paste_client_upload (GPasteClient *self,
1393 const gchar *uuid,
1394 GAsyncReadyCallback callback,
1395 gpointer user_data)
1396 {
1397 DBUS_CALL_ONE_PARAM_ASYNC (UPLOAD, string, uuid);
1398 }
1399
1400 /****************************/
1401 /* Methods / Async - Finish */
1402 /****************************/
1403
1404 /**
1405 * g_paste_client_about_finish:
1406 * @self: a #GPasteClient instance
1407 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1408 * @error: a #GError
1409 *
1410 * Display the about dialog
1411 */
1412 G_PASTE_VISIBLE void
1413 g_paste_client_about_finish (GPasteClient *self,
1414 GAsyncResult *result,
1415 GError **error)
1416 {
1417 DBUS_ASYNC_FINISH_NO_RETURN;
1418 }
1419
1420 /**
1421 * g_paste_client_add_finish:
1422 * @self: a #GPasteClient instance
1423 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1424 * @error: a #GError
1425 *
1426 * Add an item to the #GPasteDaemon
1427 */
1428 G_PASTE_VISIBLE void
1429 g_paste_client_add_finish (GPasteClient *self,
1430 GAsyncResult *result,
1431 GError **error)
1432 {
1433 DBUS_ASYNC_FINISH_NO_RETURN;
1434 }
1435
1436 /**
1437 * g_paste_client_add_file_finish:
1438 * @self: a #GPasteClient instance
1439 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1440 * @error: a #GError
1441 *
1442 * Add the file contents to the #GPasteDaemon
1443 */
1444 G_PASTE_VISIBLE void
1445 g_paste_client_add_file_finish (GPasteClient *self,
1446 GAsyncResult *result,
1447 GError **error)
1448 {
1449 DBUS_ASYNC_FINISH_NO_RETURN;
1450 }
1451
1452 /**
1453 * g_paste_client_add_password_finish:
1454 * @self: a #GPasteClient instance
1455 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1456 * @error: a #GError
1457 *
1458 * Add the password to the #GPasteDaemon
1459 */
1460 G_PASTE_VISIBLE void
1461 g_paste_client_add_password_finish (GPasteClient *self,
1462 GAsyncResult *result,
1463 GError **error)
1464 {
1465 DBUS_ASYNC_FINISH_NO_RETURN;
1466 }
1467
1468 /**
1469 * g_paste_client_backup_history_finish:
1470 * @self: a #GPasteClient instance
1471 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1472 * @error: a #GError
1473 *
1474 * Backup the current history
1475 */
1476 G_PASTE_VISIBLE void
1477 g_paste_client_backup_history_finish (GPasteClient *self,
1478 GAsyncResult *result,
1479 GError **error)
1480 {
1481 DBUS_ASYNC_FINISH_NO_RETURN;
1482 }
1483
1484 /**
1485 * g_paste_client_delete_finish:
1486 * @self: a #GPasteClient instance
1487 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1488 * @error: a #GError
1489 *
1490 * Delete an item from the #GPasteDaemon
1491 */
1492 G_PASTE_VISIBLE void
1493 g_paste_client_delete_finish (GPasteClient *self,
1494 GAsyncResult *result,
1495 GError **error)
1496 {
1497 DBUS_ASYNC_FINISH_NO_RETURN;
1498 }
1499
1500 /**
1501 * g_paste_client_delete_history_finish:
1502 * @self: a #GPasteClient instance
1503 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1504 * @error: a #GError
1505 *
1506 * Delete an history
1507 */
1508 G_PASTE_VISIBLE void
1509 g_paste_client_delete_history_finish (GPasteClient *self,
1510 GAsyncResult *result,
1511 GError **error)
1512 {
1513 DBUS_ASYNC_FINISH_NO_RETURN;
1514 }
1515
1516 /**
1517 * g_paste_client_delete_password_finish:
1518 * @self: a #GPasteClient instance
1519 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1520 * @error: a #GError
1521 *
1522 * Delete the password from the #GPasteDaemon
1523 */
1524 G_PASTE_VISIBLE void
1525 g_paste_client_delete_password_finish (GPasteClient *self,
1526 GAsyncResult *result,
1527 GError **error)
1528 {
1529 DBUS_ASYNC_FINISH_NO_RETURN;
1530 }
1531
1532 /**
1533 * g_paste_client_empty_history_finish:
1534 * @self: a #GPasteClient instance
1535 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1536 * @error: a #GError
1537 *
1538 * Empty the history from the #GPasteDaemon
1539 */
1540 G_PASTE_VISIBLE void
1541 g_paste_client_empty_history_finish (GPasteClient *self,
1542 GAsyncResult *result,
1543 GError **error)
1544 {
1545 DBUS_ASYNC_FINISH_NO_RETURN;
1546 }
1547
1548 /**
1549 * g_paste_client_get_element_finish:
1550 * @self: a #GPasteClient instance
1551 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1552 * @error: a #GError
1553 *
1554 * Get an item from the #GPasteDaemon
1555 *
1556 * Returns: (transfer full): a newly allocated string
1557 */
1558 G_PASTE_VISIBLE gchar *
1559 g_paste_client_get_element_finish (GPasteClient *self,
1560 GAsyncResult *result,
1561 GError **error)
1562 {
1563 DBUS_ASYNC_FINISH_RET_STRING;
1564 }
1565
1566 /**
1567 * g_paste_client_get_element_at_index_finish:
1568 * @self: a #GPasteClient instance
1569 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1570 * @error: a #GError
1571 *
1572 * Get an item from the #GPasteDaemon
1573 *
1574 * Returns: (transfer full): a new #GPasteClientItem
1575 */
1576 G_PASTE_VISIBLE GPasteClientItem *
1577 g_paste_client_get_element_at_index_finish (GPasteClient *self,
1578 GAsyncResult *result,
1579 GError **error)
1580 {
1581 DBUS_ASYNC_FINISH_RET_ITEM;
1582 }
1583
1584 static gchar *
1585 _g_paste_client_get_element_kind_finish (GPasteClient *self,
1586 GAsyncResult *result,
1587 GError **error)
1588 {
1589 DBUS_ASYNC_FINISH_RET_STRING;
1590 }
1591
1592 /**
1593 * g_paste_client_get_element_kind_finish:
1594 * @self: a #GPasteClient instance
1595 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1596 * @error: a #GError
1597 *
1598 * Get this kind of an item from the #GPasteDaemon
1599 *
1600 * Returns: The #GPasteItemKind
1601 */
1602 G_PASTE_VISIBLE GPasteItemKind
1603 g_paste_client_get_element_kind_finish (GPasteClient *self,
1604 GAsyncResult *result,
1605 GError **error)
1606 {
1607 g_autofree gchar *kind = _g_paste_client_get_element_kind_finish (self, result, error);
1608 GEnumValue *k = (kind) ? g_enum_get_value_by_nick (g_type_class_peek (G_PASTE_TYPE_ITEM_KIND), kind) : NULL;
1609
1610 return (k) ? k->value : G_PASTE_ITEM_KIND_INVALID;
1611 }
1612
1613 /**
1614 * g_paste_client_get_elements_finish:
1615 * @self: a #GPasteClient instance
1616 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1617 * @error: a #GError
1618 *
1619 * Get some items from the #GPasteDaemon
1620 *
1621 * Returns: (element-type GPasteClientItem) (transfer full): a newly allocated array of string
1622 */
1623 G_PASTE_VISIBLE GList *
1624 g_paste_client_get_elements_finish (GPasteClient *self,
1625 GAsyncResult *result,
1626 GError **error)
1627 {
1628 DBUS_ASYNC_FINISH_RET_ITEMS;
1629 }
1630
1631 /**
1632 * g_paste_client_get_history_finish:
1633 * @self: a #GPasteClient instance
1634 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1635 * @error: a #GError
1636 *
1637 * Get the history from the #GPasteDaemon
1638 *
1639 * Returns: (element-type GPasteClientItem) (transfer full): a newly allocated array of string
1640 */
1641 G_PASTE_VISIBLE GList *
1642 g_paste_client_get_history_finish (GPasteClient *self,
1643 GAsyncResult *result,
1644 GError **error)
1645 {
1646 DBUS_ASYNC_FINISH_RET_ITEMS;
1647 }
1648
1649 /**
1650 * g_paste_client_get_history_name_finish:
1651 * @self: a #GPasteClient instance
1652 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1653 * @error: a #GError
1654 *
1655 * Get the name of the history from the #GPasteDaemon
1656 *
1657 * Returns: (transfer full): a newly allocated string
1658 */
1659 G_PASTE_VISIBLE gchar *
1660 g_paste_client_get_history_name_finish (GPasteClient *self,
1661 GAsyncResult *result,
1662 GError **error)
1663 {
1664 DBUS_ASYNC_FINISH_RET_STRING;
1665 }
1666
1667 /**
1668 * g_paste_client_get_history_size_finish:
1669 * @self: a #GPasteClient instance
1670 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1671 * @error: a #GError
1672 *
1673 * Get the history size from the #GPasteDaemon
1674 *
1675 * Returns: the size of the history
1676 */
1677 G_PASTE_VISIBLE guint64
1678 g_paste_client_get_history_size_finish (GPasteClient *self,
1679 GAsyncResult *result,
1680 GError **error)
1681 {
1682 DBUS_ASYNC_FINISH_RET_UINT64;
1683 }
1684
1685 /**
1686 * g_paste_client_get_raw_element_finish:
1687 * @self: a #GPasteClient instance
1688 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1689 * @error: a #GError
1690 *
1691 * Get an item from the #GPasteDaemon
1692 *
1693 * Returns: (transfer full): a newly allocated string
1694 */
1695 G_PASTE_VISIBLE gchar *
1696 g_paste_client_get_raw_element_finish (GPasteClient *self,
1697 GAsyncResult *result,
1698 GError **error)
1699 {
1700 DBUS_ASYNC_FINISH_RET_STRING;
1701 }
1702
1703 /**
1704 * g_paste_client_get_raw_history_finish:
1705 * @self: a #GPasteClient instance
1706 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1707 * @error: a #GError
1708 *
1709 * Get the history from the #GPasteDaemon
1710 *
1711 * Returns: (element-type GPasteClientItem) (transfer full): a newly allocated array of string
1712 */
1713 G_PASTE_VISIBLE GList *
1714 g_paste_client_get_raw_history_finish (GPasteClient *self,
1715 GAsyncResult *result,
1716 GError **error)
1717 {
1718 DBUS_ASYNC_FINISH_RET_ITEMS;
1719 }
1720
1721 /**
1722 * g_paste_client_list_histories_finish:
1723 * @self: a #GPasteClient instance
1724 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1725 * @error: a #GError
1726 *
1727 * List all available hisotries
1728 *
1729 * Returns: (transfer full): a newly allocated array of string
1730 */
1731 G_PASTE_VISIBLE GStrv
1732 g_paste_client_list_histories_finish (GPasteClient *self,
1733 GAsyncResult *result,
1734 GError **error)
1735 {
1736 DBUS_ASYNC_FINISH_RET_STRV;
1737 }
1738
1739 /**
1740 * g_paste_client_merge_finish:
1741 * @self: a #GPasteClient instance
1742 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1743 * @error: a #GError
1744 *
1745 * Merge some history entries
1746 */
1747 G_PASTE_VISIBLE void
1748 g_paste_client_merge_finish (GPasteClient *self,
1749 GAsyncResult *result,
1750 GError **error)
1751 {
1752 DBUS_ASYNC_FINISH_NO_RETURN;
1753 }
1754
1755 /**
1756 * g_paste_client_on_extension_state_changed_finish:
1757 * @self: a #GPasteClient instance
1758 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1759 * @error: a #GError
1760 *
1761 * Call this when the extension changes its state
1762 */
1763 G_PASTE_VISIBLE void
1764 g_paste_client_on_extension_state_changed_finish (GPasteClient *self,
1765 GAsyncResult *result,
1766 GError **error)
1767 {
1768 DBUS_ASYNC_FINISH_NO_RETURN;
1769 }
1770
1771 /**
1772 * g_paste_client_reexecute_finish:
1773 * @self: a #GPasteClient instance
1774 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1775 * @error: a #GError
1776 *
1777 * Reexecute the #GPasteDaemon
1778 */
1779 G_PASTE_VISIBLE void
1780 g_paste_client_reexecute_finish (GPasteClient *self,
1781 GAsyncResult *result,
1782 GError **error)
1783 {
1784 DBUS_ASYNC_FINISH_NO_RETURN;
1785 }
1786
1787 /**
1788 * g_paste_client_rename_password_finish:
1789 * @self: a #GPasteClient instance
1790 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1791 * @error: a #GError
1792 *
1793 * Rename the password in the #GPasteDaemon
1794 */
1795 G_PASTE_VISIBLE void
1796 g_paste_client_rename_password_finish (GPasteClient *self,
1797 GAsyncResult *result,
1798 GError **error)
1799 {
1800 DBUS_ASYNC_FINISH_NO_RETURN;
1801 }
1802
1803 /**
1804 * g_paste_client_replace_finish:
1805 * @self: a #GPasteClient instance
1806 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1807 * @error: a #GError
1808 *
1809 * Replace the contents of an item
1810 */
1811 G_PASTE_VISIBLE void
1812 g_paste_client_replace_finish (GPasteClient *self,
1813 GAsyncResult *result,
1814 GError **error)
1815 {
1816 DBUS_ASYNC_FINISH_NO_RETURN;
1817 }
1818
1819 /**
1820 * g_paste_client_search_finish:
1821 * @self: a #GPasteClient instance
1822 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1823 * @error: a #GError
1824 *
1825 * Search for items matching @pattern in history
1826 *
1827 * Returns: (transfer full): The indexes of the matching items
1828 */
1829 G_PASTE_VISIBLE GStrv
1830 g_paste_client_search_finish (GPasteClient *self,
1831 GAsyncResult *result,
1832 GError **error)
1833 {
1834 DBUS_ASYNC_FINISH_RET_STRV;
1835 }
1836
1837 /**
1838 * g_paste_client_select_finish:
1839 * @self: a #GPasteClient instance
1840 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1841 * @error: a #GError
1842 *
1843 * Select an item from the #GPasteDaemon
1844 */
1845 G_PASTE_VISIBLE void
1846 g_paste_client_select_finish (GPasteClient *self,
1847 GAsyncResult *result,
1848 GError **error)
1849 {
1850 DBUS_ASYNC_FINISH_NO_RETURN;
1851 }
1852
1853 /**
1854 * g_paste_client_set_password_finish:
1855 * @self: a #GPasteClient instance
1856 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1857 * @error: a #GError
1858 *
1859 * Set the item as password
1860 */
1861 G_PASTE_VISIBLE void
1862 g_paste_client_set_password_finish (GPasteClient *self,
1863 GAsyncResult *result,
1864 GError **error)
1865 {
1866 DBUS_ASYNC_FINISH_NO_RETURN;
1867 }
1868
1869 /**
1870 * g_paste_client_show_history_finish:
1871 * @self: a #GPasteClient instance
1872 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1873 * @error: a #GError
1874 *
1875 * Emit the ShowHistory signal
1876 */
1877 G_PASTE_VISIBLE void
1878 g_paste_client_show_history_finish (GPasteClient *self,
1879 GAsyncResult *result,
1880 GError **error)
1881 {
1882 DBUS_ASYNC_FINISH_NO_RETURN;
1883 }
1884
1885 /**
1886 * g_paste_client_switch_history_finish:
1887 * @self: a #GPasteClient instance
1888 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1889 * @error: a #GError
1890 *
1891 * Switch to another history
1892 */
1893 G_PASTE_VISIBLE void
1894 g_paste_client_switch_history_finish (GPasteClient *self,
1895 GAsyncResult *result,
1896 GError **error)
1897 {
1898 DBUS_ASYNC_FINISH_NO_RETURN;
1899 }
1900
1901 /**
1902 * g_paste_client_track_finish:
1903 * @self: a #GPasteClient instance
1904 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1905 * @error: a #GError
1906 *
1907 * Change the tracking state of the #GPasteDaemon
1908 */
1909 G_PASTE_VISIBLE void
1910 g_paste_client_track_finish (GPasteClient *self,
1911 GAsyncResult *result,
1912 GError **error)
1913 {
1914 DBUS_ASYNC_FINISH_NO_RETURN;
1915 }
1916
1917 /**
1918 * g_paste_client_upload_finish:
1919 * @self: a #GPasteClient instance
1920 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to the async call.
1921 * @error: a #GError
1922 *
1923 * Upload an item to a pastebin service
1924 */
1925 G_PASTE_VISIBLE void
1926 g_paste_client_upload_finish (GPasteClient *self,
1927 GAsyncResult *result,
1928 GError **error)
1929 {
1930 DBUS_ASYNC_FINISH_NO_RETURN;
1931 }
1932
1933 /**************/
1934 /* Properties */
1935 /**************/
1936
1937 /**
1938 * g_paste_client_is_active:
1939 * @self: a #GPasteClient instance
1940 *
1941 * Check if the daemon is active
1942 *
1943 * Returns: whether the daemon is active or not
1944 */
1945 G_PASTE_VISIBLE gboolean
1946 g_paste_client_is_active (GPasteClient *self)
1947 {
1948 DBUS_GET_BOOLEAN_PROPERTY (ACTIVE);
1949 }
1950
1951 /**
1952 * g_paste_client_get_version:
1953 * @self: a #GPasteClient instance
1954 *
1955 * Get the version of the running gpaste daemon
1956 *
1957 * Returns: the version of the daemon
1958 */
1959 G_PASTE_VISIBLE gchar *
1960 g_paste_client_get_version (GPasteClient *self)
1961 {
1962 DBUS_GET_STRING_PROPERTY (VERSION);
1963 }
1964
1965 static void
1966 g_paste_client_g_signal (GDBusProxy *proxy,
1967 const gchar *sender_name G_GNUC_UNUSED,
1968 const gchar *signal_name,
1969 GVariant *parameters)
1970 {
1971 GPasteClient *self = G_PASTE_CLIENT (proxy);
1972
1973 HANDLE_SIGNAL (SHOW_HISTORY)
1974 else HANDLE_SIGNAL_WITH_DATA (DELETE_HISTORY, const gchar *, g_variant_get_string (variant, NULL))
1975 else HANDLE_SIGNAL_WITH_DATA (EMPTY_HISTORY, const gchar *, g_variant_get_string (variant, NULL))
1976 else HANDLE_SIGNAL_WITH_DATA (SWITCH_HISTORY, const gchar *, g_variant_get_string (variant, NULL))
1977 else if (g_paste_str_equal (signal_name, G_PASTE_DAEMON_SIG_UPDATE))
1978 {
1979 GVariantIter params_iter;
1980 g_variant_iter_init (&params_iter, parameters);
1981 g_autoptr (GVariant) v1 = g_variant_iter_next_value (&params_iter);
1982 g_autoptr (GVariant) v2 = g_variant_iter_next_value (&params_iter);
1983 g_autoptr (GVariant) v3 = g_variant_iter_next_value (&params_iter);
1984 g_signal_emit (self,
1985 signals[UPDATE],
1986 0, /* detail */
1987 g_enum_get_value_by_nick (g_type_class_peek (G_PASTE_TYPE_UPDATE_ACTION), g_variant_get_string (v1, NULL))->value,
1988 g_enum_get_value_by_nick (g_type_class_peek (G_PASTE_TYPE_UPDATE_TARGET), g_variant_get_string (v2, NULL))->value,
1989 g_variant_get_uint64 (v3),
1990 NULL);
1991 }
1992 }
1993
1994 static void
1995 g_paste_client_g_properties_changed (GDBusProxy *proxy,
1996 GVariant *changed_properties,
1997 const gchar * const *invalidated_properties G_GNUC_UNUSED)
1998 {
1999 GPasteClient *self = G_PASTE_CLIENT (proxy);
2000 GVariantDict dict;
2001
2002 g_variant_dict_init (&dict, changed_properties);
2003
2004 if (g_variant_dict_contains (&dict, G_PASTE_DAEMON_PROP_ACTIVE))
2005 {
2006 g_autoptr (GVariant) v = g_dbus_proxy_get_cached_property (proxy, G_PASTE_DAEMON_PROP_ACTIVE);
2007
2008 g_signal_emit (self,
2009 signals[TRACKING],
2010 0, /* detail */
2011 g_variant_get_boolean (v),
2012 NULL);
2013 }
2014 }
2015
2016 static void
2017 g_paste_client_class_init (GPasteClientClass *klass)
2018 {
2019 GDBusProxyClass *proxy_class = G_DBUS_PROXY_CLASS (klass);
2020
2021 proxy_class->g_signal = g_paste_client_g_signal;
2022 proxy_class->g_properties_changed = g_paste_client_g_properties_changed;
2023
2024 /**
2025 * GPasteClient::delete-history:
2026 * @client: the object on which the signal was emitted
2027 * @history: the name of the history we deleted
2028 *
2029 * The "delete-history" signal is emitted when we delete
2030 * an history.
2031 */
2032 signals[DELETE_HISTORY] = NEW_SIGNAL_WITH_DATA ("delete-history", STRING);
2033
2034 /**
2035 * GPasteClient::empty-history:
2036 * @client: the object on which the signal was emitted
2037 * @history: the name of the history we emptied
2038 *
2039 * The "empty-history" signal is emitted when we empty
2040 * an history.
2041 */
2042 signals[EMPTY_HISTORY] = NEW_SIGNAL_WITH_DATA ("empty-history", STRING);
2043
2044 /**
2045 * GPasteClient::show-history:
2046 * @client: the object on which the signal was emitted
2047 *
2048 * The "show-history" signal is emitted when we switch
2049 * from an history to another.
2050 */
2051 signals[SHOW_HISTORY] = NEW_SIGNAL ("show-history");
2052
2053 /**
2054 * GPasteClient::switch-history:
2055 * @client: the object on which the signal was emitted
2056 * @history: the name of the history we switch to
2057 *
2058 * The "switch-history" signal is emitted when we switch
2059 * from an history to another.
2060 */
2061 signals[SWITCH_HISTORY] = NEW_SIGNAL_WITH_DATA ("switch-history", STRING);
2062
2063 /**
2064 * GPasteClient::track:
2065 * @client: the object on which the signal was emitted
2066 * @tracking_state: whether we're now tracking or not
2067 *
2068 * The "tracking" signal is emitted when the daemon starts or stops tracking
2069 * clipboard changes.
2070 */
2071 signals[TRACKING] = NEW_SIGNAL_WITH_DATA ("tracking", BOOLEAN);
2072
2073 /**
2074 * GPasteClient::update:
2075 * @client: the object on which the signal was emitted
2076 * @action: the kind of update
2077 * @target: the items which need updating
2078 * @index: the index of the item, when the target is POSITION
2079 *
2080 * The "update" signal is emitted whenever anything changed
2081 * in the history (something was added, removed, selected, replaced...).
2082 */
2083 signals[UPDATE] = g_signal_new ("update",
2084 G_PASTE_TYPE_CLIENT,
2085 G_SIGNAL_RUN_LAST,
2086 0, /* class offset */
2087 NULL, /* accumulator */
2088 NULL, /* accumulator data */
2089 g_cclosure_marshal_generic,
2090 G_TYPE_NONE,
2091 3, /* number of params */
2092 G_PASTE_TYPE_UPDATE_ACTION,
2093 G_PASTE_TYPE_UPDATE_TARGET,
2094 G_TYPE_UINT64);
2095 }
2096
2097 static void
2098 g_paste_client_init (GPasteClient *self)
2099 {
2100 GDBusProxy *proxy = G_DBUS_PROXY (self);
2101 g_autoptr (GDBusNodeInfo) g_paste_daemon_dbus_info = g_dbus_node_info_new_for_xml (G_PASTE_DAEMON_INTERFACE,
2102 NULL); /* Error */
2103
2104 g_dbus_proxy_set_interface_info (proxy, g_paste_daemon_dbus_info->interfaces[0]);
2105 }
2106
2107 /**
2108 * g_paste_client_new_sync:
2109 * @error: Return location for error or %NULL.
2110 *
2111 * Create a new instance of #GPasteClient
2112 *
2113 * Returns: (transfer full): a newly allocated #GPasteClient
2114 * free it with g_object_unref
2115 */
2116 G_PASTE_VISIBLE GPasteClient *
2117 g_paste_client_new_sync (GError **error)
2118 {
2119 CUSTOM_PROXY_NEW (CLIENT, DAEMON, G_PASTE_BUS_NAME);
2120 }
2121
2122 /**
2123 * g_paste_client_new:
2124 * @callback: Callback function to invoke when the proxy is ready.
2125 * @user_data: User data to pass to @callback.
2126 *
2127 * Create a new instance of #GPasteClient
2128 */
2129 G_PASTE_VISIBLE void
2130 g_paste_client_new (GAsyncReadyCallback callback,
2131 gpointer user_data)
2132 {
2133 CUSTOM_PROXY_NEW_ASYNC (CLIENT, DAEMON, G_PASTE_BUS_NAME);
2134 }
2135
2136 /**
2137 * g_paste_client_new_finish:
2138 * @result: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to the async ctor.
2139 * @error: Return location for error or %NULL.
2140 *
2141 * Create a new instance of #GPasteClient
2142 *
2143 * Returns: (transfer full): a newly allocated #GPasteClient
2144 * free it with g_object_unref
2145 */
2146 G_PASTE_VISIBLE GPasteClient *
2147 g_paste_client_new_finish (GAsyncResult *result,
2148 GError **error)
2149 {
2150 CUSTOM_PROXY_NEW_FINISH (CLIENT);
2151 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_CLIENT_H__
11 #define __G_PASTE_CLIENT_H__
12
13 #include <gpaste-client-item.h>
14 #include <gpaste-item-enums.h>
15
16 G_BEGIN_DECLS
17
18 #define G_PASTE_TYPE_CLIENT (g_paste_client_get_type ())
19
20 G_PASTE_FINAL_TYPE (Client, client, CLIENT, GDBusProxy)
21
22 /*******************/
23 /* Methods / Sync */
24 /*******************/
25
26 void g_paste_client_about_sync (GPasteClient *self,
27 GError **error);
28 void g_paste_client_add_sync (GPasteClient *self,
29 const gchar *text,
30 GError **error);
31 void g_paste_client_add_file_sync (GPasteClient *self,
32 const gchar *file,
33 GError **error);
34 void g_paste_client_add_password_sync (GPasteClient *self,
35 const gchar *name,
36 const gchar *password,
37 GError **error);
38 void g_paste_client_backup_history_sync (GPasteClient *self,
39 const gchar *history,
40 const gchar *backup,
41 GError **error);
42 void g_paste_client_delete_sync (GPasteClient *self,
43 const gchar *uuid,
44 GError **error);
45 void g_paste_client_delete_history_sync (GPasteClient *self,
46 const gchar *name,
47 GError **error);
48 void g_paste_client_delete_password_sync (GPasteClient *self,
49 const gchar *name,
50 GError **error);
51 void g_paste_client_empty_history_sync (GPasteClient *self,
52 const gchar *name,
53 GError **error);
54 gchar *g_paste_client_get_element_sync (GPasteClient *self,
55 const gchar *uuid,
56 GError **error);
57 GList *g_paste_client_get_elements_sync (GPasteClient *self,
58 const gchar **uuids,
59 guint64 n_uuids,
60 GError **error);
61 GList *g_paste_client_get_history_sync (GPasteClient *self,
62 GError **error);
63 gchar *g_paste_client_get_history_name_sync (GPasteClient *self,
64 GError **error);
65 guint64 g_paste_client_get_history_size_sync (GPasteClient *self,
66 const gchar *name,
67 GError **error);
68 gchar *g_paste_client_get_raw_element_sync (GPasteClient *self,
69 const gchar *uuid,
70 GError **error);
71 GList *g_paste_client_get_raw_history_sync (GPasteClient *self,
72 GError **error);
73 GStrv g_paste_client_list_histories_sync (GPasteClient *self,
74 GError **error);
75 void g_paste_client_merge_sync (GPasteClient *self,
76 const gchar *decoration,
77 const gchar *separator,
78 const gchar **uuids,
79 guint64 n_uuids,
80 GError **error);
81 void g_paste_client_on_extension_state_changed_sync (GPasteClient *self,
82 gboolean state,
83 GError **error);
84 void g_paste_client_reexecute_sync (GPasteClient *self,
85 GError **error);
86 void g_paste_client_rename_password_sync (GPasteClient *self,
87 const gchar *old_name,
88 const gchar *new_name,
89 GError **error);
90 void g_paste_client_replace_sync (GPasteClient *self,
91 const gchar *uuid,
92 const gchar *contents,
93 GError **error);
94 GStrv g_paste_client_search_sync (GPasteClient *self,
95 const gchar *pattern,
96 GError **error);
97 void g_paste_client_select_sync (GPasteClient *self,
98 const gchar *uuid,
99 GError **error);
100 void g_paste_client_set_password_sync (GPasteClient *self,
101 const gchar *uuid,
102 const gchar *name,
103 GError **error);
104 void g_paste_client_show_history_sync (GPasteClient *self,
105 GError **error);
106 void g_paste_client_switch_history_sync (GPasteClient *self,
107 const gchar *name,
108 GError **error);
109 void g_paste_client_track_sync (GPasteClient *self,
110 gboolean state,
111 GError **error);
112 void g_paste_client_upload_sync (GPasteClient *self,
113 const gchar *uuid,
114 GError **error);
115
116 GPasteClientItem *g_paste_client_get_element_at_index_sync (GPasteClient *self,
117 guint64 index,
118 GError **error);
119 GPasteItemKind g_paste_client_get_element_kind_sync (GPasteClient *self,
120 const gchar *uuid,
121 GError **error);
122 /*******************/
123 /* Methods / Async */
124 /*******************/
125
126 void g_paste_client_about (GPasteClient *self,
127 GAsyncReadyCallback callback,
128 gpointer user_data);
129 void g_paste_client_add (GPasteClient *self,
130 const gchar *text,
131 GAsyncReadyCallback callback,
132 gpointer user_data);
133 void g_paste_client_add_file (GPasteClient *self,
134 const gchar *file,
135 GAsyncReadyCallback callback,
136 gpointer user_data);
137 void g_paste_client_add_password (GPasteClient *self,
138 const gchar *name,
139 const gchar *password,
140 GAsyncReadyCallback callback,
141 gpointer user_data);
142 void g_paste_client_backup_history (GPasteClient *self,
143 const gchar *history,
144 const gchar *backup,
145 GAsyncReadyCallback callback,
146 gpointer user_data);
147 void g_paste_client_delete (GPasteClient *self,
148 const gchar *uuid,
149 GAsyncReadyCallback callback,
150 gpointer user_data);
151 void g_paste_client_delete_history (GPasteClient *self,
152 const gchar *name,
153 GAsyncReadyCallback callback,
154 gpointer user_data);
155 void g_paste_client_delete_password (GPasteClient *self,
156 const gchar *name,
157 GAsyncReadyCallback callback,
158 gpointer user_data);
159 void g_paste_client_empty_history (GPasteClient *self,
160 const gchar *name,
161 GAsyncReadyCallback callback,
162 gpointer user_data);
163 void g_paste_client_get_element (GPasteClient *self,
164 const gchar *uuid,
165 GAsyncReadyCallback callback,
166 gpointer user_data);
167 void g_paste_client_get_element_at_index (GPasteClient *self,
168 guint64 index,
169 GAsyncReadyCallback callback,
170 gpointer user_data);
171 void g_paste_client_get_element_kind (GPasteClient *self,
172 const gchar *uuid,
173 GAsyncReadyCallback callback,
174 gpointer user_data);
175 void g_paste_client_get_elements (GPasteClient *self,
176 const gchar **uuids,
177 guint64 n_uuids,
178 GAsyncReadyCallback callback,
179 gpointer user_data);
180 void g_paste_client_get_history (GPasteClient *self,
181 GAsyncReadyCallback callback,
182 gpointer user_data);
183 void g_paste_client_get_history_name (GPasteClient *self,
184 GAsyncReadyCallback callback,
185 gpointer user_data);
186 void g_paste_client_get_history_size (GPasteClient *self,
187 const gchar *name,
188 GAsyncReadyCallback callback,
189 gpointer user_data);
190 void g_paste_client_get_raw_element (GPasteClient *self,
191 const gchar *uuid,
192 GAsyncReadyCallback callback,
193 gpointer user_data);
194 void g_paste_client_get_raw_history (GPasteClient *self,
195 GAsyncReadyCallback callback,
196 gpointer user_data);
197 void g_paste_client_list_histories (GPasteClient *self,
198 GAsyncReadyCallback callback,
199 gpointer user_data);
200 void g_paste_client_merge (GPasteClient *self,
201 const gchar *decoration,
202 const gchar *separator,
203 const gchar **uuids,
204 guint64 n_uuids,
205 GAsyncReadyCallback callback,
206 gpointer user_data);
207 void g_paste_client_on_extension_state_changed (GPasteClient *self,
208 gboolean state,
209 GAsyncReadyCallback callback,
210 gpointer user_data);
211 void g_paste_client_reexecute (GPasteClient *self,
212 GAsyncReadyCallback callback,
213 gpointer user_data);
214 void g_paste_client_rename_password (GPasteClient *self,
215 const gchar *old_name,
216 const gchar *new_name,
217 GAsyncReadyCallback callback,
218 gpointer user_data);
219 void g_paste_client_replace (GPasteClient *self,
220 const gchar *uuid,
221 const gchar *contents,
222 GAsyncReadyCallback callback,
223 gpointer user_data);
224 void g_paste_client_search (GPasteClient *self,
225 const gchar *pattern,
226 GAsyncReadyCallback callback,
227 gpointer user_data);
228 void g_paste_client_select (GPasteClient *self,
229 const gchar *uuid,
230 GAsyncReadyCallback callback,
231 gpointer user_data);
232 void g_paste_client_set_password (GPasteClient *self,
233 const gchar *uuid,
234 const gchar *name,
235 GAsyncReadyCallback callback,
236 gpointer user_data);
237 void g_paste_client_show_history (GPasteClient *self,
238 GAsyncReadyCallback callback,
239 gpointer user_data);
240 void g_paste_client_switch_history (GPasteClient *self,
241 const gchar *name,
242 GAsyncReadyCallback callback,
243 gpointer user_data);
244 void g_paste_client_track (GPasteClient *self,
245 gboolean state,
246 GAsyncReadyCallback callback,
247 gpointer user_data);
248 void g_paste_client_upload (GPasteClient *self,
249 const gchar *uuid,
250 GAsyncReadyCallback callback,
251 gpointer user_data);
252
253 /****************************/
254 /* Methods / Async - Finish */
255 /****************************/
256
257 void g_paste_client_about_finish (GPasteClient *self,
258 GAsyncResult *result,
259 GError **error);
260 void g_paste_client_add_finish (GPasteClient *self,
261 GAsyncResult *result,
262 GError **error);
263 void g_paste_client_add_file_finish (GPasteClient *self,
264 GAsyncResult *result,
265 GError **error);
266 void g_paste_client_add_password_finish (GPasteClient *self,
267 GAsyncResult *result,
268 GError **error);
269 void g_paste_client_backup_history_finish (GPasteClient *self,
270 GAsyncResult *result,
271 GError **error);
272 void g_paste_client_delete_finish (GPasteClient *self,
273 GAsyncResult *result,
274 GError **error);
275 void g_paste_client_delete_history_finish (GPasteClient *self,
276 GAsyncResult *result,
277 GError **error);
278 void g_paste_client_delete_password_finish (GPasteClient *self,
279 GAsyncResult *result,
280 GError **error);
281 void g_paste_client_empty_history_finish (GPasteClient *self,
282 GAsyncResult *result,
283 GError **error);
284 gchar *g_paste_client_get_element_finish (GPasteClient *self,
285 GAsyncResult *result,
286 GError **error);
287 GList *g_paste_client_get_elements_finish (GPasteClient *self,
288 GAsyncResult *result,
289 GError **error);
290 GList *g_paste_client_get_history_finish (GPasteClient *self,
291 GAsyncResult *result,
292 GError **error);
293 gchar *g_paste_client_get_history_name_finish (GPasteClient *self,
294 GAsyncResult *result,
295 GError **error);
296 guint64 g_paste_client_get_history_size_finish (GPasteClient *self,
297 GAsyncResult *result,
298 GError **error);
299 gchar *g_paste_client_get_raw_element_finish (GPasteClient *self,
300 GAsyncResult *result,
301 GError **error);
302 GList *g_paste_client_get_raw_history_finish (GPasteClient *self,
303 GAsyncResult *result,
304 GError **error);
305 GStrv g_paste_client_list_histories_finish (GPasteClient *self,
306 GAsyncResult *result,
307 GError **error);
308 void g_paste_client_merge_finish (GPasteClient *self,
309 GAsyncResult *result,
310 GError **error);
311 void g_paste_client_on_extension_state_changed_finish (GPasteClient *self,
312 GAsyncResult *result,
313 GError **error);
314 void g_paste_client_reexecute_finish (GPasteClient *self,
315 GAsyncResult *result,
316 GError **error);
317 void g_paste_client_rename_password_finish (GPasteClient *self,
318 GAsyncResult *result,
319 GError **error);
320 void g_paste_client_replace_finish (GPasteClient *self,
321 GAsyncResult *result,
322 GError **error);
323 GStrv g_paste_client_search_finish (GPasteClient *self,
324 GAsyncResult *result,
325 GError **error);
326 void g_paste_client_select_finish (GPasteClient *self,
327 GAsyncResult *result,
328 GError **error);
329 void g_paste_client_set_password_finish (GPasteClient *self,
330 GAsyncResult *result,
331 GError **error);
332 void g_paste_client_show_history_finish (GPasteClient *self,
333 GAsyncResult *result,
334 GError **error);
335 void g_paste_client_switch_history_finish (GPasteClient *self,
336 GAsyncResult *result,
337 GError **error);
338 void g_paste_client_track_finish (GPasteClient *self,
339 GAsyncResult *result,
340 GError **error);
341 void g_paste_client_upload_finish (GPasteClient *self,
342 GAsyncResult *result,
343 GError **error);
344
345 GPasteClientItem *g_paste_client_get_element_at_index_finish (GPasteClient *self,
346 GAsyncResult *result,
347 GError **error);
348 GPasteItemKind g_paste_client_get_element_kind_finish (GPasteClient *self,
349 GAsyncResult *result,
350 GError **error);
351
352 /**************/
353 /* Properties */
354 /**************/
355
356 gboolean g_paste_client_is_active (GPasteClient *self);
357 gchar *g_paste_client_get_version (GPasteClient *self);
358
359 /****************/
360 /* Constructors */
361 /****************/
362
363 GPasteClient *g_paste_client_new_sync (GError **error);
364 void g_paste_client_new (GAsyncReadyCallback callback,
365 gpointer user_data);
366 GPasteClient *g_paste_client_new_finish (GAsyncResult *result,
367 GError **error);
368
369 G_END_DECLS
370
371 #endif /*__G_PASTE_CLIENT_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-macros.h>
7 #include <gpaste-item-enums.h>
8
9 G_PASTE_VISIBLE GType
10 g_paste_item_kind_get_type (void)
11 {
12 static GType etype = 0;
13 if (!etype)
14 {
15 static const GEnumValue values[] = {
16 { G_PASTE_ITEM_KIND_TEXT, "G_PASTE_ITEM_KIND_TEXT", "Text" },
17 { G_PASTE_ITEM_KIND_URIS, "G_PASTE_ITEM_KIND_URIS", "Uris" },
18 { G_PASTE_ITEM_KIND_IMAGE, "G_PASTE_ITEM_KIND_IMAGE", "Image" },
19 { G_PASTE_ITEM_KIND_PASSWORD, "G_PASTE_ITEM_KIND_PASSWORD", "Password" },
20 { G_PASTE_ITEM_KIND_INVALID, NULL, NULL }
21 };
22 etype = g_enum_register_static (g_intern_static_string ("GPasteItemKind"), values);
23 g_type_class_ref (etype);
24 }
25 return etype;
26 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_ITEM_ENUMS_H__
11 #define __G_PASTE_ITEM_ENUMS_H__
12
13 #include <glib-object.h>
14
15 G_BEGIN_DECLS
16
17 typedef enum {
18 G_PASTE_ITEM_KIND_TEXT = 1,
19 G_PASTE_ITEM_KIND_URIS,
20 G_PASTE_ITEM_KIND_IMAGE,
21 G_PASTE_ITEM_KIND_PASSWORD,
22 G_PASTE_ITEM_KIND_INVALID = 0
23 } GPasteItemKind;
24
25 #define G_PASTE_TYPE_ITEM_KIND (g_paste_item_kind_get_type ())
26 GType g_paste_item_kind_get_type (void);
27
28 G_END_DECLS
29
30 #endif /*__G_PASTE_ITEM_ENUMS_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-settings-ui-panel.h>
7
8 struct _GPasteSettingsUiPanel
9 {
10 GtkGrid parent_instance;
11 };
12
13 typedef struct
14 {
15 GSList *callback_data;
16 guint64 current_line;
17 } GPasteSettingsUiPanelPrivate;
18
19 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (SettingsUiPanel, settings_ui_panel, GTK_TYPE_GRID)
20
21 #define CALLBACK_DATA(w) \
22 GPasteSettingsUiPanelPrivate *priv = g_paste_settings_ui_panel_get_instance_private (self); \
23 _CallbackDataWrapper *_data = (_CallbackDataWrapper *) g_malloc0 (sizeof (_CallbackDataWrapper)); \
24 CallbackDataWrapper *data = (CallbackDataWrapper *) _data; \
25 priv->callback_data = g_slist_prepend (priv->callback_data, _data); \
26 _data->widget = GTK_WIDGET (w); \
27 data->callback = G_CALLBACK (on_value_changed); \
28 data->reset_cb = on_reset; \
29 data->custom_data = user_data;
30
31 #define G_PASTE_CALLBACK(cb_type) \
32 CallbackDataWrapper *data = (CallbackDataWrapper *) user_data; \
33 ((cb_type) data->callback)
34
35 #define G_PASTE_RESET_CALLBACK() \
36 CallbackDataWrapper *data = (CallbackDataWrapper *) user_data; \
37 (data->reset_cb)
38
39 typedef struct
40 {
41 GCallback callback;
42 GPasteResetCallback reset_cb;
43 gpointer custom_data;
44 } CallbackDataWrapper;
45
46 enum
47 {
48 C_W_ACTION,
49 C_W_RESET,
50
51 C_W_LAST_SIGNAL
52 };
53
54 typedef struct
55 {
56 CallbackDataWrapper wrap;
57 GtkWidget *widget;
58 GtkWidget *reset_widget;
59
60 guint64 c_signals[C_W_LAST_SIGNAL];
61 } _CallbackDataWrapper;
62
63 static void
64 boolean_wrapper (GObject *object,
65 GParamSpec *pspec G_GNUC_UNUSED,
66 gpointer user_data)
67 {
68 G_PASTE_CALLBACK (GPasteBooleanCallback) (gtk_switch_get_active (GTK_SWITCH (object)), data->custom_data);
69 }
70
71 static GtkLabel *
72 g_paste_settings_ui_panel_add_label (GPasteSettingsUiPanel *self,
73 const gchar *label)
74 {
75 GtkWidget *button_label = gtk_widget_new (GTK_TYPE_LABEL,
76 "label", label,
77 "xalign", 0.0,
78 NULL);
79
80 GPasteSettingsUiPanelPrivate *priv = g_paste_settings_ui_panel_get_instance_private (self);
81
82 gtk_widget_set_hexpand (button_label, TRUE);
83 gtk_grid_attach (GTK_GRID (self), button_label, 0, priv->current_line++, 1, 1);
84
85 return GTK_LABEL (button_label);
86 }
87
88 static gboolean
89 g_paste_settings_ui_panel_on_reset_pressed (GtkWidget *widget G_GNUC_UNUSED,
90 GdkEventButton *event G_GNUC_UNUSED,
91 gpointer user_data)
92 {
93 G_PASTE_RESET_CALLBACK () (data->custom_data);
94 return FALSE;
95 }
96
97 static GtkWidget *
98 g_paste_settings_ui_panel_make_reset_button (_CallbackDataWrapper *data)
99 {
100 data->reset_widget = gtk_button_new_from_icon_name ("edit-delete-symbolic", GTK_ICON_SIZE_BUTTON);
101 data->c_signals[C_W_RESET] = g_signal_connect (data->reset_widget,
102 "button-press-event",
103 G_CALLBACK (g_paste_settings_ui_panel_on_reset_pressed),
104 data);
105 if (!((CallbackDataWrapper *) data)->reset_cb)
106 gtk_widget_set_sensitive (data->reset_widget, FALSE);
107 return data->reset_widget;
108 }
109
110 /**
111 * g_paste_settings_ui_panel_add_boolean_setting:
112 * @self: a #GPasteSettingsUiPanel instance
113 * @label: the label to display
114 * @value: the deafault value
115 * @on_value_changed: (closure user_data) (scope notified): the callback to call when the value changes
116 * @on_reset: (closure user_data) (scope notified): the callback to call when the value is reset
117 *
118 * Add a new boolean settings to the current pane
119 *
120 * Returns: (transfer none): the #GtkSwitch we just added
121 */
122 G_PASTE_VISIBLE GtkSwitch *
123 g_paste_settings_ui_panel_add_boolean_setting (GPasteSettingsUiPanel *self,
124 const gchar *label,
125 gboolean value,
126 GPasteBooleanCallback on_value_changed,
127 GPasteResetCallback on_reset,
128 gpointer user_data)
129 {
130 GtkGrid *grid = GTK_GRID (self);
131 GtkLabel *button_label = g_paste_settings_ui_panel_add_label (self, label);
132 GtkWidget *widget = gtk_switch_new ();
133 GtkSwitch *sw = GTK_SWITCH (widget);
134 CALLBACK_DATA (widget);
135
136 gtk_switch_set_active (sw, value);
137 _data->c_signals[C_W_ACTION] = g_signal_connect (widget, "notify::active", G_CALLBACK (boolean_wrapper), data);
138 gtk_grid_attach_next_to (grid, widget, GTK_WIDGET (button_label), GTK_POS_RIGHT, 1, 1);
139 gtk_grid_attach_next_to (grid, g_paste_settings_ui_panel_make_reset_button (_data), widget, GTK_POS_RIGHT, 1, 1);
140
141 return sw;
142 }
143
144 /**
145 * g_paste_settings_ui_panel_add_separator:
146 * @self: a #GPasteSettingsUiPanel instance
147 *
148 * Add a new separator to the current pane
149 */
150 G_PASTE_VISIBLE void
151 g_paste_settings_ui_panel_add_separator (GPasteSettingsUiPanel *self)
152 {
153 GPasteSettingsUiPanelPrivate *priv = g_paste_settings_ui_panel_get_instance_private (self);
154
155 gtk_grid_attach (GTK_GRID (self), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), 0, priv->current_line++, 3, 1);
156 }
157
158 static void
159 range_wrapper (GtkSpinButton *spinbutton,
160 gpointer user_data)
161 {
162 G_PASTE_CALLBACK (GPasteRangeCallback) (gtk_spin_button_get_value (spinbutton), data->custom_data);
163 }
164
165 /**
166 * g_paste_settings_ui_panel_add_range_setting:
167 * @self: a #GPasteSettingsUiPanel instance
168 * @label: the label to display
169 * @value: the deafault value
170 * @min: the minimal authorized value
171 * @max: the maximal authorized value
172 * @step: the step between proposed values
173 * @on_value_changed: (closure user_data) (scope notified): the callback to call when the value changes
174 * @on_reset: (closure user_data) (scope notified): the callback to call when the value is reset
175 *
176 * Add a new boolean settings to the current pane
177 *
178 * Returns: (transfer none): the #GtkSpinButton we just added
179 */
180 G_PASTE_VISIBLE GtkSpinButton *
181 g_paste_settings_ui_panel_add_range_setting (GPasteSettingsUiPanel *self,
182 const gchar *label,
183 gdouble value,
184 gdouble min,
185 gdouble max,
186 gdouble step,
187 GPasteRangeCallback on_value_changed,
188 GPasteResetCallback on_reset,
189 gpointer user_data)
190 {
191 GtkGrid *grid = GTK_GRID (self);
192 GtkLabel *button_label = g_paste_settings_ui_panel_add_label (self, label);
193 GtkWidget *button = gtk_spin_button_new_with_range (min, max, step);
194 GtkSpinButton *b = GTK_SPIN_BUTTON (button);
195 CALLBACK_DATA (button);
196
197 gtk_widget_set_hexpand (button, TRUE);
198 gtk_spin_button_set_value (b, value);
199 _data->c_signals[C_W_ACTION] = g_signal_connect (GTK_SPIN_BUTTON (button), "value-changed", G_CALLBACK (range_wrapper), data);
200 gtk_grid_attach_next_to (grid, button, GTK_WIDGET (button_label), GTK_POS_RIGHT, 1, 1);
201 gtk_grid_attach_next_to (grid, g_paste_settings_ui_panel_make_reset_button (_data), button, GTK_POS_RIGHT, 1, 1);
202
203 return b;
204 }
205
206 static void
207 text_wrapper (GtkEditable *editable,
208 gpointer user_data)
209 {
210 G_PASTE_CALLBACK (GPasteTextCallback) (gtk_entry_get_text (GTK_ENTRY (editable)), data->custom_data);
211 }
212
213 /**
214 * g_paste_settings_ui_panel_add_text_setting:
215 * @self: a #GPasteSettingsUiPanel instance
216 * @label: the label to display
217 * @value: the deafault value
218 * @on_value_changed: (closure user_data) (scope notified): the callback to call when the value changes
219 * @on_reset: (closure user_data) (scope notified): the callback to call when the value is reset
220 *
221 * Add a new text settings to the current pane
222 *
223 * Returns: (transfer none): the #GtkEntry we just added
224 */
225 G_PASTE_VISIBLE GtkEntry *
226 g_paste_settings_ui_panel_add_text_setting (GPasteSettingsUiPanel *self,
227 const gchar *label,
228 const gchar *value,
229 GPasteTextCallback on_value_changed,
230 GPasteResetCallback on_reset,
231 gpointer user_data)
232 {
233 GtkGrid *grid = GTK_GRID (self);
234 GtkLabel *entry_label = g_paste_settings_ui_panel_add_label (self, label);
235 GtkWidget *entry = gtk_entry_new ();
236 GtkEntry *e = GTK_ENTRY (entry);
237 CALLBACK_DATA (entry);
238
239 gtk_widget_set_hexpand (entry, TRUE);
240 gtk_entry_set_text (e, value);
241 _data->c_signals[C_W_ACTION] = g_signal_connect (GTK_EDITABLE (entry), "changed", G_CALLBACK (text_wrapper), data);
242 gtk_grid_attach_next_to (GTK_GRID (self), entry, GTK_WIDGET (entry_label), GTK_POS_RIGHT, 1, 1);
243 if (on_reset)
244 gtk_grid_attach_next_to (grid, g_paste_settings_ui_panel_make_reset_button (_data), entry, GTK_POS_RIGHT, 1, 1);
245
246 return e;
247 }
248
249 static void
250 clean_callback_data (gpointer data,
251 gpointer user_data G_GNUC_UNUSED)
252 {
253 g_autofree _CallbackDataWrapper *wrap = data;
254
255 g_signal_handler_disconnect (wrap->widget, wrap->c_signals[C_W_ACTION]);
256 if (wrap->reset_widget)
257 g_signal_handler_disconnect (wrap->reset_widget, wrap->c_signals[C_W_RESET]);
258 }
259
260 static void
261 g_paste_settings_ui_panel_dispose (GObject *object)
262 {
263 GPasteSettingsUiPanelPrivate *priv = g_paste_settings_ui_panel_get_instance_private (G_PASTE_SETTINGS_UI_PANEL (object));
264
265 g_slist_foreach (priv->callback_data, clean_callback_data, NULL);
266 g_slist_free (priv->callback_data);
267 priv->callback_data = NULL;
268
269 G_OBJECT_CLASS (g_paste_settings_ui_panel_parent_class)->dispose (object);
270 }
271
272 static void
273 g_paste_settings_ui_panel_class_init (GPasteSettingsUiPanelClass *klass)
274 {
275 G_OBJECT_CLASS (klass)->dispose = g_paste_settings_ui_panel_dispose;
276 }
277
278 static void
279 g_paste_settings_ui_panel_init (GPasteSettingsUiPanel *self)
280 {
281 GPasteSettingsUiPanelPrivate *priv = g_paste_settings_ui_panel_get_instance_private (self);
282
283 priv->callback_data = NULL;
284 priv->current_line = 0;
285
286 GtkGrid *grid = GTK_GRID (self);
287
288 gtk_grid_set_column_spacing (grid, 10);
289 gtk_grid_set_row_spacing (grid, 10);
290 }
291
292 /**
293 * g_paste_settings_ui_panel_new:
294 *
295 * Create a new instance of #GPasteSettingsUiPanel
296 *
297 * Returns: a newly allocated #GPasteSettingsUiPanel
298 * free it with g_object_unref
299 */
300 G_PASTE_VISIBLE GPasteSettingsUiPanel *
301 g_paste_settings_ui_panel_new (void) {
302 return G_PASTE_SETTINGS_UI_PANEL (gtk_widget_new (G_PASTE_TYPE_SETTINGS_UI_PANEL, NULL));
303 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_SETTINGS_UI_PANEL_H__
11 #define __G_PASTE_SETTINGS_UI_PANEL_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_SETTINGS_UI_PANEL (g_paste_settings_ui_panel_get_type ())
18
19 G_PASTE_FINAL_TYPE (SettingsUiPanel, settings_ui_panel, SETTINGS_UI_PANEL, GtkGrid)
20
21 typedef void (*GPasteBooleanCallback) (gboolean data,
22 gpointer user_data);
23 typedef void (*GPasteRangeCallback) (gdouble data,
24 gpointer user_data);
25 typedef void (*GPasteTextCallback) (const gchar *data,
26 gpointer user_data);
27 typedef void (*GPasteResetCallback) (gpointer user_data);
28
29 GtkSwitch *g_paste_settings_ui_panel_add_boolean_setting (GPasteSettingsUiPanel *self,
30 const gchar *label,
31 gboolean value,
32 GPasteBooleanCallback on_value_changed,
33 GPasteResetCallback on_reset,
34 gpointer user_data);
35 void g_paste_settings_ui_panel_add_separator (GPasteSettingsUiPanel *self);
36 GtkSpinButton *g_paste_settings_ui_panel_add_range_setting (GPasteSettingsUiPanel *self,
37 const gchar *label,
38 gdouble value,
39 gdouble min,
40 gdouble max,
41 gdouble step,
42 GPasteRangeCallback on_value_changed,
43 GPasteResetCallback on_reset,
44 gpointer user_data);
45 GtkEntry *g_paste_settings_ui_panel_add_text_setting (GPasteSettingsUiPanel *self,
46 const gchar *label,
47 const gchar *value,
48 GPasteTextCallback on_value_changed,
49 GPasteResetCallback on_reset,
50 gpointer user_data);
51
52 GPasteSettingsUiPanel *g_paste_settings_ui_panel_new (void);
53
54 G_END_DECLS
55
56 #endif /*__G_PASTE_SETTINGS_UI_PANEL_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-gsettings-keys.h>
7 #include <gpaste-settings-ui-stack.h>
8 #include <gpaste-util.h>
9
10 struct _GPasteSettingsUiStack
11 {
12 GtkStack parent_instance;
13 };
14
15 enum
16 {
17 C_SETTINGS,
18
19 C_LAST_SIGNAL
20 };
21
22 typedef struct
23 {
24 GPasteClient *client;
25 GPasteSettings *settings;
26
27 GError *init_error;
28
29 GtkSwitch *close_on_select_switch;
30 GtkSwitch *images_support_switch;
31 GtkSwitch *growing_lines_switch;
32 GtkSwitch *primary_to_history_switch;
33 GtkSwitch *save_history_switch;
34 GtkSwitch *synchronize_clipboards_switch;
35 GtkSwitch *track_changes_switch;
36 GtkSwitch *trim_items_switch;
37 GtkSpinButton *element_size_button;
38 GtkSpinButton *max_displayed_history_size_button;
39 GtkSpinButton *max_history_size_button;
40 GtkSpinButton *max_memory_usage_button;
41 GtkSpinButton *max_text_item_size_button;
42 GtkSpinButton *min_text_item_size_button;
43 GtkEntry *launch_ui_entry;
44 GtkEntry *make_password_entry;
45 GtkEntry *pop_entry;
46 GtkEntry *show_history_entry;
47 GtkEntry *sync_clipboard_to_primary_entry;
48 GtkEntry *sync_primary_to_clipboard_entry;
49 GtkEntry *upload_entry;
50 gchar ***actions;
51
52 GtkSwitch *extension_enabled_switch;
53 GtkSwitch *track_extension_state_switch;
54
55 guint64 c_signals[C_LAST_SIGNAL];
56 } GPasteSettingsUiStackPrivate;
57
58 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (SettingsUiStack, settings_ui_stack, GTK_TYPE_STACK)
59
60 #define SETTING_CALLBACK_FULL(setting, type, cast) \
61 static inline void \
62 setting##_callback (type value, \
63 gpointer user_data) \
64 { \
65 g_paste_settings_set_##setting (G_PASTE_SETTINGS (user_data), value); \
66 }
67
68 #define SETTING_CALLBACK(setting, type) SETTING_CALLBACK_FULL (setting, type, type)
69
70 #define BOOLEAN_CALLBACK(setting) SETTING_CALLBACK (setting, gboolean)
71 #define STRING_CALLBACK(setting) SETTING_CALLBACK (setting, const gchar *)
72
73 #define UINT64_CALLBACK(setting) SETTING_CALLBACK_FULL (setting, gdouble, uint64)
74
75 /**
76 * g_paste_settings_ui_stack_add_panel:
77 * @self: a #GPasteSettingsUiStack instance
78 * @name: the name of the panel
79 * @label: the label to display
80 * @panel: (transfer none): the #GPasteSettingsUiPanel to add
81 *
82 * Add a new panel to the #GPasteSettingsUiStack
83 */
84 G_PASTE_VISIBLE void
85 g_paste_settings_ui_stack_add_panel (GPasteSettingsUiStack *self,
86 const gchar *name,
87 const gchar *label,
88 GPasteSettingsUiPanel *panel)
89 {
90 g_return_if_fail (_G_PASTE_IS_SETTINGS_UI_STACK (self));
91
92 gtk_stack_add_titled (GTK_STACK (self),
93 GTK_WIDGET (panel),
94 name, label);
95 }
96
97 BOOLEAN_CALLBACK (close_on_select)
98 BOOLEAN_CALLBACK (extension_enabled)
99 BOOLEAN_CALLBACK (growing_lines)
100 BOOLEAN_CALLBACK (images_support)
101 BOOLEAN_CALLBACK (primary_to_history)
102 BOOLEAN_CALLBACK (save_history)
103 BOOLEAN_CALLBACK (synchronize_clipboards)
104 BOOLEAN_CALLBACK (track_changes)
105 BOOLEAN_CALLBACK (track_extension_state)
106 BOOLEAN_CALLBACK (trim_items)
107
108 static GPasteSettingsUiPanel *
109 g_paste_settings_ui_stack_private_make_behaviour_panel (GPasteSettingsUiStackPrivate *priv)
110 {
111 GPasteSettings *settings = priv->settings;
112 GPasteSettingsUiPanel *panel = g_paste_settings_ui_panel_new ();
113
114 priv->track_changes_switch = g_paste_settings_ui_panel_add_boolean_setting (panel,
115 _("Track clipboard changes"),
116 g_paste_settings_get_track_changes (settings),
117 track_changes_callback,
118 (GPasteResetCallback) g_paste_settings_reset_track_changes,
119 settings);
120 priv->close_on_select_switch = g_paste_settings_ui_panel_add_boolean_setting (panel,
121 _("Close UI on select"),
122 g_paste_settings_get_close_on_select (settings),
123 close_on_select_callback,
124 (GPasteResetCallback) g_paste_settings_reset_close_on_select,
125 settings);
126
127 if (g_paste_util_has_gnome_shell ())
128 {
129 priv->extension_enabled_switch = g_paste_settings_ui_panel_add_boolean_setting (panel,
130 _("Enable the gnome-shell extension"),
131 g_paste_settings_get_extension_enabled (settings),
132 extension_enabled_callback,
133 NULL,
134 settings);
135 priv->track_extension_state_switch = g_paste_settings_ui_panel_add_boolean_setting (panel,
136 _("Sync the daemon state with the extension's one"),
137 g_paste_settings_get_track_extension_state (settings),
138 track_extension_state_callback,
139 (GPasteResetCallback) g_paste_settings_reset_track_extension_state,
140 settings);
141 }
142
143 g_paste_settings_ui_panel_add_separator (panel);
144 priv->primary_to_history_switch = g_paste_settings_ui_panel_add_boolean_setting (panel,
145 _("Primary selection affects history"),
146 g_paste_settings_get_primary_to_history (settings),
147 primary_to_history_callback,
148 (GPasteResetCallback) g_paste_settings_reset_primary_to_history,
149 settings);
150 priv->synchronize_clipboards_switch = g_paste_settings_ui_panel_add_boolean_setting (panel,
151 _("Synchronize clipboard with primary selection"),
152 g_paste_settings_get_synchronize_clipboards (settings),
153 synchronize_clipboards_callback,
154 (GPasteResetCallback) g_paste_settings_reset_synchronize_clipboards,
155 settings);
156 g_paste_settings_ui_panel_add_separator (panel);
157 priv->images_support_switch = g_paste_settings_ui_panel_add_boolean_setting (panel,
158 _("Images support"),
159 g_paste_settings_get_images_support (settings),
160 images_support_callback,
161 (GPasteResetCallback) g_paste_settings_reset_images_support,
162 settings);
163 priv->trim_items_switch = g_paste_settings_ui_panel_add_boolean_setting (panel,
164 _("Trim items"),
165 g_paste_settings_get_trim_items (settings),
166 trim_items_callback,
167 (GPasteResetCallback) g_paste_settings_reset_trim_items,
168 settings);
169 priv->growing_lines_switch = g_paste_settings_ui_panel_add_boolean_setting (panel,
170 _("Detect growing lines"),
171 g_paste_settings_get_growing_lines (settings),
172 growing_lines_callback,
173 (GPasteResetCallback) g_paste_settings_reset_growing_lines,
174 settings);
175 g_paste_settings_ui_panel_add_separator (panel);
176 priv->save_history_switch = g_paste_settings_ui_panel_add_boolean_setting (panel,
177 _("Save history"),
178 g_paste_settings_get_save_history (settings),
179 save_history_callback,
180 (GPasteResetCallback) g_paste_settings_reset_save_history,
181 settings);
182
183 return panel;
184 }
185
186 UINT64_CALLBACK (element_size)
187 UINT64_CALLBACK (max_displayed_history_size)
188 UINT64_CALLBACK (max_history_size)
189 UINT64_CALLBACK (max_memory_usage)
190 UINT64_CALLBACK (max_text_item_size)
191 UINT64_CALLBACK (min_text_item_size)
192
193 static GPasteSettingsUiPanel *
194 g_paste_settings_ui_stack_private_make_history_settings_panel (GPasteSettingsUiStackPrivate *priv)
195 {
196 GPasteSettings *settings = priv->settings;
197 GPasteSettingsUiPanel *panel = g_paste_settings_ui_panel_new ();
198
199 priv->element_size_button = g_paste_settings_ui_panel_add_range_setting (panel,
200 _("Max element size when displaying"),
201 (gdouble) g_paste_settings_get_element_size (settings),
202 0, 511, 5,
203 element_size_callback,
204 (GPasteResetCallback) g_paste_settings_reset_element_size,
205 settings);
206 priv->max_displayed_history_size_button = g_paste_settings_ui_panel_add_range_setting (panel,
207 _("Max displayed history size"),
208 (gdouble) g_paste_settings_get_max_displayed_history_size (settings),
209 10, 255, 5,
210 max_displayed_history_size_callback,
211 (GPasteResetCallback) g_paste_settings_reset_max_displayed_history_size,
212 settings);
213 priv->max_history_size_button = g_paste_settings_ui_panel_add_range_setting (panel,
214 _("Max history size"),
215 (gdouble) g_paste_settings_get_max_history_size (settings),
216 100, 65535, 5,
217 max_history_size_callback,
218 (GPasteResetCallback) g_paste_settings_reset_max_history_size,
219 settings);
220 priv->max_memory_usage_button = g_paste_settings_ui_panel_add_range_setting (panel,
221 _("Max memory usage (MB)"),
222 (gdouble) g_paste_settings_get_max_memory_usage (settings),
223 5, 16383, 5,
224 max_memory_usage_callback,
225 (GPasteResetCallback) g_paste_settings_reset_max_memory_usage,
226 settings);
227 priv->max_text_item_size_button = g_paste_settings_ui_panel_add_range_setting (panel,
228 _("Max text item length"),
229 (gdouble) g_paste_settings_get_max_text_item_size (settings),
230 1, G_MAXUINT64, 1,
231 max_text_item_size_callback,
232 (GPasteResetCallback) g_paste_settings_reset_max_text_item_size,
233 settings);
234 priv->min_text_item_size_button = g_paste_settings_ui_panel_add_range_setting (panel,
235 _("Min text item length"),
236 (gdouble) g_paste_settings_get_min_text_item_size (settings),
237 1, 65535, 1,
238 min_text_item_size_callback,
239 (GPasteResetCallback) g_paste_settings_reset_min_text_item_size,
240 settings);
241
242 return panel;
243 }
244
245 STRING_CALLBACK (launch_ui)
246 STRING_CALLBACK (make_password)
247 STRING_CALLBACK (pop)
248 STRING_CALLBACK (show_history)
249 STRING_CALLBACK (sync_clipboard_to_primary)
250 STRING_CALLBACK (sync_primary_to_clipboard)
251 STRING_CALLBACK (upload)
252
253 static GPasteSettingsUiPanel *
254 g_paste_settings_ui_stack_private_make_keybindings_panel (GPasteSettingsUiStackPrivate *priv)
255 {
256 GPasteSettings *settings = priv->settings;
257 GPasteSettingsUiPanel *panel = g_paste_settings_ui_panel_new ();
258
259 /* translators: Keyboard shortcut to delete the active item from history */
260 priv->pop_entry = g_paste_settings_ui_panel_add_text_setting (panel,
261 _("Delete the active item from history"),
262 g_paste_settings_get_pop (settings),
263 pop_callback,
264 (GPasteResetCallback) g_paste_settings_reset_pop,
265 settings);
266 /* translators: Keyboard shortcut to launch the graphical tool */
267 priv->launch_ui_entry = g_paste_settings_ui_panel_add_text_setting (panel,
268 _("Launch the graphical tool"),
269 g_paste_settings_get_launch_ui (settings),
270 launch_ui_callback,
271 (GPasteResetCallback) g_paste_settings_reset_launch_ui,
272 settings);
273 /* translators: Keyboard shortcut to mark the active item as being a password */
274 priv->make_password_entry = g_paste_settings_ui_panel_add_text_setting (panel,
275 _("Mark the active item as being a password"),
276 g_paste_settings_get_make_password (settings),
277 make_password_callback,
278 (GPasteResetCallback) g_paste_settings_reset_make_password,
279 settings);
280 /* translators: Keyboard shortcut to display the history */
281 priv->show_history_entry = g_paste_settings_ui_panel_add_text_setting (panel,
282 _("Display the history"),
283 g_paste_settings_get_show_history (settings),
284 show_history_callback,
285 (GPasteResetCallback) g_paste_settings_reset_show_history,
286 settings);
287 /* translators: Keyboard shortcut to sync the clipboard to the primary selection */
288 priv->sync_clipboard_to_primary_entry = g_paste_settings_ui_panel_add_text_setting (panel,
289 _("Sync the clipboard to the primary selection"),
290 g_paste_settings_get_sync_clipboard_to_primary (settings),
291 sync_clipboard_to_primary_callback,
292 (GPasteResetCallback) g_paste_settings_reset_sync_clipboard_to_primary,
293 settings);
294 /* translators: Keyboard shortcut to sync the primary selection to the clipboard */
295 priv->sync_primary_to_clipboard_entry = g_paste_settings_ui_panel_add_text_setting (panel,
296 _("Sync the primary selection to the clipboard"),
297 g_paste_settings_get_sync_primary_to_clipboard (settings),
298 sync_primary_to_clipboard_callback,
299 (GPasteResetCallback) g_paste_settings_reset_sync_primary_to_clipboard,
300 settings);
301 /* translators: Keyboard shortcut to upload the active item from history to a pastebin service */
302 priv->upload_entry = g_paste_settings_ui_panel_add_text_setting (panel,
303 _("Upload the active item to a pastebin service"),
304 g_paste_settings_get_upload (settings),
305 upload_callback,
306 (GPasteResetCallback) g_paste_settings_reset_upload,
307 settings);
308
309 return panel;
310 }
311
312 static gboolean
313 g_paste_settings_ui_check_connection_error (GError *error)
314 {
315 if (!error)
316 return FALSE;
317
318 fprintf (stderr, "%s: %s\n", _("Couldn't connect to GPaste daemon"), error->message);
319 return TRUE;
320 }
321
322 /**
323 * g_paste_settings_ui_stack_fill:
324 * @self: a #GPasteSettingsUiStack instance
325 *
326 * Fill the #GPasteSettingsUiStack with default panels
327 */
328 G_PASTE_VISIBLE void
329 g_paste_settings_ui_stack_fill (GPasteSettingsUiStack *self)
330 {
331 GPasteSettingsUiStackPrivate *priv = g_paste_settings_ui_stack_get_instance_private (self);
332
333 g_paste_settings_ui_stack_add_panel (self, "general", _("General behaviour"), g_paste_settings_ui_stack_private_make_behaviour_panel (priv));
334 g_paste_settings_ui_stack_add_panel (self, "history", _("History settings"), g_paste_settings_ui_stack_private_make_history_settings_panel (priv));
335 g_paste_settings_ui_stack_add_panel (self, "keyboard", _("Keyboard shortcuts"), g_paste_settings_ui_stack_private_make_keybindings_panel (priv));
336 }
337
338 static void
339 g_paste_settings_ui_stack_settings_changed (GPasteSettings *settings,
340 const gchar *key,
341 gpointer user_data)
342 {
343 GPasteSettingsUiStackPrivate *priv = user_data;
344
345 if (g_paste_str_equal (key, G_PASTE_CLOSE_ON_SELECT_SETTING))
346 gtk_switch_set_active (GTK_SWITCH (priv->close_on_select_switch), g_paste_settings_get_close_on_select (settings));
347 else if (g_paste_str_equal (key, G_PASTE_ELEMENT_SIZE_SETTING))
348 gtk_spin_button_set_value (priv->element_size_button, g_paste_settings_get_element_size (settings));
349 else if (g_paste_str_equal (key, G_PASTE_GROWING_LINES_SETTING))
350 gtk_switch_set_active (GTK_SWITCH (priv->growing_lines_switch), g_paste_settings_get_growing_lines (settings));
351 else if (g_paste_str_equal (key, G_PASTE_IMAGES_SUPPORT_SETTING))
352 gtk_switch_set_active (GTK_SWITCH (priv->images_support_switch), g_paste_settings_get_images_support (settings));
353 else if (g_paste_str_equal (key, G_PASTE_LAUNCH_UI_SETTING))
354 gtk_entry_set_text (priv->launch_ui_entry, g_paste_settings_get_launch_ui (settings));
355 else if (g_paste_str_equal (key, G_PASTE_MAKE_PASSWORD_SETTING))
356 gtk_entry_set_text (priv->make_password_entry, g_paste_settings_get_make_password (settings));
357 else if (g_paste_str_equal (key, G_PASTE_MAX_DISPLAYED_HISTORY_SIZE_SETTING))
358 gtk_spin_button_set_value (priv->max_displayed_history_size_button, g_paste_settings_get_max_displayed_history_size (settings));
359 else if (g_paste_str_equal (key, G_PASTE_MAX_HISTORY_SIZE_SETTING))
360 gtk_spin_button_set_value (priv->max_history_size_button, g_paste_settings_get_max_history_size (settings));
361 else if (g_paste_str_equal (key, G_PASTE_MAX_MEMORY_USAGE_SETTING))
362 gtk_spin_button_set_value (priv->max_memory_usage_button, g_paste_settings_get_max_memory_usage (settings));
363 else if (g_paste_str_equal (key, G_PASTE_MAX_TEXT_ITEM_SIZE_SETTING))
364 gtk_spin_button_set_value (priv->max_text_item_size_button, g_paste_settings_get_max_text_item_size (settings));
365 else if (g_paste_str_equal (key, G_PASTE_MIN_TEXT_ITEM_SIZE_SETTING))
366 gtk_spin_button_set_value (priv->min_text_item_size_button, g_paste_settings_get_min_text_item_size (settings));
367 else if (g_paste_str_equal (key, G_PASTE_POP_SETTING))
368 gtk_entry_set_text (priv->pop_entry, g_paste_settings_get_pop (settings));
369 else if (g_paste_str_equal (key, G_PASTE_PRIMARY_TO_HISTORY_SETTING ))
370 gtk_switch_set_active (GTK_SWITCH (priv->primary_to_history_switch), g_paste_settings_get_primary_to_history (settings));
371 else if (g_paste_str_equal (key, G_PASTE_SAVE_HISTORY_SETTING))
372 gtk_switch_set_active (GTK_SWITCH (priv->save_history_switch), g_paste_settings_get_save_history (settings));
373 else if (g_paste_str_equal (key, G_PASTE_SHOW_HISTORY_SETTING))
374 gtk_entry_set_text (priv->show_history_entry, g_paste_settings_get_show_history (settings));
375 else if (g_paste_str_equal (key, G_PASTE_SYNC_CLIPBOARD_TO_PRIMARY_SETTING))
376 gtk_entry_set_text (priv->sync_clipboard_to_primary_entry, g_paste_settings_get_sync_clipboard_to_primary (settings));
377 else if (g_paste_str_equal (key, G_PASTE_SYNC_PRIMARY_TO_CLIPBOARD_SETTING))
378 gtk_entry_set_text (priv->sync_primary_to_clipboard_entry, g_paste_settings_get_sync_primary_to_clipboard (settings));
379 else if (g_paste_str_equal (key, G_PASTE_UPLOAD_SETTING))
380 gtk_entry_set_text (priv->upload_entry, g_paste_settings_get_upload (settings));
381 else if (g_paste_str_equal (key, G_PASTE_SYNCHRONIZE_CLIPBOARDS_SETTING))
382 gtk_switch_set_active (GTK_SWITCH (priv->synchronize_clipboards_switch), g_paste_settings_get_synchronize_clipboards (settings));
383 else if (g_paste_str_equal (key, G_PASTE_TRACK_CHANGES_SETTING))
384 gtk_switch_set_active (GTK_SWITCH (priv->track_changes_switch), g_paste_settings_get_track_changes (settings));
385 else if (g_paste_str_equal (key, G_PASTE_TRIM_ITEMS_SETTING))
386 gtk_switch_set_active (GTK_SWITCH (priv->trim_items_switch), g_paste_settings_get_trim_items (settings));
387 else if (g_paste_util_has_gnome_shell ())
388 {
389 if (g_paste_str_equal (key, G_PASTE_EXTENSION_ENABLED_SETTING))
390 gtk_switch_set_active (GTK_SWITCH (priv->extension_enabled_switch), g_paste_settings_get_extension_enabled (settings));
391 else if (g_paste_str_equal (key, G_PASTE_TRACK_EXTENSION_STATE_SETTING))
392 gtk_switch_set_active (GTK_SWITCH (priv->track_extension_state_switch), g_paste_settings_get_track_extension_state (settings));
393 }
394 }
395
396 static void
397 g_paste_settings_ui_stack_dispose (GObject *object)
398 {
399 GPasteSettingsUiStackPrivate *priv = g_paste_settings_ui_stack_get_instance_private (G_PASTE_SETTINGS_UI_STACK (object));
400
401 if (priv->settings) /* first dispose call */
402 {
403 g_signal_handler_disconnect (priv->settings, priv->c_signals[C_SETTINGS]);
404 g_clear_object (&priv->settings);
405 g_clear_object (&priv->client);
406 }
407
408 G_OBJECT_CLASS (g_paste_settings_ui_stack_parent_class)->dispose (object);
409 }
410
411 static void
412 g_paste_settings_ui_stack_finalize (GObject *object)
413 {
414 const GPasteSettingsUiStackPrivate *priv = _g_paste_settings_ui_stack_get_instance_private (G_PASTE_SETTINGS_UI_STACK (object));
415 GStrv *actions = priv->actions;
416
417 for (guint64 i = 0; actions[i]; ++i)
418 g_free ((GStrv) actions[i]);
419 g_free ((GStrv *) actions);
420
421 G_OBJECT_CLASS (g_paste_settings_ui_stack_parent_class)->finalize (object);
422 }
423
424 static void
425 g_paste_settings_ui_stack_class_init (GPasteSettingsUiStackClass *klass)
426 {
427 GObjectClass *object_class = G_OBJECT_CLASS (klass);
428
429 object_class->dispose = g_paste_settings_ui_stack_dispose;
430 object_class->finalize = g_paste_settings_ui_stack_finalize;
431 }
432
433 static void
434 g_paste_settings_ui_stack_init (GPasteSettingsUiStack *self)
435 {
436 GPasteSettingsUiStackPrivate *priv = g_paste_settings_ui_stack_get_instance_private (self);
437
438 priv->init_error = NULL;
439 priv->client = g_paste_client_new_sync (&priv->init_error);
440
441 priv->settings = g_paste_settings_new ();
442 priv->c_signals[C_SETTINGS] = g_signal_connect (priv->settings,
443 "changed",
444 G_CALLBACK (g_paste_settings_ui_stack_settings_changed),
445 priv);
446
447 GStrv *actions = priv->actions = (GStrv *) g_malloc (3 * sizeof (GStrv));
448
449 GStrv action = actions[0] = (GStrv) g_malloc (2 * sizeof (gchar *));
450 action[0] = (gchar *) "switch";
451 /* translators: This is the name of a multi-history management action */
452 action[1] = _("Switch to");
453
454 action = actions[1] = (GStrv) g_malloc (2 * sizeof (gchar *));
455 action[0] = (gchar *) "delete";
456 /* translators: This is the name of a multi-history management action */
457 action[1] = _("Delete");
458
459 actions[2] = NULL;
460 }
461
462 /**
463 * g_paste_settings_ui_stack_new:
464 *
465 * Create a new instance of #GPasteSettingsUiStack
466 *
467 * Returns: (nullable): a newly allocated #GPasteSettingsUiStack
468 * free it with g_object_unref
469 */
470 G_PASTE_VISIBLE GPasteSettingsUiStack *
471 g_paste_settings_ui_stack_new (void)
472 {
473 GPasteSettingsUiStack *self = G_PASTE_SETTINGS_UI_STACK (gtk_widget_new (G_PASTE_TYPE_SETTINGS_UI_STACK,
474 "margin", 12,
475 "homogeneous", TRUE,
476 NULL));
477 const GPasteSettingsUiStackPrivate *priv = _g_paste_settings_ui_stack_get_instance_private (self);
478
479 if (g_paste_settings_ui_check_connection_error (priv->init_error))
480 {
481 g_object_unref (self);
482 return NULL;
483 }
484
485 return self;
486 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_SETTINGS_UI_STACK_H__
11 #define __G_PASTE_SETTINGS_UI_STACK_H__
12
13 #include <gpaste-settings-ui-panel.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_SETTINGS_UI_STACK (g_paste_settings_ui_stack_get_type ())
18
19 G_PASTE_FINAL_TYPE (SettingsUiStack, settings_ui_stack, SETTINGS_UI_STACK, GtkStack)
20
21 void g_paste_settings_ui_stack_add_panel (GPasteSettingsUiStack *self,
22 const gchar *name,
23 const gchar *label,
24 GPasteSettingsUiPanel *panel);
25 void g_paste_settings_ui_stack_fill (GPasteSettingsUiStack *self);
26
27 GPasteSettingsUiStack *g_paste_settings_ui_stack_new (void);
28
29 G_END_DECLS
30
31 #endif /*__G_PASTE_SETTINGS_UI_STACK_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-settings-ui-widget.h>
7
8 struct _GPasteSettingsUiWidget
9 {
10 GtkGrid parent_instance;
11 };
12
13 typedef struct
14 {
15 GPasteSettingsUiStack *stack;
16 } GPasteSettingsUiWidgetPrivate;
17
18 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (SettingsUiWidget, settings_ui_widget, GTK_TYPE_GRID)
19
20 /**
21 * g_paste_settings_ui_widget_get_stack:
22 * @self: a #GPasteSettingsUiWidget instance
23 *
24 * Get the inner GtkStack from the Widget
25 *
26 * Returns: (transfer none): the #GtkStack
27 */
28 G_PASTE_VISIBLE GPasteSettingsUiStack *
29 g_paste_settings_ui_widget_get_stack (GPasteSettingsUiWidget *self)
30 {
31 g_return_val_if_fail (_G_PASTE_IS_SETTINGS_UI_WIDGET (self), NULL);
32
33 const GPasteSettingsUiWidgetPrivate *priv = _g_paste_settings_ui_widget_get_instance_private (self);
34
35 return priv->stack;
36 }
37
38 static void
39 g_paste_settings_ui_widget_class_init (GPasteSettingsUiWidgetClass *klass G_GNUC_UNUSED)
40 {
41 }
42
43 static void
44 g_paste_settings_ui_widget_init (GPasteSettingsUiWidget *self)
45 {
46 GPasteSettingsUiWidgetPrivate *priv = g_paste_settings_ui_widget_get_instance_private (self);
47 GtkGrid *grid = GTK_GRID (self);
48 guint64 current_line = 0;
49
50 GPasteSettingsUiStack *stack = priv->stack = g_paste_settings_ui_stack_new ();
51
52 if (!stack)
53 return;
54
55 g_paste_settings_ui_stack_fill (stack);
56
57 gtk_grid_attach (grid, gtk_widget_new (GTK_TYPE_STACK_SWITCHER,
58 "stack", GTK_STACK (stack),
59 "halign", GTK_ALIGN_CENTER,
60 NULL), 0, current_line++, 1, 1);
61 gtk_grid_attach (grid, GTK_WIDGET (stack), 0, current_line++, 1, 1);
62 }
63
64 /**
65 * g_paste_settings_ui_widget_new:
66 *
67 * Create a new instance of #GPasteSettingsUiWidget
68 *
69 * Returns: (nullable): a newly allocated #GPasteSettingsUiWidget
70 * free it with g_object_unref
71 */
72 G_PASTE_VISIBLE GtkWidget *
73 g_paste_settings_ui_widget_new (void)
74 {
75 GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_SETTINGS_UI_WIDGET, NULL);
76 const GPasteSettingsUiWidgetPrivate *priv = _g_paste_settings_ui_widget_get_instance_private (G_PASTE_SETTINGS_UI_WIDGET (self));
77
78 if (!priv->stack)
79 {
80 g_object_unref (self);
81 return NULL;
82 }
83
84 return self;
85 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_SETTINGS_UI_WIDGET_H__
11 #define __G_PASTE_SETTINGS_UI_WIDGET_H__
12
13 #include <gpaste-settings-ui-stack.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_SETTINGS_UI_WIDGET (g_paste_settings_ui_widget_get_type ())
18
19 G_PASTE_FINAL_TYPE (SettingsUiWidget, settings_ui_widget, SETTINGS_UI_WIDGET, GtkGrid)
20
21 GPasteSettingsUiStack *g_paste_settings_ui_widget_get_stack (GPasteSettingsUiWidget *self);
22
23 GtkWidget *g_paste_settings_ui_widget_new (void);
24
25 G_END_DECLS
26
27 #endif /*__G_PASTE_SETTINGS_UI_WIDGET_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-gsettings-keys.h>
7 #include <gpaste-util.h>
8
9 #define G_SETTINGS_ENABLE_BACKEND 1
10 #include <gio/gsettingsbackend.h>
11
12 struct _GPasteSettings
13 {
14 GObject parent_instance;
15 };
16
17 enum
18 {
19 C_CHANGED,
20 C_SHELL_CHANGED,
21
22 C_LAST_SIGNAL
23 };
24
25 typedef struct
26 {
27 GSettings *settings;
28 GSettings *shell_settings;
29
30 gboolean close_on_select;
31 guint64 element_size;
32 gboolean empty_history_confirmation;
33 gboolean growing_lines;
34 gchar *history_name;
35 gboolean images_support;
36 gchar *launch_ui;
37 gchar *make_password;
38 guint64 max_displayed_history_size;
39 guint64 max_history_size;
40 guint64 max_memory_usage;
41 guint64 max_text_item_size;
42 guint64 min_text_item_size;
43 gchar *pop;
44 gboolean primary_to_history;
45 gboolean rich_text_support;
46 gboolean save_history;
47 gchar *show_history;
48 gchar *sync_clipboard_to_primary;
49 gchar *sync_primary_to_clipboard;
50 gboolean synchronize_clipboards;
51 gboolean track_changes;
52 gboolean track_extension_state;
53 gboolean trim_items;
54 gchar *upload;
55
56 gboolean extension_enabled;
57
58 guint64 c_signals[C_LAST_SIGNAL];
59 } GPasteSettingsPrivate;
60
61 G_PASTE_DEFINE_TYPE_WITH_PRIVATE (Settings, settings, G_TYPE_OBJECT)
62
63 enum
64 {
65 CHANGED,
66 REBIND,
67 TRACK,
68
69 LAST_SIGNAL
70 };
71
72 static guint64 signals[LAST_SIGNAL] = { 0 };
73
74 #define SETTING(name, key, type, setting_type, fail, guards, clear_func, dup_func) \
75 G_PASTE_VISIBLE type \
76 g_paste_settings_get_##name (const GPasteSettings *self) \
77 { \
78 g_return_val_if_fail (_G_PASTE_IS_SETTINGS ((gpointer) self), fail); \
79 const GPasteSettingsPrivate *priv = _g_paste_settings_get_instance_private (self); \
80 return priv->name; \
81 } \
82 G_PASTE_VISIBLE void \
83 g_paste_settings_reset_##name (GPasteSettings *self) \
84 { \
85 g_return_if_fail (_G_PASTE_IS_SETTINGS (self)); \
86 const GPasteSettingsPrivate *priv = _g_paste_settings_get_instance_private (self); \
87 g_settings_reset (priv->settings, G_PASTE_##key##_SETTING); \
88 } \
89 static void \
90 g_paste_settings_private_set_##name##_from_dconf (GPasteSettingsPrivate *priv) \
91 { \
92 priv->name = g_settings_get_##setting_type (priv->settings, G_PASTE_##key##_SETTING); \
93 } \
94 G_PASTE_VISIBLE void \
95 g_paste_settings_set_##name (GPasteSettings *self, \
96 type value) \
97 { \
98 g_return_if_fail (_G_PASTE_IS_SETTINGS (self)); \
99 guards \
100 GPasteSettingsPrivate *priv = g_paste_settings_get_instance_private (self); \
101 clear_func \
102 priv->name = dup_func (value); \
103 g_settings_set_##setting_type (priv->settings, G_PASTE_##key##_SETTING, value); \
104 }
105
106 #define TRIVIAL_SETTING(name, key, type, setting_type, fail) \
107 SETTING (name, key, type, setting_type, fail, {}, {},)
108
109 #define BOOLEAN_SETTING(name, key) TRIVIAL_SETTING (name, key, gboolean, boolean, FALSE)
110 #define UNSIGNED_SETTING(name, key) TRIVIAL_SETTING (name, key, guint64, uint64, 0)
111
112 #define STRING_SETTING(name, key) SETTING (name, key, const gchar *, string, NULL, \
113 g_return_if_fail (value); \
114 g_return_if_fail (g_utf8_validate (value, -1, NULL));, \
115 g_free (priv->name);, g_strdup)
116
117 #define NEW_SIGNAL_FULL(name, type, MTYPE, arg_type) \
118 g_signal_new (name, \
119 G_PASTE_TYPE_SETTINGS, \
120 type, \
121 0, /* class offset */ \
122 NULL, /* accumulator */ \
123 NULL, /* accumulator data */ \
124 g_cclosure_marshal_VOID__##MTYPE, \
125 G_TYPE_NONE, \
126 1, /* number of params */ \
127 G_TYPE_##arg_type)
128 #define NEW_SIGNAL(name, arg_type) NEW_SIGNAL_FULL (name, G_SIGNAL_RUN_LAST, arg_type, arg_type)
129 #define NEW_SIGNAL_DETAILED(name, arg_type) NEW_SIGNAL_FULL (name, G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, arg_type, arg_type)
130 #define NEW_SIGNAL_DETAILED_STATIC(name, arg_type) NEW_SIGNAL_FULL (name, G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, arg_type, arg_type | G_SIGNAL_TYPE_STATIC_SCOPE)
131
132 /**
133 * g_paste_settings_get_close_on_select:
134 * @self: a #GPasteSettings instance
135 *
136 * Get the "close-on-select" setting
137 *
138 * Returns: the value of the "close-on-select" setting
139 */
140 /**
141 * g_paste_settings_reset_close_on_select:
142 * @self: a #GPasteSettings instance
143 *
144 * Reset the "close-on-select" setting
145 */
146 /**
147 * g_paste_settings_set_close_on_select:
148 * @self: a #GPasteSettings instance
149 * @value: the new history name
150 *
151 * Change the "close-on-select" setting
152 */
153 BOOLEAN_SETTING (close_on_select, CLOSE_ON_SELECT)
154
155 /**
156 * g_paste_settings_get_element_size:
157 * @self: a #GPasteSettings instance
158 *
159 * Get the "element-size" setting
160 *
161 * Returns: the value of the "element-size" setting
162 */
163 /**
164 * g_paste_settings_reset_element_size:
165 * @self: a #GPasteSettings instance
166 *
167 * Reset the "element-size" setting
168 */
169 /**
170 * g_paste_settings_set_element_size:
171 * @self: a #GPasteSettings instance
172 * @value: the maximum displayed size of an item
173 *
174 * Change the "element-size" setting
175 */
176 UNSIGNED_SETTING (element_size, ELEMENT_SIZE)
177
178 /**
179 * g_paste_settings_get_empty_history_confirmation:
180 * @self: a #GPasteSettings instance
181 *
182 * Get the "empty-history-confirmation" setting
183 *
184 * Returns: the value of the "empty-history-confirmation" setting
185 */
186 /**
187 * g_paste_settings_reset_empty_history_confirmation:
188 * @self: a #GPasteSettings instance
189 *
190 * Reset the "empty-history-confirmation" setting
191 */
192 /**
193 * g_paste_settings_set_empty_history_confirmation:
194 * @self: a #GPasteSettings instance
195 * @value: whether to prompt for confirmation when emptying an history
196 *
197 * Change the "empty-history-confirmation" setting
198 */
199 BOOLEAN_SETTING (empty_history_confirmation, EMPTY_HISTORY_CONFIRMATION)
200
201 /**
202 * g_paste_settings_get_growing_lines:
203 * @self: a #GPasteSettings instance
204 *
205 * Get the "growing-lines" setting
206 *
207 * Returns: the value of the "growing-lines" setting
208 */
209 /**
210 * g_paste_settings_reset_growing_lines:
211 * @self: a #GPasteSettings instance
212 *
213 * Reset the "growing-lines" setting
214 */
215 /**
216 * g_paste_settings_set_growing_lines:
217 * @self: a #GPasteSettings instance
218 * @value: whether to detect or not growing lines
219 *
220 * Change the "growing-lines" setting
221 */
222 BOOLEAN_SETTING (growing_lines, GROWING_LINES)
223
224 /**
225 * g_paste_settings_get_history_name:
226 * @self: a #GPasteSettings instance
227 *
228 * Get the "history-name" setting
229 *
230 * Returns: the value of the "history-name" setting
231 */
232 /**
233 * g_paste_settings_reset_history_name:
234 * @self: a #GPasteSettings instance
235 *
236 * Reset the "history-name" setting
237 */
238 /**
239 * g_paste_settings_set_history_name:
240 * @self: a #GPasteSettings instance
241 * @value: the new history name
242 *
243 * Change the "history-name" setting
244 */
245 STRING_SETTING (history_name, HISTORY_NAME)
246
247 /**
248 * g_paste_settings_get_images_support:
249 * @self: a #GPasteSettings instance
250 *
251 * Get the "images-support" setting
252 *
253 * Returns: the value of the "images-support" setting
254 */
255 /**
256 * g_paste_settings_reset_images_support:
257 * @self: a #GPasteSettings instance
258 *
259 * Reset the "images-support" setting
260 */
261 /**
262 * g_paste_settings_set_images_support:
263 * @self: a #GPasteSettings instance
264 * @value: the new history name
265 *
266 * Change the "images-support" setting
267 */
268 BOOLEAN_SETTING (images_support, IMAGES_SUPPORT)
269
270 /**
271 * g_paste_settings_get_launch_ui:
272 * @self: a #GPasteSettings instance
273 *
274 * Get the "launch-ui" setting
275 *
276 * Returns: the value of the "launch-ui" setting
277 */
278 /**
279 * g_paste_settings_reset_launch_ui:
280 * @self: a #GPasteSettings instance
281 *
282 * Reset the "launch-ui" setting
283 */
284 /**
285 * g_paste_settings_set_launch_ui:
286 * @self: a #GPasteSettings instance
287 * @value: the new keyboard shortcut
288 *
289 * Change the "launch-ui" setting
290 */
291 STRING_SETTING (launch_ui, LAUNCH_UI)
292
293 /**
294 * g_paste_settings_get_make_password:
295 * @self: a #GPasteSettings instance
296 *
297 * Get the "make-password" setting
298 *
299 * Returns: the value of the "make-password" setting
300 */
301 /**
302 * g_paste_settings_reset_make_password:
303 * @self: a #GPasteSettings instance
304 *
305 * Reset the "make-password" setting
306 */
307 /**
308 * g_paste_settings_set_make_password:
309 * @self: a #GPasteSettings instance
310 * @value: the new keyboard shortcut
311 *
312 * Change the "make-password" setting
313 */
314 STRING_SETTING (make_password, MAKE_PASSWORD)
315
316 /**
317 * g_paste_settings_get_max_displayed_history_size:
318 * @self: a #GPasteSettings instance
319 *
320 * Get the "max-displayed-history-size" setting
321 *
322 * Returns: the value of the "max-displayed-history-size" setting
323 */
324 /**
325 * g_paste_settings_reset_max_displayed_history_size:
326 * @self: a #GPasteSettings instance
327 *
328 * Reset the "max-displayed-history-size" setting
329 */
330 /**
331 * g_paste_settings_set_max_displayed_history_size:
332 * @self: a #GPasteSettings instance
333 * @value: the maximum number of items to display
334 *
335 * Change the "max-displayed-history-size" setting
336 */
337 UNSIGNED_SETTING (max_displayed_history_size, MAX_DISPLAYED_HISTORY_SIZE)
338
339 /**
340 * g_paste_settings_get_max_history_size:
341 * @self: a #GPasteSettings instance
342 *
343 * Get the "max-history-size" setting
344 *
345 * Returns: the value of the "max-history-size" setting
346 */
347 /**
348 * g_paste_settings_reset_max_history_size:
349 * @self: a #GPasteSettings instance
350 *
351 * Reset the "max-history-size" setting
352 */
353 /**
354 * g_paste_settings_set_max_history_size:
355 * @self: a #GPasteSettings instance
356 * @value: the maximum number of items the history can contain
357 *
358 * Change the "max-history-size" setting
359 */
360 UNSIGNED_SETTING (max_history_size, MAX_HISTORY_SIZE)
361
362 /**
363 * g_paste_settings_get_max_memory_usage:
364 * @self: a #GPasteSettings instance
365 *
366 * Get the "max-memory-usage" setting
367 *
368 * Returns: the value of the "max-memory-usage" setting
369 */
370 /**
371 * g_paste_settings_reset_max_memory_usage:
372 * @self: a #GPasteSettings instance
373 *
374 * Reset the "max-memory-usage" setting
375 */
376 /**
377 * g_paste_settings_set_max_memory_usage:
378 * @self: a #GPasteSettings instance
379 * @value: the maximum amount of memory we can use
380 *
381 * Change the "max-memory-usage" setting
382 */
383 UNSIGNED_SETTING (max_memory_usage, MAX_MEMORY_USAGE)
384
385 /**
386 * g_paste_settings_get_max_text_item_size:
387 * @self: a #GPasteSettings instance
388 *
389 * Get the "max-text-item-size" setting
390 *
391 * Returns: the value of the "max-text-item-size" setting
392 */
393 /**
394 * g_paste_settings_reset_max_text_item_size:
395 * @self: a #GPasteSettings instance
396 *
397 * Reset the "max-text-item-size" setting
398 */
399 /**
400 * g_paste_settings_set_max_text_item_size:
401 * @self: a #GPasteSettings instance
402 * @value: the maximum size for a textual item to be handled
403 *
404 * Change the "max-text-item-size" setting
405 */
406 UNSIGNED_SETTING (max_text_item_size, MAX_TEXT_ITEM_SIZE)
407
408 /**
409 * g_paste_settings_get_min_text_item_size:
410 * @self: a #GPasteSettings instance
411 *
412 * Get the "min-text-item-size" setting
413 *
414 * Returns: the value of the "min-text-item-size" setting
415 */
416 /**
417 * g_paste_settings_reset_min_text_item_size:
418 * @self: a #GPasteSettings instance
419 *
420 * Reset the "min-text-item-size" setting
421 */
422 /**
423 * g_paste_settings_set_min_text_item_size:
424 * @self: a #GPasteSettings instance
425 * @value: the minimum size for a textual item to be handled
426 *
427 * Change the "min-text-item-size" setting
428 */
429 UNSIGNED_SETTING (min_text_item_size, MIN_TEXT_ITEM_SIZE)
430
431 /**
432 * g_paste_settings_get_pop:
433 * @self: a #GPasteSettings instance
434 *
435 * Get the "pop" setting
436 *
437 * Returns: the value of the "pop" setting
438 */
439 /**
440 * g_paste_settings_reset_pop:
441 * @self: a #GPasteSettings instance
442 *
443 * Reset the "pop" setting
444 */
445 /**
446 * g_paste_settings_set_pop:
447 * @self: a #GPasteSettings instance
448 * @value: the new keyboard shortcut
449 *
450 * Change the "pop" setting
451 */
452 STRING_SETTING (pop, POP)
453
454 /**
455 * g_paste_settings_get_primary_to_history:
456 * @self: a #GPasteSettings instance
457 *
458 * Get the "primary-to-history" setting
459 *
460 * Returns: the value of the "primary-to-history" setting
461 */
462 /**
463 * g_paste_settings_reset_primary_to_history:
464 * @self: a #GPasteSettings instance
465 *
466 * Reset the "primary-to-history" setting
467 */
468 /**
469 * g_paste_settings_set_primary_to_history:
470 * @self: a #GPasteSettings instance
471 * @value: whether to track or not the primary selection changes as clipboard ones
472 *
473 * Change the "primary-to-history" setting
474 */
475 BOOLEAN_SETTING (primary_to_history, PRIMARY_TO_HISTORY)
476
477 /**
478 * g_paste_settings_get_rich_text_support:
479 * @self: a #GPasteSettings instance
480 *
481 * Get the "rich-text-support" setting
482 *
483 * Returns: the value of the "rich-text-support" setting
484 */
485 /**
486 * g_paste_settings_reset_rich_text_support:
487 * @self: a #GPasteSettings instance
488 *
489 * Reset the "rich-text-support" setting
490 */
491 /**
492 * g_paste_settings_set_rich_text_support:
493 * @self: a #GPasteSettings instance
494 * @value: the new history name
495 *
496 * Change the "rich-text-support" setting
497 */
498 BOOLEAN_SETTING (rich_text_support, RICH_TEXT_SUPPORT)
499
500 /**
501 * g_paste_settings_get_save_history:
502 * @self: a #GPasteSettings instance
503 *
504 * Get the "save-history" setting
505 *
506 * Returns: the value of the "save-history" setting
507 */
508 /**
509 * g_paste_settings_reset_save_history:
510 * @self: a #GPasteSettings instance
511 *
512 * Reset the "save-history" setting
513 */
514 /**
515 * g_paste_settings_set_save_history:
516 * @self: a #GPasteSettings instance
517 * @value: whether to save or not the history
518 *
519 * Change the "save-history" setting
520 */
521 BOOLEAN_SETTING (save_history, SAVE_HISTORY)
522
523 /**
524 * g_paste_settings_get_show_history:
525 * @self: a #GPasteSettings instance
526 *
527 * Get the "show-history" setting
528 *
529 * Returns: the value of the "show-history" setting
530 */
531 /**
532 * g_paste_settings_reset_show_history:
533 * @self: a #GPasteSettings instance
534 *
535 * Reset the "show-history" setting
536 */
537 /**
538 * g_paste_settings_set_show_history:
539 * @self: a #GPasteSettings instance
540 * @value: the new keyboard shortcut
541 *
542 * Change the "show-history" setting
543 */
544 STRING_SETTING (show_history, SHOW_HISTORY)
545
546 /**
547 * g_paste_settings_get_sync_clipboard_to_primary:
548 * @self: a #GPasteSettings instance
549 *
550 * Get the "sync-clipboard-to-primary" setting
551 *
552 * Returns: the value of the "sync-clipboard-to-primary" setting
553 */
554 /**
555 * g_paste_settings_reset_sync_clipboard_to_primary:
556 * @self: a #GPasteSettings instance
557 *
558 * Reset the "sync-clipboard-to-primary" setting
559 */
560 /**
561 * g_paste_settings_set_sync_clipboard_to_primary:
562 * @self: a #GPasteSettings instance
563 * @value: the new keyboard shortcut
564 *
565 * Change the "sync-clipboard-to-primary" setting
566 */
567 STRING_SETTING (sync_clipboard_to_primary, SYNC_CLIPBOARD_TO_PRIMARY)
568
569 /**
570 * g_paste_settings_get_sync_primary_to_clipboard:
571 * @self: a #GPasteSettings instance
572 *
573 * Get the "sync-primary-to-clipboard" setting
574 *
575 * Returns: the value of the "sync-primary-to-clipboard" setting
576 */
577 /**
578 * g_paste_settings_reset_sync_primary_to_clipboard:
579 * @self: a #GPasteSettings instance
580 *
581 * Reset the "sync-primary-to-clipboard" setting
582 */
583 /**
584 * g_paste_settings_set_sync_primary_to_clipboard:
585 * @self: a #GPasteSettings instance
586 * @value: the new keyboard shortcut
587 *
588 * Change the "sync-primary-to-clipboard" setting
589 */
590 STRING_SETTING (sync_primary_to_clipboard, SYNC_PRIMARY_TO_CLIPBOARD)
591
592 /**
593 * g_paste_settings_get_synchronize_clipboards:
594 * @self: a #GPasteSettings instance
595 *
596 * Get the "synchronize-clipboards" setting
597 *
598 * Returns: the value of the "synchronize-clipboards" setting
599 */
600 /**
601 * g_paste_settings_reset_synchronize_clipboards:
602 * @self: a #GPasteSettings instance
603 *
604 * Reset the "synchronize-clipboards" setting
605 */
606 /**
607 * g_paste_settings_set_synchronize_clipboards:
608 * @self: a #GPasteSettings instance
609 * @value: whether to synchronize the clipboard and the primary selection or not
610 *
611 * Change the "synchronize-clipboards" setting
612 */
613 BOOLEAN_SETTING (synchronize_clipboards, SYNCHRONIZE_CLIPBOARDS)
614
615 /**
616 * g_paste_settings_get_track_changes:
617 * @self: a #GPasteSettings instance
618 *
619 * Get the "track-changes" setting
620 *
621 * Returns: the value of the "track-changes" setting
622 */
623 /**
624 * g_paste_settings_reset_track_changes:
625 * @self: a #GPasteSettings instance
626 *
627 * Reset the "track-changes" setting
628 */
629 /**
630 * g_paste_settings_set_track_changes:
631 * @self: a #GPasteSettings instance
632 * @value: whether to track or not the clipboard changes
633 *
634 * Change the "track-changes" setting
635 */
636 BOOLEAN_SETTING (track_changes, TRACK_CHANGES)
637
638 /**
639 * g_paste_settings_get_track_extension_state:
640 * @self: a #GPasteSettings instance
641 *
642 * Get the "track-extension-state" setting
643 *
644 * Returns: the value of the "track-extension-state" setting
645 */
646 /**
647 * g_paste_settings_reset_track_extension_state:
648 * @self: a #GPasteSettings instance
649 *
650 * Reset the "track-extension-state" setting
651 */
652 /**
653 * g_paste_settings_set_track_extension_state:
654 * @self: a #GPasteSettings instance
655 * @value: whether to stop tracking or not the clipboard changes when an applet exits
656 *
657 * Change the "track-extension-state" setting
658 */
659 BOOLEAN_SETTING (track_extension_state, TRACK_EXTENSION_STATE)
660
661 /**
662 * g_paste_settings_get_trim_items:
663 * @self: a #GPasteSettings instance
664 *
665 * Get the "trim-items" setting
666 *
667 * Returns: the value of the "trim-items" setting
668 */
669 /**
670 * g_paste_settings_reset_trim_items:
671 * @self: a #GPasteSettings instance
672 *
673 * Reset the "trim-items" setting
674 */
675 /**
676 * g_paste_settings_set_trim_items:
677 * @self: a #GPasteSettings instance
678 * @value: whether to trim or not textual items
679 *
680 * Change the "trim-items" setting
681 */
682 BOOLEAN_SETTING (trim_items, TRIM_ITEMS)
683
684 /**
685 * g_paste_settings_get_upload:
686 * @self: a #GPasteSettings instance
687 *
688 * Get the "upload" setting
689 *
690 * Returns: the value of the "upload" setting
691 */
692 /**
693 * g_paste_settings_reset_upload:
694 * @self: a #GPasteSettings instance
695 *
696 * Reset the "upload" setting
697 */
698 /**
699 * g_paste_settings_set_upload:
700 * @self: a #GPasteSettings instance
701 * @value: the new keyboard shortcut
702 *
703 * Change the "upload" setting
704 */
705 STRING_SETTING (upload, UPLOAD)
706
707 /**
708 * g_paste_settings_get_extension_enabled:
709 * @self: a #GPasteSettings instance
710 *
711 * Get the "extension-enabled" special setting
712 *
713 * Returns: Whether the gnome-shell extension is enabled or not
714 */
715 G_PASTE_VISIBLE gboolean
716 g_paste_settings_get_extension_enabled (const GPasteSettings *self)
717 {
718 g_return_val_if_fail (_G_PASTE_IS_SETTINGS ((gpointer) self), FALSE);
719 const GPasteSettingsPrivate *priv = _g_paste_settings_get_instance_private (self);
720 return priv->extension_enabled;
721 }
722
723 static inline gchar **
724 g_paste_settings_private_get_enabled_extensions (GPasteSettingsPrivate *priv)
725 {
726 return (priv->shell_settings) ? g_settings_get_strv (priv->shell_settings, G_PASTE_SHELL_ENABLED_EXTENSIONS_SETTING) : NULL;
727 }
728
729 static void
730 g_paste_settings_private_set_extension_enabled_from_dconf (GPasteSettingsPrivate *priv)
731 {
732 g_auto (GStrv) extensions = g_paste_settings_private_get_enabled_extensions (priv);
733 for (GStrv e = extensions; *e; ++e)
734 {
735 if (g_paste_str_equal (*e, G_PASTE_EXTENSION_NAME))
736 {
737 priv->extension_enabled = TRUE;
738 return;
739 }
740 }
741 priv->extension_enabled = FALSE;
742 }
743
744 /**
745 * g_paste_settings_set_extension_enabled:
746 * @self: a #GPasteSettings instance
747 * @value: whether to enable or not the gnome-shell extension
748 *
749 * Change the "extension-enabled" special setting
750 */
751 G_PASTE_VISIBLE void
752 g_paste_settings_set_extension_enabled (GPasteSettings *self,
753 gboolean value)
754 {
755 g_return_if_fail (_G_PASTE_IS_SETTINGS (self));
756
757 GPasteSettingsPrivate *priv = g_paste_settings_get_instance_private (self);
758 g_auto (GStrv) extensions = NULL;
759
760 if (!priv->shell_settings || (value == priv->extension_enabled))
761 return;
762
763 extensions = g_paste_settings_private_get_enabled_extensions (priv);
764 guint64 nb = g_strv_length (extensions);
765 if (value)
766 {
767 extensions = g_realloc (extensions, (nb + 2) * sizeof (gchar *));
768 extensions[nb] = g_strdup (G_PASTE_EXTENSION_NAME);
769 extensions[nb+1] = NULL;
770 }
771 else
772 {
773 gboolean found = FALSE;
774 for (guint64 i = 0; i < nb; ++i)
775 {
776 if (!found && g_paste_str_equal (extensions[i], G_PASTE_EXTENSION_NAME))
777 {
778 found = TRUE;
779 g_free (extensions[i]);
780 }
781 if (found)
782 extensions[i] = extensions[i+1];
783 }
784 }
785
786 priv->extension_enabled = value;
787 g_settings_set_strv (priv->shell_settings, G_PASTE_SHELL_ENABLED_EXTENSIONS_SETTING, (const gchar * const *) extensions);
788 }
789
790 static void
791 g_paste_settings_shell_settings_changed (GSettings *settings G_GNUC_UNUSED,
792 const gchar *key G_GNUC_UNUSED,
793 gpointer user_data)
794 {
795 GPasteSettings *self = G_PASTE_SETTINGS (user_data);
796 GPasteSettingsPrivate *priv = g_paste_settings_get_instance_private (self);
797
798 g_paste_settings_private_set_extension_enabled_from_dconf (priv);
799
800 /* Forward the signal */
801 g_signal_emit (self,
802 signals[CHANGED],
803 g_quark_from_string (G_PASTE_EXTENSION_ENABLED_SETTING),
804 G_PASTE_EXTENSION_ENABLED_SETTING,
805 NULL);
806 }
807
808 static void
809 g_paste_settings_rebind (GPasteSettings *self,
810 const gchar *key)
811 {
812 g_signal_emit (self,
813 signals[REBIND],
814 g_quark_from_string (key),
815 NULL);
816 }
817
818 static void
819 g_paste_settings_settings_changed (GSettings *settings G_GNUC_UNUSED,
820 const gchar *key,
821 gpointer user_data)
822 {
823 GPasteSettings *self = G_PASTE_SETTINGS (user_data);
824 GPasteSettingsPrivate *priv = g_paste_settings_get_instance_private (self);
825
826 if (g_paste_str_equal (key, G_PASTE_CLOSE_ON_SELECT_SETTING))
827 g_paste_settings_private_set_close_on_select_from_dconf (priv);
828 else if (g_paste_str_equal (key, G_PASTE_ELEMENT_SIZE_SETTING))
829 g_paste_settings_private_set_element_size_from_dconf (priv);
830 else if (g_paste_str_equal (key, G_PASTE_EMPTY_HISTORY_CONFIRMATION_SETTING))
831 g_paste_settings_private_set_empty_history_confirmation_from_dconf (priv);
832 else if (g_paste_str_equal (key, G_PASTE_GROWING_LINES_SETTING))
833 g_paste_settings_private_set_growing_lines_from_dconf (priv);
834 else if (g_paste_str_equal (key, G_PASTE_HISTORY_NAME_SETTING))
835 g_paste_settings_private_set_history_name_from_dconf (priv);
836 else if (g_paste_str_equal (key, G_PASTE_IMAGES_SUPPORT_SETTING))
837 g_paste_settings_private_set_images_support_from_dconf (priv);
838 else if (g_paste_str_equal (key, G_PASTE_LAUNCH_UI_SETTING))
839 {
840 g_paste_settings_private_set_launch_ui_from_dconf (priv);
841 g_paste_settings_rebind (self, G_PASTE_LAUNCH_UI_SETTING);
842 }
843 else if (g_paste_str_equal (key, G_PASTE_MAKE_PASSWORD_SETTING))
844 {
845 g_paste_settings_private_set_make_password_from_dconf (priv);
846 g_paste_settings_rebind (self, G_PASTE_MAKE_PASSWORD_SETTING);
847 }
848 else if (g_paste_str_equal (key, G_PASTE_MAX_DISPLAYED_HISTORY_SIZE_SETTING))
849 g_paste_settings_private_set_max_displayed_history_size_from_dconf (priv);
850 else if (g_paste_str_equal (key, G_PASTE_MAX_HISTORY_SIZE_SETTING))
851 g_paste_settings_private_set_max_history_size_from_dconf (priv);
852 else if (g_paste_str_equal (key, G_PASTE_MAX_MEMORY_USAGE_SETTING))
853 g_paste_settings_private_set_max_memory_usage_from_dconf (priv);
854 else if (g_paste_str_equal (key, G_PASTE_MAX_TEXT_ITEM_SIZE_SETTING))
855 g_paste_settings_private_set_max_text_item_size_from_dconf (priv);
856 else if (g_paste_str_equal (key, G_PASTE_MIN_TEXT_ITEM_SIZE_SETTING))
857 g_paste_settings_private_set_min_text_item_size_from_dconf (priv);
858 else if (g_paste_str_equal (key, G_PASTE_POP_SETTING))
859 {
860 g_paste_settings_private_set_pop_from_dconf (priv);
861 g_paste_settings_rebind (self, G_PASTE_POP_SETTING);
862 }
863 else if (g_paste_str_equal (key, G_PASTE_PRIMARY_TO_HISTORY_SETTING ))
864 g_paste_settings_private_set_primary_to_history_from_dconf (priv);
865 else if (g_paste_str_equal (key, G_PASTE_RICH_TEXT_SUPPORT_SETTING))
866 g_paste_settings_private_set_rich_text_support_from_dconf (priv);
867 else if (g_paste_str_equal (key, G_PASTE_SAVE_HISTORY_SETTING))
868 g_paste_settings_private_set_save_history_from_dconf (priv);
869 else if (g_paste_str_equal (key, G_PASTE_SHOW_HISTORY_SETTING))
870 {
871 g_paste_settings_private_set_show_history_from_dconf (priv);
872 g_paste_settings_rebind (self, G_PASTE_SHOW_HISTORY_SETTING);
873 }
874 else if (g_paste_str_equal (key, G_PASTE_SYNC_CLIPBOARD_TO_PRIMARY_SETTING))
875 {
876 g_paste_settings_private_set_sync_clipboard_to_primary_from_dconf (priv);
877 g_paste_settings_rebind (self, G_PASTE_SYNC_CLIPBOARD_TO_PRIMARY_SETTING);
878 }
879 else if (g_paste_str_equal (key, G_PASTE_SYNC_PRIMARY_TO_CLIPBOARD_SETTING))
880 {
881 g_paste_settings_private_set_sync_primary_to_clipboard_from_dconf (priv);
882 g_paste_settings_rebind (self, G_PASTE_SYNC_PRIMARY_TO_CLIPBOARD_SETTING);
883 }
884 else if (g_paste_str_equal (key, G_PASTE_SYNCHRONIZE_CLIPBOARDS_SETTING))
885 g_paste_settings_private_set_synchronize_clipboards_from_dconf (priv);
886 else if (g_paste_str_equal (key, G_PASTE_TRACK_CHANGES_SETTING))
887 {
888 g_paste_settings_private_set_track_changes_from_dconf (priv);
889 g_signal_emit (self,
890 signals[TRACK],
891 0, /* detail */
892 priv->track_changes,
893 NULL);
894 }
895 else if (g_paste_str_equal (key, G_PASTE_TRACK_EXTENSION_STATE_SETTING))
896 g_paste_settings_private_set_track_extension_state_from_dconf (priv);
897 else if (g_paste_str_equal (key, G_PASTE_TRIM_ITEMS_SETTING))
898 g_paste_settings_private_set_trim_items_from_dconf (priv);
899 else if (g_paste_str_equal (key, G_PASTE_UPLOAD_SETTING))
900 {
901 g_paste_settings_private_set_upload_from_dconf (priv);
902 g_paste_settings_rebind (self, G_PASTE_UPLOAD_SETTING);
903 }
904
905 /* Forward the signal */
906 g_signal_emit (self,
907 signals[CHANGED],
908 g_quark_from_string (key),
909 key,
910 NULL);
911 }
912
913 static void
914 g_paste_settings_dispose (GObject *object)
915 {
916 GPasteSettingsPrivate *priv = g_paste_settings_get_instance_private (G_PASTE_SETTINGS (object));
917 GSettings *settings = priv->settings;
918 GSettings *shell_settings = priv->shell_settings;
919
920 if (settings)
921 {
922 g_signal_handler_disconnect (settings, priv->c_signals[C_CHANGED]);
923 g_clear_object (&priv->settings);
924 }
925
926 if (shell_settings)
927 {
928 g_signal_handler_disconnect (shell_settings, priv->c_signals[C_SHELL_CHANGED]);
929 g_clear_object (&priv->shell_settings);
930 }
931
932 G_OBJECT_CLASS (g_paste_settings_parent_class)->dispose (object);
933 }
934
935 static void
936 g_paste_settings_finalize (GObject *object)
937 {
938 const GPasteSettingsPrivate *priv = _g_paste_settings_get_instance_private (G_PASTE_SETTINGS (object));
939
940 g_free (priv->history_name);
941 g_free (priv->launch_ui);
942 g_free (priv->make_password);
943 g_free (priv->pop);
944 g_free (priv->show_history);
945 g_free (priv->sync_clipboard_to_primary);
946 g_free (priv->sync_primary_to_clipboard);
947 g_free (priv->upload);
948
949 G_OBJECT_CLASS (g_paste_settings_parent_class)->finalize (object);
950 }
951
952 static void
953 g_paste_settings_class_init (GPasteSettingsClass *klass)
954 {
955 GObjectClass *object_class = G_OBJECT_CLASS (klass);
956
957 object_class->dispose = g_paste_settings_dispose;
958 object_class->finalize = g_paste_settings_finalize;
959
960 /**
961 * GPasteSettings::changed:
962 * @settings: the object on which the signal was emitted
963 * @key: the name of the key that changed
964 *
965 * The "changed" signal is emitted when a key has potentially changed.
966 * You should call one of the g_paste_settings_get() calls to check the new
967 * value.
968 *
969 * This signal supports detailed connections. You can connect to the
970 * detailed signal "changed::x" in order to only receive callbacks
971 * when key "x" changes.
972 */
973 signals[CHANGED] = NEW_SIGNAL_DETAILED_STATIC ("changed", STRING);
974
975 /**
976 * GPasteSettings::rebind:
977 * @settings: the object on which the signal was emitted
978 * @key: the name of the key that changed
979 *
980 * The "rebind" signal is emitted when a key has potentially changed.
981 * You should call one of the g_paste_settings_get() calls to check the new
982 * value.
983 *
984 * This signal supports detailed connections. You can connect to the
985 * detailed signal "rebind::x" in order to only receive callbacks
986 * when key "x" changes.
987 */
988 signals[REBIND] = NEW_SIGNAL_DETAILED ("rebind" , STRING);
989
990 /**
991 * GPasteSettings::track:
992 * @settings: the object on which the signal was emitted
993 * @tracking_state: whether we're now tracking or not
994 *
995 * The "track" signal is emitted when the daemon starts or stops tracking
996 * clipboard changes
997 */
998 signals[TRACK] = NEW_SIGNAL ("track" , BOOLEAN);
999 }
1000
1001 static GSettings *
1002 create_g_settings (void)
1003 {
1004 g_autofree gchar *config_file_path = g_build_filename (g_get_user_config_dir (), PACKAGE, "settings", NULL);
1005 g_autoptr (GFile) config_file = g_file_new_for_path (config_file_path);
1006
1007 if (g_file_query_exists (config_file, NULL /* cancellable */))
1008 {
1009 g_autoptr (GSettingsBackend) backend = g_keyfile_settings_backend_new (config_file_path, G_PASTE_SETTINGS_PATH, PACKAGE_NAME);
1010
1011 return g_settings_new_with_backend (G_PASTE_SETTINGS_NAME, backend);
1012 }
1013 else
1014 {
1015 return g_settings_new (G_PASTE_SETTINGS_NAME);
1016 }
1017 }
1018
1019 static void
1020 g_paste_settings_init (GPasteSettings *self)
1021 {
1022 GPasteSettingsPrivate *priv = g_paste_settings_get_instance_private (self);
1023 GSettings *settings = priv->settings = create_g_settings ();
1024
1025 priv->history_name = NULL;
1026 priv->launch_ui = NULL;
1027 priv->make_password = NULL;
1028 priv->pop = NULL;
1029 priv->show_history = NULL;
1030 priv->sync_clipboard_to_primary = NULL;
1031 priv->sync_primary_to_clipboard = NULL;
1032 priv->upload = NULL;
1033
1034 priv->c_signals[C_CHANGED] = g_signal_connect (settings,
1035 "changed",
1036 G_CALLBACK (g_paste_settings_settings_changed),
1037 self);
1038
1039 g_paste_settings_private_set_close_on_select_from_dconf (priv);
1040 g_paste_settings_private_set_element_size_from_dconf (priv);
1041 g_paste_settings_private_set_empty_history_confirmation_from_dconf (priv);
1042 g_paste_settings_private_set_growing_lines_from_dconf (priv);
1043 g_paste_settings_private_set_history_name_from_dconf (priv);
1044 g_paste_settings_private_set_images_support_from_dconf (priv);
1045 g_paste_settings_private_set_launch_ui_from_dconf (priv);
1046 g_paste_settings_private_set_make_password_from_dconf (priv);
1047 g_paste_settings_private_set_max_displayed_history_size_from_dconf (priv);
1048 g_paste_settings_private_set_max_history_size_from_dconf (priv);
1049 g_paste_settings_private_set_max_memory_usage_from_dconf (priv);
1050 g_paste_settings_private_set_max_text_item_size_from_dconf (priv);
1051 g_paste_settings_private_set_min_text_item_size_from_dconf (priv);
1052 g_paste_settings_private_set_pop_from_dconf (priv);
1053 g_paste_settings_private_set_primary_to_history_from_dconf (priv);
1054 g_paste_settings_private_set_rich_text_support_from_dconf (priv);
1055 g_paste_settings_private_set_save_history_from_dconf (priv);
1056 g_paste_settings_private_set_show_history_from_dconf (priv);
1057 g_paste_settings_private_set_sync_clipboard_to_primary_from_dconf (priv);
1058 g_paste_settings_private_set_sync_primary_to_clipboard_from_dconf (priv);
1059 g_paste_settings_private_set_synchronize_clipboards_from_dconf (priv);
1060 g_paste_settings_private_set_track_changes_from_dconf (priv);
1061 g_paste_settings_private_set_track_extension_state_from_dconf (priv);
1062 g_paste_settings_private_set_trim_items_from_dconf (priv);
1063 g_paste_settings_private_set_upload_from_dconf (priv);
1064
1065 priv->shell_settings = NULL;
1066 priv->extension_enabled = FALSE;
1067
1068 if (g_paste_util_has_gnome_shell ())
1069 {
1070 priv->shell_settings = g_settings_new (G_PASTE_SHELL_SETTINGS_NAME);
1071
1072 priv->c_signals[C_SHELL_CHANGED] = g_signal_connect (priv->shell_settings,
1073 "changed::" G_PASTE_SHELL_ENABLED_EXTENSIONS_SETTING,
1074 G_CALLBACK (g_paste_settings_shell_settings_changed),
1075 self);
1076
1077 g_paste_settings_private_set_extension_enabled_from_dconf (priv);
1078 }
1079 }
1080
1081 /**
1082 * g_paste_settings_new:
1083 *
1084 * Create a new instance of #GPasteSettings
1085 *
1086 * Returns: a newly allocated #GPasteSettings
1087 * free it with g_object_unref
1088 */
1089 G_PASTE_VISIBLE GPasteSettings *
1090 g_paste_settings_new (void)
1091 {
1092 return g_object_new (G_PASTE_TYPE_SETTINGS, NULL);
1093 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_SETTINGS_H__
11 #define __G_PASTE_SETTINGS_H__
12
13 #include <gpaste-macros.h>
14
15 G_BEGIN_DECLS
16
17 #define G_PASTE_TYPE_SETTINGS (g_paste_settings_get_type ())
18
19 G_PASTE_FINAL_TYPE (Settings, settings, SETTINGS, GObject)
20
21 gboolean g_paste_settings_get_close_on_select (const GPasteSettings *self);
22 guint64 g_paste_settings_get_element_size (const GPasteSettings *self);
23 gboolean g_paste_settings_get_empty_history_confirmation (const GPasteSettings *self);
24 gboolean g_paste_settings_get_growing_lines (const GPasteSettings *self);
25 const gchar *g_paste_settings_get_history_name (const GPasteSettings *self);
26 gboolean g_paste_settings_get_images_support (const GPasteSettings *self);
27 const gchar *g_paste_settings_get_launch_ui (const GPasteSettings *self);
28 const gchar *g_paste_settings_get_make_password (const GPasteSettings *self);
29 guint64 g_paste_settings_get_max_displayed_history_size (const GPasteSettings *self);
30 guint64 g_paste_settings_get_max_history_size (const GPasteSettings *self);
31 guint64 g_paste_settings_get_max_memory_usage (const GPasteSettings *self);
32 guint64 g_paste_settings_get_max_text_item_size (const GPasteSettings *self);
33 guint64 g_paste_settings_get_min_text_item_size (const GPasteSettings *self);
34 const gchar *g_paste_settings_get_pop (const GPasteSettings *self);
35 gboolean g_paste_settings_get_primary_to_history (const GPasteSettings *self);
36 gboolean g_paste_settings_get_rich_text_support (const GPasteSettings *self);
37 gboolean g_paste_settings_get_save_history (const GPasteSettings *self);
38 const gchar *g_paste_settings_get_show_history (const GPasteSettings *self);
39 const gchar *g_paste_settings_get_sync_clipboard_to_primary (const GPasteSettings *self);
40 const gchar *g_paste_settings_get_sync_primary_to_clipboard (const GPasteSettings *self);
41 gboolean g_paste_settings_get_synchronize_clipboards (const GPasteSettings *self);
42 gboolean g_paste_settings_get_track_changes (const GPasteSettings *self);
43 gboolean g_paste_settings_get_track_extension_state (const GPasteSettings *self);
44 gboolean g_paste_settings_get_trim_items (const GPasteSettings *self);
45 const gchar *g_paste_settings_get_upload (const GPasteSettings *self);
46
47 void g_paste_settings_reset_close_on_select (GPasteSettings *self);
48 void g_paste_settings_reset_element_size (GPasteSettings *self);
49 void g_paste_settings_reset_empty_history_confirmation (GPasteSettings *self);
50 void g_paste_settings_reset_growing_lines (GPasteSettings *self);
51 void g_paste_settings_reset_history_name (GPasteSettings *self);
52 void g_paste_settings_reset_images_support (GPasteSettings *self);
53 void g_paste_settings_reset_launch_ui (GPasteSettings *self);
54 void g_paste_settings_reset_make_password (GPasteSettings *self);
55 void g_paste_settings_reset_max_displayed_history_size (GPasteSettings *self);
56 void g_paste_settings_reset_max_history_size (GPasteSettings *self);
57 void g_paste_settings_reset_max_memory_usage (GPasteSettings *self);
58 void g_paste_settings_reset_max_text_item_size (GPasteSettings *self);
59 void g_paste_settings_reset_min_text_item_size (GPasteSettings *self);
60 void g_paste_settings_reset_pop (GPasteSettings *self);
61 void g_paste_settings_reset_primary_to_history (GPasteSettings *self);
62 void g_paste_settings_reset_rich_text_support (GPasteSettings *self);
63 void g_paste_settings_reset_save_history (GPasteSettings *self);
64 void g_paste_settings_reset_show_history (GPasteSettings *self);
65 void g_paste_settings_reset_sync_clipboard_to_primary (GPasteSettings *self);
66 void g_paste_settings_reset_sync_primary_to_clipboard (GPasteSettings *self);
67 void g_paste_settings_reset_synchronize_clipboards (GPasteSettings *self);
68 void g_paste_settings_reset_track_changes (GPasteSettings *self);
69 void g_paste_settings_reset_track_extension_state (GPasteSettings *self);
70 void g_paste_settings_reset_trim_items (GPasteSettings *self);
71 void g_paste_settings_reset_upload (GPasteSettings *self);
72
73 void g_paste_settings_set_close_on_select (GPasteSettings *self,
74 gboolean value);
75 void g_paste_settings_set_element_size (GPasteSettings *self,
76 guint64 value);
77 void g_paste_settings_set_empty_history_confirmation (GPasteSettings *self,
78 gboolean value);
79 void g_paste_settings_set_growing_lines (GPasteSettings *self,
80 gboolean value);
81 void g_paste_settings_set_history_name (GPasteSettings *self,
82 const gchar *value);
83 void g_paste_settings_set_images_support (GPasteSettings *self,
84 gboolean value);
85 void g_paste_settings_set_launch_ui (GPasteSettings *self,
86 const gchar *value);
87 void g_paste_settings_set_make_password (GPasteSettings *self,
88 const gchar *value);
89 void g_paste_settings_set_max_displayed_history_size (GPasteSettings *self,
90 guint64 value);
91 void g_paste_settings_set_max_history_size (GPasteSettings *self,
92 guint64 value);
93 void g_paste_settings_set_max_memory_usage (GPasteSettings *self,
94 guint64 value);
95 void g_paste_settings_set_max_text_item_size (GPasteSettings *self,
96 guint64 value);
97 void g_paste_settings_set_min_text_item_size (GPasteSettings *self,
98 guint64 value);
99 void g_paste_settings_set_pop (GPasteSettings *self,
100 const gchar *value);
101 void g_paste_settings_set_primary_to_history (GPasteSettings *self,
102 gboolean value);
103 void g_paste_settings_set_rich_text_support (GPasteSettings *self,
104 gboolean value);
105 void g_paste_settings_set_save_history (GPasteSettings *self,
106 gboolean value);
107 void g_paste_settings_set_show_history (GPasteSettings *self,
108 const gchar *value);
109 void g_paste_settings_set_sync_clipboard_to_primary (GPasteSettings *self,
110 const gchar *value);
111 void g_paste_settings_set_sync_primary_to_clipboard (GPasteSettings *self,
112 const gchar *value);
113 void g_paste_settings_set_synchronize_clipboards (GPasteSettings *self,
114 gboolean value);
115 void g_paste_settings_set_track_changes (GPasteSettings *self,
116 gboolean value);
117 void g_paste_settings_set_track_extension_state (GPasteSettings *self,
118 gboolean value);
119 void g_paste_settings_set_trim_items (GPasteSettings *self,
120 gboolean value);
121 void g_paste_settings_set_upload (GPasteSettings *self,
122 const gchar *value);
123
124 gboolean g_paste_settings_get_extension_enabled (const GPasteSettings *self);
125 void g_paste_settings_set_extension_enabled (GPasteSettings *self,
126 gboolean value);
127
128 GPasteSettings *g_paste_settings_new (void);
129
130 G_END_DECLS
131
132 #endif /*__G_PASTE_SETTINGS_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-macros.h>
7 #include <gpaste-update-enums.h>
8
9 G_PASTE_VISIBLE GType
10 g_paste_update_action_get_type (void)
11 {
12 static GType etype = 0;
13 if (!etype)
14 {
15 static const GEnumValue values[] = {
16 { G_PASTE_UPDATE_ACTION_REPLACE, "G_PASTE_UPDATE_ACTION_REPLACE", "REPLACE" },
17 { G_PASTE_UPDATE_ACTION_REMOVE, "G_PASTE_UPDATE_ACTION_REMOVE", "REMOVE" },
18 { G_PASTE_UPDATE_ACTION_INVALID, NULL, NULL }
19 };
20 etype = g_enum_register_static (g_intern_static_string ("GPasteUpdateAction"), values);
21 g_type_class_ref (etype);
22 }
23 return etype;
24 }
25
26 G_PASTE_VISIBLE GType
27 g_paste_update_target_get_type (void)
28 {
29 static GType etype = 0;
30 if (!etype)
31 {
32 static const GEnumValue values[] = {
33 { G_PASTE_UPDATE_TARGET_ALL, "G_PASTE_UPDATE_TARGET_ALL", "ALL" },
34 { G_PASTE_UPDATE_TARGET_POSITION, "G_PASTE_UPDATE_TARGET_POSITION", "POSITION" },
35 { G_PASTE_UPDATE_TARGET_INVALID, NULL, NULL }
36 };
37 etype = g_enum_register_static (g_intern_static_string ("GPasteUpdateTarget"), values);
38 g_type_class_ref (etype);
39 }
40 return etype;
41 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UPDATE_ENUMS_H__
11 #define __G_PASTE_UPDATE_ENUMS_H__
12
13 #include <glib-object.h>
14
15 G_BEGIN_DECLS
16
17 typedef enum {
18 G_PASTE_UPDATE_ACTION_REPLACE = 1,
19 G_PASTE_UPDATE_ACTION_REMOVE,
20 G_PASTE_UPDATE_ACTION_INVALID = 0
21 } GPasteUpdateAction;
22
23 #define G_PASTE_TYPE_UPDATE_ACTION (g_paste_update_action_get_type ())
24 GType g_paste_update_action_get_type (void);
25
26 typedef enum {
27 G_PASTE_UPDATE_TARGET_ALL = 1,
28 G_PASTE_UPDATE_TARGET_POSITION,
29 G_PASTE_UPDATE_TARGET_INVALID = 0
30 } GPasteUpdateTarget;
31
32 #define G_PASTE_TYPE_UPDATE_TARGET (g_paste_update_target_get_type ())
33 GType g_paste_update_target_get_type (void);
34
35 G_END_DECLS
36
37 #endif /*__G_PASTE_UPDATE_ENUMS_H__*/
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #include <gpaste-gsettings-keys.h>
7 #include <gpaste-util.h>
8
9 #include "gpaste-gtk-compat.h"
10
11 /**
12 * g_paste_util_confirm_dialog:
13 * @parent: (nullable): the parent #GtkWindow
14 * @msg: the message to display
15 *
16 * Show GPaste about dialog
17 */
18 G_PASTE_VISIBLE gboolean
19 g_paste_util_confirm_dialog (GtkWindow *parent,
20 const gchar *action,
21 const gchar *msg)
22 {
23 g_return_val_if_fail (!parent || GTK_IS_WINDOW (parent), FALSE);
24 g_return_val_if_fail (g_utf8_validate (msg, -1, NULL), FALSE);
25
26 GtkWidget *dialog = gtk_dialog_new_with_buttons (PACKAGE_STRING, parent,
27 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_USE_HEADER_BAR,
28 action, GTK_RESPONSE_OK,
29 _("Cancel"), GTK_RESPONSE_CANCEL,
30 NULL);
31 GtkWidget *label = gtk_label_new (msg);
32 GtkDialog *d = GTK_DIALOG (dialog);
33
34 gtk_widget_set_vexpand (label, TRUE);
35 gtk_widget_set_valign (label, TRUE);
36 gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (d)), label, TRUE, TRUE);
37 gtk_widget_show (label);
38
39 gboolean ret = gtk_dialog_run (d) == GTK_RESPONSE_OK;
40
41 gtk_widget_destroy (dialog);
42
43 return ret;
44 }
45
46 /* Copied from glib's gio/gapplication-tool.c */
47 static GVariant *
48 app_get_platform_data (void)
49 {
50 g_auto (GVariantBuilder) builder;
51 const gchar *startup_id;
52
53 g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
54
55 if ((startup_id = g_getenv ("DESKTOP_STARTUP_ID")))
56 g_variant_builder_add (&builder, "{sv}", "desktop-startup-id", g_variant_new_string (startup_id));
57
58 return g_variant_builder_end (&builder);
59 }
60
61 static void
62 g_paste_util_spawn_on_proxy_ready (GObject *source_object G_GNUC_UNUSED,
63 GAsyncResult *res,
64 gpointer user_data G_GNUC_UNUSED)
65 {
66 g_autoptr (GDBusProxy) proxy = g_dbus_proxy_new_for_bus_finish (res, NULL /* error */);
67
68 if (proxy)
69 {
70 g_dbus_proxy_call (proxy,
71 "Activate",
72 g_variant_new ("(@a{sv})", app_get_platform_data ()),
73 G_DBUS_CALL_FLAGS_NONE,
74 -1,
75 NULL, /* cancellable */
76 NULL, /* callback */
77 NULL); /* user_data */
78 }
79 }
80
81 /**
82 * g_paste_util_spawn:
83 * @app: the GPaste app to spawn
84 *
85 * spawn a GPaste app
86 */
87 G_PASTE_VISIBLE void
88 g_paste_util_spawn (const gchar *app)
89 {
90 g_return_if_fail (g_utf8_validate (app, -1, NULL));
91
92 g_autofree gchar *name = g_strdup_printf ("org.gnome.GPaste.%s", app);
93 g_autofree gchar *object = g_strdup_printf ("/org/gnome/GPaste/%s", app);
94
95 g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
96 G_DBUS_PROXY_FLAGS_NONE,
97 NULL,
98 name,
99 object,
100 "org.freedesktop.Application",
101 NULL,
102 g_paste_util_spawn_on_proxy_ready,
103 NULL);
104 }
105
106 static GDBusProxy *
107 _bus_proxy_new_sync (const gchar *app,
108 GError **error)
109 {
110 g_autofree gchar *name = g_strdup_printf ("org.gnome.GPaste.%s", app);
111 g_autofree gchar *object = g_strdup_printf ("/org/gnome/GPaste/%s", app);
112
113 return g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
114 G_DBUS_PROXY_FLAGS_NONE,
115 NULL,
116 name,
117 object,
118 "org.freedesktop.Application",
119 NULL,
120 error);
121 }
122
123 static gboolean
124 _spawn_sync (GDBusProxy *proxy,
125 GError **error)
126 {
127 G_GNUC_UNUSED g_autoptr (GVariant) res = g_dbus_proxy_call_sync (proxy,
128 "Activate",
129 g_variant_new ("(@a{sv})", app_get_platform_data ()),
130 G_DBUS_CALL_FLAGS_NONE,
131 -1,
132 NULL,
133 error);
134
135 return !error || !(*error);
136 }
137
138 /**
139 * g_paste_util_spawn_sync:
140 * @app: the GPaste app to spawn
141 * @error: a #GError or %NULL
142 *
143 * spawn a GPaste app
144 *
145 * Returns: whether the spawn was successful
146 */
147 G_PASTE_VISIBLE gboolean
148 g_paste_util_spawn_sync (const gchar *app,
149 GError **error)
150 {
151 g_return_val_if_fail (g_utf8_validate (app, -1, NULL), FALSE);
152 g_return_val_if_fail (!error || !(*error), FALSE);
153
154 g_autoptr (GDBusProxy) proxy = _bus_proxy_new_sync (app, error);
155
156 if (!proxy)
157 return FALSE;
158
159 return _spawn_sync (proxy, error);
160 }
161
162 static void
163 g_paste_util_activate_ui_on_proxy_ready (GObject *source_object G_GNUC_UNUSED,
164 GAsyncResult *res,
165 gpointer user_data)
166 {
167 g_autofree gpointer *data = (gpointer *) user_data;
168 g_autofree gchar *action = data[0];
169 GVariant *arg = data[1];
170 g_autoptr (GDBusProxy) proxy = g_dbus_proxy_new_for_bus_finish (res, NULL /* error */);
171
172 if (proxy)
173 {
174 g_auto (GVariantBuilder) params;
175
176 g_variant_builder_init (&params, G_VARIANT_TYPE ("av"));
177
178 if (arg)
179 g_variant_builder_add (&params, "v", arg);
180
181 g_dbus_proxy_call (proxy,
182 "ActivateAction",
183 g_variant_new ("(sav@a{sv})", action, &params, app_get_platform_data ()),
184 G_DBUS_CALL_FLAGS_NONE,
185 -1,
186 NULL, /* cancellable */
187 NULL, /* callback */
188 NULL); /* user_data */
189 }
190 }
191
192 /**
193 * g_paste_util_activate_ui:
194 * @action: the action to activate
195 * @arg: (nullable): the action argument
196 *
197 * Activate an action on a GPaste app
198 */
199 G_PASTE_VISIBLE void
200 g_paste_util_activate_ui (const gchar *action,
201 GVariant *arg)
202 {
203 g_return_if_fail (g_utf8_validate (action, -1, NULL));
204
205 gpointer *data = g_new (gpointer, 2);
206 data[0] = g_strdup (action);
207 data[1] = arg;
208
209 g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
210 G_DBUS_PROXY_FLAGS_NONE,
211 NULL,
212 "org.gnome.GPaste.Ui",
213 "/org/gnome/GPaste/Ui",
214 "org.freedesktop.Application",
215 NULL,
216 g_paste_util_activate_ui_on_proxy_ready,
217 data);
218 }
219
220 /**
221 * g_paste_util_activate_ui_sync:
222 * @action: the action to activate
223 * @arg: (nullable): the action argument
224 * @error: a #GError or %NULL
225 *
226 * activate an action from GPaste Ui
227 *
228 * Returns: whether the action was successful
229 */
230 G_PASTE_VISIBLE gboolean
231 g_paste_util_activate_ui_sync (const gchar *action,
232 GVariant *arg,
233 GError **error)
234 {
235 g_return_val_if_fail (g_utf8_validate (action, -1, NULL), FALSE);
236 g_return_val_if_fail (!error || !(*error), FALSE);
237
238 g_autoptr (GDBusProxy) proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
239 G_DBUS_PROXY_FLAGS_NONE,
240 NULL,
241 "org.gnome.GPaste.Ui",
242 "/org/gnome/GPaste/Ui",
243 "org.freedesktop.Application",
244 NULL,
245 error);
246
247 if (!proxy)
248 return FALSE;
249
250 g_auto (GVariantBuilder) params;
251
252 g_variant_builder_init (&params, G_VARIANT_TYPE ("av"));
253
254 if (arg)
255 g_variant_builder_add (&params, "v", arg);
256
257 /* We only consume it */
258 G_GNUC_UNUSED g_autoptr (GVariant) res = g_dbus_proxy_call_sync (proxy,
259 "ActivateAction",
260 g_variant_new ("(sav@a{sv})",
261 action,
262 &params,
263 app_get_platform_data ()),
264 G_DBUS_CALL_FLAGS_NONE,
265 -1,
266 NULL, /* cancellable */
267 error);
268
269 return TRUE;
270 }
271
272 /**
273 * g_paste_util_empty_with_confirmation:
274 * @client: a #GPasteClient instance
275 * @settings: a #GPasteSettings instance
276 * @history: the name of the history to empty
277 *
278 * Empty an history after confirmation.
279 * Confirmation is skipped if GPaste is configured to do so.
280 */
281 G_PASTE_VISIBLE void
282 g_paste_util_empty_with_confirmation (GPasteClient *client,
283 const GPasteSettings *settings,
284 const gchar *history)
285 {
286 g_return_if_fail (_G_PASTE_IS_CLIENT (client));
287 g_return_if_fail (_G_PASTE_IS_SETTINGS (settings));
288 g_return_if_fail (g_utf8_validate (history, -1, NULL));
289
290 if (g_paste_settings_get_empty_history_confirmation (settings))
291 g_paste_util_activate_ui ("empty", g_variant_new_string (history));
292 else
293 g_paste_client_empty_history (client, history, NULL, NULL);
294 }
295
296 /**
297 * g_paste_util_empty_with_confirmation_sync:
298 * @client: a #GPasteClient instance
299 * @settings: a #GPasteSettings instance
300 * @history: the name of the history to empty
301 * @error: a #GError or %NULL
302 *
303 * Empty an history after confirmation.
304 * Confirmation is skipped if GPaste is configured to do so.
305 *
306 * Returns: whether the action was successful
307 */
308 G_PASTE_VISIBLE gboolean
309 g_paste_util_empty_with_confirmation_sync (GPasteClient *client,
310 const GPasteSettings *settings,
311 const gchar *history,
312 GError **error)
313 {
314 g_return_val_if_fail (_G_PASTE_IS_CLIENT (client), FALSE);
315 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), FALSE);
316 g_return_val_if_fail (g_utf8_validate (history, -1, NULL), FALSE);
317 g_return_val_if_fail (!error || !(*error), FALSE);
318
319 if (g_paste_settings_get_empty_history_confirmation (settings))
320 {
321 return g_paste_util_activate_ui_sync ("empty", g_variant_new_string (history), error);
322 }
323 else
324 {
325 g_autoptr (GError) _error = NULL;
326
327 g_paste_client_empty_history_sync (client, history, &_error);
328
329 if (error)
330 {
331 *error = _error;
332 _error = NULL;
333 }
334
335 return !_error && !(error && *error);
336 }
337 }
338
339 /**
340 * g_paste_util_relace:
341 * @text: the initial text
342 * @pattern: the pattern to replace
343 * @substitution: the replacement text
344 *
345 * Replace some text
346 *
347 * Returns: the newly allocated string
348 */
349 G_PASTE_VISIBLE gchar *
350 g_paste_util_replace (const gchar *text,
351 const gchar *pattern,
352 const gchar *substitution)
353 {
354 g_return_val_if_fail (g_utf8_validate (text, -1, NULL), NULL);
355 g_return_val_if_fail (g_utf8_validate (pattern, -1, NULL), NULL);
356 g_return_val_if_fail (g_utf8_validate (substitution, -1, NULL), NULL);
357
358 g_autofree gchar *regex_string = g_regex_escape_string (pattern, -1);
359 g_autoptr (GRegex) regex = g_regex_new (regex_string,
360 0, /* Compile options */
361 0, /* Match options */
362 NULL); /* Error */
363 return g_regex_replace_literal (regex,
364 text,
365 (gssize) -1,
366 0, /* Start position */
367 substitution,
368 0, /* Match options */
369 NULL); /* Error */
370 }
371
372 /**
373 * g_paste_util_compute_checksum:
374 * @image: the #GdkPixbuf to checksum
375 *
376 * Compute the checksum of an image
377 *
378 * Returns: the newly allocated checksum
379 */
380 G_PASTE_VISIBLE gchar *
381 g_paste_util_compute_checksum (GdkPixbuf *image)
382 {
383 if (!image || !GDK_IS_PIXBUF (image))
384 return NULL;
385
386 const guint8 *data = gdk_pixbuf_read_pixels (image);
387 gsize length = gdk_pixbuf_get_byte_length (image);
388
389 return g_compute_checksum_for_data (G_CHECKSUM_SHA256, data, length);
390 }
391
392 /**
393 * g_paste_util_empty_history:
394 * @parent_window: (nullable): the parent #GtkWindow
395 * @client: a #GPasteClient instance
396 * @settings: a #GPasteSettings instance
397 * @history: the name of the history to empty
398 *
399 * Empty history after prompting user for confirmation
400 */
401 G_PASTE_VISIBLE void
402 g_paste_util_empty_history (GtkWindow *parent_window,
403 GPasteClient *client,
404 GPasteSettings *settings,
405 const gchar *history)
406 {
407 if (!g_paste_settings_get_empty_history_confirmation (settings) ||
408 /* Translators: this is the translation for emptying the history */
409 g_paste_util_confirm_dialog (parent_window, _("Empty"), _("Do you really want to empty the history?")))
410 g_paste_client_empty_history (client, history, NULL, NULL);
411 }
412
413 /**
414 * g_paste_util_has_gnome_shell:
415 *
416 * Check whether gnome-shell is installed or not
417 *
418 * Returns: %TRUE if gnome-shell is installed
419 */
420 G_PASTE_VISIBLE gboolean
421 g_paste_util_has_gnome_shell (void)
422 {
423 GSettingsSchemaSource *source = g_settings_schema_source_get_default ();
424
425 if (!source)
426 return FALSE;
427
428 g_autoptr (GSettingsSchema) schema = g_settings_schema_source_lookup (source, G_PASTE_SHELL_SETTINGS_NAME, TRUE);
429
430 return !!schema;
431 }
432
433 /**
434 * g_paste_util_show_win:
435 * @application: a #GtkApplication
436 *
437 * Present the application's window to user
438 */
439 G_PASTE_VISIBLE void
440 g_paste_util_show_win (GApplication *application)
441 {
442 g_return_if_fail (GTK_IS_APPLICATION (application));
443
444 for (GList *wins = gtk_application_get_windows (GTK_APPLICATION (application)); wins; wins = g_list_next (wins))
445 {
446 if (GTK_IS_WIDGET (wins->data) && gtk_widget_get_realized (wins->data))
447 gtk_window_present (wins->data);
448 }
449 }
450
451 /**
452 * g_paste_util_get_au_result:
453 * @variant: a #GVariant
454 * @len: the length of the resulting array
455 *
456 * Get the "au" GVariant as an array of guint32
457 *
458 * Returns: (array length=len): The resulting array
459 */
460 G_PASTE_VISIBLE guint32 *
461 g_paste_util_get_dbus_au_result (GVariant *variant,
462 guint64 *len)
463 {
464 guint64 _len;
465 const guint32 *r = g_variant_get_fixed_array (variant, &_len, sizeof (guint32));
466 guint32 *ret = g_memdup (r, _len * sizeof (guint32));
467
468 if (len)
469 *len = _len;
470
471 return ret;
472 }
473
474 /**
475 * g_paste_util_get_dbus_item_result:
476 * @variant: a #GVariant
477 *
478 * Get the "(ss)" GVariant as an item
479 *
480 * Returns: (transfer full): The item
481 */
482 G_PASTE_VISIBLE GPasteClientItem *
483 g_paste_util_get_dbus_item_result (GVariant *variant)
484 {
485 const gchar *uuid, *value;
486
487 g_variant_get (variant, "(ss)", &uuid, &value);
488
489 return g_paste_client_item_new (uuid, value);
490 }
491
492 /**
493 * g_paste_util_get_dbus_items_result:
494 * @variant: a #GVariant
495 *
496 * Get the "a(ss)" GVariant as a list of items
497 *
498 * Returns: (element-type GPasteClientItem) (transfer full): The items
499 */
500 G_PASTE_VISIBLE GList *
501 g_paste_util_get_dbus_items_result (GVariant *variant)
502 {
503 GList *items = NULL;
504 GVariantIter iter;
505 g_autoptr (GVariant) v = NULL;
506
507 g_variant_iter_init (&iter, variant);
508 while ((v = g_variant_iter_next_value (&iter)))
509 {
510 items = g_list_append (items, g_paste_util_get_dbus_item_result (v));
511 g_variant_unref (v);
512 }
513
514 return items;
515 }
516
517 static gchar *
518 g_paste_util_get_runtime_dir (const gchar *component)
519 {
520 g_return_val_if_fail (component, NULL);
521
522 return g_strdup_printf ("%s/" PACKAGE_NAME "/%s", g_get_user_runtime_dir (), component);
523 }
524
525 /**
526 * g_paste_util_write_pid_file:
527 * @component: The component we're handling
528 *
529 * Write the pid file
530 */
531 G_PASTE_VISIBLE void
532 g_paste_util_write_pid_file (const gchar *component)
533 {
534 g_return_if_fail (component);
535
536 g_autofree gchar *dir = g_paste_util_get_runtime_dir (component);
537
538 g_mkdir_with_parents (dir, 0700);
539
540 g_autofree gchar *pidfile = g_strdup_printf ("%s/pid", dir);
541 g_autofree gchar *contents = g_strdup_printf ("%" G_PID_FORMAT, getpid ());
542
543 g_file_set_contents (pidfile, contents, -1, NULL);
544 }
545
546 /**
547 * g_paste_util_read_pid_file:
548 * @component: The component we're handling
549 *
550 * Read the pid file
551 *
552 * Returns: the pid
553 */
554 G_PASTE_VISIBLE GPid
555 g_paste_util_read_pid_file (const gchar *component)
556 {
557 g_return_val_if_fail (component, (GPid) -1);
558
559 #ifdef G_OS_UNIX
560 g_autofree gchar *dir = g_paste_util_get_runtime_dir (component);
561 g_autofree gchar *pidfile = g_strdup_printf ("%s/pid", dir);
562 g_autofree gchar *contents = NULL;
563
564 if (!g_file_get_contents (pidfile, &contents, NULL, NULL))
565 return (GPid) -1;
566
567 return (GPid) g_ascii_strtoll (contents, NULL, 0);
568 #else
569 return (GPid) -1;
570 #endif
571 }
572
573 /**
574 * g_paste_util_xml_decode:
575 * @text: The text to decode
576 *
577 * Decode the text to its original pre-xml form
578 *
579 * Returns: the decoded text
580 */
581 G_PASTE_VISIBLE gchar *
582 g_paste_util_xml_decode (const gchar *text)
583 {
584 g_return_val_if_fail (text, NULL);
585
586 g_autofree gchar *_decoded_text = g_paste_util_replace (text, "&gt;", ">");
587
588 return g_paste_util_replace (_decoded_text, "&amp;", "&");
589 }
590
591 /**
592 * g_paste_util_xml_encode:
593 * @text: The text to encode
594 *
595 * Encode the text into its xml form
596 *
597 * Returns: the encoded text
598 */
599 G_PASTE_VISIBLE gchar *
600 g_paste_util_xml_encode (const gchar *text)
601 {
602 g_return_val_if_fail (text, NULL);
603
604 g_autofree gchar *_encoded_text = g_paste_util_replace (text, "&", "&amp;");
605
606 return g_paste_util_replace (_encoded_text, ">", "&gt;");
607 }
608
609 /**
610 * g_paste_util_get_history_dir_path:
611 *
612 * Get the path to the directory where we store the history
613 *
614 * Returns: the directory path
615 */
616 G_PASTE_VISIBLE gchar *
617 g_paste_util_get_history_dir_path (void)
618 {
619 return g_build_filename (g_get_user_data_dir (), PACKAGE, NULL);
620 }
621
622 /**
623 * g_paste_util_get_history_dir:
624 *
625 * Get the directory where we store the history
626 *
627 * Returns: (transfer full): the directory
628 */
629 G_PASTE_VISIBLE GFile *
630 g_paste_util_get_history_dir (void)
631 {
632 g_autofree gchar *history_dir_path = g_paste_util_get_history_dir_path ();
633
634 return g_file_new_for_path (history_dir_path);
635 }
636
637 /**
638 * g_paste_util_get_history_file_path:
639 * @name: the name of the history
640 * @extension: the file extension
641 *
642 * Get the path to the file in which we store the history
643 *
644 * Returns: the file path
645 */
646 G_PASTE_VISIBLE gchar *
647 g_paste_util_get_history_file_path (const gchar *name,
648 const gchar *extension)
649 {
650 g_return_val_if_fail (name, NULL);
651 g_return_val_if_fail (extension, NULL);
652
653 g_autofree gchar *history_dir_path = g_paste_util_get_history_dir_path ();
654 g_autofree gchar *history_file_name = g_strconcat (name, ".", extension, NULL);
655
656 return g_build_filename (history_dir_path, history_file_name, NULL);
657 }
658
659 /**
660 * g_paste_util_get_history_file:
661 * @name: the name of the history
662 * @extension: the file extension
663 *
664 * Get the file in which we store the history
665 *
666 * Returns: (transfer full): the file
667 */
668 G_PASTE_VISIBLE GFile *
669 g_paste_util_get_history_file (const gchar *name,
670 const gchar *extension)
671 {
672 g_return_val_if_fail (name, NULL);
673 g_return_val_if_fail (extension, NULL);
674
675 g_autofree gchar *history_file_path = g_paste_util_get_history_file_path (name, extension);
676
677 return g_file_new_for_path (history_file_path);
678 }
679
680 /**
681 * g_paste_util_ensure_history_dir_exists:
682 * @settings: a #GPasteSettings instance
683 *
684 * Ensure the history dir exists
685 *
686 * Returns: where it exists or if there was an error creating it
687 */
688 G_PASTE_VISIBLE gboolean
689 g_paste_util_ensure_history_dir_exists (const GPasteSettings *settings)
690 {
691 g_return_val_if_fail (_G_PASTE_IS_SETTINGS (settings), FALSE);
692
693 g_autoptr (GFile) history_dir = g_paste_util_get_history_dir ();
694
695 if (!g_file_query_exists (history_dir,
696 NULL)) /* cancellable */
697 {
698 if (!g_paste_settings_get_save_history (settings))
699 return TRUE;
700
701 g_autoptr (GError) error = NULL;
702
703 g_file_make_directory_with_parents (history_dir,
704 NULL, /* cancellable */
705 &error);
706 if (error)
707 {
708 g_critical ("%s: %s", _("Could not create history dir"), error->message);
709 return FALSE;
710 }
711 }
712
713 return TRUE;
714 }
0 /*
1 * This file is part of GPaste.
2 *
3 * Copyright (c) 2010-2018, Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 */
5
6 #if !defined (__G_PASTE_H_INSIDE__) && !defined (G_PASTE_COMPILATION)
7 #error "Only <gpaste.h> can be included directly."
8 #endif
9
10 #ifndef __G_PASTE_UTIL_H__
11 #define __G_PASTE_UTIL_H__
12
13 #include <gpaste-settings.h>
14 #include <gpaste-client.h>
15
16 #include <gdk-pixbuf/gdk-pixbuf.h>
17
18 G_BEGIN_DECLS
19
20 gboolean g_paste_util_confirm_dialog (GtkWindow *parent,
21 const gchar *action,
22 const gchar *msg);
23 void g_paste_util_spawn (const gchar *app);
24 gboolean g_paste_util_spawn_sync (const gchar *app,
25 GError **error);
26 void g_paste_util_activate_ui (const gchar *action,
27 GVariant *arg);
28 gboolean g_paste_util_activate_ui_sync (const gchar *action,
29 GVariant *arg,
30 GError **error);
31 void g_paste_util_empty_with_confirmation (GPasteClient *client,
32 const GPasteSettings *settings,
33 const gchar *history);
34 gboolean g_paste_util_empty_with_confirmation_sync (GPasteClient *client,
35 const GPasteSettings *settings,
36 const gchar *history,
37 GError **error);
38 gchar *g_paste_util_replace (const gchar *text,
39 const gchar *pattern,
40 const gchar *substitution);
41 gchar *g_paste_util_compute_checksum (GdkPixbuf *image);
42
43 void g_paste_util_empty_history (GtkWindow *parent_window,
44 GPasteClient *client,
45 GPasteSettings *settings,
46 const gchar *history);
47
48 gboolean g_paste_util_has_gnome_shell (void);
49
50 void g_paste_util_show_win (GApplication *application);
51
52 guint32 *g_paste_util_get_dbus_au_result (GVariant *variant,
53 guint64 *len);
54
55 GPasteClientItem *g_paste_util_get_dbus_item_result (GVariant *variant);
56 GList *g_paste_util_get_dbus_items_result (GVariant *variant);
57
58 void g_paste_util_write_pid_file (const gchar *component);
59 GPid g_paste_util_read_pid_file (const gchar *component);
60
61 gchar *g_paste_util_xml_decode (const gchar *text);
62 gchar *g_paste_util_xml_encode (const gchar *text);
63
64 gchar *g_paste_util_get_history_dir_path (void);
65 GFile *g_paste_util_get_history_dir (void);
66 gchar *g_paste_util_get_history_file_path (const gchar *name,
67 const gchar *extension);
68 GFile *g_paste_util_get_history_file (const gchar *name,
69 const gchar *extension);
70
71 gboolean g_paste_util_ensure_history_dir_exists (const GPasteSettings *settings);
72
73 G_END_DECLS
74
75 #endif /*__G_PASTE_UTIL_H__*/
55 bin/gpaste-ui \
66 $(NULL)
77
8 bin_gpaste_ui_SOURCES = \
9 %D%/ui/gpaste-ui.c \
8 bin_gpaste_ui_SOURCES = \
9 %D%/ui/gpaste-ui-about.c \
10 %D%/ui/gpaste-ui-about.h \
11 %D%/ui/gpaste-ui-backup-history.c \
12 %D%/ui/gpaste-ui-backup-history.h \
13 %D%/ui/gpaste-ui-delete-history.c \
14 %D%/ui/gpaste-ui-delete-history.h \
15 %D%/ui/gpaste-ui-delete-item.c \
16 %D%/ui/gpaste-ui-delete-item.h \
17 %D%/ui/gpaste-ui-edit-item.c \
18 %D%/ui/gpaste-ui-edit-item.h \
19 %D%/ui/gpaste-ui-empty-history.c \
20 %D%/ui/gpaste-ui-empty-history.h \
21 %D%/ui/gpaste-ui-empty-item.c \
22 %D%/ui/gpaste-ui-empty-item.h \
23 %D%/ui/gpaste-ui-header.c \
24 %D%/ui/gpaste-ui-header.h \
25 %D%/ui/gpaste-ui-history-action.c \
26 %D%/ui/gpaste-ui-history-action.h \
27 %D%/ui/gpaste-ui-history-actions.c \
28 %D%/ui/gpaste-ui-history-actions.h \
29 %D%/ui/gpaste-ui-history.c \
30 %D%/ui/gpaste-ui-history.h \
31 %D%/ui/gpaste-ui-item-action.c \
32 %D%/ui/gpaste-ui-item-action.h \
33 %D%/ui/gpaste-ui-item-skeleton.c \
34 %D%/ui/gpaste-ui-item-skeleton.h \
35 %D%/ui/gpaste-ui-item.c \
36 %D%/ui/gpaste-ui-item.h \
37 %D%/ui/gpaste-ui-new-item.c \
38 %D%/ui/gpaste-ui-new-item.h \
39 %D%/ui/gpaste-ui-panel-history.c \
40 %D%/ui/gpaste-ui-panel-history.h \
41 %D%/ui/gpaste-ui-panel.c \
42 %D%/ui/gpaste-ui-panel.h \
43 %D%/ui/gpaste-ui-reexec.c \
44 %D%/ui/gpaste-ui-reexec.h \
45 %D%/ui/gpaste-ui-search-bar.c \
46 %D%/ui/gpaste-ui-search-bar.h \
47 %D%/ui/gpaste-ui-search.c \
48 %D%/ui/gpaste-ui-search.h \
49 %D%/ui/gpaste-ui-settings.c \
50 %D%/ui/gpaste-ui-settings.h \
51 %D%/ui/gpaste-ui-shortcuts-window.c \
52 %D%/ui/gpaste-ui-shortcuts-window.h \
53 %D%/ui/gpaste-ui-switch.c \
54 %D%/ui/gpaste-ui-switch.h \
55 %D%/ui/gpaste-ui-upload-item.c \
56 %D%/ui/gpaste-ui-upload-item.h \
57 %D%/ui/gpaste-ui-window.c \
58 %D%/ui/gpaste-ui-window.h \
59 %D%/ui/gpaste-ui.c \
60 %D%/ui/tmp/gpaste-client.c \
61 %D%/ui/tmp/gpaste-client.h \
62 %D%/ui/tmp/gpaste-client-item.c \
63 %D%/ui/tmp/gpaste-client-item.h \
64 %D%/ui/tmp/gpaste-util.c \
65 %D%/ui/tmp/gpaste-util.h \
66 %D%/ui/tmp/gpaste-settings.c \
67 %D%/ui/tmp/gpaste-settings.h \
68 %D%/ui/tmp/gpaste-update-enums.c \
69 %D%/ui/tmp/gpaste-update-enums.h \
70 %D%/ui/tmp/gpaste-settings-ui-panel.c \
71 %D%/ui/tmp/gpaste-settings-ui-panel.h \
72 %D%/ui/tmp/gpaste-settings-ui-stack.c \
73 %D%/ui/tmp/gpaste-settings-ui-stack.h \
74 %D%/ui/tmp/gpaste-settings-ui-widget.c \
75 %D%/ui/tmp/gpaste-settings-ui-widget.h \
76 %D%/ui/tmp/gpaste-item-enums.c \
77 %D%/ui/tmp/gpaste-item-enums.h \
1078 $(NULL)
1179
1280 bin_gpaste_ui_CFLAGS = \
1381 $(GLIB_CFLAGS) \
14 $(GTK_CFLAGS) \
82 $(GTK3_CFLAGS) \
83 -I $(srcdir)/src/ui/ \
84 -I $(srcdir)/src/ui/tmp/ \
1585 $(NULL)
1686
1787 bin_gpaste_ui_LDADD = \
18 $(builddir)/$(libgpaste_la_file) \
1988 $(GLIB_LIBS) \
20 $(GTK_LIBS) \
89 $(GTK3_LIBS) \
2190 $(NULL)
91 # $(builddir)/$(libgpaste_la_file)