Merge lp:~name-is-carl/eidete/fix-for-freya into lp:eidete

Proposed by PerfectCarl
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
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)

To post a comment you must log in.
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-05-29 17:06:50 +0000
+++ CMakeLists.txt 2015-01-04 13:23:18 +0000
@@ -16,20 +16,44 @@
16set (PKGDATADIR "${DATADIR}/eidete")16set (PKGDATADIR "${DATADIR}/eidete")
17set (GETTEXT_PACKAGE "eidete")17set (GETTEXT_PACKAGE "eidete")
18set (RELEASE_NAME "Feature rich and functional.")18set (RELEASE_NAME "Feature rich and functional.")
19set (VERSION "0.1")19set (VERSION "0.2")
20set (VERSION_INFO "Release")20set (VERSION_INFO "Release")
21set (CMAKE_C_FLAGS "-ggdb")21set (CMAKE_C_FLAGS "-ggdb")
22set (PREFIX ${CMAKE_INSTALL_PREFIX})22set (PREFIX ${CMAKE_INSTALL_PREFIX})
23set (DOLLAR "$")23set (DOLLAR "$")
2424
25# Comment this out to enable C compiler warnings
26add_definitions (-w)
27
25list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)28list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
2629
30# Building for GStreamer 1.0 by default
31# Uncomment the following line to build for GStreamer 0.10
32# set (USE_GSTREAMER_0_10 "TRUE")
33
34if(DEFINED USE_GSTREAMER_0_10)
35 message ("-- Building eidete for GStreamer 0.10")
36 set(EXTRA_DEFINITIONS -DGSTREAMER_0_10_IS_DEFINED)
37 add_definitions(${EXTRA_DEFINITIONS})
38 set(GST_PACKAGES gstreamer-interfaces-0.10 gstreamer-0.10 gstreamer-pbutils-0.10)
39else ()
40 message ("-- Building eidete for GStreamer 1.0")
41 set(GST_PACKAGES gstreamer-1.0 gstreamer-pbutils-1.0)
42endif ()
43
27configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala)44configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala)
28add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DWNCK_I_KNOW_THIS_IS_UNSTABLE `pkg-config --cflags --libs gstreamer-interfaces-0.10`)45add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DWNCK_I_KNOW_THIS_IS_UNSTABLE)
2946
30find_package(PkgConfig)47find_package(PkgConfig)
31pkg_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)48pkg_check_modules(DEPS REQUIRED gtk+-3.0>=3.10
49 libwnck-3.0
50 granite
51 xtst
52 gdk-x11-3.0
53 x11
54 ${GST_PACKAGES})
3255
56# TEST
33add_definitions(${DEPS_CFLAGS})57add_definitions(${DEPS_CFLAGS})
3458
35link_libraries(${DEPS_LIBRARIES})59link_libraries(${DEPS_LIBRARIES})
@@ -40,6 +64,7 @@
40ensure_vala_version("0.16.0" MINIMUM)64ensure_vala_version("0.16.0" MINIMUM)
4165
42include(ValaPrecompile)66include(ValaPrecompile)
67
43vala_precompile(VALA_C68vala_precompile(VALA_C
44 src/eidete.vala69 src/eidete.vala
45 src/Widgets/countdown.vala70 src/Widgets/countdown.vala
@@ -51,15 +76,14 @@
51PACKAGES76PACKAGES
52 granite77 granite
53 gtk+-3.078 gtk+-3.0
54 gstreamer-0.1079 ${GST_PACKAGES}
55 gstreamer-pbutils-0.10
56 gstreamer-interfaces-0.10
57 libwnck-3.080 libwnck-3.0
58 gdk-x11-3.081 gdk-x11-3.0
59OPTIONS82OPTIONS
60 -X -lXtst83 -X -lXtst
61 --thread84 --thread
62 --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/85 --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/
86 ${EXTRA_DEFINITIONS}
63 )87 )
6488
65vala_precompile(VALA_C_VIDEOBIN89vala_precompile(VALA_C_VIDEOBIN
@@ -79,4 +103,4 @@
79install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/eidete.desktop DESTINATION share/applications)103install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/eidete.desktop DESTINATION share/applications)
80install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/eidete.svg DESTINATION share/icons/hicolor/48x48/apps)104install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/eidete.svg DESTINATION share/icons/hicolor/48x48/apps)
81install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/videobin.svg DESTINATION share/icons/hicolor/48x48/apps)105install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/videobin.svg DESTINATION share/icons/hicolor/48x48/apps)
82install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/videobin.contract DESTINATION ${CMAKE_INSTALL_PREFIX}/share/contractor)
83\ No newline at end of file106\ No newline at end of file
107install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/videobin.contract DESTINATION ${CMAKE_INSTALL_PREFIX}/share/contractor)
84108
=== added file 'README'
--- README 1970-01-01 00:00:00 +0000
+++ README 2015-01-04 13:23:18 +0000
@@ -0,0 +1,22 @@
1## Introduction
2
3A simple screencasting app for the elementary project
4
5Current Features
6- encoding to webm
7- selection of the area to be recorded
8- display of the pressed keys
9- audio recording
10
11For more information go to: https://launchpad.net/eidete
12
13## How to build
14Install dependencies
15 sudo apt-get build-dep eidete
16OR
17 sudo apt-get build-dep granite-demo
18 sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
19
20 mkdir build && cd build
21 cmake -DCMAKE_INSTALL_PREFIX=/usr ../
22 make
023
=== modified file 'po/eidete.pot'
--- po/eidete.pot 2013-05-17 20:02:58 +0000
+++ po/eidete.pot 2015-01-04 13:23:18 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2013-05-17 23:02+0300\n"11"POT-Creation-Date: 2015-01-04 12:47+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,183 +17,198 @@
17"Content-Type: text/plain; charset=CHARSET\n"17"Content-Type: text/plain; charset=CHARSET\n"
18"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
1919
20#: /home/kristjan/translations/po/../src/desktop_launcher.vala:520#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:140
21msgid "Record screencasts"
22msgstr ""
23
24#: /home/kristjan/translations/po/../src/desktop_launcher.vala:6
25msgid "Screencaster"
26msgstr ""
27
28#: /home/kristjan/translations/po/../src/videobin_uploader.vala:45
29msgid "Upload"
30msgstr ""
31
32#: /home/kristjan/translations/po/../src/savedialog.vala:8
33#: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:28
34#: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:64
35#: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:100
36msgid "Save"
37msgstr ""
38
39#: /home/kristjan/translations/po/../src/eidete.vala:138
40msgid "Monitor"21msgid "Monitor"
41msgstr ""22msgstr ""
4223
43#: /home/kristjan/translations/po/../src/eidete.vala:15824#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:160
44msgid "Fullscreen"25msgid "Fullscreen"
45msgstr ""26msgstr ""
4627
47#: /home/kristjan/translations/po/../src/eidete.vala:15928#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:161
48msgid "Custom"29msgid "Custom"
49msgstr ""30msgstr ""
5031
51#: /home/kristjan/translations/po/../src/eidete.vala:17032#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:172
52msgid "Default"33msgid "Default"
53msgstr ""34msgstr ""
5435
55#: /home/kristjan/translations/po/../src/eidete.vala:17936#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:181
56msgid "Sound"37msgid "Sound"
57msgstr ""38msgstr ""
5839
59#: /home/kristjan/translations/po/../src/eidete.vala:18240#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:184
60msgid "Video"41msgid "Video"
61msgstr ""42msgstr ""
6243
63#: /home/kristjan/translations/po/../src/eidete.vala:18544#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:187
64msgid "Keyboard"45msgid "Keyboard"
65msgstr ""46msgstr ""
6647
67#: /home/kristjan/translations/po/../src/eidete.vala:18848#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:190
68msgid "Mouse"49msgid "Mouse"
69msgstr ""50msgstr ""
7051
71#: /home/kristjan/translations/po/../src/eidete.vala:19152#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:193
72msgid "Start Recording"53msgid "Start Recording"
73msgstr ""54msgstr ""
7455
75#: /home/kristjan/translations/po/../src/eidete.vala:19756#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:199
76msgid "About"57msgid "About"
77msgstr ""58msgstr ""
7859
79#: /home/kristjan/translations/po/../src/eidete.vala:21060#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:212
80msgid "Record Computer Sounds"61msgid "Record Computer Sounds"
81msgstr ""62msgstr ""
8263
83#: /home/kristjan/translations/po/../src/eidete.vala:21264#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:214
84msgid "Record from Microphone"65msgid "Record from Microphone"
85msgstr ""66msgstr ""
8667
87#: /home/kristjan/translations/po/../src/eidete.vala:21568#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:217
88msgid "Record from Monitor"69msgid "Record from Monitor"
89msgstr ""70msgstr ""
9071
91#: /home/kristjan/translations/po/../src/eidete.vala:21772#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:219
92msgid "Recording Area"73msgid "Recording Area"
93msgstr ""74msgstr ""
9475
95#: /home/kristjan/translations/po/../src/eidete.vala:21976#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:221
96msgid "Width"77msgid "Width"
97msgstr ""78msgstr ""
9879
99#: /home/kristjan/translations/po/../src/eidete.vala:22180#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:223
100msgid "Height"81msgid "Height"
101msgstr ""82msgstr ""
10283
103#: /home/kristjan/translations/po/../src/eidete.vala:24584#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:247
104msgid "Pressed keys on screen"85msgid "Pressed keys on screen"
105msgstr ""86msgstr ""
10687
107#: /home/kristjan/translations/po/../src/eidete.vala:24888#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:250
108msgid "Mouse clicks on screen"89msgid "Mouse clicks on screen"
109msgstr ""90msgstr ""
11091
111#: /home/kristjan/translations/po/../src/eidete.vala:25092#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:252
112msgid "Circle around the cursor"93msgid "Circle around the cursor"
113msgstr ""94msgstr ""
11495
115#: /home/kristjan/translations/po/../src/eidete.vala:25696#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:258
116msgid "Behavior"97msgid "Behavior"
117msgstr ""98msgstr ""
11899
119#: /home/kristjan/translations/po/../src/eidete.vala:257100#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:259
120msgid "Appearance"101msgid "Appearance"
121msgstr ""102msgstr ""
122103
123#: /home/kristjan/translations/po/../src/eidete.vala:449104#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:461
124#: /home/kristjan/translations/po/../src/eidete.vala:456105#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:682
125#: /home/kristjan/translations/po/../src/eidete.vala:641
126msgid "Recording paused"106msgid "Recording paused"
127msgstr ""107msgstr ""
128108
129#: /home/kristjan/translations/po/../src/eidete.vala:459109#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:464
130msgid "You can continue or finish the recording now"110msgid "You can continue or finish the recording now"
131msgstr ""111msgstr ""
132112
133#: /home/kristjan/translations/po/../src/eidete.vala:468113#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:473
134msgid "Continue"114msgid "Continue"
135msgstr ""115msgstr ""
136116
137#: /home/kristjan/translations/po/../src/eidete.vala:469117#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:474
138msgid "Continue recording"118msgid "Continue recording"
139msgstr ""119msgstr ""
140120
141#: /home/kristjan/translations/po/../src/eidete.vala:472121#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:477
142msgid "Finish"122msgid "Finish"
143msgstr ""123msgstr ""
144124
145#: /home/kristjan/translations/po/../src/eidete.vala:473125#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:478
146msgid "Stop the recording and save the file"126msgid "Stop the recording and save the file"
147msgstr ""127msgstr ""
148128
149#: /home/kristjan/translations/po/../src/eidete.vala:476129#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:481
130#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:50
150msgid "Cancel"131msgid "Cancel"
151msgstr ""132msgstr ""
152133
153#: /home/kristjan/translations/po/../src/eidete.vala:477134#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:482
154msgid "Cancel the recording without saving the file"135msgid "Cancel the recording without saving the file"
155msgstr ""136msgstr ""
156137
157#: /home/kristjan/translations/po/../src/eidete.vala:651138#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:690
158msgid "Pause recording"139msgid "Pause recording"
159msgstr ""140msgstr ""
160141
161#: /home/kristjan/translations/po/../src/eidete.vala:671142#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:719
162msgid "Pause Recording"143msgid "Pause Recording"
163msgstr ""144msgstr ""
164145
165#: /home/kristjan/translations/po/../src/eidete.vala:672146#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/eidete.vala:720
166msgid "Finish Recording"147msgid "Finish Recording"
167msgstr ""148msgstr ""
168149
169#: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:24150#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/desktop_launcher.vala:5
151msgid "Record screencasts"
152msgstr ""
153
154#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/desktop_launcher.vala:6
155msgid "Screencaster"
156msgstr ""
157
158#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:40
170msgid "Recording complete"159msgid "Recording complete"
171msgstr ""160msgstr ""
172161
173#: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:33162#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:44
174msgid "Don't save"163#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:107
175msgstr ""164#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:146
176165#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:226
177#: /home/kristjan/translations/po/../src/Widgets/end_dialog.vala:62166msgid "Save"
178msgid "Could not contact Contractor. Click the Save button to save the file."167msgstr ""
179msgstr ""168
180169#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:144
181#: /home/kristjan/translations/po/../src/Widgets/keyview.vala:48170#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:224
171msgid "Could not contact Contractor."
172msgstr ""
173
174#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:214
175msgid "Save file"
176msgstr ""
177
178#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/end_dialog.vala:216
179msgid "Execute"
180msgstr ""
181
182#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/countdown.vala:27
183msgid "Recording starts in"
184msgstr ""
185
186#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/countdown.vala:34
187msgid "Focus Eidete to stop recording"
188msgstr ""
189
190#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/keyview.vala:48
182msgid "Left"191msgid "Left"
183msgstr ""192msgstr ""
184193
185#: /home/kristjan/translations/po/../src/Widgets/keyview.vala:51194#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/keyview.vala:51
186msgid "Middle"195msgid "Middle"
187msgstr ""196msgstr ""
188197
189#: /home/kristjan/translations/po/../src/Widgets/keyview.vala:54198#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/Widgets/keyview.vala:54
190msgid "Right"199msgid "Right"
191msgstr ""200msgstr ""
192201
193#: /home/kristjan/translations/po/../src/Widgets/countdown.vala:27202#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:41
194msgid "Recording starts in"203#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:43
195msgstr ""204#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:45
196205msgid "Optional"
197#: /home/kristjan/translations/po/../src/Widgets/countdown.vala:34206msgstr ""
198msgid "Focus Eidete to stop recording"207
208#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:48
209msgid "Upload"
210msgstr ""
211
212#: /home/cran/Documents/Projects/elementary/eidete/fix-for-freya/po/../src/videobin_uploader.vala:57
213msgid "Your email address for relocating your videos"
199msgstr ""214msgstr ""
200215
=== modified file 'src/Widgets/end_dialog.vala'
--- src/Widgets/end_dialog.vala 2013-05-15 15:57:25 +0000
+++ src/Widgets/end_dialog.vala 2015-01-04 13:23:18 +0000
@@ -1,37 +1,54 @@
1using Gtk;1using Gtk;
22
3
4namespace Eidete.Widgets {3namespace Eidete.Widgets {
54
6 private bool contractor;5 public class EndDialog : Dialog {
76
8 public class EndDialog : Window {7 private bool contractor;
8
9 private EideteApp app ;
10 private Button export ;
11 private Grid grid;
12 private ListStore list ;
13 private TreeView treeview ;
14 private File source ;
15
9 public EndDialog (EideteApp app){16 public EndDialog (EideteApp app){
17 this.app = app ;
18 build_ui () ;
19 this.window_position = WindowPosition.CENTER;
20 }
21
22 private void build_ui () {
23 this.get_header_bar ().get_style_context ().remove_class ("header-bar");
10 this.set_default_size (400, 200);24 this.set_default_size (400, 200);
1125 this.resizable = false;
12 this.set_application (app);26 this.set_application (app);
1327
14 if (app.selectionarea != null)28 if (app.selectionarea != null)
15 app.selectionarea.destroy ();29 app.selectionarea.destroy ();
16 if (app.keyview != null)30 if (app.keyview != null)
17 app.keyview.destroy ();31 app.keyview.destroy ();
18 this.window_position = WindowPosition.CENTER;32
19 this.icon_name = "eidete";33 this.icon_name = "eidete";
2034
21 var grid = new Grid ();35 grid = new Grid ();
22 grid.margin = 12;36 grid.margin = 12;
2337
38 var content = (Gtk.Box) this.get_content_area () ;
24 var title = new Label ("<span size='30000'>"+_("Recording complete")+"</span>");39 var title = new Label ("<span size='30000'>"+_("Recording complete")+"</span>");
25 title.use_markup = true;40 title.use_markup = true;
26 title.halign = Align.START;41 title.halign = Align.START;
2742
28 var export = new Button.with_label (_("Save"));43 export = new Button.with_label (_("Save"));
29 export.image = new Image.from_stock (Stock.SAVE, IconSize.BUTTON);44 export.image = new Image.from_stock (Stock.SAVE, IconSize.BUTTON);
30 export.can_default = true;45 export.can_default = true;
46 export.get_style_context ().add_class ("suggested-action");
31 this.set_default (export);47 this.set_default (export);
3248
33 var cancel = new Button.with_label (_("Don't save"));49 var cancel = new Button.with_label (_("Cancel"));
34 cancel.image = new Image.from_stock (Stock.DELETE, IconSize.BUTTON);50 cancel.image = new Image.from_stock (Stock.DELETE, IconSize.BUTTON);
51 cancel.margin_end = 6;
35 cancel.halign = Align.END;52 cancel.halign = Align.END;
3653
37 var bbox = new ButtonBox (Orientation.HORIZONTAL);54 var bbox = new ButtonBox (Orientation.HORIZONTAL);
@@ -39,84 +56,174 @@
39 bbox.pack_end (export, false, true, 0);56 bbox.pack_end (export, false, true, 0);
40 bbox.layout_style = ButtonBoxStyle.END;57 bbox.layout_style = ButtonBoxStyle.END;
4158
42 //contractor59
43 var list = new ListStore (2, typeof (Gdk.Pixbuf), typeof (string));60 list = new ListStore (2, typeof (Gdk.Pixbuf), typeof (string));
44 var t = new TreeView.with_model (list);61 treeview = new TreeView.with_model (list);
45 t.headers_visible = false;62 treeview.headers_visible = false;
46 t.hexpand = true;63 treeview.hexpand = true;
64 treeview.set_activate_on_single_click (false) ;
65 treeview.row_activated.connect ( on_contract_executed) ;
4766
48 var cell1 = new CellRendererPixbuf ();67 var cell1 = new CellRendererPixbuf ();
49 cell1.set_padding (5, 15);68 cell1.set_padding (5, 15);
50 t.insert_column_with_attributes (-1, "", cell1, "pixbuf", 0);69 treeview.insert_column_with_attributes (-1, "", cell1, "pixbuf", 0);
51 var cell2 = new CellRendererText ();70 var cell2 = new CellRendererText ();
52 cell2.set_padding (2, 15);71 cell2.set_padding (2, 15);
53 t.insert_column_with_attributes (-1, "", cell2, "markup", 1);72 treeview.insert_column_with_attributes (-1, "", cell2, "markup", 1);
5473
5574 //contractor
56 var c = Granite.Services.Contractor.get_contract (app.settings.destination, "video");75 load_contracts () ;
57 if (c == null || c.length <= 1){
58 warning ("You should install and/or run contractor");
59 contractor = false;
60 var info = new InfoBar ();
61 info.message_type = MessageType.WARNING;
62 info.pack_start (new Label (_("Could not contact Contractor. Click the Save button to save the file.")));
63 grid.attach (info, 0, 3, 2, 1);
64 export.label = _("Save");
65 }else{
66 contractor = true;
67 for (var i=0;i<c.length; i++){
68 TreeIter it;
69 list.append (out it);
70 Gdk.Pixbuf icon = null;
71 try{
72 icon = IconTheme.get_default ().load_icon (c[i].lookup ("IconName"), 32, 0);
73 }catch (Error e){warning (e.message);}
74 list.set (it, 0, icon, 1,
75 "<b>"+c[i].lookup ("Name")+"</b>\n"+c[i].lookup ("Description"));
76 }
77 t.set_cursor (new TreePath.from_string ("0"), null, false);
78 }
7976
80 grid.attach (title, 0, 0, 2, 1);77 grid.attach (title, 0, 0, 2, 1);
81 grid.attach (new Label (""), 0, 2, 1, 1);78 grid.attach (new Label (""), 0, 2, 1, 1);
82 grid.attach (t, 0, 4, 1, 1);79 grid.attach (treeview, 0, 4, 1, 1);
83 grid.attach (new Label (""), 0, 5, 1, 1);80 grid.attach (new Label (""), 0, 5, 1, 1);
84 grid.attach (bbox, 0, 6, 1, 1);81 grid.attach (bbox, 0, 6, 1, 1);
8582 source = File.new_for_path (app.settings.destination);
83
86 if (contractor){84 if (contractor){
87 export.clicked.connect ( () => {85 export.clicked.connect (on_contract_executed) ;
88 TreePath path;
89 t.get_cursor (out path, null);
90 try{
91 Process.spawn_command_line_async (c[int.parse (path.to_string ())].lookup ("Exec"));
92 }catch (Error e){
93 print(e.message);
94 }
95 this.destroy ();
96 });
97 } else {86 } else {
98 export.clicked.connect ( () => {87 export.clicked.connect ( () => {
99 var source = File.new_for_path (app.settings.destination);88 save_file () ;
100 var file = new FileChooserDialog (_("Save"), null, FileChooserAction.SAVE, Stock.OK, ResponseType.OK);89 this.destroy ();
101 file.set_current_name (source.get_basename ());90 });
102 file.do_overwrite_confirmation = true;
103 var res = file.run ();
104 if (res == ResponseType.OK){
105 var destination = File.new_for_path (file.get_filename ());
106 try{
107 source.copy (destination, FileCopyFlags.OVERWRITE);
108 }catch (GLib.Error e){stderr.printf ("Error: %s\n", e.message);}
109
110 file.destroy ();
111 this.destroy ();
112 }else{
113 file.destroy ();
114 }
115 });
116 }91 }
117 cancel.clicked.connect ( () => {this.destroy ();});92 cancel.clicked.connect ( () => {this.destroy ();});
11893
119 this.add (grid);94 content.add (grid);
95 }
96
97 private void on_contract_executed () {
98 TreePath path;
99 treeview.get_cursor (out path, null);
100 int index = int.parse (path.to_string ()) ;
101 execute_command (index) ;
102 this.destroy ();
103 }
104
105 private void save_file () {
106 var dialog = new FileChooserDialog (_("Save"), null, FileChooserAction.SAVE, Stock.OK, ResponseType.OK);
107 dialog.set_current_name (source.get_basename ());
108 var videos_folder = Environment.get_user_special_dir(UserDirectory.VIDEOS);
109 dialog.set_current_folder (videos_folder);
110 dialog.do_overwrite_confirmation = true;
111 var res = dialog.run ();
112 if (res == ResponseType.OK){
113 var destination = File.new_for_path (dialog.get_filename ());
114 try{
115 source.copy (destination, FileCopyFlags.OVERWRITE);
116 }catch (GLib.Error e){
117 stderr.printf ("Error: %s\n", e.message);
118 }
119 }
120 dialog.destroy ();
121 }
122 // Using deprecated Contractor API. Necesserary to maintain luna compatibility
123#if false
124 private void execute_command_deprecated (int index) {
125 string cmd = contracts_dep[index].lookup ("Exec") ;
126 try{
127 Process.spawn_command_line_async (cmd);
128 }catch (Error e){
129 print(e.message);
130 }
131 }
132
133 private HashTable<string,string>[] contracts_dep ;
134
135 private void load_contracts_deprecated () {
136 // CARL deprecated Contractor API
137 contracts_dep = Granite.Services.Contractor.get_contract (app.settings.destination, "video");
138 if (contracts_dep == null || contracts_dep.length <= 1){
139 warning ("You should install and/or run contractor");
140 contractor = false;
141 var info = new InfoBar ();
142 info.message_type = MessageType.WARNING;
143 info.pack_start (new Label (_("Could not contact Contractor.")));
144 grid.attach (info, 0, 3, 2, 1);
145 export.label = _("Save");
146 }else{
147 contractor = true;
148 for (var i=0;i<contracts_dep.length; i++){
149 TreeIter it;
150 list.append (out it);
151 Gdk.Pixbuf icon = null;
152 try{
153 icon = IconTheme.get_default ().load_icon (contracts_dep[i].lookup ("IconName"), 32, 0);
154 }catch (Error e){
155 warning (e.message);
156 }
157 list.set (it, 0, icon, 1,
158 "<b>"+contracts_dep[i].lookup ("Name")+"</b>\n"+contracts_dep[i].lookup ("Description"));
159 }
160 treeview.set_cursor (new TreePath.from_string ("0"), null, false);
161 }
162 }
163#endif
164 private Gee.List<Granite.Services.Contract> contracts ;
165 private int contracts_size = 0 ;
166
167 private void execute_command (int index) {
168 if( index < contracts_size ) {
169 var contract = contracts.@get (index) ;
170 try{
171 contract.execute_with_file (source) ;
172 }catch (Error e){
173 warning (e.message);
174 }
175 }
176 else
177 save_file () ;
178 }
179
180 private void load_contracts () {
181 contracts_size = 0 ;
182 try{
183 contracts = Granite.Services.ContractorProxy.get_contracts_by_mime ("video");
184 }catch (Error e){
185 warning (e.message);
186 }
187 if (contracts != null){
188
189 contractor = true;
190 foreach( var contract in contracts ) {
191 TreeIter it;
192 list.append (out it);
193 Gdk.Pixbuf icon = null;
194 try{
195 icon = IconTheme.get_default ().load_icon (contract.get_icon ().to_string (), 32, 0);
196
197 }catch (Error e){
198 warning (e.message);
199 }
200 list.set (it, 0, icon, 1,
201 "<b>"+contract.get_display_name ()+"</b>\n"+contract.get_description ());
202 contracts_size ++ ;
203 }
204 TreeIter it;
205 list.append (out it);
206 Gdk.Pixbuf icon = null;
207 try{
208 icon = IconTheme.get_default ().load_icon ("document-save", 32, 0);
209 }catch (Error e){
210 warning (e.message);
211 }
212 list.set (it, 0, icon, 1,
213 "<b>"+_("Save file")+"</b>\n"+("Save the file onto a disk"));
214 treeview.set_cursor (new TreePath.from_string (contracts_size.to_string ()), null, false);
215 export.label = _("Execute");
216 }
217 if( contracts_size == 0 )
218 {
219 warning ("You should install and/or run contractor");
220 contractor = false;
221 var info = new InfoBar ();
222 info.message_type = MessageType.WARNING;
223 info.pack_start (new Label (_("Could not contact Contractor.")));
224 grid.attach (info, 0, 3, 2, 1);
225 export.label = _("Save");
226 }
120 }227 }
121 }228 }
122}229}
123230
=== modified file 'src/eidete.vala'
--- src/eidete.vala 2014-05-29 17:08:23 +0000
+++ src/eidete.vala 2015-01-04 13:23:18 +0000
@@ -1,4 +1,3 @@
1//valac --pkg gtk+-3.0 --pkg gstreamer-0.10 --pkg gstreamer-pbutils-0.10 --pkg granite screencast.vala
21
3using Gst;2using Gst;
4using Granite;3using Granite;
@@ -81,9 +80,8 @@
81 public Window main_window;80 public Window main_window;
82 public Eidete.Widgets.KeyView keyview;81 public Eidete.Widgets.KeyView keyview;
83 public Eidete.Widgets.SelectionArea selectionarea;82 public Eidete.Widgets.SelectionArea selectionarea;
84 public Granite.Widgets.StaticNotebook tabs;83 public Gtk.Stack tabs;
85 public Grid pause_grid;84 public Grid pause_grid;
86 public Image pause_icon;
87 public Wnck.Window win;85 public Wnck.Window win;
88 public Gdk.Screen screen;86 public Gdk.Screen screen;
89 public Gdk.Rectangle monitor_rec;87 public Gdk.Rectangle monitor_rec;
@@ -125,12 +123,7 @@
125 UI123 UI
126 */124 */
127125
128 tabs = new Granite.Widgets.StaticNotebook (false);126 tabs = new Gtk.Stack ();
129 tabs.margin = 12;
130
131 pause_icon = new Image.from_icon_name ("media-playback-pause", IconSize.DIALOG);
132 pause_icon.pixel_size = 64;
133
134127
135 var grid = new Grid ();128 var grid = new Grid ();
136 grid.column_spacing = 12;129 grid.column_spacing = 12;
@@ -140,6 +133,7 @@
140 var monitors_combo = new ComboBoxText ();133 var monitors_combo = new ComboBoxText ();
141 monitors_combo.hexpand = true;134 monitors_combo.hexpand = true;
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++)
136 // TODO proper translation here
143 monitors_combo.append (i.to_string (), _("Monitor")+" "+(i+1).to_string ());137 monitors_combo.append (i.to_string (), _("Monitor")+" "+(i+1).to_string ());
144 monitors_combo.active = 0;138 monitors_combo.active = 0;
145 if (Gdk.Screen.get_default ().get_n_monitors () == 1)139 if (Gdk.Screen.get_default ().get_n_monitors () == 1)
@@ -148,12 +142,10 @@
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);
149 width.max_length = 4;143 width.max_length = 4;
150 width.margin_left = 1;144 width.margin_left = 1;
151 width.margin_right = -4;
152145
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);
154 height.max_length = 4;147 height.max_length = 4;
155 height.margin_left = 1;148 height.margin_left = 1;
156 height.margin_right = -4;
157 width.set_sensitive (false);149 width.set_sensitive (false);
158 height.set_sensitive (false);150 height.set_sensitive (false);
159 width.halign = Align.START;151 width.halign = Align.START;
@@ -181,23 +173,24 @@
181 audio_box.pack_start (use_audio, false, true, 0);173 audio_box.pack_start (use_audio, false, true, 0);
182 audio_box.pack_start (audio_source, true, true, 0);174 audio_box.pack_start (audio_source, true, true, 0);
183175
184 var sound = new LLabel.markup ("<b>"+_("Sound")+":"+"</b>");176 var sound = new LLabel.markup ("<b>"+_("Sound")+"</b>");
185 sound.margin_top = 18;177 sound.margin_top = 18;
186178
187 var video = new LLabel.markup ("<b>"+_("Video")+":"+"</b>");179 var video = new LLabel.markup ("<b>"+_("Video")+"</b>");
188 video.margin_top = 12;180 video.margin_top = 12;
189181
190 var keyboard = new LLabel.markup ("<b>"+_("Keyboard")+":"+"</b>");182 var keyboard = new LLabel.markup ("<b>"+_("Keyboard")+"</b>");
191 keyboard.margin_top = 18;183 keyboard.margin_top = 18;
192184
193 var mouse = new LLabel.markup ("<b>"+_("Mouse")+":"+"</b>");185 var mouse = new LLabel.markup ("<b>"+_("Mouse")+"</b>");
194 mouse.margin_top = 12;186 mouse.margin_top = 12;
195187
196 var start_bt = new Button.with_label (_("Start Recording"));188 var start_bt = new Button.with_label (_("Start Recording"));
197 start_bt.can_default = true;189 start_bt.can_default = true;
198 start_bt.get_style_context ().add_class ("noundo");190 start_bt.get_style_context ().add_class ("noundo");
199191 start_bt.get_style_context ().add_class ("suggested-action");
200 var cancel_bt = new Button.from_stock (Stock.CANCEL);192
193 var cancel_bt = new Button.with_label (_("Cancel"));
201194
202 var about_bt = new Button.with_label (_("About"));195 var about_bt = new Button.with_label (_("About"));
203 about_bt.image = new Image.from_stock (Stock.ABOUT, IconSize.BUTTON);196 about_bt.image = new Image.from_stock (Stock.ABOUT, IconSize.BUTTON);
@@ -212,7 +205,7 @@
212 this.main_window.set_default (start_bt);205 this.main_window.set_default (start_bt);
213206
214 grid.attach ((sound), 0, 0, 1, 1);207 grid.attach ((sound), 0, 0, 1, 1);
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);
216 grid.attach (use_comp_sounds, 1, 1, 1, 1);209 grid.attach (use_comp_sounds, 1, 1, 1, 1);
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);
218 grid.attach (audio_box, 1, 2, 1, 1);211 grid.attach (audio_box, 1, 2, 1, 1);
@@ -258,10 +251,20 @@
258 grid2.row_spacing = 6;251 grid2.row_spacing = 6;
259 grid2.hexpand = true;252 grid2.hexpand = true;
260253
261 tabs.append_page (grid, new Label (_("Behavior")));254 tabs.add_titled (grid, "behavior", _("Behavior"));
262 tabs.append_page (grid2, new Label (_("Appearance")));255 tabs.add_titled (grid2, "apperance", _("Appearance"));
263256
264 this.main_window.add (tabs);257 var main_box = new Gtk.Grid ();
258 var stack_switcher = new Gtk.StackSwitcher ();
259 stack_switcher.stack = tabs;
260 stack_switcher.halign = Gtk.Align.CENTER;
261
262 main_box.attach (stack_switcher, 0, 0, 1, 1);
263 main_box.attach (tabs, 0, 1, 1, 1);
264 main_box.margin = 12;
265
266 this.main_window.add (main_box);
267 build_pause_ui () ;
265 this.main_window.show_all ();268 this.main_window.show_all ();
266 this.main_window.present ();269 this.main_window.present ();
267270
@@ -353,11 +356,7 @@
353 settings.audio = false;356 settings.audio = false;
354 use_audio.toggled.connect ( () => {357 use_audio.toggled.connect ( () => {
355 settings.audio = use_audio.active;358 settings.audio = use_audio.active;
356 if (use_audio.active){359 audio_source.set_sensitive (use_audio.active);
357 audio_source.set_sensitive (true);
358 }else{
359 audio_source.set_sensitive (false);
360 }
361 });360 });
362361
363362
@@ -433,6 +432,12 @@
433432
434 Granite.Services.Logger.initialize ("Eidete");433 Granite.Services.Logger.initialize ("Eidete");
435 Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.DEBUG;434 Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.DEBUG;
435 uint major ;
436 uint minor ;
437 uint micro ;
438 uint nano ;
439 Gst.version (out major, out minor, out micro, out nano) ;
440 message ("GStreamer version: %u.%u.%u.%u", major, minor, micro, nano ) ;
436 }441 }
437442
438 public override void activate (){443 public override void activate (){
@@ -451,7 +456,7 @@
451456
452 pause_grid = new Grid ();457 pause_grid = new Grid ();
453 pause_grid.margin = 12;458 pause_grid.margin = 12;
454 this.main_window.title = _("Recording paused");459 //this.main_window.title = _("Recording paused");
455460
456461
457 var img_text_grid = new Grid ();462 var img_text_grid = new Grid ();
@@ -477,6 +482,7 @@
477 var stop_bt = new Button.with_label (_("Finish"));482 var stop_bt = new Button.with_label (_("Finish"));
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"));
479 stop_bt.image = new Image.from_stock (Stock.APPLY, IconSize.BUTTON);484 stop_bt.image = new Image.from_stock (Stock.APPLY, IconSize.BUTTON);
485 stop_bt.get_style_context ().add_class ("suggested-action");
480486
481 var cancel_bt = new Button.with_label (_("Cancel"));487 var cancel_bt = new Button.with_label (_("Cancel"));
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"));
@@ -539,15 +545,25 @@
539 }545 }
540546
541 pipeline = new Pipeline ("screencast-pipe");547 pipeline = new Pipeline ("screencast-pipe");
548
549 #if GSTREAMER_0_10_IS_DEFINED
542 dynamic Element muxer = ElementFactory.make ("webmmux", "mux");550 dynamic Element muxer = ElementFactory.make ("webmmux", "mux");
543 dynamic Element sink = ElementFactory.make ("filesink", "sink");551 dynamic Element sink = ElementFactory.make ("filesink", "sink");
544552 #else
553 var muxer = ElementFactory.make ("webmmux", "mux");
554 var sink = ElementFactory.make ("filesink", "sink");
555 #endif
545 //video bin556 //video bin
546 this.videobin = new Gst.Bin ("video");557 this.videobin = new Gst.Bin ("video");
547 try {558 try {
548 videobin = (Gst.Bin)parse_bin_from_description (559 #if GSTREAMER_0_10_IS_DEFINED
549 "ximagesrc name=\"videosrc\" ! video/x-raw-rgb, framerate=15/1 !560 videobin = (Gst.Bin)parse_bin_from_description (
550 ffmpegcolorspace ! vp8enc name=\"encoder\" ! queue", true);561 "ximagesrc name=\"videosrc\" ! video/x-raw-rgb, framerate=15/1 !
562 ffmpegcolorspace ! vp8enc name=\"encoder\" ! queue", true);
563 #else
564 videobin = (Gst.Bin)parse_bin_from_description (
565 "ximagesrc name=\"videosrc\" ! video/x-raw, framerate=24/1 ! videoconvert ! vp8enc name=\"encoder\" ! queue", true);
566 #endif
551 }catch (Error e){ stderr.printf ("Error: %s\n", e.message);}567 }catch (Error e){ stderr.printf ("Error: %s\n", e.message);}
552568
553 //audio bin569 //audio bin
@@ -564,19 +580,32 @@
564 }catch (Error e){warning (e.message);}580 }catch (Error e){warning (e.message);}
565581
566 //configure582 //configure
583 assert( sink != null ) ;
567 sink.set ("location", settings.destination);584 sink.set ("location", settings.destination);
568 videobin.get_by_name ("videosrc").set ("startx", this.settings.sx);585 var src = videobin.get_by_name ("videosrc") ;
569 videobin.get_by_name ("videosrc").set ("starty", this.settings.sy);586 assert (src != null) ;
570 videobin.get_by_name ("videosrc").set ("endx", this.settings.ex);587 src.set ("startx", this.settings.sx);
571 videobin.get_by_name ("videosrc").set ("endy", this.settings.ey);588 src.set ("starty", this.settings.sy);
572 videobin.get_by_name ("videosrc").set ("use-damage", false);589 src.set ("endx", this.settings.ex);
573 videobin.get_by_name ("videosrc").set ("screen-num", this.settings.monitor);590 src.set ("endy", this.settings.ey);
591 src.set ("use-damage", false);
592 src.set ("screen-num", this.settings.monitor);
574593
575 //videobin.get_by_name ("encoder").set ("mode", 1);594 //videobin.get_by_name ("encoder").set ("mode", 1);
576 videobin.get_by_name ("encoder").set ("quality", 8.0);595 var encoder = videobin.get_by_name ("encoder") ;
577 videobin.get_by_name ("encoder").set ("speed", 6);596 assert (encoder != null) ;
578 videobin.get_by_name ("encoder").set ("max-keyframe-distance", 150);597 #if GSTREAMER_0_10_IS_DEFINED
579 videobin.get_by_name ("encoder").set ("threads", int.parse (cores.substring (2)));598 encoder.set ("quality", 8.0);
599 encoder.set ("speed", 6);
600 encoder.set ("max-keyframe-distance", 150);
601 #else
602 // From these values see https://mail.gnome.org/archives/commits-list/2012-September/msg08183.html
603 encoder.set ("min_quantizer", 13);
604 encoder.set ("max_quantizer", 13);
605 encoder.set ("cpu-used", 5);
606 encoder.set ("deadline", 1000000);
607 #endif
608 encoder.set ("threads", int.parse (cores.substring (2)));
580609
581610
582 if (pipeline==null||muxer==null||sink==null||videobin==null||audiobin==null){611 if (pipeline==null||muxer==null||sink==null||videobin==null||audiobin==null){
@@ -589,14 +618,28 @@
589 pipeline.add_many (videobin, muxer, sink);618 pipeline.add_many (videobin, muxer, sink);
590619
591620
592 videobin.get_static_pad ("src").link(muxer.get_request_pad ("video_%d"));621 var video_pad = videobin.get_static_pad ("src") ;
593 if (settings.audio)622 assert (video_pad != null ) ;
594 audiobin.get_static_pad ("src").link(muxer.get_request_pad ("audio_%d"));623 #if GSTREAMER_0_10_IS_DEFINED
595624 var m = muxer.get_request_pad ("video_%d") ;
625 #else
626 var m = muxer.get_request_pad ("video_%u") ;
627 #endif
628 assert (m != null ) ;
629 video_pad.link(m);
630 if (settings.audio){
631 #if GSTREAMER_0_10_IS_DEFINED
632 audiobin.get_static_pad ("src").link (muxer.get_request_pad ("audio_%d"));
633 #else
634 audiobin.get_static_pad ("src").link (muxer.get_request_pad ("audio_%u"));
635 #endif
636 }
596 muxer.link (sink);637 muxer.link (sink);
597638 #if GSTREAMER_0_10_IS_DEFINED
598 pipeline.get_bus ().add_watch (bus_message_cb);639 pipeline.get_bus ().add_watch (bus_message_cb);
599640 #else
641 pipeline.get_bus ().add_watch (Priority.DEFAULT, bus_message_cb);
642 #endif
600 pipeline.set_state (State.READY);643 pipeline.set_state (State.READY);
601644
602 if (selectionarea != null)645 if (selectionarea != null)
@@ -620,7 +663,10 @@
620 case Gst.MessageType.ERROR:663 case Gst.MessageType.ERROR:
621 GLib.Error err; string debug;664 GLib.Error err; string debug;
622 msg.parse_error (out err, out debug);665 msg.parse_error (out err, out debug);
623 stderr.printf ("Error: %s\n", err.message);666
667 display_error ("Eidete encountered a gstreamer error while recording, creating a screencast is not possible:\n%s\n\n[%s]"
668 .printf (err.message, debug), true);
669 stderr.printf ("Error: %s\n", debug);
624 pipeline.set_state (State.NULL);670 pipeline.set_state (State.NULL);
625 break;671 break;
626 case Gst.MessageType.EOS:672 case Gst.MessageType.EOS:
@@ -644,25 +690,51 @@
644690
645 if (to_normal){691 if (to_normal){
646 this.main_window.title = _("Recording paused");692 this.main_window.title = _("Recording paused");
647 this.main_window.remove (pause_icon);693 remove_widget (tabs) ;
648 if (pause_grid == null)694 add_widget (pause_grid) ;
649 this.build_pause_ui ();695
650 this.main_window.add (pause_grid);
651 this.main_window.icon_name = "eidete";696 this.main_window.icon_name = "eidete";
652 this.app_icon = "eidete";697 this.app_icon = "eidete";
653 this.main_window.show_all ();698
654 this.main_window.resize (1, 1);
655 }else{699 }else{
656 this.main_window.title = _("Pause recording");700 this.main_window.title = _("Pause recording");
657 if (this.main_window.get_child () == tabs)701 if (this.main_window.get_child () == tabs) {
658 this.main_window.remove (tabs);702 remove_widget (tabs) ;
659 else703 add_widget (pause_grid) ;
660 this.main_window.remove (pause_grid);704 }
661 this.main_window.add (pause_icon);
662 this.main_window.icon_name = "media-playback-pause";705 this.main_window.icon_name = "media-playback-pause";
663 this.app_icon = "media-playback-pause";706 this.app_icon = "media-playback-pause";
664 this.main_window.show_all ();707
665 }708 }
709 this.main_window.show_all ();
710 }
711 private void remove_widget (Gtk.Widget widget) {
712 if (this.main_window.get_child () == widget)
713 this.main_window.remove (widget);
714 }
715
716 private void add_widget (Gtk.Widget widget) {
717 if (this.main_window.get_child () != widget)
718 this.main_window.add (widget);
719 }
720
721 /**
722 * Displays an error dialog with the given message to the user
723 *
724 * @param error The message to display
725 * @param fatal Quit eidete after the user dismissed the dialog
726 */
727 private void display_error (string error, bool fatal) {
728 var dialog = new Gtk.MessageDialog (main_window, Gtk.DialogFlags.MODAL,
729 Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, error);
730 dialog.show_all ();
731 dialog.response.connect (() => {
732 dialog.destroy ();
733
734 if (fatal)
735 main_window.destroy ();
736 });
737 dialog.run ();
666 }738 }
667 }739 }
668}740}
@@ -692,4 +764,4 @@
692 eidete = new Eidete.EideteApp ();764 eidete = new Eidete.EideteApp ();
693765
694 return eidete.run (args);766 return eidete.run (args);
695}
696\ No newline at end of file767\ No newline at end of file
768}
697769
=== modified file 'src/keycapture.c'
--- src/keycapture.c 2012-04-04 00:02:38 +0000
+++ src/keycapture.c 2015-01-04 13:23:18 +0000
@@ -4,8 +4,12 @@
4#include <X11/Xlib.h>4#include <X11/Xlib.h>
5#include <X11/XKBlib.h>5#include <X11/XKBlib.h>
6#include <X11/extensions/record.h> //libxtst-dev, Xtst6#include <X11/extensions/record.h> //libxtst-dev, Xtst
7#ifdef GSTREAMER_0_10_IS_DEFINED
7#include <gstreamer-0.10/gst/gst.h>8#include <gstreamer-0.10/gst/gst.h>
8#include <gstreamer-0.10/gst/gstinterface.h>9#include <gstreamer-0.10/gst/gstinterface.h>
10#else
11#include <gstreamer-1.0/gst/gst.h>
12#endif
9/*13/*
10GList *list_devices (){14GList *list_devices (){
11 GstElement *pulsesrc = gst_element_factory_make ("pulsesrc", "src");15 GstElement *pulsesrc = gst_element_factory_make ("pulsesrc", "src");
1216
=== modified file 'src/videobin_uploader.vala'
--- src/videobin_uploader.vala 2012-01-03 12:54:48 +0000
+++ src/videobin_uploader.vala 2015-01-04 13:23:18 +0000
@@ -27,7 +27,7 @@
27 }27 }
28 28
29 29
30 public Uploader (string file){30 public Uploader (File file){
31 this.title = "Upload to videobin.org";31 this.title = "Upload to videobin.org";
32 this.set_default_size (300, 1);32 this.set_default_size (300, 1);
33 this.window_position = WindowPosition.CENTER;33 this.window_position = WindowPosition.CENTER;
@@ -38,21 +38,26 @@
38 grid.row_spacing = 5;38 grid.row_spacing = 5;
39 39
40 var title = new Entry ();40 var title = new Entry ();
41 title.placeholder_text = _("Optional") ;
41 var description = new Entry ();42 var description = new Entry ();
43 description.placeholder_text = _("Optional") ;
42 var email = new Entry ();44 var email = new Entry ();
45 email.placeholder_text = _("Optional") ;
43 var img = new Image.from_icon_name ("videobin", IconSize.DIALOG);46 var img = new Image.from_icon_name ("videobin", IconSize.DIALOG);
44 47
45 var upload = new Button.with_label (_("Upload"));48 var upload_button = new Button.with_label (_("Upload"));
49 upload_button.get_style_context ().add_class ("suggested-action");
46 var cancel = new Button.from_stock (Stock.CANCEL);50 var cancel = new Button.from_stock (Stock.CANCEL);
51 cancel.margin_end = 6;
47 52
48 var bbox = new Box (Orientation.HORIZONTAL, 0);53 var bbox = new Box (Orientation.HORIZONTAL, 0);
49 bbox.pack_end (upload, false, true, 0);54 bbox.pack_end (upload_button, false, true, 0);
50 bbox.pack_end (cancel, false, true, 0);55 bbox.pack_end (cancel, false, true, 0);
51 56
52 email.set_tooltip_text ("Your email address for relocating your videos");57 email.set_tooltip_text (_("Your email address for relocating your videos"));
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);
54 upload.can_default = true;59 upload_button.can_default = true;
55 this.set_default (upload);60 this.set_default (upload_button);
56 61
57 grid.attach (img, 0, 0, 1, 2);62 grid.attach (img, 0, 0, 1, 2);
58 grid.attach (new LLabel ("Title"), 1, 0, 1, 1);63 grid.attach (new LLabel ("Title"), 1, 0, 1, 1);
@@ -68,9 +73,12 @@
68 73
69 cancel.clicked.connect (Gtk.main_quit);74 cancel.clicked.connect (Gtk.main_quit);
70 75
71 upload.clicked.connect ( () => {76 upload_button.clicked.connect ( () => {
72 string url;77 string url;
73 string command = "curl -F\"api=1\" -F\"videoFile=@"+file+"\" ";78 string path = file.get_path() ;
79 if( path.has_prefix ("'") && path.has_suffix ("'"))
80 path = path.substring (1, path.length-2) ;
81 string command = "curl -F\"api=1\" -F\"videoFile=@"+path+"\" ";
74 if (email.text != "")82 if (email.text != "")
75 command += "-F\"email="+email.text+"\" ";83 command += "-F\"email="+email.text+"\" ";
76 if (title.text != "")84 if (title.text != "")
@@ -78,11 +86,15 @@
78 if (description.text != "")86 if (description.text != "")
79 command += "-F\"description="+description.text+"\" ";87 command += "-F\"description="+description.text+"\" ";
80 command += "http://videobin.org/add";88 command += "http://videobin.org/add";
81
82 try{89 try{
83 Process.spawn_command_line_sync (command, out url);90 Process.spawn_command_line_sync (command, out url);
84 }catch (Error e){error (e.message);}91 }catch (Error e){error (e.message);}
85 try{92 try{
93 if( url == null || url == "" )
94 {
95 warning( "The upload has failed. Command: %s", command) ;
96 }
97 else
86 Process.spawn_command_line_async ("sensible-browser "+url);98 Process.spawn_command_line_async ("sensible-browser "+url);
87 }catch (Error e){error (e.message);}99 }catch (Error e){error (e.message);}
88 Gtk.main_quit ();100 Gtk.main_quit ();
@@ -93,9 +105,17 @@
93105
94public static void main (string [] args){106public static void main (string [] args){
95 Gtk.init (ref args);107 Gtk.init (ref args);
96 var file = File.new_for_uri (args[1]);108 if( args.length<=1)
97 var u = new Uploader (file.get_path ());109 {
98 u.show_all ();110 warning ("You must provide a valid file path" ) ;
99 Gtk.main ();111 }
112 else
113 {
114 var path = args[1] ;
115 var file = File.new_for_path (path);
116 var dialog = new Uploader (file);
117 dialog.show_all ();
118 Gtk.main ();
119 }
100}120}
101121

Subscribers

People subscribed via source and target branches