Merge lp:~name-is-carl/eidete/fix-for-freya into lp:eidete
- fix-for-freya
- Merge into trunk
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 176 | ||||||||||||||||
Proposed branch: | lp:~name-is-carl/eidete/fix-for-freya | ||||||||||||||||
Merge into: | lp:eidete | ||||||||||||||||
Diff against target: |
1173 lines (+494/-230) 7 files modified
CMakeLists.txt (+31/-7) README (+22/-0) po/eidete.pot (+87/-72) src/Widgets/end_dialog.vala (+181/-74) src/eidete.vala (+135/-63) src/keycapture.c (+4/-0) src/videobin_uploader.vala (+34/-14) |
||||||||||||||||
To merge this branch: | bzr merge lp:~name-is-carl/eidete/fix-for-freya | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tom Beckmann | Pending | ||
elementary Apps team | Pending | ||
Review via email: mp+245398@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)
- 183. By PerfectCarl
-
Fixing the pause button issue
- 184. By PerfectCarl
-
Fix code formatting
- 185. By PerfectCarl
-
Revert the annoying code reformatting. Bump the version to 0.2
- 186. By PerfectCarl
-
Revert more geany code reformatting
- 187. By PerfectCarl
-
Add missing ':' in label
- 188. By PerfectCarl
-
Add a README file
- 189. By PerfectCarl
-
Porting contracts to Freya (work in progress)
- 190. By PerfectCarl
-
Fix tabs
- 191. By PerfectCarl
-
More work on the contracts
- 192. By PerfectCarl
-
Fix UI. Start fixing video-uploader
- 193. By PerfectCarl
-
Fix upload to video-bin
- 194. By PerfectCarl
-
Revert to old formatting
- 195. By PerfectCarl
-
Revert to old formatting
- 196. By PerfectCarl
-
Fixing new build warnings
- 197. By PerfectCarl
-
Fixing minor formatting issues
- 198. By PerfectCarl
-
Reverted to trunk pot
- 199. By PerfectCarl
-
Fix styling issues
- 200. By Tom Beckmann
-
fix some gtk deprecations and other minor problems with the ui
- 201. By Tom Beckmann
-
display an error dialog when gstreamer fails
- 202. By Tom Beckmann
-
simplify cmake logic for gst versions
- 203. By Tom Beckmann
-
more cmake cleanup
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-05-29 17:06:50 +0000 | |||
3 | +++ CMakeLists.txt 2015-01-04 13:23:18 +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 |
71 | 60 | -X -lXtst | 83 | -X -lXtst |
72 | 61 | --thread | 84 | --thread |
73 | 62 | --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/ | 85 | --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/ |
74 | 86 | ${EXTRA_DEFINITIONS} | ||
75 | 63 | ) | 87 | ) |
76 | 64 | 88 | ||
77 | 65 | vala_precompile(VALA_C_VIDEOBIN | 89 | vala_precompile(VALA_C_VIDEOBIN |
78 | @@ -79,4 +103,4 @@ | |||
79 | 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) |
80 | 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) |
81 | 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) |
82 | 82 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/videobin.contract DESTINATION ${CMAKE_INSTALL_PREFIX}/share/contractor) | ||
83 | 83 | \ No newline at end of file | 106 | \ No newline at end of file |
84 | 107 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/videobin.contract DESTINATION ${CMAKE_INSTALL_PREFIX}/share/contractor) | ||
85 | 84 | 108 | ||
86 | === added file 'README' | |||
87 | --- README 1970-01-01 00:00:00 +0000 | |||
88 | +++ README 2015-01-04 13:23:18 +0000 | |||
89 | @@ -0,0 +1,22 @@ | |||
90 | 1 | ## Introduction | ||
91 | 2 | |||
92 | 3 | A simple screencasting app for the elementary project | ||
93 | 4 | |||
94 | 5 | Current Features | ||
95 | 6 | - encoding to webm | ||
96 | 7 | - selection of the area to be recorded | ||
97 | 8 | - display of the pressed keys | ||
98 | 9 | - audio recording | ||
99 | 10 | |||
100 | 11 | For more information go to: https://launchpad.net/eidete | ||
101 | 12 | |||
102 | 13 | ## How to build | ||
103 | 14 | Install dependencies | ||
104 | 15 | sudo apt-get build-dep eidete | ||
105 | 16 | OR | ||
106 | 17 | sudo apt-get build-dep granite-demo | ||
107 | 18 | sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev | ||
108 | 19 | |||
109 | 20 | mkdir build && cd build | ||
110 | 21 | cmake -DCMAKE_INSTALL_PREFIX=/usr ../ | ||
111 | 22 | make | ||
112 | 0 | 23 | ||
113 | === modified file 'po/eidete.pot' | |||
114 | --- po/eidete.pot 2013-05-17 20:02:58 +0000 | |||
115 | +++ po/eidete.pot 2015-01-04 13:23:18 +0000 | |||
116 | @@ -8,7 +8,7 @@ | |||
117 | 8 | msgstr "" | 8 | msgstr "" |
118 | 9 | "Project-Id-Version: PACKAGE VERSION\n" | 9 | "Project-Id-Version: PACKAGE VERSION\n" |
119 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
121 | 11 | "POT-Creation-Date: 2013-05-17 23:02+0300\n" | 11 | "POT-Creation-Date: 2015-01-04 12:47+0100\n" |
122 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
123 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
124 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
125 | @@ -17,183 +17,198 @@ | |||
126 | 17 | "Content-Type: text/plain; charset=CHARSET\n" | 17 | "Content-Type: text/plain; charset=CHARSET\n" |
127 | 18 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
128 | 19 | 19 | ||
149 | 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 |
130 | 21 | msgid "Record screencasts" | ||
131 | 22 | msgstr "" | ||
132 | 23 | |||
133 | 24 | #: /home/kristjan/translations/po/../src/desktop_launcher.vala:6 | ||
134 | 25 | msgid "Screencaster" | ||
135 | 26 | msgstr "" | ||
136 | 27 | |||
137 | 28 | #: /home/kristjan/translations/po/../src/videobin_uploader.vala:45 | ||
138 | 29 | msgid "Upload" | ||
139 | 30 | msgstr "" | ||
140 | 31 | |||
141 | 32 | #: /home/kristjan/translations/po/../src/savedialog.vala:8 | ||
142 | 33 | #: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:28 | ||
143 | 34 | #: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:64 | ||
144 | 35 | #: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:100 | ||
145 | 36 | msgid "Save" | ||
146 | 37 | msgstr "" | ||
147 | 38 | |||
148 | 39 | #: /home/kristjan/translations/po/../src/eidete.vala:138 | ||
150 | 40 | msgid "Monitor" | 21 | msgid "Monitor" |
151 | 41 | msgstr "" | 22 | msgstr "" |
152 | 42 | 23 | ||
154 | 43 | #: /home/kristjan/translations/po/../src/eidete.vala:158 | 24 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:160 |
155 | 44 | msgid "Fullscreen" | 25 | msgid "Fullscreen" |
156 | 45 | msgstr "" | 26 | msgstr "" |
157 | 46 | 27 | ||
159 | 47 | #: /home/kristjan/translations/po/../src/eidete.vala:159 | 28 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:161 |
160 | 48 | msgid "Custom" | 29 | msgid "Custom" |
161 | 49 | msgstr "" | 30 | msgstr "" |
162 | 50 | 31 | ||
164 | 51 | #: /home/kristjan/translations/po/../src/eidete.vala:170 | 32 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:172 |
165 | 52 | msgid "Default" | 33 | msgid "Default" |
166 | 53 | msgstr "" | 34 | msgstr "" |
167 | 54 | 35 | ||
169 | 55 | #: /home/kristjan/translations/po/../src/eidete.vala:179 | 36 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:181 |
170 | 56 | msgid "Sound" | 37 | msgid "Sound" |
171 | 57 | msgstr "" | 38 | msgstr "" |
172 | 58 | 39 | ||
174 | 59 | #: /home/kristjan/translations/po/../src/eidete.vala:182 | 40 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:184 |
175 | 60 | msgid "Video" | 41 | msgid "Video" |
176 | 61 | msgstr "" | 42 | msgstr "" |
177 | 62 | 43 | ||
179 | 63 | #: /home/kristjan/translations/po/../src/eidete.vala:185 | 44 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:187 |
180 | 64 | msgid "Keyboard" | 45 | msgid "Keyboard" |
181 | 65 | msgstr "" | 46 | msgstr "" |
182 | 66 | 47 | ||
184 | 67 | #: /home/kristjan/translations/po/../src/eidete.vala:188 | 48 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:190 |
185 | 68 | msgid "Mouse" | 49 | msgid "Mouse" |
186 | 69 | msgstr "" | 50 | msgstr "" |
187 | 70 | 51 | ||
189 | 71 | #: /home/kristjan/translations/po/../src/eidete.vala:191 | 52 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:193 |
190 | 72 | msgid "Start Recording" | 53 | msgid "Start Recording" |
191 | 73 | msgstr "" | 54 | msgstr "" |
192 | 74 | 55 | ||
194 | 75 | #: /home/kristjan/translations/po/../src/eidete.vala:197 | 56 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:199 |
195 | 76 | msgid "About" | 57 | msgid "About" |
196 | 77 | msgstr "" | 58 | msgstr "" |
197 | 78 | 59 | ||
199 | 79 | #: /home/kristjan/translations/po/../src/eidete.vala:210 | 60 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:212 |
200 | 80 | msgid "Record Computer Sounds" | 61 | msgid "Record Computer Sounds" |
201 | 81 | msgstr "" | 62 | msgstr "" |
202 | 82 | 63 | ||
204 | 83 | #: /home/kristjan/translations/po/../src/eidete.vala:212 | 64 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:214 |
205 | 84 | msgid "Record from Microphone" | 65 | msgid "Record from Microphone" |
206 | 85 | msgstr "" | 66 | msgstr "" |
207 | 86 | 67 | ||
209 | 87 | #: /home/kristjan/translations/po/../src/eidete.vala:215 | 68 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:217 |
210 | 88 | msgid "Record from Monitor" | 69 | msgid "Record from Monitor" |
211 | 89 | msgstr "" | 70 | msgstr "" |
212 | 90 | 71 | ||
214 | 91 | #: /home/kristjan/translations/po/../src/eidete.vala:217 | 72 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:219 |
215 | 92 | msgid "Recording Area" | 73 | msgid "Recording Area" |
216 | 93 | msgstr "" | 74 | msgstr "" |
217 | 94 | 75 | ||
219 | 95 | #: /home/kristjan/translations/po/../src/eidete.vala:219 | 76 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:221 |
220 | 96 | msgid "Width" | 77 | msgid "Width" |
221 | 97 | msgstr "" | 78 | msgstr "" |
222 | 98 | 79 | ||
224 | 99 | #: /home/kristjan/translations/po/../src/eidete.vala:221 | 80 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:223 |
225 | 100 | msgid "Height" | 81 | msgid "Height" |
226 | 101 | msgstr "" | 82 | msgstr "" |
227 | 102 | 83 | ||
229 | 103 | #: /home/kristjan/translations/po/../src/eidete.vala:245 | 84 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:247 |
230 | 104 | msgid "Pressed keys on screen" | 85 | msgid "Pressed keys on screen" |
231 | 105 | msgstr "" | 86 | msgstr "" |
232 | 106 | 87 | ||
234 | 107 | #: /home/kristjan/translations/po/../src/eidete.vala:248 | 88 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:250 |
235 | 108 | msgid "Mouse clicks on screen" | 89 | msgid "Mouse clicks on screen" |
236 | 109 | msgstr "" | 90 | msgstr "" |
237 | 110 | 91 | ||
239 | 111 | #: /home/kristjan/translations/po/../src/eidete.vala:250 | 92 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:252 |
240 | 112 | msgid "Circle around the cursor" | 93 | msgid "Circle around the cursor" |
241 | 113 | msgstr "" | 94 | msgstr "" |
242 | 114 | 95 | ||
244 | 115 | #: /home/kristjan/translations/po/../src/eidete.vala:256 | 96 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:258 |
245 | 116 | msgid "Behavior" | 97 | msgid "Behavior" |
246 | 117 | msgstr "" | 98 | msgstr "" |
247 | 118 | 99 | ||
249 | 119 | #: /home/kristjan/translations/po/../src/eidete.vala:257 | 100 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:259 |
250 | 120 | msgid "Appearance" | 101 | msgid "Appearance" |
251 | 121 | msgstr "" | 102 | msgstr "" |
252 | 122 | 103 | ||
256 | 123 | #: /home/kristjan/translations/po/../src/eidete.vala:449 | 104 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:461 |
257 | 124 | #: /home/kristjan/translations/po/../src/eidete.vala:456 | 105 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:682 |
255 | 125 | #: /home/kristjan/translations/po/../src/eidete.vala:641 | ||
258 | 126 | msgid "Recording paused" | 106 | msgid "Recording paused" |
259 | 127 | msgstr "" | 107 | msgstr "" |
260 | 128 | 108 | ||
262 | 129 | #: /home/kristjan/translations/po/../src/eidete.vala:459 | 109 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:464 |
263 | 130 | msgid "You can continue or finish the recording now" | 110 | msgid "You can continue or finish the recording now" |
264 | 131 | msgstr "" | 111 | msgstr "" |
265 | 132 | 112 | ||
267 | 133 | #: /home/kristjan/translations/po/../src/eidete.vala:468 | 113 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:473 |
268 | 134 | msgid "Continue" | 114 | msgid "Continue" |
269 | 135 | msgstr "" | 115 | msgstr "" |
270 | 136 | 116 | ||
272 | 137 | #: /home/kristjan/translations/po/../src/eidete.vala:469 | 117 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:474 |
273 | 138 | msgid "Continue recording" | 118 | msgid "Continue recording" |
274 | 139 | msgstr "" | 119 | msgstr "" |
275 | 140 | 120 | ||
277 | 141 | #: /home/kristjan/translations/po/../src/eidete.vala:472 | 121 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:477 |
278 | 142 | msgid "Finish" | 122 | msgid "Finish" |
279 | 143 | msgstr "" | 123 | msgstr "" |
280 | 144 | 124 | ||
282 | 145 | #: /home/kristjan/translations/po/../src/eidete.vala:473 | 125 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:478 |
283 | 146 | msgid "Stop the recording and save the file" | 126 | msgid "Stop the recording and save the file" |
284 | 147 | msgstr "" | 127 | msgstr "" |
285 | 148 | 128 | ||
287 | 149 | #: /home/kristjan/translations/po/../src/eidete.vala:476 | 129 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:481 |
288 | 130 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:50 | ||
289 | 150 | msgid "Cancel" | 131 | msgid "Cancel" |
290 | 151 | msgstr "" | 132 | msgstr "" |
291 | 152 | 133 | ||
293 | 153 | #: /home/kristjan/translations/po/../src/eidete.vala:477 | 134 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:482 |
294 | 154 | msgid "Cancel the recording without saving the file" | 135 | msgid "Cancel the recording without saving the file" |
295 | 155 | msgstr "" | 136 | msgstr "" |
296 | 156 | 137 | ||
298 | 157 | #: /home/kristjan/translations/po/../src/eidete.vala:651 | 138 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:690 |
299 | 158 | msgid "Pause recording" | 139 | msgid "Pause recording" |
300 | 159 | msgstr "" | 140 | msgstr "" |
301 | 160 | 141 | ||
303 | 161 | #: /home/kristjan/translations/po/../src/eidete.vala:671 | 142 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:719 |
304 | 162 | msgid "Pause Recording" | 143 | msgid "Pause Recording" |
305 | 163 | msgstr "" | 144 | msgstr "" |
306 | 164 | 145 | ||
308 | 165 | #: /home/kristjan/translations/po/../src/eidete.vala:672 | 146 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:720 |
309 | 166 | msgid "Finish Recording" | 147 | msgid "Finish Recording" |
310 | 167 | msgstr "" | 148 | msgstr "" |
311 | 168 | 149 | ||
313 | 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 |
314 | 151 | msgid "Record screencasts" | ||
315 | 152 | msgstr "" | ||
316 | 153 | |||
317 | 154 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/desktop_launcher.vala:6 | ||
318 | 155 | msgid "Screencaster" | ||
319 | 156 | msgstr "" | ||
320 | 157 | |||
321 | 158 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:40 | ||
322 | 170 | msgid "Recording complete" | 159 | msgid "Recording complete" |
323 | 171 | msgstr "" | 160 | msgstr "" |
324 | 172 | 161 | ||
334 | 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 |
335 | 174 | msgid "Don't save" | 163 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:107 |
336 | 175 | msgstr "" | 164 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:146 |
337 | 176 | 165 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:226 | |
338 | 177 | #: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:62 | 166 | msgid "Save" |
339 | 178 | msgid "Could not contact Contractor. Click the Save button to save the file." | 167 | msgstr "" |
340 | 179 | msgstr "" | 168 | |
341 | 180 | 169 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:144 | |
342 | 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 |
343 | 171 | msgid "Could not contact Contractor." | ||
344 | 172 | msgstr "" | ||
345 | 173 | |||
346 | 174 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:214 | ||
347 | 175 | msgid "Save file" | ||
348 | 176 | msgstr "" | ||
349 | 177 | |||
350 | 178 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:216 | ||
351 | 179 | msgid "Execute" | ||
352 | 180 | msgstr "" | ||
353 | 181 | |||
354 | 182 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/countdown.vala:27 | ||
355 | 183 | msgid "Recording starts in" | ||
356 | 184 | msgstr "" | ||
357 | 185 | |||
358 | 186 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/countdown.vala:34 | ||
359 | 187 | msgid "Focus Eidete to stop recording" | ||
360 | 188 | msgstr "" | ||
361 | 189 | |||
362 | 190 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/keyview.vala:48 | ||
363 | 182 | msgid "Left" | 191 | msgid "Left" |
364 | 183 | msgstr "" | 192 | msgstr "" |
365 | 184 | 193 | ||
367 | 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 |
368 | 186 | msgid "Middle" | 195 | msgid "Middle" |
369 | 187 | msgstr "" | 196 | msgstr "" |
370 | 188 | 197 | ||
372 | 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 |
373 | 190 | msgid "Right" | 199 | msgid "Right" |
374 | 191 | msgstr "" | 200 | msgstr "" |
375 | 192 | 201 | ||
382 | 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 |
383 | 194 | msgid "Recording starts in" | 203 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:43 |
384 | 195 | msgstr "" | 204 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:45 |
385 | 196 | 205 | msgid "Optional" | |
386 | 197 | #: /home/kristjan/translations/po/../src/Widgets/countdown.vala:34 | 206 | msgstr "" |
387 | 198 | msgid "Focus Eidete to stop recording" | 207 | |
388 | 208 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:48 | ||
389 | 209 | msgid "Upload" | ||
390 | 210 | msgstr "" | ||
391 | 211 | |||
392 | 212 | #: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:57 | ||
393 | 213 | msgid "Your email address for relocating your videos" | ||
394 | 199 | msgstr "" | 214 | msgstr "" |
395 | 200 | 215 | ||
396 | === modified file 'src/Widgets/end_dialog.vala' | |||
397 | --- src/Widgets/end_dialog.vala 2013-05-15 15:57:25 +0000 | |||
398 | +++ src/Widgets/end_dialog.vala 2015-01-04 13:23:18 +0000 | |||
399 | @@ -1,37 +1,54 @@ | |||
400 | 1 | using Gtk; | 1 | using Gtk; |
401 | 2 | 2 | ||
402 | 3 | |||
403 | 4 | namespace Eidete.Widgets { | 3 | namespace Eidete.Widgets { |
404 | 5 | 4 | ||
406 | 6 | private bool contractor; | 5 | public class EndDialog : Dialog { |
407 | 7 | 6 | ||
409 | 8 | public class EndDialog : Window { | 7 | private bool contractor; |
410 | 8 | |||
411 | 9 | private EideteApp app ; | ||
412 | 10 | private Button export ; | ||
413 | 11 | private Grid grid; | ||
414 | 12 | private ListStore list ; | ||
415 | 13 | private TreeView treeview ; | ||
416 | 14 | private File source ; | ||
417 | 15 | |||
418 | 9 | public EndDialog (EideteApp app){ | 16 | public EndDialog (EideteApp app){ |
419 | 17 | this.app = app ; | ||
420 | 18 | build_ui () ; | ||
421 | 19 | this.window_position = WindowPosition.CENTER; | ||
422 | 20 | } | ||
423 | 21 | |||
424 | 22 | private void build_ui () { | ||
425 | 23 | this.get_header_bar ().get_style_context ().remove_class ("header-bar"); | ||
426 | 10 | this.set_default_size (400, 200); | 24 | this.set_default_size (400, 200); |
428 | 11 | 25 | this.resizable = false; | |
429 | 12 | this.set_application (app); | 26 | this.set_application (app); |
431 | 13 | 27 | ||
432 | 14 | if (app.selectionarea != null) | 28 | if (app.selectionarea != null) |
434 | 15 | app.selectionarea.destroy (); | 29 | app.selectionarea.destroy (); |
435 | 16 | if (app.keyview != null) | 30 | if (app.keyview != null) |
438 | 17 | app.keyview.destroy (); | 31 | app.keyview.destroy (); |
439 | 18 | this.window_position = WindowPosition.CENTER; | 32 | |
440 | 19 | this.icon_name = "eidete"; | 33 | this.icon_name = "eidete"; |
441 | 20 | 34 | ||
443 | 21 | var grid = new Grid (); | 35 | grid = new Grid (); |
444 | 22 | grid.margin = 12; | 36 | grid.margin = 12; |
445 | 23 | 37 | ||
446 | 38 | var content = (Gtk.Box) this.get_content_area () ; | ||
447 | 24 | var title = new Label ("<span size='30000'>"+_("Recording complete")+"</span>"); | 39 | var title = new Label ("<span size='30000'>"+_("Recording complete")+"</span>"); |
448 | 25 | title.use_markup = true; | 40 | title.use_markup = true; |
449 | 26 | title.halign = Align.START; | 41 | title.halign = Align.START; |
450 | 27 | 42 | ||
452 | 28 | var export = new Button.with_label (_("Save")); | 43 | export = new Button.with_label (_("Save")); |
453 | 29 | export.image = new Image.from_stock (Stock.SAVE, IconSize.BUTTON); | 44 | export.image = new Image.from_stock (Stock.SAVE, IconSize.BUTTON); |
454 | 30 | export.can_default = true; | 45 | export.can_default = true; |
455 | 46 | export.get_style_context ().add_class ("suggested-action"); | ||
456 | 31 | this.set_default (export); | 47 | this.set_default (export); |
457 | 32 | 48 | ||
459 | 33 | var cancel = new Button.with_label (_("Don't save")); | 49 | var cancel = new Button.with_label (_("Cancel")); |
460 | 34 | cancel.image = new Image.from_stock (Stock.DELETE, IconSize.BUTTON); | 50 | cancel.image = new Image.from_stock (Stock.DELETE, IconSize.BUTTON); |
461 | 51 | cancel.margin_end = 6; | ||
462 | 35 | cancel.halign = Align.END; | 52 | cancel.halign = Align.END; |
463 | 36 | 53 | ||
464 | 37 | var bbox = new ButtonBox (Orientation.HORIZONTAL); | 54 | var bbox = new ButtonBox (Orientation.HORIZONTAL); |
465 | @@ -39,84 +56,174 @@ | |||
466 | 39 | bbox.pack_end (export, false, true, 0); | 56 | bbox.pack_end (export, false, true, 0); |
467 | 40 | bbox.layout_style = ButtonBoxStyle.END; | 57 | bbox.layout_style = ButtonBoxStyle.END; |
468 | 41 | 58 | ||
474 | 42 | //contractor | 59 | |
475 | 43 | var list = new ListStore (2, typeof (Gdk.Pixbuf), typeof (string)); | 60 | list = new ListStore (2, typeof (Gdk.Pixbuf), typeof (string)); |
476 | 44 | var t = new TreeView.with_model (list); | 61 | treeview = new TreeView.with_model (list); |
477 | 45 | t.headers_visible = false; | 62 | treeview.headers_visible = false; |
478 | 46 | t.hexpand = true; | 63 | treeview.hexpand = true; |
479 | 64 | treeview.set_activate_on_single_click (false) ; | ||
480 | 65 | treeview.row_activated.connect ( on_contract_executed) ; | ||
481 | 47 | 66 | ||
482 | 48 | var cell1 = new CellRendererPixbuf (); | 67 | var cell1 = new CellRendererPixbuf (); |
483 | 49 | cell1.set_padding (5, 15); | 68 | cell1.set_padding (5, 15); |
485 | 50 | t.insert_column_with_attributes (-1, "", cell1, "pixbuf", 0); | 69 | treeview.insert_column_with_attributes (-1, "", cell1, "pixbuf", 0); |
486 | 51 | var cell2 = new CellRendererText (); | 70 | var cell2 = new CellRendererText (); |
487 | 52 | cell2.set_padding (2, 15); | 71 | cell2.set_padding (2, 15); |
514 | 53 | t.insert_column_with_attributes (-1, "", cell2, "markup", 1); | 72 | treeview.insert_column_with_attributes (-1, "", cell2, "markup", 1); |
515 | 54 | 73 | ||
516 | 55 | 74 | //contractor | |
517 | 56 | var c = Granite.Services.Contractor.get_contract (app.settings.destination, "video"); | 75 | load_contracts () ; |
492 | 57 | if (c == null || c.length <= 1){ | ||
493 | 58 | warning ("You should install and/or run contractor"); | ||
494 | 59 | contractor = false; | ||
495 | 60 | var info = new InfoBar (); | ||
496 | 61 | info.message_type = MessageType.WARNING; | ||
497 | 62 | info.pack_start (new Label (_("Could not contact Contractor. Click the Save button to save the file."))); | ||
498 | 63 | grid.attach (info, 0, 3, 2, 1); | ||
499 | 64 | export.label = _("Save"); | ||
500 | 65 | }else{ | ||
501 | 66 | contractor = true; | ||
502 | 67 | for (var i=0;i<c.length; i++){ | ||
503 | 68 | TreeIter it; | ||
504 | 69 | list.append (out it); | ||
505 | 70 | Gdk.Pixbuf icon = null; | ||
506 | 71 | try{ | ||
507 | 72 | icon = IconTheme.get_default ().load_icon (c[i].lookup ("IconName"), 32, 0); | ||
508 | 73 | }catch (Error e){warning (e.message);} | ||
509 | 74 | list.set (it, 0, icon, 1, | ||
510 | 75 | "<b>"+c[i].lookup ("Name")+"</b>\n"+c[i].lookup ("Description")); | ||
511 | 76 | } | ||
512 | 77 | t.set_cursor (new TreePath.from_string ("0"), null, false); | ||
513 | 78 | } | ||
518 | 79 | 76 | ||
519 | 80 | grid.attach (title, 0, 0, 2, 1); | 77 | grid.attach (title, 0, 0, 2, 1); |
520 | 81 | grid.attach (new Label (""), 0, 2, 1, 1); | 78 | grid.attach (new Label (""), 0, 2, 1, 1); |
522 | 82 | grid.attach (t, 0, 4, 1, 1); | 79 | grid.attach (treeview, 0, 4, 1, 1); |
523 | 83 | grid.attach (new Label (""), 0, 5, 1, 1); | 80 | grid.attach (new Label (""), 0, 5, 1, 1); |
524 | 84 | grid.attach (bbox, 0, 6, 1, 1); | 81 | grid.attach (bbox, 0, 6, 1, 1); |
526 | 85 | 82 | source = File.new_for_path (app.settings.destination); | |
527 | 83 | |||
528 | 86 | if (contractor){ | 84 | if (contractor){ |
539 | 87 | export.clicked.connect ( () => { | 85 | export.clicked.connect (on_contract_executed) ; |
530 | 88 | TreePath path; | ||
531 | 89 | t.get_cursor (out path, null); | ||
532 | 90 | try{ | ||
533 | 91 | Process.spawn_command_line_async (c[int.parse (path.to_string ())].lookup ("Exec")); | ||
534 | 92 | }catch (Error e){ | ||
535 | 93 | print(e.message); | ||
536 | 94 | } | ||
537 | 95 | this.destroy (); | ||
538 | 96 | }); | ||
540 | 97 | } else { | 86 | } else { |
559 | 98 | export.clicked.connect ( () => { | 87 | export.clicked.connect ( () => { |
560 | 99 | var source = File.new_for_path (app.settings.destination); | 88 | save_file () ; |
561 | 100 | var file = new FileChooserDialog (_("Save"), null, FileChooserAction.SAVE, Stock.OK, ResponseType.OK); | 89 | this.destroy (); |
562 | 101 | file.set_current_name (source.get_basename ()); | 90 | }); |
545 | 102 | file.do_overwrite_confirmation = true; | ||
546 | 103 | var res = file.run (); | ||
547 | 104 | if (res == ResponseType.OK){ | ||
548 | 105 | var destination = File.new_for_path (file.get_filename ()); | ||
549 | 106 | try{ | ||
550 | 107 | source.copy (destination, FileCopyFlags.OVERWRITE); | ||
551 | 108 | }catch (GLib.Error e){stderr.printf ("Error: %s\n", e.message);} | ||
552 | 109 | |||
553 | 110 | file.destroy (); | ||
554 | 111 | this.destroy (); | ||
555 | 112 | }else{ | ||
556 | 113 | file.destroy (); | ||
557 | 114 | } | ||
558 | 115 | }); | ||
563 | 116 | } | 91 | } |
564 | 117 | cancel.clicked.connect ( () => {this.destroy ();}); | 92 | cancel.clicked.connect ( () => {this.destroy ();}); |
565 | 118 | 93 | ||
567 | 119 | this.add (grid); | 94 | content.add (grid); |
568 | 95 | } | ||
569 | 96 | |||
570 | 97 | private void on_contract_executed () { | ||
571 | 98 | TreePath path; | ||
572 | 99 | treeview.get_cursor (out path, null); | ||
573 | 100 | int index = int.parse (path.to_string ()) ; | ||
574 | 101 | execute_command (index) ; | ||
575 | 102 | this.destroy (); | ||
576 | 103 | } | ||
577 | 104 | |||
578 | 105 | private void save_file () { | ||
579 | 106 | var dialog = new FileChooserDialog (_("Save"), null, FileChooserAction.SAVE, Stock.OK, ResponseType.OK); | ||
580 | 107 | dialog.set_current_name (source.get_basename ()); | ||
581 | 108 | var videos_folder = Environment.get_user_special_dir(UserDirectory.VIDEOS); | ||
582 | 109 | dialog.set_current_folder (videos_folder); | ||
583 | 110 | dialog.do_overwrite_confirmation = true; | ||
584 | 111 | var res = dialog.run (); | ||
585 | 112 | if (res == ResponseType.OK){ | ||
586 | 113 | var destination = File.new_for_path (dialog.get_filename ()); | ||
587 | 114 | try{ | ||
588 | 115 | source.copy (destination, FileCopyFlags.OVERWRITE); | ||
589 | 116 | }catch (GLib.Error e){ | ||
590 | 117 | stderr.printf ("Error: %s\n", e.message); | ||
591 | 118 | } | ||
592 | 119 | } | ||
593 | 120 | dialog.destroy (); | ||
594 | 121 | } | ||
595 | 122 | // Using deprecated Contractor API. Necesserary to maintain luna compatibility | ||
596 | 123 | #if false | ||
597 | 124 | private void execute_command_deprecated (int index) { | ||
598 | 125 | string cmd = contracts_dep[index].lookup ("Exec") ; | ||
599 | 126 | try{ | ||
600 | 127 | Process.spawn_command_line_async (cmd); | ||
601 | 128 | }catch (Error e){ | ||
602 | 129 | print(e.message); | ||
603 | 130 | } | ||
604 | 131 | } | ||
605 | 132 | |||
606 | 133 | private HashTable<string,string>[] contracts_dep ; | ||
607 | 134 | |||
608 | 135 | private void load_contracts_deprecated () { | ||
609 | 136 | // CARL deprecated Contractor API | ||
610 | 137 | contracts_dep = Granite.Services.Contractor.get_contract (app.settings.destination, "video"); | ||
611 | 138 | if (contracts_dep == null || contracts_dep.length <= 1){ | ||
612 | 139 | warning ("You should install and/or run contractor"); | ||
613 | 140 | contractor = false; | ||
614 | 141 | var info = new InfoBar (); | ||
615 | 142 | info.message_type = MessageType.WARNING; | ||
616 | 143 | info.pack_start (new Label (_("Could not contact Contractor."))); | ||
617 | 144 | grid.attach (info, 0, 3, 2, 1); | ||
618 | 145 | export.label = _("Save"); | ||
619 | 146 | }else{ | ||
620 | 147 | contractor = true; | ||
621 | 148 | for (var i=0;i<contracts_dep.length; i++){ | ||
622 | 149 | TreeIter it; | ||
623 | 150 | list.append (out it); | ||
624 | 151 | Gdk.Pixbuf icon = null; | ||
625 | 152 | try{ | ||
626 | 153 | icon = IconTheme.get_default ().load_icon (contracts_dep[i].lookup ("IconName"), 32, 0); | ||
627 | 154 | }catch (Error e){ | ||
628 | 155 | warning (e.message); | ||
629 | 156 | } | ||
630 | 157 | list.set (it, 0, icon, 1, | ||
631 | 158 | "<b>"+contracts_dep[i].lookup ("Name")+"</b>\n"+contracts_dep[i].lookup ("Description")); | ||
632 | 159 | } | ||
633 | 160 | treeview.set_cursor (new TreePath.from_string ("0"), null, false); | ||
634 | 161 | } | ||
635 | 162 | } | ||
636 | 163 | #endif | ||
637 | 164 | private Gee.List<Granite.Services.Contract> contracts ; | ||
638 | 165 | private int contracts_size = 0 ; | ||
639 | 166 | |||
640 | 167 | private void execute_command (int index) { | ||
641 | 168 | if( index < contracts_size ) { | ||
642 | 169 | var contract = contracts.@get (index) ; | ||
643 | 170 | try{ | ||
644 | 171 | contract.execute_with_file (source) ; | ||
645 | 172 | }catch (Error e){ | ||
646 | 173 | warning (e.message); | ||
647 | 174 | } | ||
648 | 175 | } | ||
649 | 176 | else | ||
650 | 177 | save_file () ; | ||
651 | 178 | } | ||
652 | 179 | |||
653 | 180 | private void load_contracts () { | ||
654 | 181 | contracts_size = 0 ; | ||
655 | 182 | try{ | ||
656 | 183 | contracts = Granite.Services.ContractorProxy.get_contracts_by_mime ("video"); | ||
657 | 184 | }catch (Error e){ | ||
658 | 185 | warning (e.message); | ||
659 | 186 | } | ||
660 | 187 | if (contracts != null){ | ||
661 | 188 | |||
662 | 189 | contractor = true; | ||
663 | 190 | foreach( var contract in contracts ) { | ||
664 | 191 | TreeIter it; | ||
665 | 192 | list.append (out it); | ||
666 | 193 | Gdk.Pixbuf icon = null; | ||
667 | 194 | try{ | ||
668 | 195 | icon = IconTheme.get_default ().load_icon (contract.get_icon ().to_string (), 32, 0); | ||
669 | 196 | |||
670 | 197 | }catch (Error e){ | ||
671 | 198 | warning (e.message); | ||
672 | 199 | } | ||
673 | 200 | list.set (it, 0, icon, 1, | ||
674 | 201 | "<b>"+contract.get_display_name ()+"</b>\n"+contract.get_description ()); | ||
675 | 202 | contracts_size ++ ; | ||
676 | 203 | } | ||
677 | 204 | TreeIter it; | ||
678 | 205 | list.append (out it); | ||
679 | 206 | Gdk.Pixbuf icon = null; | ||
680 | 207 | try{ | ||
681 | 208 | icon = IconTheme.get_default ().load_icon ("document-save", 32, 0); | ||
682 | 209 | }catch (Error e){ | ||
683 | 210 | warning (e.message); | ||
684 | 211 | } | ||
685 | 212 | list.set (it, 0, icon, 1, | ||
686 | 213 | "<b>"+_("Save file")+"</b>\n"+("Save the file onto a disk")); | ||
687 | 214 | treeview.set_cursor (new TreePath.from_string (contracts_size.to_string ()), null, false); | ||
688 | 215 | export.label = _("Execute"); | ||
689 | 216 | } | ||
690 | 217 | if( contracts_size == 0 ) | ||
691 | 218 | { | ||
692 | 219 | warning ("You should install and/or run contractor"); | ||
693 | 220 | contractor = false; | ||
694 | 221 | var info = new InfoBar (); | ||
695 | 222 | info.message_type = MessageType.WARNING; | ||
696 | 223 | info.pack_start (new Label (_("Could not contact Contractor."))); | ||
697 | 224 | grid.attach (info, 0, 3, 2, 1); | ||
698 | 225 | export.label = _("Save"); | ||
699 | 226 | } | ||
700 | 120 | } | 227 | } |
701 | 121 | } | 228 | } |
702 | 122 | } | 229 | } |
703 | 123 | 230 | ||
704 | === modified file 'src/eidete.vala' | |||
705 | --- src/eidete.vala 2014-05-29 17:08:23 +0000 | |||
706 | +++ src/eidete.vala 2015-01-04 13:23:18 +0000 | |||
707 | @@ -1,4 +1,3 @@ | |||
708 | 1 | //valac --pkg gtk+-3.0 --pkg gstreamer-0.10 --pkg gstreamer-pbutils-0.10 --pkg granite screencast.vala | ||
709 | 2 | 1 | ||
710 | 3 | using Gst; | 2 | using Gst; |
711 | 4 | using Granite; | 3 | using Granite; |
712 | @@ -81,9 +80,8 @@ | |||
713 | 81 | public Window main_window; | 80 | public Window main_window; |
714 | 82 | public Eidete.Widgets.KeyView keyview; | 81 | public Eidete.Widgets.KeyView keyview; |
715 | 83 | public Eidete.Widgets.SelectionArea selectionarea; | 82 | public Eidete.Widgets.SelectionArea selectionarea; |
717 | 84 | public Granite.Widgets.StaticNotebook tabs; | 83 | public Gtk.Stack tabs; |
718 | 85 | public Grid pause_grid; | 84 | public Grid pause_grid; |
719 | 86 | public Image pause_icon; | ||
720 | 87 | public Wnck.Window win; | 85 | public Wnck.Window win; |
721 | 88 | public Gdk.Screen screen; | 86 | public Gdk.Screen screen; |
722 | 89 | public Gdk.Rectangle monitor_rec; | 87 | public Gdk.Rectangle monitor_rec; |
723 | @@ -125,12 +123,7 @@ | |||
724 | 125 | UI | 123 | UI |
725 | 126 | */ | 124 | */ |
726 | 127 | 125 | ||
733 | 128 | tabs = new Granite.Widgets.StaticNotebook (false); | 126 | tabs = new Gtk.Stack (); |
728 | 129 | tabs.margin = 12; | ||
729 | 130 | |||
730 | 131 | pause_icon = new Image.from_icon_name ("media-playback-pause", IconSize.DIALOG); | ||
731 | 132 | pause_icon.pixel_size = 64; | ||
732 | 133 | |||
734 | 134 | 127 | ||
735 | 135 | var grid = new Grid (); | 128 | var grid = new Grid (); |
736 | 136 | grid.column_spacing = 12; | 129 | grid.column_spacing = 12; |
737 | @@ -140,6 +133,7 @@ | |||
738 | 140 | var monitors_combo = new ComboBoxText (); | 133 | var monitors_combo = new ComboBoxText (); |
739 | 141 | monitors_combo.hexpand = true; | 134 | monitors_combo.hexpand = true; |
740 | 142 | for (var i=0;i<Gdk.Screen.get_default ().get_n_monitors (); i++) | 135 | for (var i=0;i<Gdk.Screen.get_default ().get_n_monitors (); i++) |
741 | 136 | // TODO proper translation here | ||
742 | 143 | monitors_combo.append (i.to_string (), _("Monitor")+" "+(i+1).to_string ()); | 137 | monitors_combo.append (i.to_string (), _("Monitor")+" "+(i+1).to_string ()); |
743 | 144 | monitors_combo.active = 0; | 138 | monitors_combo.active = 0; |
744 | 145 | if (Gdk.Screen.get_default ().get_n_monitors () == 1) | 139 | if (Gdk.Screen.get_default ().get_n_monitors () == 1) |
745 | @@ -148,12 +142,10 @@ | |||
746 | 148 | var width = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_width (), 1); | 142 | var width = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_width (), 1); |
747 | 149 | width.max_length = 4; | 143 | width.max_length = 4; |
748 | 150 | width.margin_left = 1; | 144 | width.margin_left = 1; |
749 | 151 | width.margin_right = -4; | ||
750 | 152 | 145 | ||
751 | 153 | var height = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_height (), 1); | 146 | var height = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_height (), 1); |
752 | 154 | height.max_length = 4; | 147 | height.max_length = 4; |
753 | 155 | height.margin_left = 1; | 148 | height.margin_left = 1; |
754 | 156 | height.margin_right = -4; | ||
755 | 157 | width.set_sensitive (false); | 149 | width.set_sensitive (false); |
756 | 158 | height.set_sensitive (false); | 150 | height.set_sensitive (false); |
757 | 159 | width.halign = Align.START; | 151 | width.halign = Align.START; |
758 | @@ -181,23 +173,24 @@ | |||
759 | 181 | audio_box.pack_start (use_audio, false, true, 0); | 173 | audio_box.pack_start (use_audio, false, true, 0); |
760 | 182 | audio_box.pack_start (audio_source, true, true, 0); | 174 | audio_box.pack_start (audio_source, true, true, 0); |
761 | 183 | 175 | ||
763 | 184 | var sound = new LLabel.markup ("<b>"+_("Sound")+":"+"</b>"); | 176 | var sound = new LLabel.markup ("<b>"+_("Sound")+"</b>"); |
764 | 185 | sound.margin_top = 18; | 177 | sound.margin_top = 18; |
765 | 186 | 178 | ||
767 | 187 | var video = new LLabel.markup ("<b>"+_("Video")+":"+"</b>"); | 179 | var video = new LLabel.markup ("<b>"+_("Video")+"</b>"); |
768 | 188 | video.margin_top = 12; | 180 | video.margin_top = 12; |
769 | 189 | 181 | ||
771 | 190 | var keyboard = new LLabel.markup ("<b>"+_("Keyboard")+":"+"</b>"); | 182 | var keyboard = new LLabel.markup ("<b>"+_("Keyboard")+"</b>"); |
772 | 191 | keyboard.margin_top = 18; | 183 | keyboard.margin_top = 18; |
773 | 192 | 184 | ||
775 | 193 | var mouse = new LLabel.markup ("<b>"+_("Mouse")+":"+"</b>"); | 185 | var mouse = new LLabel.markup ("<b>"+_("Mouse")+"</b>"); |
776 | 194 | mouse.margin_top = 12; | 186 | mouse.margin_top = 12; |
777 | 195 | 187 | ||
778 | 196 | var start_bt = new Button.with_label (_("Start Recording")); | 188 | var start_bt = new Button.with_label (_("Start Recording")); |
779 | 197 | start_bt.can_default = true; | 189 | start_bt.can_default = true; |
780 | 198 | start_bt.get_style_context ().add_class ("noundo"); | 190 | start_bt.get_style_context ().add_class ("noundo"); |
783 | 199 | 191 | start_bt.get_style_context ().add_class ("suggested-action"); | |
784 | 200 | var cancel_bt = new Button.from_stock (Stock.CANCEL); | 192 | |
785 | 193 | var cancel_bt = new Button.with_label (_("Cancel")); | ||
786 | 201 | 194 | ||
787 | 202 | var about_bt = new Button.with_label (_("About")); | 195 | var about_bt = new Button.with_label (_("About")); |
788 | 203 | about_bt.image = new Image.from_stock (Stock.ABOUT, IconSize.BUTTON); | 196 | about_bt.image = new Image.from_stock (Stock.ABOUT, IconSize.BUTTON); |
789 | @@ -212,7 +205,7 @@ | |||
790 | 212 | this.main_window.set_default (start_bt); | 205 | this.main_window.set_default (start_bt); |
791 | 213 | 206 | ||
792 | 214 | grid.attach ((sound), 0, 0, 1, 1); | 207 | grid.attach ((sound), 0, 0, 1, 1); |
794 | 215 | grid.attach (new LLabel.right (_("Record Computer Sounds")), 0, 1, 1, 1); | 208 | grid.attach (new LLabel.right (_("Record Computer Sounds")+":"), 0, 1, 1, 1); |
795 | 216 | grid.attach (use_comp_sounds, 1, 1, 1, 1); | 209 | grid.attach (use_comp_sounds, 1, 1, 1, 1); |
796 | 217 | grid.attach (new LLabel.right (_("Record from Microphone")+":"), 0, 2, 1, 1); | 210 | grid.attach (new LLabel.right (_("Record from Microphone")+":"), 0, 2, 1, 1); |
797 | 218 | grid.attach (audio_box, 1, 2, 1, 1); | 211 | grid.attach (audio_box, 1, 2, 1, 1); |
798 | @@ -258,10 +251,20 @@ | |||
799 | 258 | grid2.row_spacing = 6; | 251 | grid2.row_spacing = 6; |
800 | 259 | grid2.hexpand = true; | 252 | grid2.hexpand = true; |
801 | 260 | 253 | ||
806 | 261 | tabs.append_page (grid, new Label (_("Behavior"))); | 254 | tabs.add_titled (grid, "behavior", _("Behavior")); |
807 | 262 | tabs.append_page (grid2, new Label (_("Appearance"))); | 255 | tabs.add_titled (grid2, "apperance", _("Appearance")); |
808 | 263 | 256 | ||
809 | 264 | this.main_window.add (tabs); | 257 | var main_box = new Gtk.Grid (); |
810 | 258 | var stack_switcher = new Gtk.StackSwitcher (); | ||
811 | 259 | stack_switcher.stack = tabs; | ||
812 | 260 | stack_switcher.halign = Gtk.Align.CENTER; | ||
813 | 261 | |||
814 | 262 | main_box.attach (stack_switcher, 0, 0, 1, 1); | ||
815 | 263 | main_box.attach (tabs, 0, 1, 1, 1); | ||
816 | 264 | main_box.margin = 12; | ||
817 | 265 | |||
818 | 266 | this.main_window.add (main_box); | ||
819 | 267 | build_pause_ui () ; | ||
820 | 265 | this.main_window.show_all (); | 268 | this.main_window.show_all (); |
821 | 266 | this.main_window.present (); | 269 | this.main_window.present (); |
822 | 267 | 270 | ||
823 | @@ -353,11 +356,7 @@ | |||
824 | 353 | settings.audio = false; | 356 | settings.audio = false; |
825 | 354 | use_audio.toggled.connect ( () => { | 357 | use_audio.toggled.connect ( () => { |
826 | 355 | settings.audio = use_audio.active; | 358 | settings.audio = use_audio.active; |
832 | 356 | if (use_audio.active){ | 359 | audio_source.set_sensitive (use_audio.active); |
828 | 357 | audio_source.set_sensitive (true); | ||
829 | 358 | }else{ | ||
830 | 359 | audio_source.set_sensitive (false); | ||
831 | 360 | } | ||
833 | 361 | }); | 360 | }); |
834 | 362 | 361 | ||
835 | 363 | 362 | ||
836 | @@ -433,6 +432,12 @@ | |||
837 | 433 | 432 | ||
838 | 434 | Granite.Services.Logger.initialize ("Eidete"); | 433 | Granite.Services.Logger.initialize ("Eidete"); |
839 | 435 | Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.DEBUG; | 434 | Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.DEBUG; |
840 | 435 | uint major ; | ||
841 | 436 | uint minor ; | ||
842 | 437 | uint micro ; | ||
843 | 438 | uint nano ; | ||
844 | 439 | Gst.version (out major, out minor, out micro, out nano) ; | ||
845 | 440 | message ("GStreamer version: %u.%u.%u.%u", major, minor, micro, nano ) ; | ||
846 | 436 | } | 441 | } |
847 | 437 | 442 | ||
848 | 438 | public override void activate (){ | 443 | public override void activate (){ |
849 | @@ -451,7 +456,7 @@ | |||
850 | 451 | 456 | ||
851 | 452 | pause_grid = new Grid (); | 457 | pause_grid = new Grid (); |
852 | 453 | pause_grid.margin = 12; | 458 | pause_grid.margin = 12; |
854 | 454 | this.main_window.title = _("Recording paused"); | 459 | //this.main_window.title = _("Recording paused"); |
855 | 455 | 460 | ||
856 | 456 | 461 | ||
857 | 457 | var img_text_grid = new Grid (); | 462 | var img_text_grid = new Grid (); |
858 | @@ -477,6 +482,7 @@ | |||
859 | 477 | var stop_bt = new Button.with_label (_("Finish")); | 482 | var stop_bt = new Button.with_label (_("Finish")); |
860 | 478 | stop_bt.set_tooltip_text (_("Stop the recording and save the file")); | 483 | stop_bt.set_tooltip_text (_("Stop the recording and save the file")); |
861 | 479 | stop_bt.image = new Image.from_stock (Stock.APPLY, IconSize.BUTTON); | 484 | stop_bt.image = new Image.from_stock (Stock.APPLY, IconSize.BUTTON); |
862 | 485 | stop_bt.get_style_context ().add_class ("suggested-action"); | ||
863 | 480 | 486 | ||
864 | 481 | var cancel_bt = new Button.with_label (_("Cancel")); | 487 | var cancel_bt = new Button.with_label (_("Cancel")); |
865 | 482 | cancel_bt.set_tooltip_text (_("Cancel the recording without saving the file")); | 488 | cancel_bt.set_tooltip_text (_("Cancel the recording without saving the file")); |
866 | @@ -539,15 +545,25 @@ | |||
867 | 539 | } | 545 | } |
868 | 540 | 546 | ||
869 | 541 | pipeline = new Pipeline ("screencast-pipe"); | 547 | pipeline = new Pipeline ("screencast-pipe"); |
870 | 548 | |||
871 | 549 | #if GSTREAMER_0_10_IS_DEFINED | ||
872 | 542 | dynamic Element muxer = ElementFactory.make ("webmmux", "mux"); | 550 | dynamic Element muxer = ElementFactory.make ("webmmux", "mux"); |
873 | 543 | dynamic Element sink = ElementFactory.make ("filesink", "sink"); | 551 | dynamic Element sink = ElementFactory.make ("filesink", "sink"); |
875 | 544 | 552 | #else | |
876 | 553 | var muxer = ElementFactory.make ("webmmux", "mux"); | ||
877 | 554 | var sink = ElementFactory.make ("filesink", "sink"); | ||
878 | 555 | #endif | ||
879 | 545 | //video bin | 556 | //video bin |
880 | 546 | this.videobin = new Gst.Bin ("video"); | 557 | this.videobin = new Gst.Bin ("video"); |
881 | 547 | try { | 558 | try { |
885 | 548 | videobin = (Gst.Bin)parse_bin_from_description ( | 559 | #if GSTREAMER_0_10_IS_DEFINED |
886 | 549 | "ximagesrc name=\"videosrc\" ! video/x-raw-rgb, framerate=15/1 ! | 560 | videobin = (Gst.Bin)parse_bin_from_description ( |
887 | 550 | ffmpegcolorspace ! vp8enc name=\"encoder\" ! queue", true); | 561 | "ximagesrc name=\"videosrc\" ! video/x-raw-rgb, framerate=15/1 ! |
888 | 562 | ffmpegcolorspace ! vp8enc name=\"encoder\" ! queue", true); | ||
889 | 563 | #else | ||
890 | 564 | videobin = (Gst.Bin)parse_bin_from_description ( | ||
891 | 565 | "ximagesrc name=\"videosrc\" ! video/x-raw, framerate=24/1 ! videoconvert ! vp8enc name=\"encoder\" ! queue", true); | ||
892 | 566 | #endif | ||
893 | 551 | }catch (Error e){ stderr.printf ("Error: %s\n", e.message);} | 567 | }catch (Error e){ stderr.printf ("Error: %s\n", e.message);} |
894 | 552 | 568 | ||
895 | 553 | //audio bin | 569 | //audio bin |
896 | @@ -564,19 +580,32 @@ | |||
897 | 564 | }catch (Error e){warning (e.message);} | 580 | }catch (Error e){warning (e.message);} |
898 | 565 | 581 | ||
899 | 566 | //configure | 582 | //configure |
900 | 583 | assert( sink != null ) ; | ||
901 | 567 | sink.set ("location", settings.destination); | 584 | sink.set ("location", settings.destination); |
908 | 568 | videobin.get_by_name ("videosrc").set ("startx", this.settings.sx); | 585 | var src = videobin.get_by_name ("videosrc") ; |
909 | 569 | videobin.get_by_name ("videosrc").set ("starty", this.settings.sy); | 586 | assert (src != null) ; |
910 | 570 | videobin.get_by_name ("videosrc").set ("endx", this.settings.ex); | 587 | src.set ("startx", this.settings.sx); |
911 | 571 | videobin.get_by_name ("videosrc").set ("endy", this.settings.ey); | 588 | src.set ("starty", this.settings.sy); |
912 | 572 | videobin.get_by_name ("videosrc").set ("use-damage", false); | 589 | src.set ("endx", this.settings.ex); |
913 | 573 | videobin.get_by_name ("videosrc").set ("screen-num", this.settings.monitor); | 590 | src.set ("endy", this.settings.ey); |
914 | 591 | src.set ("use-damage", false); | ||
915 | 592 | src.set ("screen-num", this.settings.monitor); | ||
916 | 574 | 593 | ||
917 | 575 | //videobin.get_by_name ("encoder").set ("mode", 1); | 594 | //videobin.get_by_name ("encoder").set ("mode", 1); |
922 | 576 | videobin.get_by_name ("encoder").set ("quality", 8.0); | 595 | var encoder = videobin.get_by_name ("encoder") ; |
923 | 577 | videobin.get_by_name ("encoder").set ("speed", 6); | 596 | assert (encoder != null) ; |
924 | 578 | videobin.get_by_name ("encoder").set ("max-keyframe-distance", 150); | 597 | #if GSTREAMER_0_10_IS_DEFINED |
925 | 579 | videobin.get_by_name ("encoder").set ("threads", int.parse (cores.substring (2))); | 598 | encoder.set ("quality", 8.0); |
926 | 599 | encoder.set ("speed", 6); | ||
927 | 600 | encoder.set ("max-keyframe-distance", 150); | ||
928 | 601 | #else | ||
929 | 602 | // From these values see https://mail.gnome.org/archives/commits-list/2012-September/msg08183.html | ||
930 | 603 | encoder.set ("min_quantizer", 13); | ||
931 | 604 | encoder.set ("max_quantizer", 13); | ||
932 | 605 | encoder.set ("cpu-used", 5); | ||
933 | 606 | encoder.set ("deadline", 1000000); | ||
934 | 607 | #endif | ||
935 | 608 | encoder.set ("threads", int.parse (cores.substring (2))); | ||
936 | 580 | 609 | ||
937 | 581 | 610 | ||
938 | 582 | if (pipeline==null||muxer==null||sink==null||videobin==null||audiobin==null){ | 611 | if (pipeline==null||muxer==null||sink==null||videobin==null||audiobin==null){ |
939 | @@ -589,14 +618,28 @@ | |||
940 | 589 | pipeline.add_many (videobin, muxer, sink); | 618 | pipeline.add_many (videobin, muxer, sink); |
941 | 590 | 619 | ||
942 | 591 | 620 | ||
947 | 592 | videobin.get_static_pad ("src").link(muxer.get_request_pad ("video_%d")); | 621 | var video_pad = videobin.get_static_pad ("src") ; |
948 | 593 | if (settings.audio) | 622 | assert (video_pad != null ) ; |
949 | 594 | audiobin.get_static_pad ("src").link(muxer.get_request_pad ("audio_%d")); | 623 | #if GSTREAMER_0_10_IS_DEFINED |
950 | 595 | 624 | var m = muxer.get_request_pad ("video_%d") ; | |
951 | 625 | #else | ||
952 | 626 | var m = muxer.get_request_pad ("video_%u") ; | ||
953 | 627 | #endif | ||
954 | 628 | assert (m != null ) ; | ||
955 | 629 | video_pad.link(m); | ||
956 | 630 | if (settings.audio){ | ||
957 | 631 | #if GSTREAMER_0_10_IS_DEFINED | ||
958 | 632 | audiobin.get_static_pad ("src").link (muxer.get_request_pad ("audio_%d")); | ||
959 | 633 | #else | ||
960 | 634 | audiobin.get_static_pad ("src").link (muxer.get_request_pad ("audio_%u")); | ||
961 | 635 | #endif | ||
962 | 636 | } | ||
963 | 596 | muxer.link (sink); | 637 | muxer.link (sink); |
967 | 597 | 638 | #if GSTREAMER_0_10_IS_DEFINED | |
968 | 598 | pipeline.get_bus ().add_watch (bus_message_cb); | 639 | pipeline.get_bus ().add_watch (bus_message_cb); |
969 | 599 | 640 | #else | |
970 | 641 | pipeline.get_bus ().add_watch (Priority.DEFAULT, bus_message_cb); | ||
971 | 642 | #endif | ||
972 | 600 | pipeline.set_state (State.READY); | 643 | pipeline.set_state (State.READY); |
973 | 601 | 644 | ||
974 | 602 | if (selectionarea != null) | 645 | if (selectionarea != null) |
975 | @@ -620,7 +663,10 @@ | |||
976 | 620 | case Gst.MessageType.ERROR: | 663 | case Gst.MessageType.ERROR: |
977 | 621 | GLib.Error err; string debug; | 664 | GLib.Error err; string debug; |
978 | 622 | msg.parse_error (out err, out debug); | 665 | msg.parse_error (out err, out debug); |
980 | 623 | stderr.printf ("Error: %s\n", err.message); | 666 | |
981 | 667 | display_error ("Eidete encountered a gstreamer error while recording, creating a screencast is not possible:\n%s\n\n[%s]" | ||
982 | 668 | .printf (err.message, debug), true); | ||
983 | 669 | stderr.printf ("Error: %s\n", debug); | ||
984 | 624 | pipeline.set_state (State.NULL); | 670 | pipeline.set_state (State.NULL); |
985 | 625 | break; | 671 | break; |
986 | 626 | case Gst.MessageType.EOS: | 672 | case Gst.MessageType.EOS: |
987 | @@ -644,25 +690,51 @@ | |||
988 | 644 | 690 | ||
989 | 645 | if (to_normal){ | 691 | if (to_normal){ |
990 | 646 | this.main_window.title = _("Recording paused"); | 692 | this.main_window.title = _("Recording paused"); |
995 | 647 | this.main_window.remove (pause_icon); | 693 | remove_widget (tabs) ; |
996 | 648 | if (pause_grid == null) | 694 | add_widget (pause_grid) ; |
997 | 649 | this.build_pause_ui (); | 695 | |
994 | 650 | this.main_window.add (pause_grid); | ||
998 | 651 | this.main_window.icon_name = "eidete"; | 696 | this.main_window.icon_name = "eidete"; |
999 | 652 | this.app_icon = "eidete"; | 697 | this.app_icon = "eidete"; |
1002 | 653 | this.main_window.show_all (); | 698 | |
1001 | 654 | this.main_window.resize (1, 1); | ||
1003 | 655 | }else{ | 699 | }else{ |
1004 | 656 | this.main_window.title = _("Pause recording"); | 700 | this.main_window.title = _("Pause recording"); |
1010 | 657 | if (this.main_window.get_child () == tabs) | 701 | if (this.main_window.get_child () == tabs) { |
1011 | 658 | this.main_window.remove (tabs); | 702 | remove_widget (tabs) ; |
1012 | 659 | else | 703 | add_widget (pause_grid) ; |
1013 | 660 | this.main_window.remove (pause_grid); | 704 | } |
1009 | 661 | this.main_window.add (pause_icon); | ||
1014 | 662 | this.main_window.icon_name = "media-playback-pause"; | 705 | this.main_window.icon_name = "media-playback-pause"; |
1015 | 663 | this.app_icon = "media-playback-pause"; | 706 | this.app_icon = "media-playback-pause"; |
1017 | 664 | this.main_window.show_all (); | 707 | |
1018 | 665 | } | 708 | } |
1019 | 709 | this.main_window.show_all (); | ||
1020 | 710 | } | ||
1021 | 711 | private void remove_widget (Gtk.Widget widget) { | ||
1022 | 712 | if (this.main_window.get_child () == widget) | ||
1023 | 713 | this.main_window.remove (widget); | ||
1024 | 714 | } | ||
1025 | 715 | |||
1026 | 716 | private void add_widget (Gtk.Widget widget) { | ||
1027 | 717 | if (this.main_window.get_child () != widget) | ||
1028 | 718 | this.main_window.add (widget); | ||
1029 | 719 | } | ||
1030 | 720 | |||
1031 | 721 | /** | ||
1032 | 722 | * Displays an error dialog with the given message to the user | ||
1033 | 723 | * | ||
1034 | 724 | * @param error The message to display | ||
1035 | 725 | * @param fatal Quit eidete after the user dismissed the dialog | ||
1036 | 726 | */ | ||
1037 | 727 | private void display_error (string error, bool fatal) { | ||
1038 | 728 | var dialog = new Gtk.MessageDialog (main_window, Gtk.DialogFlags.MODAL, | ||
1039 | 729 | Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, error); | ||
1040 | 730 | dialog.show_all (); | ||
1041 | 731 | dialog.response.connect (() => { | ||
1042 | 732 | dialog.destroy (); | ||
1043 | 733 | |||
1044 | 734 | if (fatal) | ||
1045 | 735 | main_window.destroy (); | ||
1046 | 736 | }); | ||
1047 | 737 | dialog.run (); | ||
1048 | 666 | } | 738 | } |
1049 | 667 | } | 739 | } |
1050 | 668 | } | 740 | } |
1051 | @@ -692,4 +764,4 @@ | |||
1052 | 692 | eidete = new Eidete.EideteApp (); | 764 | eidete = new Eidete.EideteApp (); |
1053 | 693 | 765 | ||
1054 | 694 | return eidete.run (args); | 766 | return eidete.run (args); |
1055 | 695 | } | ||
1056 | 696 | \ No newline at end of file | 767 | \ No newline at end of file |
1057 | 768 | } | ||
1058 | 697 | 769 | ||
1059 | === modified file 'src/keycapture.c' | |||
1060 | --- src/keycapture.c 2012-04-04 00:02:38 +0000 | |||
1061 | +++ src/keycapture.c 2015-01-04 13:23:18 +0000 | |||
1062 | @@ -4,8 +4,12 @@ | |||
1063 | 4 | #include <X11/Xlib.h> | 4 | #include <X11/Xlib.h> |
1064 | 5 | #include <X11/XKBlib.h> | 5 | #include <X11/XKBlib.h> |
1065 | 6 | #include <X11/extensions/record.h> //libxtst-dev, Xtst | 6 | #include <X11/extensions/record.h> //libxtst-dev, Xtst |
1066 | 7 | #ifdef GSTREAMER_0_10_IS_DEFINED | ||
1067 | 7 | #include <gstreamer-0.10/gst/gst.h> | 8 | #include <gstreamer-0.10/gst/gst.h> |
1068 | 8 | #include <gstreamer-0.10/gst/gstinterface.h> | 9 | #include <gstreamer-0.10/gst/gstinterface.h> |
1069 | 10 | #else | ||
1070 | 11 | #include <gstreamer-1.0/gst/gst.h> | ||
1071 | 12 | #endif | ||
1072 | 9 | /* | 13 | /* |
1073 | 10 | GList *list_devices (){ | 14 | GList *list_devices (){ |
1074 | 11 | GstElement *pulsesrc = gst_element_factory_make ("pulsesrc", "src"); | 15 | GstElement *pulsesrc = gst_element_factory_make ("pulsesrc", "src"); |
1075 | 12 | 16 | ||
1076 | === modified file 'src/videobin_uploader.vala' | |||
1077 | --- src/videobin_uploader.vala 2012-01-03 12:54:48 +0000 | |||
1078 | +++ src/videobin_uploader.vala 2015-01-04 13:23:18 +0000 | |||
1079 | @@ -27,7 +27,7 @@ | |||
1080 | 27 | } | 27 | } |
1081 | 28 | 28 | ||
1082 | 29 | 29 | ||
1084 | 30 | public Uploader (string file){ | 30 | public Uploader (File file){ |
1085 | 31 | this.title = "Upload to videobin.org"; | 31 | this.title = "Upload to videobin.org"; |
1086 | 32 | this.set_default_size (300, 1); | 32 | this.set_default_size (300, 1); |
1087 | 33 | this.window_position = WindowPosition.CENTER; | 33 | this.window_position = WindowPosition.CENTER; |
1088 | @@ -38,21 +38,26 @@ | |||
1089 | 38 | grid.row_spacing = 5; | 38 | grid.row_spacing = 5; |
1090 | 39 | 39 | ||
1091 | 40 | var title = new Entry (); | 40 | var title = new Entry (); |
1092 | 41 | title.placeholder_text = _("Optional") ; | ||
1093 | 41 | var description = new Entry (); | 42 | var description = new Entry (); |
1094 | 43 | description.placeholder_text = _("Optional") ; | ||
1095 | 42 | var email = new Entry (); | 44 | var email = new Entry (); |
1096 | 45 | email.placeholder_text = _("Optional") ; | ||
1097 | 43 | var img = new Image.from_icon_name ("videobin", IconSize.DIALOG); | 46 | var img = new Image.from_icon_name ("videobin", IconSize.DIALOG); |
1098 | 44 | 47 | ||
1100 | 45 | var upload = new Button.with_label (_("Upload")); | 48 | var upload_button = new Button.with_label (_("Upload")); |
1101 | 49 | upload_button.get_style_context ().add_class ("suggested-action"); | ||
1102 | 46 | var cancel = new Button.from_stock (Stock.CANCEL); | 50 | var cancel = new Button.from_stock (Stock.CANCEL); |
1103 | 51 | cancel.margin_end = 6; | ||
1104 | 47 | 52 | ||
1105 | 48 | var bbox = new Box (Orientation.HORIZONTAL, 0); | 53 | var bbox = new Box (Orientation.HORIZONTAL, 0); |
1107 | 49 | bbox.pack_end (upload, false, true, 0); | 54 | bbox.pack_end (upload_button, false, true, 0); |
1108 | 50 | bbox.pack_end (cancel, false, true, 0); | 55 | bbox.pack_end (cancel, false, true, 0); |
1109 | 51 | 56 | ||
1114 | 52 | email.set_tooltip_text ("Your email address for relocating your videos"); | 57 | email.set_tooltip_text (_("Your email address for relocating your videos")); |
1115 | 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); |
1116 | 54 | upload.can_default = true; | 59 | upload_button.can_default = true; |
1117 | 55 | this.set_default (upload); | 60 | this.set_default (upload_button); |
1118 | 56 | 61 | ||
1119 | 57 | grid.attach (img, 0, 0, 1, 2); | 62 | grid.attach (img, 0, 0, 1, 2); |
1120 | 58 | grid.attach (new LLabel ("Title"), 1, 0, 1, 1); | 63 | grid.attach (new LLabel ("Title"), 1, 0, 1, 1); |
1121 | @@ -68,9 +73,12 @@ | |||
1122 | 68 | 73 | ||
1123 | 69 | cancel.clicked.connect (Gtk.main_quit); | 74 | cancel.clicked.connect (Gtk.main_quit); |
1124 | 70 | 75 | ||
1126 | 71 | upload.clicked.connect ( () => { | 76 | upload_button.clicked.connect ( () => { |
1127 | 72 | string url; | 77 | string url; |
1129 | 73 | string command = "curl -F\"api=1\" -F\"videoFile=@"+file+"\" "; | 78 | string path = file.get_path() ; |
1130 | 79 | if( path.has_prefix ("'") && path.has_suffix ("'")) | ||
1131 | 80 | path = path.substring (1, path.length-2) ; | ||
1132 | 81 | string command = "curl -F\"api=1\" -F\"videoFile=@"+path+"\" "; | ||
1133 | 74 | if (email.text != "") | 82 | if (email.text != "") |
1134 | 75 | command += "-F\"email="+email.text+"\" "; | 83 | command += "-F\"email="+email.text+"\" "; |
1135 | 76 | if (title.text != "") | 84 | if (title.text != "") |
1136 | @@ -78,11 +86,15 @@ | |||
1137 | 78 | if (description.text != "") | 86 | if (description.text != "") |
1138 | 79 | command += "-F\"description="+description.text+"\" "; | 87 | command += "-F\"description="+description.text+"\" "; |
1139 | 80 | command += "http://videobin.org/add"; | 88 | command += "http://videobin.org/add"; |
1140 | 81 | |||
1141 | 82 | try{ | 89 | try{ |
1142 | 83 | Process.spawn_command_line_sync (command, out url); | 90 | Process.spawn_command_line_sync (command, out url); |
1143 | 84 | }catch (Error e){error (e.message);} | 91 | }catch (Error e){error (e.message);} |
1144 | 85 | try{ | 92 | try{ |
1145 | 93 | if( url == null || url == "" ) | ||
1146 | 94 | { | ||
1147 | 95 | warning( "The upload has failed. Command: %s", command) ; | ||
1148 | 96 | } | ||
1149 | 97 | else | ||
1150 | 86 | Process.spawn_command_line_async ("sensible-browser "+url); | 98 | Process.spawn_command_line_async ("sensible-browser "+url); |
1151 | 87 | }catch (Error e){error (e.message);} | 99 | }catch (Error e){error (e.message);} |
1152 | 88 | Gtk.main_quit (); | 100 | Gtk.main_quit (); |
1153 | @@ -93,9 +105,17 @@ | |||
1154 | 93 | 105 | ||
1155 | 94 | public static void main (string [] args){ | 106 | public static void main (string [] args){ |
1156 | 95 | Gtk.init (ref args); | 107 | Gtk.init (ref args); |
1161 | 96 | var file = File.new_for_uri (args[1]); | 108 | if( args.length<=1) |
1162 | 97 | var u = new Uploader (file.get_path ()); | 109 | { |
1163 | 98 | u.show_all (); | 110 | warning ("You must provide a valid file path" ) ; |
1164 | 99 | Gtk.main (); | 111 | } |
1165 | 112 | else | ||
1166 | 113 | { | ||
1167 | 114 | var path = args[1] ; | ||
1168 | 115 | var file = File.new_for_path (path); | ||
1169 | 116 | var dialog = new Uploader (file); | ||
1170 | 117 | dialog.show_all (); | ||
1171 | 118 | Gtk.main (); | ||
1172 | 119 | } | ||
1173 | 100 | } | 120 | } |
1174 | 101 | 121 |