Merge lp:~elementary-apps/eidete/fix-for-freya into lp:eidete
- fix-for-freya
- Merge into trunk
Proposed by
Tom Beckmann
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | PerfectCarl | ||||||||||||||||
Approved revision: | 207 | ||||||||||||||||
Merged at revision: | 176 | ||||||||||||||||
Proposed branch: | lp:~elementary-apps/eidete/fix-for-freya | ||||||||||||||||
Merge into: | lp:eidete | ||||||||||||||||
Diff against target: |
1635 lines (+700/-415) 9 files modified
CMakeLists.txt (+32/-8) README (+22/-0) po/eidete.pot (+87/-72) src/Widgets/end_dialog.vala (+192/-76) src/Widgets/keyview.vala (+177/-167) src/Widgets/selectionarea.vala (+14/-11) src/eidete.vala (+136/-67) src/keycapture.c (+6/-0) src/videobin_uploader.vala (+34/-14) |
||||||||||||||||
To merge this branch: | bzr merge lp:~elementary-apps/eidete/fix-for-freya | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PerfectCarl (community) | Approve | ||
Review via email: mp+245513@code.launchpad.net |
Commit message
Make eidete work for elementary freya:
- port it to gstreamer 1.0
- fix contractors
- fix video-bin (though videobin.org doesn't support webm files anymore)
- update styling
- update pot
- fix misc issues
Note: the project is still compatible with gstreamer 0.10 and luna (see makefile for more info)
Description of the change
Make eidete work for elementary freya: fixing issues and port it to gstreamer 1.0.
The project is still compatible with gstreamer 0.10 (see makefile for more info)
(this is a more public (in terms of access rights) copy of the original 314 compatibility branch)
To post a comment you must log in.
- 205. By Tom Beckmann
-
fix a bunch of compiler warnings
- 206. By PerfectCarl
-
Fix the pause windows
- 207. By PerfectCarl
-
Fix size issues
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-05-29 17:06:50 +0000 | |||
3 | +++ CMakeLists.txt 2015-01-04 16:20:24 +0000 | |||
4 | @@ -16,20 +16,44 @@ | |||
5 | 16 | set (PKGDATADIR "${DATADIR}/eidete") | 16 | set (PKGDATADIR "${DATADIR}/eidete") |
6 | 17 | set (GETTEXT_PACKAGE "eidete") | 17 | set (GETTEXT_PACKAGE "eidete") |
7 | 18 | set (RELEASE_NAME "Feature rich and functional.") | 18 | set (RELEASE_NAME "Feature rich and functional.") |
9 | 19 | set (VERSION "0.1") | 19 | set (VERSION "0.2") |
10 | 20 | set (VERSION_INFO "Release") | 20 | set (VERSION_INFO "Release") |
11 | 21 | set (CMAKE_C_FLAGS "-ggdb") | 21 | set (CMAKE_C_FLAGS "-ggdb") |
12 | 22 | set (PREFIX ${CMAKE_INSTALL_PREFIX}) | 22 | set (PREFIX ${CMAKE_INSTALL_PREFIX}) |
13 | 23 | set (DOLLAR "$") | 23 | set (DOLLAR "$") |
14 | 24 | 24 | ||
15 | 25 | # Comment this out to enable C compiler warnings | ||
16 | 26 | add_definitions (-w) | ||
17 | 27 | |||
18 | 25 | list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) | 28 | list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) |
19 | 26 | 29 | ||
20 | 30 | # Building for GStreamer 1.0 by default | ||
21 | 31 | # Uncomment the following line to build for GStreamer 0.10 | ||
22 | 32 | # set (USE_GSTREAMER_0_10 "TRUE") | ||
23 | 33 | |||
24 | 34 | if(DEFINED USE_GSTREAMER_0_10) | ||
25 | 35 | message ("-- Building eidete for GStreamer 0.10") | ||
26 | 36 | set(EXTRA_DEFINITIONS -DGSTREAMER_0_10_IS_DEFINED) | ||
27 | 37 | add_definitions(${EXTRA_DEFINITIONS}) | ||
28 | 38 | set(GST_PACKAGES gstreamer-interfaces-0.10 gstreamer-0.10 gstreamer-pbutils-0.10) | ||
29 | 39 | else () | ||
30 | 40 | message ("-- Building eidete for GStreamer 1.0") | ||
31 | 41 | set(GST_PACKAGES gstreamer-1.0 gstreamer-pbutils-1.0) | ||
32 | 42 | endif () | ||
33 | 43 | |||
34 | 27 | configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala) | 44 | configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala) |
36 | 28 | add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DWNCK_I_KNOW_THIS_IS_UNSTABLE `pkg-config --cflags --libs gstreamer-interfaces-0.10`) | 45 | add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DWNCK_I_KNOW_THIS_IS_UNSTABLE) |
37 | 29 | 46 | ||
38 | 30 | find_package(PkgConfig) | 47 | find_package(PkgConfig) |
40 | 31 | pkg_check_modules(DEPS REQUIRED gtk+-3.0>=3.10 libwnck-3.0 gstreamer-interfaces-0.10 gstreamer-0.10 gstreamer-pbutils-0.10 granite xtst gdk-x11-3.0 x11) | 48 | pkg_check_modules(DEPS REQUIRED gtk+-3.0>=3.10 |
41 | 49 | libwnck-3.0 | ||
42 | 50 | granite | ||
43 | 51 | xtst | ||
44 | 52 | gdk-x11-3.0 | ||
45 | 53 | x11 | ||
46 | 54 | ${GST_PACKAGES}) | ||
47 | 32 | 55 | ||
48 | 56 | # TEST | ||
49 | 33 | add_definitions(${DEPS_CFLAGS}) | 57 | add_definitions(${DEPS_CFLAGS}) |
50 | 34 | 58 | ||
51 | 35 | link_libraries(${DEPS_LIBRARIES}) | 59 | link_libraries(${DEPS_LIBRARIES}) |
52 | @@ -40,6 +64,7 @@ | |||
53 | 40 | ensure_vala_version("0.16.0" MINIMUM) | 64 | ensure_vala_version("0.16.0" MINIMUM) |
54 | 41 | 65 | ||
55 | 42 | include(ValaPrecompile) | 66 | include(ValaPrecompile) |
56 | 67 | |||
57 | 43 | vala_precompile(VALA_C | 68 | vala_precompile(VALA_C |
58 | 44 | src/eidete.vala | 69 | src/eidete.vala |
59 | 45 | src/Widgets/countdown.vala | 70 | src/Widgets/countdown.vala |
60 | @@ -51,15 +76,14 @@ | |||
61 | 51 | PACKAGES | 76 | PACKAGES |
62 | 52 | granite | 77 | granite |
63 | 53 | gtk+-3.0 | 78 | gtk+-3.0 |
67 | 54 | gstreamer-0.10 | 79 | ${GST_PACKAGES} |
65 | 55 | gstreamer-pbutils-0.10 | ||
66 | 56 | gstreamer-interfaces-0.10 | ||
68 | 57 | libwnck-3.0 | 80 | libwnck-3.0 |
69 | 58 | gdk-x11-3.0 | 81 | gdk-x11-3.0 |
70 | 59 | OPTIONS | 82 | OPTIONS |
72 | 60 | -X -lXtst | 83 | --enable-experimental |
73 | 61 | --thread | 84 | --thread |
74 | 62 | --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/ | 85 | --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/ |
75 | 86 | ${EXTRA_DEFINITIONS} | ||
76 | 63 | ) | 87 | ) |
77 | 64 | 88 | ||
78 | 65 | vala_precompile(VALA_C_VIDEOBIN | 89 | vala_precompile(VALA_C_VIDEOBIN |
79 | @@ -79,4 +103,4 @@ | |||
80 | 79 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/eidete.desktop DESTINATION share/applications) | 103 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/eidete.desktop DESTINATION share/applications) |
81 | 80 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/eidete.svg DESTINATION share/icons/hicolor/48x48/apps) | 104 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/eidete.svg DESTINATION share/icons/hicolor/48x48/apps) |
82 | 81 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/videobin.svg DESTINATION share/icons/hicolor/48x48/apps) | 105 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/videobin.svg DESTINATION share/icons/hicolor/48x48/apps) |
83 | 82 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/videobin.contract DESTINATION ${CMAKE_INSTALL_PREFIX}/share/contractor) | ||
84 | 83 | \ No newline at end of file | 106 | \ No newline at end of file |
85 | 107 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/videobin.contract DESTINATION ${CMAKE_INSTALL_PREFIX}/share/contractor) | ||
86 | 84 | 108 | ||
87 | === added file 'README' | |||
88 | --- README 1970-01-01 00:00:00 +0000 | |||
89 | +++ README 2015-01-04 16:20:24 +0000 | |||
90 | @@ -0,0 +1,22 @@ | |||
91 | 1 | ## Introduction | ||
92 | 2 | |||
93 | 3 | A simple screencasting app for the elementary project | ||
94 | 4 | |||
95 | 5 | Current Features | ||
96 | 6 | - encoding to webm | ||
97 | 7 | - selection of the area to be recorded | ||
98 | 8 | - display of the pressed keys | ||
99 | 9 | - audio recording | ||
100 | 10 | |||
101 | 11 | For more information go to: https://launchpad.net/eidete | ||
102 | 12 | |||
103 | 13 | ## How to build | ||
104 | 14 | Install dependencies | ||
105 | 15 | sudo apt-get build-dep eidete | ||
106 | 16 | OR | ||
107 | 17 | sudo apt-get build-dep granite-demo | ||
108 | 18 | sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev | ||
109 | 19 | |||
110 | 20 | mkdir build && cd build | ||
111 | 21 | cmake -DCMAKE_INSTALL_PREFIX=/usr ../ | ||
112 | 22 | make | ||
113 | 0 | 23 | ||
114 | === modified file 'po/eidete.pot' | |||
115 | --- po/eidete.pot 2013-05-17 20:02:58 +0000 | |||
116 | +++ po/eidete.pot 2015-01-04 16:20:24 +0000 | |||
117 | @@ -8,7 +8,7 @@ | |||
118 | 8 | msgstr "" | 8 | msgstr "" |
119 | 9 | "Project-Id-Version: PACKAGE VERSION\n" | 9 | "Project-Id-Version: PACKAGE VERSION\n" |
120 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
122 | 11 | "POT-Creation-Date: 2013-05-17 23:02+0300\n" | 11 | "POT-Creation-Date: 2015-01-04 12:47+0100\n" |
123 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
124 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
125 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
126 | @@ -17,183 +17,198 @@ | |||
127 | 17 | "Content-Type: text/plain; charset=CHARSET\n" | 17 | "Content-Type: text/plain; charset=CHARSET\n" |
128 | 18 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
129 | 19 | 19 | ||
150 | 20 | #: /home/kristjan/translations/po/../src/desktop_launcher.vala:5 | 20 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:140 |
131 | 21 | msgid "Record screencasts" | ||
132 | 22 | msgstr "" | ||
133 | 23 | |||
134 | 24 | #: /home/kristjan/translations/po/../src/desktop_launcher.vala:6 | ||
135 | 25 | msgid "Screencaster" | ||
136 | 26 | msgstr "" | ||
137 | 27 | |||
138 | 28 | #: /home/kristjan/translations/po/../src/videobin_uploader.vala:45 | ||
139 | 29 | msgid "Upload" | ||
140 | 30 | msgstr "" | ||
141 | 31 | |||
142 | 32 | #: /home/kristjan/translations/po/../src/savedialog.vala:8 | ||
143 | 33 | #: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:28 | ||
144 | 34 | #: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:64 | ||
145 | 35 | #: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:100 | ||
146 | 36 | msgid "Save" | ||
147 | 37 | msgstr "" | ||
148 | 38 | |||
149 | 39 | #: /home/kristjan/translations/po/../src/eidete.vala:138 | ||
151 | 40 | msgid "Monitor" | 21 | msgid "Monitor" |
152 | 41 | msgstr "" | 22 | msgstr "" |
153 | 42 | 23 | ||
155 | 43 | #: /home/kristjan/translations/po/../src/eidete.vala:158 | 24 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:160 |
156 | 44 | msgid "Fullscreen" | 25 | msgid "Fullscreen" |
157 | 45 | msgstr "" | 26 | msgstr "" |
158 | 46 | 27 | ||
160 | 47 | #: /home/kristjan/translations/po/../src/eidete.vala:159 | 28 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:161 |
161 | 48 | msgid "Custom" | 29 | msgid "Custom" |
162 | 49 | msgstr "" | 30 | msgstr "" |
163 | 50 | 31 | ||
165 | 51 | #: /home/kristjan/translations/po/../src/eidete.vala:170 | 32 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:172 |
166 | 52 | msgid "Default" | 33 | msgid "Default" |
167 | 53 | msgstr "" | 34 | msgstr "" |
168 | 54 | 35 | ||
170 | 55 | #: /home/kristjan/translations/po/../src/eidete.vala:179 | 36 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:181 |
171 | 56 | msgid "Sound" | 37 | msgid "Sound" |
172 | 57 | msgstr "" | 38 | msgstr "" |
173 | 58 | 39 | ||
175 | 59 | #: /home/kristjan/translations/po/../src/eidete.vala:182 | 40 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:184 |
176 | 60 | msgid "Video" | 41 | msgid "Video" |
177 | 61 | msgstr "" | 42 | msgstr "" |
178 | 62 | 43 | ||
180 | 63 | #: /home/kristjan/translations/po/../src/eidete.vala:185 | 44 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:187 |
181 | 64 | msgid "Keyboard" | 45 | msgid "Keyboard" |
182 | 65 | msgstr "" | 46 | msgstr "" |
183 | 66 | 47 | ||
185 | 67 | #: /home/kristjan/translations/po/../src/eidete.vala:188 | 48 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:190 |
186 | 68 | msgid "Mouse" | 49 | msgid "Mouse" |
187 | 69 | msgstr "" | 50 | msgstr "" |
188 | 70 | 51 | ||
190 | 71 | #: /home/kristjan/translations/po/../src/eidete.vala:191 | 52 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:193 |
191 | 72 | msgid "Start Recording" | 53 | msgid "Start Recording" |
192 | 73 | msgstr "" | 54 | msgstr "" |
193 | 74 | 55 | ||
195 | 75 | #: /home/kristjan/translations/po/../src/eidete.vala:197 | 56 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:199 |
196 | 76 | msgid "About" | 57 | msgid "About" |
197 | 77 | msgstr "" | 58 | msgstr "" |
198 | 78 | 59 | ||
200 | 79 | #: /home/kristjan/translations/po/../src/eidete.vala:210 | 60 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:212 |
201 | 80 | msgid "Record Computer Sounds" | 61 | msgid "Record Computer Sounds" |
202 | 81 | msgstr "" | 62 | msgstr "" |
203 | 82 | 63 | ||
205 | 83 | #: /home/kristjan/translations/po/../src/eidete.vala:212 | 64 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:214 |
206 | 84 | msgid "Record from Microphone" | 65 | msgid "Record from Microphone" |
207 | 85 | msgstr "" | 66 | msgstr "" |
208 | 86 | 67 | ||
210 | 87 | #: /home/kristjan/translations/po/../src/eidete.vala:215 | 68 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:217 |
211 | 88 | msgid "Record from Monitor" | 69 | msgid "Record from Monitor" |
212 | 89 | msgstr "" | 70 | msgstr "" |
213 | 90 | 71 | ||
215 | 91 | #: /home/kristjan/translations/po/../src/eidete.vala:217 | 72 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:219 |
216 | 92 | msgid "Recording Area" | 73 | msgid "Recording Area" |
217 | 93 | msgstr "" | 74 | msgstr "" |
218 | 94 | 75 | ||
220 | 95 | #: /home/kristjan/translations/po/../src/eidete.vala:219 | 76 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:221 |
221 | 96 | msgid "Width" | 77 | msgid "Width" |
222 | 97 | msgstr "" | 78 | msgstr "" |
223 | 98 | 79 | ||
225 | 99 | #: /home/kristjan/translations/po/../src/eidete.vala:221 | 80 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:223 |
226 | 100 | msgid "Height" | 81 | msgid "Height" |
227 | 101 | msgstr "" | 82 | msgstr "" |
228 | 102 | 83 | ||
230 | 103 | #: /home/kristjan/translations/po/../src/eidete.vala:245 | 84 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:247 |
231 | 104 | msgid "Pressed keys on screen" | 85 | msgid "Pressed keys on screen" |
232 | 105 | msgstr "" | 86 | msgstr "" |
233 | 106 | 87 | ||
235 | 107 | #: /home/kristjan/translations/po/../src/eidete.vala:248 | 88 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:250 |
236 | 108 | msgid "Mouse clicks on screen" | 89 | msgid "Mouse clicks on screen" |
237 | 109 | msgstr "" | 90 | msgstr "" |
238 | 110 | 91 | ||
240 | 111 | #: /home/kristjan/translations/po/../src/eidete.vala:250 | 92 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:252 |
241 | 112 | msgid "Circle around the cursor" | 93 | msgid "Circle around the cursor" |
242 | 113 | msgstr "" | 94 | msgstr "" |
243 | 114 | 95 | ||
245 | 115 | #: /home/kristjan/translations/po/../src/eidete.vala:256 | 96 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:258 |
246 | 116 | msgid "Behavior" | 97 | msgid "Behavior" |
247 | 117 | msgstr "" | 98 | msgstr "" |
248 | 118 | 99 | ||
250 | 119 | #: /home/kristjan/translations/po/../src/eidete.vala:257 | 100 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:259 |
251 | 120 | msgid "Appearance" | 101 | msgid "Appearance" |
252 | 121 | msgstr "" | 102 | msgstr "" |
253 | 122 | 103 | ||
257 | 123 | #: /home/kristjan/translations/po/../src/eidete.vala:449 | 104 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:461 |
258 | 124 | #: /home/kristjan/translations/po/../src/eidete.vala:456 | 105 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:682 |
256 | 125 | #: /home/kristjan/translations/po/../src/eidete.vala:641 | ||
259 | 126 | msgid "Recording paused" | 106 | msgid "Recording paused" |
260 | 127 | msgstr "" | 107 | msgstr "" |
261 | 128 | 108 | ||
263 | 129 | #: /home/kristjan/translations/po/../src/eidete.vala:459 | 109 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:464 |
264 | 130 | msgid "You can continue or finish the recording now" | 110 | msgid "You can continue or finish the recording now" |
265 | 131 | msgstr "" | 111 | msgstr "" |
266 | 132 | 112 | ||
268 | 133 | #: /home/kristjan/translations/po/../src/eidete.vala:468 | 113 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:473 |
269 | 134 | msgid "Continue" | 114 | msgid "Continue" |
270 | 135 | msgstr "" | 115 | msgstr "" |
271 | 136 | 116 | ||
273 | 137 | #: /home/kristjan/translations/po/../src/eidete.vala:469 | 117 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:474 |
274 | 138 | msgid "Continue recording" | 118 | msgid "Continue recording" |
275 | 139 | msgstr "" | 119 | msgstr "" |
276 | 140 | 120 | ||
278 | 141 | #: /home/kristjan/translations/po/../src/eidete.vala:472 | 121 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:477 |
279 | 142 | msgid "Finish" | 122 | msgid "Finish" |
280 | 143 | msgstr "" | 123 | msgstr "" |
281 | 144 | 124 | ||
283 | 145 | #: /home/kristjan/translations/po/../src/eidete.vala:473 | 125 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:478 |
284 | 146 | msgid "Stop the recording and save the file" | 126 | msgid "Stop the recording and save the file" |
285 | 147 | msgstr "" | 127 | msgstr "" |
286 | 148 | 128 | ||
288 | 149 | #: /home/kristjan/translations/po/../src/eidete.vala:476 | 129 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:481 |
289 | 130 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:50 | ||
290 | 150 | msgid "Cancel" | 131 | msgid "Cancel" |
291 | 151 | msgstr "" | 132 | msgstr "" |
292 | 152 | 133 | ||
294 | 153 | #: /home/kristjan/translations/po/../src/eidete.vala:477 | 134 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:482 |
295 | 154 | msgid "Cancel the recording without saving the file" | 135 | msgid "Cancel the recording without saving the file" |
296 | 155 | msgstr "" | 136 | msgstr "" |
297 | 156 | 137 | ||
299 | 157 | #: /home/kristjan/translations/po/../src/eidete.vala:651 | 138 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:690 |
300 | 158 | msgid "Pause recording" | 139 | msgid "Pause recording" |
301 | 159 | msgstr "" | 140 | msgstr "" |
302 | 160 | 141 | ||
304 | 161 | #: /home/kristjan/translations/po/../src/eidete.vala:671 | 142 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:719 |
305 | 162 | msgid "Pause Recording" | 143 | msgid "Pause Recording" |
306 | 163 | msgstr "" | 144 | msgstr "" |
307 | 164 | 145 | ||
309 | 165 | #: /home/kristjan/translations/po/../src/eidete.vala:672 | 146 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:720 |
310 | 166 | msgid "Finish Recording" | 147 | msgid "Finish Recording" |
311 | 167 | msgstr "" | 148 | msgstr "" |
312 | 168 | 149 | ||
314 | 169 | #: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:24 | 150 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/desktop_launcher.vala:5 |
315 | 151 | msgid "Record screencasts" | ||
316 | 152 | msgstr "" | ||
317 | 153 | |||
318 | 154 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/desktop_launcher.vala:6 | ||
319 | 155 | msgid "Screencaster" | ||
320 | 156 | msgstr "" | ||
321 | 157 | |||
322 | 158 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:40 | ||
323 | 170 | msgid "Recording complete" | 159 | msgid "Recording complete" |
324 | 171 | msgstr "" | 160 | msgstr "" |
325 | 172 | 161 | ||
335 | 173 | #: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:33 | 162 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:44 |
336 | 174 | msgid "Don't save" | 163 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:107 |
337 | 175 | msgstr "" | 164 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:146 |
338 | 176 | 165 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:226 | |
339 | 177 | #: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:62 | 166 | msgid "Save" |
340 | 178 | msgid "Could not contact Contractor. Click the Save button to save the file." | 167 | msgstr "" |
341 | 179 | msgstr "" | 168 | |
342 | 180 | 169 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:144 | |
343 | 181 | #: /home/kristjan/translations/po/../src/Widgets/keyview.vala:48 | 170 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:224 |
344 | 171 | msgid "Could not contact Contractor." | ||
345 | 172 | msgstr "" | ||
346 | 173 | |||
347 | 174 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:214 | ||
348 | 175 | msgid "Save file" | ||
349 | 176 | msgstr "" | ||
350 | 177 | |||
351 | 178 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:216 | ||
352 | 179 | msgid "Execute" | ||
353 | 180 | msgstr "" | ||
354 | 181 | |||
355 | 182 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/countdown.vala:27 | ||
356 | 183 | msgid "Recording starts in" | ||
357 | 184 | msgstr "" | ||
358 | 185 | |||
359 | 186 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/countdown.vala:34 | ||
360 | 187 | msgid "Focus Eidete to stop recording" | ||
361 | 188 | msgstr "" | ||
362 | 189 | |||
363 | 190 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/keyview.vala:48 | ||
364 | 182 | msgid "Left" | 191 | msgid "Left" |
365 | 183 | msgstr "" | 192 | msgstr "" |
366 | 184 | 193 | ||
368 | 185 | #: /home/kristjan/translations/po/../src/Widgets/keyview.vala:51 | 194 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/keyview.vala:51 |
369 | 186 | msgid "Middle" | 195 | msgid "Middle" |
370 | 187 | msgstr "" | 196 | msgstr "" |
371 | 188 | 197 | ||
373 | 189 | #: /home/kristjan/translations/po/../src/Widgets/keyview.vala:54 | 198 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/keyview.vala:54 |
374 | 190 | msgid "Right" | 199 | msgid "Right" |
375 | 191 | msgstr "" | 200 | msgstr "" |
376 | 192 | 201 | ||
383 | 193 | #: /home/kristjan/translations/po/../src/Widgets/countdown.vala:27 | 202 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:41 |
384 | 194 | msgid "Recording starts in" | 203 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:43 |
385 | 195 | msgstr "" | 204 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:45 |
386 | 196 | 205 | msgid "Optional" | |
387 | 197 | #: /home/kristjan/translations/po/../src/Widgets/countdown.vala:34 | 206 | msgstr "" |
388 | 198 | msgid "Focus Eidete to stop recording" | 207 | |
389 | 208 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:48 | ||
390 | 209 | msgid "Upload" | ||
391 | 210 | msgstr "" | ||
392 | 211 | |||
393 | 212 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:57 | ||
394 | 213 | msgid "Your email address for relocating your videos" | ||
395 | 199 | msgstr "" | 214 | msgstr "" |
396 | 200 | 215 | ||
397 | === modified file 'src/Widgets/end_dialog.vala' | |||
398 | --- src/Widgets/end_dialog.vala 2013-05-15 15:57:25 +0000 | |||
399 | +++ src/Widgets/end_dialog.vala 2015-01-04 16:20:24 +0000 | |||
400 | @@ -1,122 +1,238 @@ | |||
401 | 1 | using Gtk; | 1 | using Gtk; |
402 | 2 | 2 | ||
403 | 3 | |||
404 | 4 | namespace Eidete.Widgets { | 3 | namespace Eidete.Widgets { |
405 | 5 | 4 | ||
407 | 6 | private bool contractor; | 5 | public class EndDialog : Dialog { |
408 | 7 | 6 | ||
410 | 8 | public class EndDialog : Window { | 7 | private bool contractor; |
411 | 8 | |||
412 | 9 | private EideteApp app ; | ||
413 | 10 | private Button export ; | ||
414 | 11 | private Grid grid; | ||
415 | 12 | private ListStore list ; | ||
416 | 13 | private TreeView treeview ; | ||
417 | 14 | private File source ; | ||
418 | 15 | |||
419 | 9 | public EndDialog (EideteApp app){ | 16 | public EndDialog (EideteApp app){ |
421 | 10 | this.set_default_size (400, 200); | 17 | this.app = app ; |
422 | 18 | //build_ui () ; | ||
423 | 19 | this.window_position = WindowPosition.CENTER_ON_PARENT; | ||
424 | 20 | } | ||
425 | 11 | 21 | ||
426 | 22 | private void build_ui () { | ||
427 | 23 | this.get_header_bar ().get_style_context ().remove_class ("header-bar"); | ||
428 | 24 | this.set_default_size (600, 600); | ||
429 | 12 | this.set_application (app); | 25 | this.set_application (app); |
431 | 13 | 26 | ||
432 | 14 | if (app.selectionarea != null) | 27 | if (app.selectionarea != null) |
434 | 15 | app.selectionarea.destroy (); | 28 | app.selectionarea.destroy (); |
435 | 16 | if (app.keyview != null) | 29 | if (app.keyview != null) |
438 | 17 | app.keyview.destroy (); | 30 | app.keyview.destroy (); |
439 | 18 | this.window_position = WindowPosition.CENTER; | 31 | |
440 | 19 | this.icon_name = "eidete"; | 32 | this.icon_name = "eidete"; |
441 | 20 | 33 | ||
443 | 21 | var grid = new Grid (); | 34 | grid = new Grid (); |
444 | 22 | grid.margin = 12; | 35 | grid.margin = 12; |
445 | 23 | 36 | ||
446 | 37 | var content = (Gtk.Box) this.get_content_area () ; | ||
447 | 24 | var title = new Label ("<span size='30000'>"+_("Recording complete")+"</span>"); | 38 | var title = new Label ("<span size='30000'>"+_("Recording complete")+"</span>"); |
448 | 25 | title.use_markup = true; | 39 | title.use_markup = true; |
449 | 26 | title.halign = Align.START; | 40 | title.halign = Align.START; |
450 | 27 | 41 | ||
452 | 28 | var export = new Button.with_label (_("Save")); | 42 | export = new Button.with_label (_("Save")); |
453 | 29 | export.image = new Image.from_stock (Stock.SAVE, IconSize.BUTTON); | 43 | export.image = new Image.from_stock (Stock.SAVE, IconSize.BUTTON); |
454 | 30 | export.can_default = true; | 44 | export.can_default = true; |
455 | 45 | export.get_style_context ().add_class ("suggested-action"); | ||
456 | 31 | this.set_default (export); | 46 | this.set_default (export); |
457 | 32 | 47 | ||
459 | 33 | var cancel = new Button.with_label (_("Don't save")); | 48 | var cancel = new Button.with_label (_("Cancel")); |
460 | 34 | cancel.image = new Image.from_stock (Stock.DELETE, IconSize.BUTTON); | 49 | cancel.image = new Image.from_stock (Stock.DELETE, IconSize.BUTTON); |
462 | 35 | cancel.halign = Align.END; | 50 | cancel.margin_end = 6; |
463 | 36 | 51 | ||
464 | 37 | var bbox = new ButtonBox (Orientation.HORIZONTAL); | 52 | var bbox = new ButtonBox (Orientation.HORIZONTAL); |
465 | 53 | bbox.homogeneous = true; | ||
466 | 38 | bbox.pack_end (cancel, false, true, 0); | 54 | bbox.pack_end (cancel, false, true, 0); |
467 | 39 | bbox.pack_end (export, false, true, 0); | 55 | bbox.pack_end (export, false, true, 0); |
468 | 40 | bbox.layout_style = ButtonBoxStyle.END; | 56 | bbox.layout_style = ButtonBoxStyle.END; |
469 | 41 | 57 | ||
475 | 42 | //contractor | 58 | |
476 | 43 | var list = new ListStore (2, typeof (Gdk.Pixbuf), typeof (string)); | 59 | list = new ListStore (2, typeof (Gdk.Pixbuf), typeof (string)); |
477 | 44 | var t = new TreeView.with_model (list); | 60 | treeview = new TreeView.with_model (list); |
478 | 45 | t.headers_visible = false; | 61 | treeview.headers_visible = false; |
479 | 46 | t.hexpand = true; | 62 | treeview.hexpand = true; |
480 | 63 | treeview.set_activate_on_single_click (false) ; | ||
481 | 64 | treeview.row_activated.connect ( on_contract_executed) ; | ||
482 | 47 | 65 | ||
483 | 48 | var cell1 = new CellRendererPixbuf (); | 66 | var cell1 = new CellRendererPixbuf (); |
484 | 49 | cell1.set_padding (5, 15); | 67 | cell1.set_padding (5, 15); |
486 | 50 | t.insert_column_with_attributes (-1, "", cell1, "pixbuf", 0); | 68 | treeview.insert_column_with_attributes (-1, "", cell1, "pixbuf", 0); |
487 | 51 | var cell2 = new CellRendererText (); | 69 | var cell2 = new CellRendererText (); |
488 | 52 | cell2.set_padding (2, 15); | 70 | cell2.set_padding (2, 15); |
516 | 53 | t.insert_column_with_attributes (-1, "", cell2, "markup", 1); | 71 | treeview.insert_column_with_attributes (-1, "", cell2, "markup", 1); |
517 | 54 | 72 | ||
518 | 55 | 73 | //contractor | |
519 | 56 | var c = Granite.Services.Contractor.get_contract (app.settings.destination, "video"); | 74 | load_contracts () ; |
520 | 57 | if (c == null || c.length <= 1){ | 75 | |
521 | 58 | warning ("You should install and/or run contractor"); | 76 | var scrolled = new Gtk.ScrolledWindow (null, null); |
522 | 59 | contractor = false; | 77 | scrolled.vexpand = true; |
523 | 60 | var info = new InfoBar (); | 78 | scrolled.add (treeview); |
524 | 61 | info.message_type = MessageType.WARNING; | 79 | |
498 | 62 | info.pack_start (new Label (_("Could not contact Contractor. Click the Save button to save the file."))); | ||
499 | 63 | grid.attach (info, 0, 3, 2, 1); | ||
500 | 64 | export.label = _("Save"); | ||
501 | 65 | }else{ | ||
502 | 66 | contractor = true; | ||
503 | 67 | for (var i=0;i<c.length; i++){ | ||
504 | 68 | TreeIter it; | ||
505 | 69 | list.append (out it); | ||
506 | 70 | Gdk.Pixbuf icon = null; | ||
507 | 71 | try{ | ||
508 | 72 | icon = IconTheme.get_default ().load_icon (c[i].lookup ("IconName"), 32, 0); | ||
509 | 73 | }catch (Error e){warning (e.message);} | ||
510 | 74 | list.set (it, 0, icon, 1, | ||
511 | 75 | "<b>"+c[i].lookup ("Name")+"</b>\n"+c[i].lookup ("Description")); | ||
512 | 76 | } | ||
513 | 77 | t.set_cursor (new TreePath.from_string ("0"), null, false); | ||
514 | 78 | } | ||
515 | 79 | |||
525 | 80 | grid.attach (title, 0, 0, 2, 1); | 80 | grid.attach (title, 0, 0, 2, 1); |
526 | 81 | grid.attach (new Label (""), 0, 2, 1, 1); | 81 | grid.attach (new Label (""), 0, 2, 1, 1); |
528 | 82 | grid.attach (t, 0, 4, 1, 1); | 82 | grid.attach (scrolled, 0, 4, 1, 1); |
529 | 83 | grid.attach (new Label (""), 0, 5, 1, 1); | 83 | grid.attach (new Label (""), 0, 5, 1, 1); |
530 | 84 | grid.attach (bbox, 0, 6, 1, 1); | 84 | grid.attach (bbox, 0, 6, 1, 1); |
532 | 85 | 85 | source = File.new_for_path (app.settings.destination); | |
533 | 86 | |||
534 | 86 | if (contractor){ | 87 | if (contractor){ |
545 | 87 | export.clicked.connect ( () => { | 88 | export.clicked.connect (on_contract_executed) ; |
536 | 88 | TreePath path; | ||
537 | 89 | t.get_cursor (out path, null); | ||
538 | 90 | try{ | ||
539 | 91 | Process.spawn_command_line_async (c[int.parse (path.to_string ())].lookup ("Exec")); | ||
540 | 92 | }catch (Error e){ | ||
541 | 93 | print(e.message); | ||
542 | 94 | } | ||
543 | 95 | this.destroy (); | ||
544 | 96 | }); | ||
546 | 97 | } else { | 89 | } else { |
565 | 98 | export.clicked.connect ( () => { | 90 | export.clicked.connect ( () => { |
566 | 99 | var source = File.new_for_path (app.settings.destination); | 91 | save_file () ; |
567 | 100 | var file = new FileChooserDialog (_("Save"), null, FileChooserAction.SAVE, Stock.OK, ResponseType.OK); | 92 | this.destroy (); |
568 | 101 | file.set_current_name (source.get_basename ()); | 93 | }); |
551 | 102 | file.do_overwrite_confirmation = true; | ||
552 | 103 | var res = file.run (); | ||
553 | 104 | if (res == ResponseType.OK){ | ||
554 | 105 | var destination = File.new_for_path (file.get_filename ()); | ||
555 | 106 | try{ | ||
556 | 107 | source.copy (destination, FileCopyFlags.OVERWRITE); | ||
557 | 108 | }catch (GLib.Error e){stderr.printf ("Error: %s\n", e.message);} | ||
558 | 109 | |||
559 | 110 | file.destroy (); | ||
560 | 111 | this.destroy (); | ||
561 | 112 | }else{ | ||
562 | 113 | file.destroy (); | ||
563 | 114 | } | ||
564 | 115 | }); | ||
569 | 116 | } | 94 | } |
570 | 117 | cancel.clicked.connect ( () => {this.destroy ();}); | 95 | cancel.clicked.connect ( () => {this.destroy ();}); |
571 | 118 | 96 | ||
573 | 119 | this.add (grid); | 97 | content.add (grid); |
574 | 98 | } | ||
575 | 99 | |||
576 | 100 | public void display () { | ||
577 | 101 | build_ui () ; | ||
578 | 102 | show_all () ; | ||
579 | 103 | } | ||
580 | 104 | |||
581 | 105 | private void on_contract_executed () { | ||
582 | 106 | TreePath path; | ||
583 | 107 | treeview.get_cursor (out path, null); | ||
584 | 108 | int index = int.parse (path.to_string ()) ; | ||
585 | 109 | execute_command (index) ; | ||
586 | 110 | this.destroy (); | ||
587 | 111 | } | ||
588 | 112 | |||
589 | 113 | private void save_file () { | ||
590 | 114 | var dialog = new FileChooserDialog (_("Save"), null, FileChooserAction.SAVE, Stock.OK, ResponseType.OK); | ||
591 | 115 | dialog.set_current_name (source.get_basename ()); | ||
592 | 116 | var videos_folder = Environment.get_user_special_dir(UserDirectory.VIDEOS); | ||
593 | 117 | dialog.set_current_folder (videos_folder); | ||
594 | 118 | dialog.do_overwrite_confirmation = true; | ||
595 | 119 | var res = dialog.run (); | ||
596 | 120 | if (res == ResponseType.OK){ | ||
597 | 121 | var destination = File.new_for_path (dialog.get_filename ()); | ||
598 | 122 | try{ | ||
599 | 123 | source.copy (destination, FileCopyFlags.OVERWRITE); | ||
600 | 124 | }catch (GLib.Error e){ | ||
601 | 125 | stderr.printf ("Error: %s\n", e.message); | ||
602 | 126 | } | ||
603 | 127 | } | ||
604 | 128 | dialog.destroy (); | ||
605 | 129 | } | ||
606 | 130 | // Using deprecated Contractor API. Necesserary to maintain luna compatibility | ||
607 | 131 | #if false | ||
608 | 132 | private void execute_command_deprecated (int index) { | ||
609 | 133 | string cmd = contracts_dep[index].lookup ("Exec") ; | ||
610 | 134 | try{ | ||
611 | 135 | Process.spawn_command_line_async (cmd); | ||
612 | 136 | }catch (Error e){ | ||
613 | 137 | print(e.message); | ||
614 | 138 | } | ||
615 | 139 | } | ||
616 | 140 | |||
617 | 141 | private HashTable<string,string>[] contracts_dep ; | ||
618 | 142 | |||
619 | 143 | private void load_contracts_deprecated () { | ||
620 | 144 | // CARL deprecated Contractor API | ||
621 | 145 | contracts_dep = Granite.Services.Contractor.get_contract (app.settings.destination, "video"); | ||
622 | 146 | if (contracts_dep == null || contracts_dep.length <= 1){ | ||
623 | 147 | warning ("You should install and/or run contractor"); | ||
624 | 148 | contractor = false; | ||
625 | 149 | var info = new InfoBar (); | ||
626 | 150 | info.message_type = MessageType.WARNING; | ||
627 | 151 | info.pack_start (new Label (_("Could not contact Contractor."))); | ||
628 | 152 | grid.attach (info, 0, 3, 2, 1); | ||
629 | 153 | export.label = _("Save"); | ||
630 | 154 | }else{ | ||
631 | 155 | contractor = true; | ||
632 | 156 | for (var i=0;i<contracts_dep.length; i++){ | ||
633 | 157 | TreeIter it; | ||
634 | 158 | list.append (out it); | ||
635 | 159 | Gdk.Pixbuf icon = null; | ||
636 | 160 | try{ | ||
637 | 161 | icon = IconTheme.get_default ().load_icon (contracts_dep[i].lookup ("IconName"), 32, 0); | ||
638 | 162 | }catch (Error e){ | ||
639 | 163 | warning (e.message); | ||
640 | 164 | } | ||
641 | 165 | list.set (it, 0, icon, 1, | ||
642 | 166 | "<b>"+contracts_dep[i].lookup ("Name")+"</b>\n"+contracts_dep[i].lookup ("Description")); | ||
643 | 167 | } | ||
644 | 168 | treeview.set_cursor (new TreePath.from_string ("0"), null, false); | ||
645 | 169 | } | ||
646 | 170 | } | ||
647 | 171 | #endif | ||
648 | 172 | private Gee.List<Granite.Services.Contract> contracts ; | ||
649 | 173 | private int contracts_size = 0 ; | ||
650 | 174 | |||
651 | 175 | private void execute_command (int index) { | ||
652 | 176 | if( index == 0) | ||
653 | 177 | save_file () ; | ||
654 | 178 | else { | ||
655 | 179 | var contract = contracts.@get (index-1) ; | ||
656 | 180 | try{ | ||
657 | 181 | contract.execute_with_file (source) ; | ||
658 | 182 | }catch (Error e){ | ||
659 | 183 | warning (e.message); | ||
660 | 184 | } | ||
661 | 185 | } | ||
662 | 186 | |||
663 | 187 | } | ||
664 | 188 | |||
665 | 189 | private void load_contracts () { | ||
666 | 190 | contracts_size = 0 ; | ||
667 | 191 | try{ | ||
668 | 192 | contracts = Granite.Services.ContractorProxy.get_contracts_by_mime ("video"); | ||
669 | 193 | }catch (Error e){ | ||
670 | 194 | warning (e.message); | ||
671 | 195 | } | ||
672 | 196 | if (contracts != null){ | ||
673 | 197 | |||
674 | 198 | contractor = true; | ||
675 | 199 | foreach( var contract in contracts ) { | ||
676 | 200 | TreeIter it; | ||
677 | 201 | list.append (out it); | ||
678 | 202 | Gdk.Pixbuf icon = null; | ||
679 | 203 | try{ | ||
680 | 204 | icon = IconTheme.get_default ().load_icon (contract.get_icon ().to_string (), 32, 0); | ||
681 | 205 | |||
682 | 206 | }catch (Error e){ | ||
683 | 207 | warning (e.message); | ||
684 | 208 | } | ||
685 | 209 | list.set (it, 0, icon, 1, | ||
686 | 210 | "<b>"+contract.get_display_name ()+"</b>\n"+contract.get_description ()); | ||
687 | 211 | contracts_size ++ ; | ||
688 | 212 | } | ||
689 | 213 | TreeIter it; | ||
690 | 214 | list.insert (out it, 0); | ||
691 | 215 | Gdk.Pixbuf icon = null; | ||
692 | 216 | try{ | ||
693 | 217 | icon = IconTheme.get_default ().load_icon ("document-save", 32, 0); | ||
694 | 218 | }catch (Error e){ | ||
695 | 219 | warning (e.message); | ||
696 | 220 | } | ||
697 | 221 | list.set (it, 0, icon, 1, | ||
698 | 222 | "<b>"+_("Save file")+"</b>\n"+("Save the file onto a disk")); | ||
699 | 223 | treeview.set_cursor (new TreePath.from_string ("0"), null, false); | ||
700 | 224 | export.label = _("Execute"); | ||
701 | 225 | } | ||
702 | 226 | if( contracts_size == 0 ) | ||
703 | 227 | { | ||
704 | 228 | warning ("You should install and/or run contractor"); | ||
705 | 229 | contractor = false; | ||
706 | 230 | var info = new InfoBar (); | ||
707 | 231 | info.message_type = MessageType.WARNING; | ||
708 | 232 | info.pack_start (new Label (_("Could not contact Contractor."))); | ||
709 | 233 | grid.attach (info, 0, 3, 2, 1); | ||
710 | 234 | export.label = _("Save"); | ||
711 | 235 | } | ||
712 | 120 | } | 236 | } |
713 | 121 | } | 237 | } |
714 | 122 | } | 238 | } |
715 | 123 | 239 | ||
716 | === modified file 'src/Widgets/keyview.vala' | |||
717 | --- src/Widgets/keyview.vala 2013-05-17 01:00:15 +0000 | |||
718 | +++ src/Widgets/keyview.vala 2015-01-04 16:20:24 +0000 | |||
719 | @@ -243,7 +243,10 @@ | |||
720 | 243 | if (mouse_circle) { | 243 | if (mouse_circle) { |
721 | 244 | this.circle = new YellowCircle (mouse_circle_color); | 244 | this.circle = new YellowCircle (mouse_circle_color); |
722 | 245 | this.captured_move.connect ( (x, y) => { | 245 | this.captured_move.connect ( (x, y) => { |
724 | 246 | this.circle.move (x, y); | 246 | Idle.add (() => { |
725 | 247 | this.circle.move (x, y); | ||
726 | 248 | return false; | ||
727 | 249 | }); | ||
728 | 247 | //debug ("Moved to %i, %i\n", x, y); | 250 | //debug ("Moved to %i, %i\n", x, y); |
729 | 248 | }); | 251 | }); |
730 | 249 | } | 252 | } |
731 | @@ -257,175 +260,182 @@ | |||
732 | 257 | 260 | ||
733 | 258 | if (keyboard) | 261 | if (keyboard) |
734 | 259 | this.captured.connect ( (keyvalue, released) => { | 262 | this.captured.connect ( (keyvalue, released) => { |
901 | 260 | if (released){ | 263 | Idle.add (() => { |
902 | 261 | switch (keyvalue){ | 264 | handle_key_event (keyvalue, released); |
903 | 262 | case "Control_L": | 265 | return false; |
904 | 263 | case "Control_R": | 266 | }); |
739 | 264 | this.ctrl = false; | ||
740 | 265 | this.queue_draw (); | ||
741 | 266 | break; | ||
742 | 267 | case "Shift_L": | ||
743 | 268 | case "Shift_R": | ||
744 | 269 | this.shift = false; | ||
745 | 270 | this.queue_draw (); | ||
746 | 271 | break; | ||
747 | 272 | case "Alt_L": | ||
748 | 273 | case "Alt_R": | ||
749 | 274 | this.alt = false; | ||
750 | 275 | this.queue_draw (); | ||
751 | 276 | break; | ||
752 | 277 | case "Super_L": | ||
753 | 278 | case "Super_R": | ||
754 | 279 | this.super = false; | ||
755 | 280 | this.queue_draw (); | ||
756 | 281 | return; | ||
757 | 282 | case "ISO_Level3_Shift": | ||
758 | 283 | this.iso_level3_shift = false; | ||
759 | 284 | this.queue_draw (); | ||
760 | 285 | return; | ||
761 | 286 | } | ||
762 | 287 | }else{ | ||
763 | 288 | string res = keyvalue; | ||
764 | 289 | switch (res){ | ||
765 | 290 | case "Control_L": | ||
766 | 291 | case "Control_R": | ||
767 | 292 | this.ctrl = true; | ||
768 | 293 | this.queue_draw (); | ||
769 | 294 | return; | ||
770 | 295 | case "Shift_L": | ||
771 | 296 | case "Shift_R": | ||
772 | 297 | this.shift = true; | ||
773 | 298 | this.queue_draw (); | ||
774 | 299 | return; | ||
775 | 300 | case "Alt_L": | ||
776 | 301 | case "Alt_R": | ||
777 | 302 | this.alt = true; | ||
778 | 303 | this.queue_draw (); | ||
779 | 304 | return; | ||
780 | 305 | case "Super_L": | ||
781 | 306 | case "Super_R": | ||
782 | 307 | this.super = true; | ||
783 | 308 | this.queue_draw (); | ||
784 | 309 | return; | ||
785 | 310 | case "ISO_Level3_Shift": | ||
786 | 311 | this.iso_level3_shift = true; | ||
787 | 312 | this.queue_draw (); | ||
788 | 313 | return; | ||
789 | 314 | case "Escape": | ||
790 | 315 | res = "Esc"; break; | ||
791 | 316 | case "Return": | ||
792 | 317 | res = "⏎"; break; | ||
793 | 318 | case "Delete": | ||
794 | 319 | res = "Del"; break; | ||
795 | 320 | case "Insert": | ||
796 | 321 | res = "Ins"; break; | ||
797 | 322 | case "comma": | ||
798 | 323 | res = ","; break; | ||
799 | 324 | case "period": | ||
800 | 325 | res = "."; break; | ||
801 | 326 | case "minus": | ||
802 | 327 | res = "-"; break; | ||
803 | 328 | case "plus": | ||
804 | 329 | res = "+"; break; | ||
805 | 330 | case "Tab": | ||
806 | 331 | res = "Tab"; break; | ||
807 | 332 | case "BackSpace": | ||
808 | 333 | res = "⌫"; break; | ||
809 | 334 | case "Left": | ||
810 | 335 | res = "◄"; break; | ||
811 | 336 | case "Right": | ||
812 | 337 | res = "►"; break; | ||
813 | 338 | case "Up": | ||
814 | 339 | res = "▲"; break; | ||
815 | 340 | case "Down": | ||
816 | 341 | res = "▼"; break; | ||
817 | 342 | case "space": | ||
818 | 343 | res = " "; break; | ||
819 | 344 | case "backslash": | ||
820 | 345 | res = "\\"; break; | ||
821 | 346 | case "bracketleft": | ||
822 | 347 | res = "["; break; | ||
823 | 348 | case "bracketright": | ||
824 | 349 | res = "]"; break; | ||
825 | 350 | case "braceleft": | ||
826 | 351 | res = "{"; break; | ||
827 | 352 | case "braceright": | ||
828 | 353 | res = "}"; break; | ||
829 | 354 | case "apostrophe": | ||
830 | 355 | res = "'"; break; | ||
831 | 356 | case "asciitilde": | ||
832 | 357 | res = "~"; break; | ||
833 | 358 | case "grave": | ||
834 | 359 | res = "`"; break; | ||
835 | 360 | case "bar": | ||
836 | 361 | res = "|"; break; | ||
837 | 362 | case "ampersand": | ||
838 | 363 | res = "&"; break; | ||
839 | 364 | case "parenleft": | ||
840 | 365 | res = "("; break; | ||
841 | 366 | case "parenright": | ||
842 | 367 | res = ")"; break; | ||
843 | 368 | case "less": | ||
844 | 369 | res = "<"; break; | ||
845 | 370 | case "greater": | ||
846 | 371 | res = ">"; break; | ||
847 | 372 | case "equal": | ||
848 | 373 | res = "="; break; | ||
849 | 374 | case "exclam": | ||
850 | 375 | res = "!"; break; | ||
851 | 376 | case "quotedbl": | ||
852 | 377 | res = "\""; break; | ||
853 | 378 | case "numbersign": | ||
854 | 379 | res = "\""; break; | ||
855 | 380 | case "dollar": | ||
856 | 381 | res = "$"; break; | ||
857 | 382 | case "slash": | ||
858 | 383 | res = "/"; break; | ||
859 | 384 | case "asterisk": | ||
860 | 385 | res = "*"; break; | ||
861 | 386 | case "colon": | ||
862 | 387 | res = ":"; break; | ||
863 | 388 | case "semicolon": | ||
864 | 389 | res = ";"; break; | ||
865 | 390 | case "underscore": | ||
866 | 391 | res = "_"; break; | ||
867 | 392 | case "Next": | ||
868 | 393 | res = "Pg▲"; break; | ||
869 | 394 | case "Prior": | ||
870 | 395 | res = "Pg▼"; break; | ||
871 | 396 | case "asciicircum": | ||
872 | 397 | res = "^"; break; | ||
873 | 398 | case "at": | ||
874 | 399 | res = "@"; break; | ||
875 | 400 | case "question": | ||
876 | 401 | res = "?"; break; | ||
877 | 402 | default: | ||
878 | 403 | if (keyvalue.length > 9) | ||
879 | 404 | res = keyvalue.substring (0, 9); | ||
880 | 405 | break; | ||
881 | 406 | } | ||
882 | 407 | |||
883 | 408 | if ((!keys.is_empty ()) && | ||
884 | 409 | (keys.peek_head ().key == res) && | ||
885 | 410 | (keys.peek_head ().ctrl == ctrl) && | ||
886 | 411 | (keys.peek_head ().shift == shift) && | ||
887 | 412 | (keys.peek_head ().alt == alt) && | ||
888 | 413 | (keys.peek_head ().iso_level3_shift == iso_level3_shift)){ | ||
889 | 414 | keys.peek_head ().count ++; | ||
890 | 415 | this.queue_draw (); | ||
891 | 416 | }else{ | ||
892 | 417 | var key = new Key (res, ctrl, shift, alt, super, iso_level3_shift); | ||
893 | 418 | if (!released){ | ||
894 | 419 | keys.push_head (key); | ||
895 | 420 | if (keys.length+2 > (screen_h / key_size)) | ||
896 | 421 | keys.pop_tail (); | ||
897 | 422 | this.queue_draw (); | ||
898 | 423 | } | ||
899 | 424 | } | ||
900 | 425 | } | ||
905 | 426 | }); | 267 | }); |
906 | 427 | } | 268 | } |
907 | 428 | 269 | ||
908 | 270 | void handle_key_event (string keyvalue, bool released) { | ||
909 | 271 | if (released){ | ||
910 | 272 | switch (keyvalue){ | ||
911 | 273 | case "Control_L": | ||
912 | 274 | case "Control_R": | ||
913 | 275 | this.ctrl = false; | ||
914 | 276 | this.queue_draw (); | ||
915 | 277 | break; | ||
916 | 278 | case "Shift_L": | ||
917 | 279 | case "Shift_R": | ||
918 | 280 | this.shift = false; | ||
919 | 281 | this.queue_draw (); | ||
920 | 282 | break; | ||
921 | 283 | case "Alt_L": | ||
922 | 284 | case "Alt_R": | ||
923 | 285 | this.alt = false; | ||
924 | 286 | this.queue_draw (); | ||
925 | 287 | break; | ||
926 | 288 | case "Super_L": | ||
927 | 289 | case "Super_R": | ||
928 | 290 | this.super = false; | ||
929 | 291 | this.queue_draw (); | ||
930 | 292 | return; | ||
931 | 293 | case "ISO_Level3_Shift": | ||
932 | 294 | this.iso_level3_shift = false; | ||
933 | 295 | this.queue_draw (); | ||
934 | 296 | return; | ||
935 | 297 | } | ||
936 | 298 | }else{ | ||
937 | 299 | string res = keyvalue; | ||
938 | 300 | switch (res){ | ||
939 | 301 | case "Control_L": | ||
940 | 302 | case "Control_R": | ||
941 | 303 | this.ctrl = true; | ||
942 | 304 | this.queue_draw (); | ||
943 | 305 | return; | ||
944 | 306 | case "Shift_L": | ||
945 | 307 | case "Shift_R": | ||
946 | 308 | this.shift = true; | ||
947 | 309 | this.queue_draw (); | ||
948 | 310 | return; | ||
949 | 311 | case "Alt_L": | ||
950 | 312 | case "Alt_R": | ||
951 | 313 | this.alt = true; | ||
952 | 314 | this.queue_draw (); | ||
953 | 315 | return; | ||
954 | 316 | case "Super_L": | ||
955 | 317 | case "Super_R": | ||
956 | 318 | this.super = true; | ||
957 | 319 | this.queue_draw (); | ||
958 | 320 | return; | ||
959 | 321 | case "ISO_Level3_Shift": | ||
960 | 322 | this.iso_level3_shift = true; | ||
961 | 323 | this.queue_draw (); | ||
962 | 324 | return; | ||
963 | 325 | case "Escape": | ||
964 | 326 | res = "Esc"; break; | ||
965 | 327 | case "Return": | ||
966 | 328 | res = "⏎"; break; | ||
967 | 329 | case "Delete": | ||
968 | 330 | res = "Del"; break; | ||
969 | 331 | case "Insert": | ||
970 | 332 | res = "Ins"; break; | ||
971 | 333 | case "comma": | ||
972 | 334 | res = ","; break; | ||
973 | 335 | case "period": | ||
974 | 336 | res = "."; break; | ||
975 | 337 | case "minus": | ||
976 | 338 | res = "-"; break; | ||
977 | 339 | case "plus": | ||
978 | 340 | res = "+"; break; | ||
979 | 341 | case "Tab": | ||
980 | 342 | res = "Tab"; break; | ||
981 | 343 | case "BackSpace": | ||
982 | 344 | res = "⌫"; break; | ||
983 | 345 | case "Left": | ||
984 | 346 | res = "◄"; break; | ||
985 | 347 | case "Right": | ||
986 | 348 | res = "►"; break; | ||
987 | 349 | case "Up": | ||
988 | 350 | res = "▲"; break; | ||
989 | 351 | case "Down": | ||
990 | 352 | res = "▼"; break; | ||
991 | 353 | case "space": | ||
992 | 354 | res = " "; break; | ||
993 | 355 | case "backslash": | ||
994 | 356 | res = "\\"; break; | ||
995 | 357 | case "bracketleft": | ||
996 | 358 | res = "["; break; | ||
997 | 359 | case "bracketright": | ||
998 | 360 | res = "]"; break; | ||
999 | 361 | case "braceleft": | ||
1000 | 362 | res = "{"; break; | ||
1001 | 363 | case "braceright": | ||
1002 | 364 | res = "}"; break; | ||
1003 | 365 | case "apostrophe": | ||
1004 | 366 | res = "'"; break; | ||
1005 | 367 | case "asciitilde": | ||
1006 | 368 | res = "~"; break; | ||
1007 | 369 | case "grave": | ||
1008 | 370 | res = "`"; break; | ||
1009 | 371 | case "bar": | ||
1010 | 372 | res = "|"; break; | ||
1011 | 373 | case "ampersand": | ||
1012 | 374 | res = "&"; break; | ||
1013 | 375 | case "parenleft": | ||
1014 | 376 | res = "("; break; | ||
1015 | 377 | case "parenright": | ||
1016 | 378 | res = ")"; break; | ||
1017 | 379 | case "less": | ||
1018 | 380 | res = "<"; break; | ||
1019 | 381 | case "greater": | ||
1020 | 382 | res = ">"; break; | ||
1021 | 383 | case "equal": | ||
1022 | 384 | res = "="; break; | ||
1023 | 385 | case "exclam": | ||
1024 | 386 | res = "!"; break; | ||
1025 | 387 | case "quotedbl": | ||
1026 | 388 | res = "\""; break; | ||
1027 | 389 | case "numbersign": | ||
1028 | 390 | res = "\""; break; | ||
1029 | 391 | case "dollar": | ||
1030 | 392 | res = "$"; break; | ||
1031 | 393 | case "slash": | ||
1032 | 394 | res = "/"; break; | ||
1033 | 395 | case "asterisk": | ||
1034 | 396 | res = "*"; break; | ||
1035 | 397 | case "colon": | ||
1036 | 398 | res = ":"; break; | ||
1037 | 399 | case "semicolon": | ||
1038 | 400 | res = ";"; break; | ||
1039 | 401 | case "underscore": | ||
1040 | 402 | res = "_"; break; | ||
1041 | 403 | case "Next": | ||
1042 | 404 | res = "Pg▲"; break; | ||
1043 | 405 | case "Prior": | ||
1044 | 406 | res = "Pg▼"; break; | ||
1045 | 407 | case "asciicircum": | ||
1046 | 408 | res = "^"; break; | ||
1047 | 409 | case "at": | ||
1048 | 410 | res = "@"; break; | ||
1049 | 411 | case "question": | ||
1050 | 412 | res = "?"; break; | ||
1051 | 413 | default: | ||
1052 | 414 | if (keyvalue.length > 9) | ||
1053 | 415 | res = keyvalue.substring (0, 9); | ||
1054 | 416 | break; | ||
1055 | 417 | } | ||
1056 | 418 | |||
1057 | 419 | if ((!keys.is_empty ()) && | ||
1058 | 420 | (keys.peek_head ().key == res) && | ||
1059 | 421 | (keys.peek_head ().ctrl == ctrl) && | ||
1060 | 422 | (keys.peek_head ().shift == shift) && | ||
1061 | 423 | (keys.peek_head ().alt == alt) && | ||
1062 | 424 | (keys.peek_head ().iso_level3_shift == iso_level3_shift)){ | ||
1063 | 425 | keys.peek_head ().count ++; | ||
1064 | 426 | this.queue_draw (); | ||
1065 | 427 | }else{ | ||
1066 | 428 | var key = new Key (res, ctrl, shift, alt, super, iso_level3_shift); | ||
1067 | 429 | if (!released){ | ||
1068 | 430 | keys.push_head (key); | ||
1069 | 431 | if (keys.length+2 > (screen_h / key_size)) | ||
1070 | 432 | keys.pop_tail (); | ||
1071 | 433 | this.queue_draw (); | ||
1072 | 434 | } | ||
1073 | 435 | } | ||
1074 | 436 | } | ||
1075 | 437 | } | ||
1076 | 438 | |||
1077 | 429 | public void capture (){ | 439 | public void capture (){ |
1078 | 430 | try{ | 440 | try{ |
1079 | 431 | Thread.create<void*> (this.intercept_key_thread, true); | 441 | Thread.create<void*> (this.intercept_key_thread, true); |
1080 | 432 | 442 | ||
1081 | === modified file 'src/Widgets/selectionarea.vala' | |||
1082 | --- src/Widgets/selectionarea.vala 2012-04-04 00:02:38 +0000 | |||
1083 | +++ src/Widgets/selectionarea.vala 2015-01-04 16:20:24 +0000 | |||
1084 | @@ -42,38 +42,41 @@ | |||
1085 | 42 | }); | 42 | }); |
1086 | 43 | 43 | ||
1087 | 44 | this.configure_event.connect ((e) => { | 44 | this.configure_event.connect ((e) => { |
1088 | 45 | var screen_width = Gdk.Screen.width (); | ||
1089 | 46 | var screen_height = Gdk.Screen.height (); | ||
1090 | 47 | |||
1091 | 45 | // check if coordinates are out of the screen and check | 48 | // check if coordinates are out of the screen and check |
1092 | 46 | // if coordinate + width/height is out of the screen, then | 49 | // if coordinate + width/height is out of the screen, then |
1093 | 47 | // adjust coordinates to keep width and height (and aspect | 50 | // adjust coordinates to keep width and height (and aspect |
1094 | 48 | // ratio) intact | 51 | // ratio) intact |
1096 | 49 | if( e.x < 0 || e.x > e.window.get_screen().width() ) { | 52 | if( e.x < 0 || e.x > screen_width ) { |
1097 | 50 | x = 0; | 53 | x = 0; |
1101 | 51 | } else if( e.x + e.width > e.window.get_screen().width() | 54 | } else if( e.x + e.width > screen_width |
1102 | 52 | && e.width < e.window.get_screen().width() ) { | 55 | && e.width < screen_width ) { |
1103 | 53 | x = e.window.get_screen().width() - e.width; | 56 | x = screen_width - e.width; |
1104 | 54 | } else { | 57 | } else { |
1105 | 55 | x = e.x; | 58 | x = e.x; |
1106 | 56 | } | 59 | } |
1107 | 57 | 60 | ||
1108 | 58 | if( e.y < 0 ) { | 61 | if( e.y < 0 ) { |
1109 | 59 | y = 0; | 62 | y = 0; |
1113 | 60 | } else if( e.y + e.height >= e.window.get_screen().height() | 63 | } else if( e.y + e.height >= screen_height |
1114 | 61 | && e.height < e.window.get_screen().height() ) { | 64 | && e.height < screen_height ) { |
1115 | 62 | y = e.window.get_screen().height() - e.height - 1; | 65 | y = screen_height - e.height - 1; |
1116 | 63 | } else { | 66 | } else { |
1117 | 64 | y = e.y; | 67 | y = e.y; |
1118 | 65 | } | 68 | } |
1119 | 66 | 69 | ||
1120 | 67 | // just in case an edge is still outside of the screen | 70 | // just in case an edge is still outside of the screen |
1121 | 68 | // we'll modify the width/height if thats the case | 71 | // we'll modify the width/height if thats the case |
1124 | 69 | if( x + e.width > e.window.get_screen().width() ) { | 72 | if( x + e.width > screen_width ) { |
1125 | 70 | w = e.window.get_screen().width() - x; | 73 | w = screen_width - x; |
1126 | 71 | } else { | 74 | } else { |
1127 | 72 | w = e.width; | 75 | w = e.width; |
1128 | 73 | } | 76 | } |
1129 | 74 | 77 | ||
1132 | 75 | if( y + e.height > e.window.get_screen().height() ) { | 78 | if( y + e.height > screen_height ) { |
1133 | 76 | h = e.window.get_screen().height() - y; | 79 | h = screen_height - y; |
1134 | 77 | } else { | 80 | } else { |
1135 | 78 | h = e.height; | 81 | h = e.height; |
1136 | 79 | } | 82 | } |
1137 | 80 | 83 | ||
1138 | === modified file 'src/eidete.vala' | |||
1139 | --- src/eidete.vala 2014-05-29 17:08:23 +0000 | |||
1140 | +++ src/eidete.vala 2015-01-04 16:20:24 +0000 | |||
1141 | @@ -1,4 +1,3 @@ | |||
1142 | 1 | //valac --pkg gtk+-3.0 --pkg gstreamer-0.10 --pkg gstreamer-pbutils-0.10 --pkg granite screencast.vala | ||
1143 | 2 | 1 | ||
1144 | 3 | using Gst; | 2 | using Gst; |
1145 | 4 | using Granite; | 3 | using Granite; |
1146 | @@ -81,9 +80,10 @@ | |||
1147 | 81 | public Window main_window; | 80 | public Window main_window; |
1148 | 82 | public Eidete.Widgets.KeyView keyview; | 81 | public Eidete.Widgets.KeyView keyview; |
1149 | 83 | public Eidete.Widgets.SelectionArea selectionarea; | 82 | public Eidete.Widgets.SelectionArea selectionarea; |
1153 | 84 | public Granite.Widgets.StaticNotebook tabs; | 83 | private Gtk.Stack tabs; |
1154 | 85 | public Grid pause_grid; | 84 | private Grid pause_grid; |
1155 | 86 | public Image pause_icon; | 85 | private Gtk.Grid main_box ; |
1156 | 86 | private Gtk.StackSwitcher stack_switcher ; | ||
1157 | 87 | public Wnck.Window win; | 87 | public Wnck.Window win; |
1158 | 88 | public Gdk.Screen screen; | 88 | public Gdk.Screen screen; |
1159 | 89 | public Gdk.Rectangle monitor_rec; | 89 | public Gdk.Rectangle monitor_rec; |
1160 | @@ -93,8 +93,8 @@ | |||
1161 | 93 | public bool recording; | 93 | public bool recording; |
1162 | 94 | public bool typing_size; | 94 | public bool typing_size; |
1163 | 95 | 95 | ||
1166 | 96 | public Gst.Bin videobin; | 96 | public Gst.Bin videobin; |
1167 | 97 | public Gst.Bin audiobin; | 97 | public Gst.Bin audiobin; |
1168 | 98 | 98 | ||
1169 | 99 | public EideteApp (){ | 99 | public EideteApp (){ |
1170 | 100 | } | 100 | } |
1171 | @@ -125,12 +125,7 @@ | |||
1172 | 125 | UI | 125 | UI |
1173 | 126 | */ | 126 | */ |
1174 | 127 | 127 | ||
1181 | 128 | tabs = new Granite.Widgets.StaticNotebook (false); | 128 | tabs = new Gtk.Stack (); |
1176 | 129 | tabs.margin = 12; | ||
1177 | 130 | |||
1178 | 131 | pause_icon = new Image.from_icon_name ("media-playback-pause", IconSize.DIALOG); | ||
1179 | 132 | pause_icon.pixel_size = 64; | ||
1180 | 133 | |||
1182 | 134 | 129 | ||
1183 | 135 | var grid = new Grid (); | 130 | var grid = new Grid (); |
1184 | 136 | grid.column_spacing = 12; | 131 | grid.column_spacing = 12; |
1185 | @@ -140,6 +135,7 @@ | |||
1186 | 140 | var monitors_combo = new ComboBoxText (); | 135 | var monitors_combo = new ComboBoxText (); |
1187 | 141 | monitors_combo.hexpand = true; | 136 | monitors_combo.hexpand = true; |
1188 | 142 | for (var i=0;i<Gdk.Screen.get_default ().get_n_monitors (); i++) | 137 | for (var i=0;i<Gdk.Screen.get_default ().get_n_monitors (); i++) |
1189 | 138 | // TODO proper translation here | ||
1190 | 143 | monitors_combo.append (i.to_string (), _("Monitor")+" "+(i+1).to_string ()); | 139 | monitors_combo.append (i.to_string (), _("Monitor")+" "+(i+1).to_string ()); |
1191 | 144 | monitors_combo.active = 0; | 140 | monitors_combo.active = 0; |
1192 | 145 | if (Gdk.Screen.get_default ().get_n_monitors () == 1) | 141 | if (Gdk.Screen.get_default ().get_n_monitors () == 1) |
1193 | @@ -148,12 +144,10 @@ | |||
1194 | 148 | var width = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_width (), 1); | 144 | var width = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_width (), 1); |
1195 | 149 | width.max_length = 4; | 145 | width.max_length = 4; |
1196 | 150 | width.margin_left = 1; | 146 | width.margin_left = 1; |
1197 | 151 | width.margin_right = -4; | ||
1198 | 152 | 147 | ||
1199 | 153 | var height = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_height (), 1); | 148 | var height = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_height (), 1); |
1200 | 154 | height.max_length = 4; | 149 | height.max_length = 4; |
1201 | 155 | height.margin_left = 1; | 150 | height.margin_left = 1; |
1202 | 156 | height.margin_right = -4; | ||
1203 | 157 | width.set_sensitive (false); | 151 | width.set_sensitive (false); |
1204 | 158 | height.set_sensitive (false); | 152 | height.set_sensitive (false); |
1205 | 159 | width.halign = Align.START; | 153 | width.halign = Align.START; |
1206 | @@ -181,23 +175,24 @@ | |||
1207 | 181 | audio_box.pack_start (use_audio, false, true, 0); | 175 | audio_box.pack_start (use_audio, false, true, 0); |
1208 | 182 | audio_box.pack_start (audio_source, true, true, 0); | 176 | audio_box.pack_start (audio_source, true, true, 0); |
1209 | 183 | 177 | ||
1211 | 184 | var sound = new LLabel.markup ("<b>"+_("Sound")+":"+"</b>"); | 178 | var sound = new LLabel.markup ("<b>"+_("Sound")+"</b>"); |
1212 | 185 | sound.margin_top = 18; | 179 | sound.margin_top = 18; |
1213 | 186 | 180 | ||
1215 | 187 | var video = new LLabel.markup ("<b>"+_("Video")+":"+"</b>"); | 181 | var video = new LLabel.markup ("<b>"+_("Video")+"</b>"); |
1216 | 188 | video.margin_top = 12; | 182 | video.margin_top = 12; |
1217 | 189 | 183 | ||
1219 | 190 | var keyboard = new LLabel.markup ("<b>"+_("Keyboard")+":"+"</b>"); | 184 | var keyboard = new LLabel.markup ("<b>"+_("Keyboard")+"</b>"); |
1220 | 191 | keyboard.margin_top = 18; | 185 | keyboard.margin_top = 18; |
1221 | 192 | 186 | ||
1223 | 193 | var mouse = new LLabel.markup ("<b>"+_("Mouse")+":"+"</b>"); | 187 | var mouse = new LLabel.markup ("<b>"+_("Mouse")+"</b>"); |
1224 | 194 | mouse.margin_top = 12; | 188 | mouse.margin_top = 12; |
1225 | 195 | 189 | ||
1226 | 196 | var start_bt = new Button.with_label (_("Start Recording")); | 190 | var start_bt = new Button.with_label (_("Start Recording")); |
1227 | 197 | start_bt.can_default = true; | 191 | start_bt.can_default = true; |
1228 | 198 | start_bt.get_style_context ().add_class ("noundo"); | 192 | start_bt.get_style_context ().add_class ("noundo"); |
1231 | 199 | 193 | start_bt.get_style_context ().add_class ("suggested-action"); | |
1232 | 200 | var cancel_bt = new Button.from_stock (Stock.CANCEL); | 194 | |
1233 | 195 | var cancel_bt = new Button.with_label (_("Cancel")); | ||
1234 | 201 | 196 | ||
1235 | 202 | var about_bt = new Button.with_label (_("About")); | 197 | var about_bt = new Button.with_label (_("About")); |
1236 | 203 | about_bt.image = new Image.from_stock (Stock.ABOUT, IconSize.BUTTON); | 198 | about_bt.image = new Image.from_stock (Stock.ABOUT, IconSize.BUTTON); |
1237 | @@ -212,7 +207,7 @@ | |||
1238 | 212 | this.main_window.set_default (start_bt); | 207 | this.main_window.set_default (start_bt); |
1239 | 213 | 208 | ||
1240 | 214 | grid.attach ((sound), 0, 0, 1, 1); | 209 | grid.attach ((sound), 0, 0, 1, 1); |
1242 | 215 | grid.attach (new LLabel.right (_("Record Computer Sounds")), 0, 1, 1, 1); | 210 | grid.attach (new LLabel.right (_("Record Computer Sounds")+":"), 0, 1, 1, 1); |
1243 | 216 | grid.attach (use_comp_sounds, 1, 1, 1, 1); | 211 | grid.attach (use_comp_sounds, 1, 1, 1, 1); |
1244 | 217 | grid.attach (new LLabel.right (_("Record from Microphone")+":"), 0, 2, 1, 1); | 212 | grid.attach (new LLabel.right (_("Record from Microphone")+":"), 0, 2, 1, 1); |
1245 | 218 | grid.attach (audio_box, 1, 2, 1, 1); | 213 | grid.attach (audio_box, 1, 2, 1, 1); |
1246 | @@ -258,10 +253,24 @@ | |||
1247 | 258 | grid2.row_spacing = 6; | 253 | grid2.row_spacing = 6; |
1248 | 259 | grid2.hexpand = true; | 254 | grid2.hexpand = true; |
1249 | 260 | 255 | ||
1254 | 261 | tabs.append_page (grid, new Label (_("Behavior"))); | 256 | tabs.add_titled (grid, "behavior", _("Behavior")); |
1255 | 262 | tabs.append_page (grid2, new Label (_("Appearance"))); | 257 | tabs.add_titled (grid2, "apperance", _("Appearance")); |
1256 | 263 | 258 | ||
1257 | 264 | this.main_window.add (tabs); | 259 | main_box = new Gtk.Grid (); |
1258 | 260 | stack_switcher = new Gtk.StackSwitcher (); | ||
1259 | 261 | stack_switcher.stack = tabs; | ||
1260 | 262 | stack_switcher.halign = Gtk.Align.CENTER; | ||
1261 | 263 | build_pause_ui () ; | ||
1262 | 264 | pause_grid.show_all(); | ||
1263 | 265 | pause_grid.hide(); | ||
1264 | 266 | pause_grid.no_show_all = true; | ||
1265 | 267 | main_box.attach (stack_switcher, 0, 0, 1, 1); | ||
1266 | 268 | main_box.attach (tabs, 0, 1, 1, 1); | ||
1267 | 269 | main_box.attach (pause_grid, 0, 2, 1, 1); | ||
1268 | 270 | main_box.margin = 12; | ||
1269 | 271 | |||
1270 | 272 | this.main_window.add (main_box); | ||
1271 | 273 | |||
1272 | 265 | this.main_window.show_all (); | 274 | this.main_window.show_all (); |
1273 | 266 | this.main_window.present (); | 275 | this.main_window.present (); |
1274 | 267 | 276 | ||
1275 | @@ -353,11 +362,7 @@ | |||
1276 | 353 | settings.audio = false; | 362 | settings.audio = false; |
1277 | 354 | use_audio.toggled.connect ( () => { | 363 | use_audio.toggled.connect ( () => { |
1278 | 355 | settings.audio = use_audio.active; | 364 | settings.audio = use_audio.active; |
1284 | 356 | if (use_audio.active){ | 365 | audio_source.set_sensitive (use_audio.active); |
1280 | 357 | audio_source.set_sensitive (true); | ||
1281 | 358 | }else{ | ||
1282 | 359 | audio_source.set_sensitive (false); | ||
1283 | 360 | } | ||
1285 | 361 | }); | 366 | }); |
1286 | 362 | 367 | ||
1287 | 363 | 368 | ||
1288 | @@ -433,6 +438,12 @@ | |||
1289 | 433 | 438 | ||
1290 | 434 | Granite.Services.Logger.initialize ("Eidete"); | 439 | Granite.Services.Logger.initialize ("Eidete"); |
1291 | 435 | Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.DEBUG; | 440 | Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.DEBUG; |
1292 | 441 | uint major ; | ||
1293 | 442 | uint minor ; | ||
1294 | 443 | uint micro ; | ||
1295 | 444 | uint nano ; | ||
1296 | 445 | Gst.version (out major, out minor, out micro, out nano) ; | ||
1297 | 446 | message ("GStreamer version: %u.%u.%u.%u", major, minor, micro, nano ) ; | ||
1298 | 436 | } | 447 | } |
1299 | 437 | 448 | ||
1300 | 438 | public override void activate (){ | 449 | public override void activate (){ |
1301 | @@ -451,7 +462,7 @@ | |||
1302 | 451 | 462 | ||
1303 | 452 | pause_grid = new Grid (); | 463 | pause_grid = new Grid (); |
1304 | 453 | pause_grid.margin = 12; | 464 | pause_grid.margin = 12; |
1306 | 454 | this.main_window.title = _("Recording paused"); | 465 | //this.main_window.title = _("Recording paused"); |
1307 | 455 | 466 | ||
1308 | 456 | 467 | ||
1309 | 457 | var img_text_grid = new Grid (); | 468 | var img_text_grid = new Grid (); |
1310 | @@ -477,6 +488,7 @@ | |||
1311 | 477 | var stop_bt = new Button.with_label (_("Finish")); | 488 | var stop_bt = new Button.with_label (_("Finish")); |
1312 | 478 | stop_bt.set_tooltip_text (_("Stop the recording and save the file")); | 489 | stop_bt.set_tooltip_text (_("Stop the recording and save the file")); |
1313 | 479 | stop_bt.image = new Image.from_stock (Stock.APPLY, IconSize.BUTTON); | 490 | stop_bt.image = new Image.from_stock (Stock.APPLY, IconSize.BUTTON); |
1314 | 491 | stop_bt.get_style_context ().add_class ("suggested-action"); | ||
1315 | 480 | 492 | ||
1316 | 481 | var cancel_bt = new Button.with_label (_("Cancel")); | 493 | var cancel_bt = new Button.with_label (_("Cancel")); |
1317 | 482 | cancel_bt.set_tooltip_text (_("Cancel the recording without saving the file")); | 494 | cancel_bt.set_tooltip_text (_("Cancel the recording without saving the file")); |
1318 | @@ -539,15 +551,25 @@ | |||
1319 | 539 | } | 551 | } |
1320 | 540 | 552 | ||
1321 | 541 | pipeline = new Pipeline ("screencast-pipe"); | 553 | pipeline = new Pipeline ("screencast-pipe"); |
1322 | 554 | |||
1323 | 555 | #if GSTREAMER_0_10_IS_DEFINED | ||
1324 | 542 | dynamic Element muxer = ElementFactory.make ("webmmux", "mux"); | 556 | dynamic Element muxer = ElementFactory.make ("webmmux", "mux"); |
1325 | 543 | dynamic Element sink = ElementFactory.make ("filesink", "sink"); | 557 | dynamic Element sink = ElementFactory.make ("filesink", "sink"); |
1327 | 544 | 558 | #else | |
1328 | 559 | var muxer = ElementFactory.make ("webmmux", "mux"); | ||
1329 | 560 | var sink = ElementFactory.make ("filesink", "sink"); | ||
1330 | 561 | #endif | ||
1331 | 545 | //video bin | 562 | //video bin |
1332 | 546 | this.videobin = new Gst.Bin ("video"); | 563 | this.videobin = new Gst.Bin ("video"); |
1333 | 547 | try { | 564 | try { |
1337 | 548 | videobin = (Gst.Bin)parse_bin_from_description ( | 565 | #if GSTREAMER_0_10_IS_DEFINED |
1338 | 549 | "ximagesrc name=\"videosrc\" ! video/x-raw-rgb, framerate=15/1 ! | 566 | videobin = (Gst.Bin)parse_bin_from_description ( |
1339 | 550 | ffmpegcolorspace ! vp8enc name=\"encoder\" ! queue", true); | 567 | "ximagesrc name=\"videosrc\" ! video/x-raw-rgb, framerate=15/1 ! |
1340 | 568 | ffmpegcolorspace ! vp8enc name=\"encoder\" ! queue", true); | ||
1341 | 569 | #else | ||
1342 | 570 | videobin = (Gst.Bin)parse_bin_from_description ( | ||
1343 | 571 | "ximagesrc name=\"videosrc\" ! video/x-raw, framerate=24/1 ! videoconvert ! vp8enc name=\"encoder\" ! queue", true); | ||
1344 | 572 | #endif | ||
1345 | 551 | }catch (Error e){ stderr.printf ("Error: %s\n", e.message);} | 573 | }catch (Error e){ stderr.printf ("Error: %s\n", e.message);} |
1346 | 552 | 574 | ||
1347 | 553 | //audio bin | 575 | //audio bin |
1348 | @@ -564,19 +586,32 @@ | |||
1349 | 564 | }catch (Error e){warning (e.message);} | 586 | }catch (Error e){warning (e.message);} |
1350 | 565 | 587 | ||
1351 | 566 | //configure | 588 | //configure |
1352 | 589 | assert( sink != null ) ; | ||
1353 | 567 | sink.set ("location", settings.destination); | 590 | sink.set ("location", settings.destination); |
1360 | 568 | videobin.get_by_name ("videosrc").set ("startx", this.settings.sx); | 591 | var src = videobin.get_by_name ("videosrc") ; |
1361 | 569 | videobin.get_by_name ("videosrc").set ("starty", this.settings.sy); | 592 | assert (src != null) ; |
1362 | 570 | videobin.get_by_name ("videosrc").set ("endx", this.settings.ex); | 593 | src.set ("startx", this.settings.sx); |
1363 | 571 | videobin.get_by_name ("videosrc").set ("endy", this.settings.ey); | 594 | src.set ("starty", this.settings.sy); |
1364 | 572 | videobin.get_by_name ("videosrc").set ("use-damage", false); | 595 | src.set ("endx", this.settings.ex); |
1365 | 573 | videobin.get_by_name ("videosrc").set ("screen-num", this.settings.monitor); | 596 | src.set ("endy", this.settings.ey); |
1366 | 597 | src.set ("use-damage", false); | ||
1367 | 598 | src.set ("screen-num", this.settings.monitor); | ||
1368 | 574 | 599 | ||
1369 | 575 | //videobin.get_by_name ("encoder").set ("mode", 1); | 600 | //videobin.get_by_name ("encoder").set ("mode", 1); |
1374 | 576 | videobin.get_by_name ("encoder").set ("quality", 8.0); | 601 | var encoder = videobin.get_by_name ("encoder") ; |
1375 | 577 | videobin.get_by_name ("encoder").set ("speed", 6); | 602 | assert (encoder != null) ; |
1376 | 578 | videobin.get_by_name ("encoder").set ("max-keyframe-distance", 150); | 603 | #if GSTREAMER_0_10_IS_DEFINED |
1377 | 579 | videobin.get_by_name ("encoder").set ("threads", int.parse (cores.substring (2))); | 604 | encoder.set ("quality", 8.0); |
1378 | 605 | encoder.set ("speed", 6); | ||
1379 | 606 | encoder.set ("max-keyframe-distance", 150); | ||
1380 | 607 | #else | ||
1381 | 608 | // From these values see https://mail.gnome.org/archives/commits-list/2012-September/msg08183.html | ||
1382 | 609 | encoder.set ("min_quantizer", 13); | ||
1383 | 610 | encoder.set ("max_quantizer", 13); | ||
1384 | 611 | encoder.set ("cpu-used", 5); | ||
1385 | 612 | encoder.set ("deadline", 1000000); | ||
1386 | 613 | #endif | ||
1387 | 614 | encoder.set ("threads", int.parse (cores.substring (2))); | ||
1388 | 580 | 615 | ||
1389 | 581 | 616 | ||
1390 | 582 | if (pipeline==null||muxer==null||sink==null||videobin==null||audiobin==null){ | 617 | if (pipeline==null||muxer==null||sink==null||videobin==null||audiobin==null){ |
1391 | @@ -589,14 +624,28 @@ | |||
1392 | 589 | pipeline.add_many (videobin, muxer, sink); | 624 | pipeline.add_many (videobin, muxer, sink); |
1393 | 590 | 625 | ||
1394 | 591 | 626 | ||
1399 | 592 | videobin.get_static_pad ("src").link(muxer.get_request_pad ("video_%d")); | 627 | var video_pad = videobin.get_static_pad ("src") ; |
1400 | 593 | if (settings.audio) | 628 | assert (video_pad != null ) ; |
1401 | 594 | audiobin.get_static_pad ("src").link(muxer.get_request_pad ("audio_%d")); | 629 | #if GSTREAMER_0_10_IS_DEFINED |
1402 | 595 | 630 | var m = muxer.get_request_pad ("video_%d") ; | |
1403 | 631 | #else | ||
1404 | 632 | var m = muxer.get_request_pad ("video_%u") ; | ||
1405 | 633 | #endif | ||
1406 | 634 | assert (m != null ) ; | ||
1407 | 635 | video_pad.link(m); | ||
1408 | 636 | if (settings.audio){ | ||
1409 | 637 | #if GSTREAMER_0_10_IS_DEFINED | ||
1410 | 638 | audiobin.get_static_pad ("src").link (muxer.get_request_pad ("audio_%d")); | ||
1411 | 639 | #else | ||
1412 | 640 | audiobin.get_static_pad ("src").link (muxer.get_request_pad ("audio_%u")); | ||
1413 | 641 | #endif | ||
1414 | 642 | } | ||
1415 | 596 | muxer.link (sink); | 643 | muxer.link (sink); |
1419 | 597 | 644 | #if GSTREAMER_0_10_IS_DEFINED | |
1420 | 598 | pipeline.get_bus ().add_watch (bus_message_cb); | 645 | pipeline.get_bus ().add_watch (bus_message_cb); |
1421 | 599 | 646 | #else | |
1422 | 647 | pipeline.get_bus ().add_watch (Priority.DEFAULT, bus_message_cb); | ||
1423 | 648 | #endif | ||
1424 | 600 | pipeline.set_state (State.READY); | 649 | pipeline.set_state (State.READY); |
1425 | 601 | 650 | ||
1426 | 602 | if (selectionarea != null) | 651 | if (selectionarea != null) |
1427 | @@ -620,7 +669,10 @@ | |||
1428 | 620 | case Gst.MessageType.ERROR: | 669 | case Gst.MessageType.ERROR: |
1429 | 621 | GLib.Error err; string debug; | 670 | GLib.Error err; string debug; |
1430 | 622 | msg.parse_error (out err, out debug); | 671 | msg.parse_error (out err, out debug); |
1432 | 623 | stderr.printf ("Error: %s\n", err.message); | 672 | |
1433 | 673 | display_error ("Eidete encountered a gstreamer error while recording, creating a screencast is not possible:\n%s\n\n[%s]" | ||
1434 | 674 | .printf (err.message, debug), true); | ||
1435 | 675 | stderr.printf ("Error: %s\n", debug); | ||
1436 | 624 | pipeline.set_state (State.NULL); | 676 | pipeline.set_state (State.NULL); |
1437 | 625 | break; | 677 | break; |
1438 | 626 | case Gst.MessageType.EOS: | 678 | case Gst.MessageType.EOS: |
1439 | @@ -629,7 +681,7 @@ | |||
1440 | 629 | this.recording = false; | 681 | this.recording = false; |
1441 | 630 | 682 | ||
1442 | 631 | var end = new Eidete.Widgets.EndDialog (this); | 683 | var end = new Eidete.Widgets.EndDialog (this); |
1444 | 632 | end.show_all (); | 684 | end.display (); |
1445 | 633 | this.main_window.destroy (); | 685 | this.main_window.destroy (); |
1446 | 634 | 686 | ||
1447 | 635 | break; | 687 | break; |
1448 | @@ -644,26 +696,43 @@ | |||
1449 | 644 | 696 | ||
1450 | 645 | if (to_normal){ | 697 | if (to_normal){ |
1451 | 646 | this.main_window.title = _("Recording paused"); | 698 | this.main_window.title = _("Recording paused"); |
1456 | 647 | this.main_window.remove (pause_icon); | 699 | tabs.hide () ; |
1457 | 648 | if (pause_grid == null) | 700 | stack_switcher.hide () ; |
1458 | 649 | this.build_pause_ui (); | 701 | pause_grid.show () ; |
1455 | 650 | this.main_window.add (pause_grid); | ||
1459 | 651 | this.main_window.icon_name = "eidete"; | 702 | this.main_window.icon_name = "eidete"; |
1460 | 652 | this.app_icon = "eidete"; | 703 | this.app_icon = "eidete"; |
1463 | 653 | this.main_window.show_all (); | 704 | |
1462 | 654 | this.main_window.resize (1, 1); | ||
1464 | 655 | }else{ | 705 | }else{ |
1465 | 656 | this.main_window.title = _("Pause recording"); | 706 | this.main_window.title = _("Pause recording"); |
1471 | 657 | if (this.main_window.get_child () == tabs) | 707 | if (tabs.visible) { |
1472 | 658 | this.main_window.remove (tabs); | 708 | tabs.hide () ; |
1473 | 659 | else | 709 | stack_switcher.hide () ; |
1474 | 660 | this.main_window.remove (pause_grid); | 710 | pause_grid.show () ; |
1475 | 661 | this.main_window.add (pause_icon); | 711 | } |
1476 | 662 | this.main_window.icon_name = "media-playback-pause"; | 712 | this.main_window.icon_name = "media-playback-pause"; |
1477 | 663 | this.app_icon = "media-playback-pause"; | 713 | this.app_icon = "media-playback-pause"; |
1479 | 664 | this.main_window.show_all (); | 714 | |
1480 | 665 | } | 715 | } |
1481 | 666 | } | 716 | } |
1482 | 717 | |||
1483 | 718 | /** | ||
1484 | 719 | * Displays an error dialog with the given message to the user | ||
1485 | 720 | * | ||
1486 | 721 | * @param error The message to display | ||
1487 | 722 | * @param fatal Quit eidete after the user dismissed the dialog | ||
1488 | 723 | */ | ||
1489 | 724 | private void display_error (string error, bool fatal) { | ||
1490 | 725 | var dialog = new Gtk.MessageDialog (main_window, Gtk.DialogFlags.MODAL, | ||
1491 | 726 | Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, error); | ||
1492 | 727 | dialog.show_all (); | ||
1493 | 728 | dialog.response.connect (() => { | ||
1494 | 729 | dialog.destroy (); | ||
1495 | 730 | |||
1496 | 731 | if (fatal) | ||
1497 | 732 | main_window.destroy (); | ||
1498 | 733 | }); | ||
1499 | 734 | dialog.run (); | ||
1500 | 735 | } | ||
1501 | 667 | } | 736 | } |
1502 | 668 | } | 737 | } |
1503 | 669 | 738 | ||
1504 | @@ -692,4 +761,4 @@ | |||
1505 | 692 | eidete = new Eidete.EideteApp (); | 761 | eidete = new Eidete.EideteApp (); |
1506 | 693 | 762 | ||
1507 | 694 | return eidete.run (args); | 763 | return eidete.run (args); |
1508 | 695 | } | ||
1509 | 696 | \ No newline at end of file | 764 | \ No newline at end of file |
1510 | 765 | } | ||
1511 | 697 | 766 | ||
1512 | === modified file 'src/keycapture.c' | |||
1513 | --- src/keycapture.c 2012-04-04 00:02:38 +0000 | |||
1514 | +++ src/keycapture.c 2015-01-04 16:20:24 +0000 | |||
1515 | @@ -4,8 +4,12 @@ | |||
1516 | 4 | #include <X11/Xlib.h> | 4 | #include <X11/Xlib.h> |
1517 | 5 | #include <X11/XKBlib.h> | 5 | #include <X11/XKBlib.h> |
1518 | 6 | #include <X11/extensions/record.h> //libxtst-dev, Xtst | 6 | #include <X11/extensions/record.h> //libxtst-dev, Xtst |
1519 | 7 | #ifdef GSTREAMER_0_10_IS_DEFINED | ||
1520 | 7 | #include <gstreamer-0.10/gst/gst.h> | 8 | #include <gstreamer-0.10/gst/gst.h> |
1521 | 8 | #include <gstreamer-0.10/gst/gstinterface.h> | 9 | #include <gstreamer-0.10/gst/gstinterface.h> |
1522 | 10 | #else | ||
1523 | 11 | #include <gstreamer-1.0/gst/gst.h> | ||
1524 | 12 | #endif | ||
1525 | 9 | /* | 13 | /* |
1526 | 10 | GList *list_devices (){ | 14 | GList *list_devices (){ |
1527 | 11 | GstElement *pulsesrc = gst_element_factory_make ("pulsesrc", "src"); | 15 | GstElement *pulsesrc = gst_element_factory_make ("pulsesrc", "src"); |
1528 | @@ -47,6 +51,8 @@ | |||
1529 | 47 | default: | 51 | default: |
1530 | 48 | break; | 52 | break; |
1531 | 49 | } | 53 | } |
1532 | 54 | |||
1533 | 55 | XRecordFreeData (d); | ||
1534 | 50 | } | 56 | } |
1535 | 51 | 57 | ||
1536 | 52 | void* intercept_key_thread (void *data) { | 58 | void* intercept_key_thread (void *data) { |
1537 | 53 | 59 | ||
1538 | === modified file 'src/videobin_uploader.vala' | |||
1539 | --- src/videobin_uploader.vala 2012-01-03 12:54:48 +0000 | |||
1540 | +++ src/videobin_uploader.vala 2015-01-04 16:20:24 +0000 | |||
1541 | @@ -27,7 +27,7 @@ | |||
1542 | 27 | } | 27 | } |
1543 | 28 | 28 | ||
1544 | 29 | 29 | ||
1546 | 30 | public Uploader (string file){ | 30 | public Uploader (File file){ |
1547 | 31 | this.title = "Upload to videobin.org"; | 31 | this.title = "Upload to videobin.org"; |
1548 | 32 | this.set_default_size (300, 1); | 32 | this.set_default_size (300, 1); |
1549 | 33 | this.window_position = WindowPosition.CENTER; | 33 | this.window_position = WindowPosition.CENTER; |
1550 | @@ -38,21 +38,26 @@ | |||
1551 | 38 | grid.row_spacing = 5; | 38 | grid.row_spacing = 5; |
1552 | 39 | 39 | ||
1553 | 40 | var title = new Entry (); | 40 | var title = new Entry (); |
1554 | 41 | title.placeholder_text = _("Optional") ; | ||
1555 | 41 | var description = new Entry (); | 42 | var description = new Entry (); |
1556 | 43 | description.placeholder_text = _("Optional") ; | ||
1557 | 42 | var email = new Entry (); | 44 | var email = new Entry (); |
1558 | 45 | email.placeholder_text = _("Optional") ; | ||
1559 | 43 | var img = new Image.from_icon_name ("videobin", IconSize.DIALOG); | 46 | var img = new Image.from_icon_name ("videobin", IconSize.DIALOG); |
1560 | 44 | 47 | ||
1562 | 45 | var upload = new Button.with_label (_("Upload")); | 48 | var upload_button = new Button.with_label (_("Upload")); |
1563 | 49 | upload_button.get_style_context ().add_class ("suggested-action"); | ||
1564 | 46 | var cancel = new Button.from_stock (Stock.CANCEL); | 50 | var cancel = new Button.from_stock (Stock.CANCEL); |
1565 | 51 | cancel.margin_end = 6; | ||
1566 | 47 | 52 | ||
1567 | 48 | var bbox = new Box (Orientation.HORIZONTAL, 0); | 53 | var bbox = new Box (Orientation.HORIZONTAL, 0); |
1569 | 49 | bbox.pack_end (upload, false, true, 0); | 54 | bbox.pack_end (upload_button, false, true, 0); |
1570 | 50 | bbox.pack_end (cancel, false, true, 0); | 55 | bbox.pack_end (cancel, false, true, 0); |
1571 | 51 | 56 | ||
1576 | 52 | email.set_tooltip_text ("Your email address for relocating your videos"); | 57 | email.set_tooltip_text (_("Your email address for relocating your videos")); |
1577 | 53 | upload.image = new Image.from_icon_name ("mail-reply-sender", IconSize.BUTTON); | 58 | upload_button.image = new Image.from_icon_name ("mail-reply-sender", IconSize.BUTTON); |
1578 | 54 | upload.can_default = true; | 59 | upload_button.can_default = true; |
1579 | 55 | this.set_default (upload); | 60 | this.set_default (upload_button); |
1580 | 56 | 61 | ||
1581 | 57 | grid.attach (img, 0, 0, 1, 2); | 62 | grid.attach (img, 0, 0, 1, 2); |
1582 | 58 | grid.attach (new LLabel ("Title"), 1, 0, 1, 1); | 63 | grid.attach (new LLabel ("Title"), 1, 0, 1, 1); |
1583 | @@ -68,9 +73,12 @@ | |||
1584 | 68 | 73 | ||
1585 | 69 | cancel.clicked.connect (Gtk.main_quit); | 74 | cancel.clicked.connect (Gtk.main_quit); |
1586 | 70 | 75 | ||
1588 | 71 | upload.clicked.connect ( () => { | 76 | upload_button.clicked.connect ( () => { |
1589 | 72 | string url; | 77 | string url; |
1591 | 73 | string command = "curl -F\"api=1\" -F\"videoFile=@"+file+"\" "; | 78 | string path = file.get_path() ; |
1592 | 79 | if( path.has_prefix ("'") && path.has_suffix ("'")) | ||
1593 | 80 | path = path.substring (1, path.length-2) ; | ||
1594 | 81 | string command = "curl -F\"api=1\" -F\"videoFile=@"+path+"\" "; | ||
1595 | 74 | if (email.text != "") | 82 | if (email.text != "") |
1596 | 75 | command += "-F\"email="+email.text+"\" "; | 83 | command += "-F\"email="+email.text+"\" "; |
1597 | 76 | if (title.text != "") | 84 | if (title.text != "") |
1598 | @@ -78,11 +86,15 @@ | |||
1599 | 78 | if (description.text != "") | 86 | if (description.text != "") |
1600 | 79 | command += "-F\"description="+description.text+"\" "; | 87 | command += "-F\"description="+description.text+"\" "; |
1601 | 80 | command += "http://videobin.org/add"; | 88 | command += "http://videobin.org/add"; |
1602 | 81 | |||
1603 | 82 | try{ | 89 | try{ |
1604 | 83 | Process.spawn_command_line_sync (command, out url); | 90 | Process.spawn_command_line_sync (command, out url); |
1605 | 84 | }catch (Error e){error (e.message);} | 91 | }catch (Error e){error (e.message);} |
1606 | 85 | try{ | 92 | try{ |
1607 | 93 | if( url == null || url == "" ) | ||
1608 | 94 | { | ||
1609 | 95 | warning( "The upload has failed. Command: %s", command) ; | ||
1610 | 96 | } | ||
1611 | 97 | else | ||
1612 | 86 | Process.spawn_command_line_async ("sensible-browser "+url); | 98 | Process.spawn_command_line_async ("sensible-browser "+url); |
1613 | 87 | }catch (Error e){error (e.message);} | 99 | }catch (Error e){error (e.message);} |
1614 | 88 | Gtk.main_quit (); | 100 | Gtk.main_quit (); |
1615 | @@ -93,9 +105,17 @@ | |||
1616 | 93 | 105 | ||
1617 | 94 | public static void main (string [] args){ | 106 | public static void main (string [] args){ |
1618 | 95 | Gtk.init (ref args); | 107 | Gtk.init (ref args); |
1623 | 96 | var file = File.new_for_uri (args[1]); | 108 | if( args.length<=1) |
1624 | 97 | var u = new Uploader (file.get_path ()); | 109 | { |
1625 | 98 | u.show_all (); | 110 | warning ("You must provide a valid file path" ) ; |
1626 | 99 | Gtk.main (); | 111 | } |
1627 | 112 | else | ||
1628 | 113 | { | ||
1629 | 114 | var path = args[1] ; | ||
1630 | 115 | var file = File.new_for_path (path); | ||
1631 | 116 | var dialog = new Uploader (file); | ||
1632 | 117 | dialog.show_all (); | ||
1633 | 118 | Gtk.main (); | ||
1634 | 119 | } | ||
1635 | 100 | } | 120 | } |
1636 | 101 | 121 |
Approved