Merge lp:~elementary-apps/eidete/fix-for-freya into lp:eidete

Proposed by Tom Beckmann
Status: Merged
Approved by: PerfectCarl
Approved revision: 207
Merged at revision: 176
Proposed branch: lp:~elementary-apps/eidete/fix-for-freya
Merge into: lp:eidete
Diff against target: 1635 lines (+700/-415)
9 files modified
CMakeLists.txt (+32/-8)
README (+22/-0)
po/eidete.pot (+87/-72)
src/Widgets/end_dialog.vala (+192/-76)
src/Widgets/keyview.vala (+177/-167)
src/Widgets/selectionarea.vala (+14/-11)
src/eidete.vala (+136/-67)
src/keycapture.c (+6/-0)
src/videobin_uploader.vala (+34/-14)
To merge this branch: bzr merge lp:~elementary-apps/eidete/fix-for-freya
Reviewer Review Type Date Requested Status
PerfectCarl (community) Approve
Review via email: mp+245513@code.launchpad.net

Commit message

Make eidete work for elementary freya:
   - port it to gstreamer 1.0
   - fix contractors
   - fix video-bin (though videobin.org doesn't support webm files anymore)
   - update styling
   - update pot
   - fix misc issues

Note: the project is still compatible with gstreamer 0.10 and luna (see makefile for more info)

Description of the change

Make eidete work for elementary freya: fixing issues and port it to gstreamer 1.0.
The project is still compatible with gstreamer 0.10 (see makefile for more info)

(this is a more public (in terms of access rights) copy of the original 314 compatibility branch)

To post a comment you must log in.
205. By Tom Beckmann

fix a bunch of compiler warnings

206. By PerfectCarl

Fix the pause windows

207. By PerfectCarl

Fix size issues

Revision history for this message
PerfectCarl (name-is-carl) wrote :

Approved

review: Approve

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 16:20:24 +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 --enable-experimental
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 16:20:24 +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 16:20:24 +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 16:20:24 +0000
@@ -1,122 +1,238 @@
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){
10 this.set_default_size (400, 200);17 this.app = app ;
18 //build_ui () ;
19 this.window_position = WindowPosition.CENTER_ON_PARENT;
20 }
1121
22 private void build_ui () {
23 this.get_header_bar ().get_style_context ().remove_class ("header-bar");
24 this.set_default_size (600, 600);
12 this.set_application (app);25 this.set_application (app);
1326
14 if (app.selectionarea != null)27 if (app.selectionarea != null)
15 app.selectionarea.destroy ();28 app.selectionarea.destroy ();
16 if (app.keyview != null)29 if (app.keyview != null)
17 app.keyview.destroy ();30 app.keyview.destroy ();
18 this.window_position = WindowPosition.CENTER;31
19 this.icon_name = "eidete";32 this.icon_name = "eidete";
2033
21 var grid = new Grid ();34 grid = new Grid ();
22 grid.margin = 12;35 grid.margin = 12;
2336
37 var content = (Gtk.Box) this.get_content_area () ;
24 var title = new Label ("<span size='30000'>"+_("Recording complete")+"</span>");38 var title = new Label ("<span size='30000'>"+_("Recording complete")+"</span>");
25 title.use_markup = true;39 title.use_markup = true;
26 title.halign = Align.START;40 title.halign = Align.START;
2741
28 var export = new Button.with_label (_("Save"));42 export = new Button.with_label (_("Save"));
29 export.image = new Image.from_stock (Stock.SAVE, IconSize.BUTTON);43 export.image = new Image.from_stock (Stock.SAVE, IconSize.BUTTON);
30 export.can_default = true;44 export.can_default = true;
45 export.get_style_context ().add_class ("suggested-action");
31 this.set_default (export);46 this.set_default (export);
3247
33 var cancel = new Button.with_label (_("Don't save"));48 var cancel = new Button.with_label (_("Cancel"));
34 cancel.image = new Image.from_stock (Stock.DELETE, IconSize.BUTTON);49 cancel.image = new Image.from_stock (Stock.DELETE, IconSize.BUTTON);
35 cancel.halign = Align.END;50 cancel.margin_end = 6;
3651
37 var bbox = new ButtonBox (Orientation.HORIZONTAL);52 var bbox = new ButtonBox (Orientation.HORIZONTAL);
53 bbox.homogeneous = true;
38 bbox.pack_end (cancel, false, true, 0);54 bbox.pack_end (cancel, false, true, 0);
39 bbox.pack_end (export, false, true, 0);55 bbox.pack_end (export, false, true, 0);
40 bbox.layout_style = ButtonBoxStyle.END;56 bbox.layout_style = ButtonBoxStyle.END;
4157
42 //contractor58
43 var list = new ListStore (2, typeof (Gdk.Pixbuf), typeof (string));59 list = new ListStore (2, typeof (Gdk.Pixbuf), typeof (string));
44 var t = new TreeView.with_model (list);60 treeview = new TreeView.with_model (list);
45 t.headers_visible = false;61 treeview.headers_visible = false;
46 t.hexpand = true;62 treeview.hexpand = true;
63 treeview.set_activate_on_single_click (false) ;
64 treeview.row_activated.connect ( on_contract_executed) ;
4765
48 var cell1 = new CellRendererPixbuf ();66 var cell1 = new CellRendererPixbuf ();
49 cell1.set_padding (5, 15);67 cell1.set_padding (5, 15);
50 t.insert_column_with_attributes (-1, "", cell1, "pixbuf", 0);68 treeview.insert_column_with_attributes (-1, "", cell1, "pixbuf", 0);
51 var cell2 = new CellRendererText ();69 var cell2 = new CellRendererText ();
52 cell2.set_padding (2, 15);70 cell2.set_padding (2, 15);
53 t.insert_column_with_attributes (-1, "", cell2, "markup", 1);71 treeview.insert_column_with_attributes (-1, "", cell2, "markup", 1);
5472
5573 //contractor
56 var c = Granite.Services.Contractor.get_contract (app.settings.destination, "video");74 load_contracts () ;
57 if (c == null || c.length <= 1){75
58 warning ("You should install and/or run contractor");76 var scrolled = new Gtk.ScrolledWindow (null, null);
59 contractor = false;77 scrolled.vexpand = true;
60 var info = new InfoBar ();78 scrolled.add (treeview);
61 info.message_type = MessageType.WARNING;79
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 }
79
80 grid.attach (title, 0, 0, 2, 1);80 grid.attach (title, 0, 0, 2, 1);
81 grid.attach (new Label (""), 0, 2, 1, 1);81 grid.attach (new Label (""), 0, 2, 1, 1);
82 grid.attach (t, 0, 4, 1, 1);82 grid.attach (scrolled, 0, 4, 1, 1);
83 grid.attach (new Label (""), 0, 5, 1, 1);83 grid.attach (new Label (""), 0, 5, 1, 1);
84 grid.attach (bbox, 0, 6, 1, 1);84 grid.attach (bbox, 0, 6, 1, 1);
8585 source = File.new_for_path (app.settings.destination);
86
86 if (contractor){87 if (contractor){
87 export.clicked.connect ( () => {88 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 {89 } else {
98 export.clicked.connect ( () => {90 export.clicked.connect ( () => {
99 var source = File.new_for_path (app.settings.destination);91 save_file () ;
100 var file = new FileChooserDialog (_("Save"), null, FileChooserAction.SAVE, Stock.OK, ResponseType.OK);92 this.destroy ();
101 file.set_current_name (source.get_basename ());93 });
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 }94 }
117 cancel.clicked.connect ( () => {this.destroy ();});95 cancel.clicked.connect ( () => {this.destroy ();});
11896
119 this.add (grid);97 content.add (grid);
98 }
99
100 public void display () {
101 build_ui () ;
102 show_all () ;
103 }
104
105 private void on_contract_executed () {
106 TreePath path;
107 treeview.get_cursor (out path, null);
108 int index = int.parse (path.to_string ()) ;
109 execute_command (index) ;
110 this.destroy ();
111 }
112
113 private void save_file () {
114 var dialog = new FileChooserDialog (_("Save"), null, FileChooserAction.SAVE, Stock.OK, ResponseType.OK);
115 dialog.set_current_name (source.get_basename ());
116 var videos_folder = Environment.get_user_special_dir(UserDirectory.VIDEOS);
117 dialog.set_current_folder (videos_folder);
118 dialog.do_overwrite_confirmation = true;
119 var res = dialog.run ();
120 if (res == ResponseType.OK){
121 var destination = File.new_for_path (dialog.get_filename ());
122 try{
123 source.copy (destination, FileCopyFlags.OVERWRITE);
124 }catch (GLib.Error e){
125 stderr.printf ("Error: %s\n", e.message);
126 }
127 }
128 dialog.destroy ();
129 }
130 // Using deprecated Contractor API. Necesserary to maintain luna compatibility
131#if false
132 private void execute_command_deprecated (int index) {
133 string cmd = contracts_dep[index].lookup ("Exec") ;
134 try{
135 Process.spawn_command_line_async (cmd);
136 }catch (Error e){
137 print(e.message);
138 }
139 }
140
141 private HashTable<string,string>[] contracts_dep ;
142
143 private void load_contracts_deprecated () {
144 // CARL deprecated Contractor API
145 contracts_dep = Granite.Services.Contractor.get_contract (app.settings.destination, "video");
146 if (contracts_dep == null || contracts_dep.length <= 1){
147 warning ("You should install and/or run contractor");
148 contractor = false;
149 var info = new InfoBar ();
150 info.message_type = MessageType.WARNING;
151 info.pack_start (new Label (_("Could not contact Contractor.")));
152 grid.attach (info, 0, 3, 2, 1);
153 export.label = _("Save");
154 }else{
155 contractor = true;
156 for (var i=0;i<contracts_dep.length; i++){
157 TreeIter it;
158 list.append (out it);
159 Gdk.Pixbuf icon = null;
160 try{
161 icon = IconTheme.get_default ().load_icon (contracts_dep[i].lookup ("IconName"), 32, 0);
162 }catch (Error e){
163 warning (e.message);
164 }
165 list.set (it, 0, icon, 1,
166 "<b>"+contracts_dep[i].lookup ("Name")+"</b>\n"+contracts_dep[i].lookup ("Description"));
167 }
168 treeview.set_cursor (new TreePath.from_string ("0"), null, false);
169 }
170 }
171#endif
172 private Gee.List<Granite.Services.Contract> contracts ;
173 private int contracts_size = 0 ;
174
175 private void execute_command (int index) {
176 if( index == 0)
177 save_file () ;
178 else {
179 var contract = contracts.@get (index-1) ;
180 try{
181 contract.execute_with_file (source) ;
182 }catch (Error e){
183 warning (e.message);
184 }
185 }
186
187 }
188
189 private void load_contracts () {
190 contracts_size = 0 ;
191 try{
192 contracts = Granite.Services.ContractorProxy.get_contracts_by_mime ("video");
193 }catch (Error e){
194 warning (e.message);
195 }
196 if (contracts != null){
197
198 contractor = true;
199 foreach( var contract in contracts ) {
200 TreeIter it;
201 list.append (out it);
202 Gdk.Pixbuf icon = null;
203 try{
204 icon = IconTheme.get_default ().load_icon (contract.get_icon ().to_string (), 32, 0);
205
206 }catch (Error e){
207 warning (e.message);
208 }
209 list.set (it, 0, icon, 1,
210 "<b>"+contract.get_display_name ()+"</b>\n"+contract.get_description ());
211 contracts_size ++ ;
212 }
213 TreeIter it;
214 list.insert (out it, 0);
215 Gdk.Pixbuf icon = null;
216 try{
217 icon = IconTheme.get_default ().load_icon ("document-save", 32, 0);
218 }catch (Error e){
219 warning (e.message);
220 }
221 list.set (it, 0, icon, 1,
222 "<b>"+_("Save file")+"</b>\n"+("Save the file onto a disk"));
223 treeview.set_cursor (new TreePath.from_string ("0"), null, false);
224 export.label = _("Execute");
225 }
226 if( contracts_size == 0 )
227 {
228 warning ("You should install and/or run contractor");
229 contractor = false;
230 var info = new InfoBar ();
231 info.message_type = MessageType.WARNING;
232 info.pack_start (new Label (_("Could not contact Contractor.")));
233 grid.attach (info, 0, 3, 2, 1);
234 export.label = _("Save");
235 }
120 }236 }
121 }237 }
122}238}
123239
=== modified file 'src/Widgets/keyview.vala'
--- src/Widgets/keyview.vala 2013-05-17 01:00:15 +0000
+++ src/Widgets/keyview.vala 2015-01-04 16:20:24 +0000
@@ -243,7 +243,10 @@
243 if (mouse_circle) {243 if (mouse_circle) {
244 this.circle = new YellowCircle (mouse_circle_color);244 this.circle = new YellowCircle (mouse_circle_color);
245 this.captured_move.connect ( (x, y) => {245 this.captured_move.connect ( (x, y) => {
246 this.circle.move (x, y);246 Idle.add (() => {
247 this.circle.move (x, y);
248 return false;
249 });
247 //debug ("Moved to %i, %i\n", x, y);250 //debug ("Moved to %i, %i\n", x, y);
248 });251 });
249 }252 }
@@ -257,175 +260,182 @@
257260
258 if (keyboard)261 if (keyboard)
259 this.captured.connect ( (keyvalue, released) => {262 this.captured.connect ( (keyvalue, released) => {
260 if (released){263 Idle.add (() => {
261 switch (keyvalue){264 handle_key_event (keyvalue, released);
262 case "Control_L":265 return false;
263 case "Control_R":266 });
264 this.ctrl = false;
265 this.queue_draw ();
266 break;
267 case "Shift_L":
268 case "Shift_R":
269 this.shift = false;
270 this.queue_draw ();
271 break;
272 case "Alt_L":
273 case "Alt_R":
274 this.alt = false;
275 this.queue_draw ();
276 break;
277 case "Super_L":
278 case "Super_R":
279 this.super = false;
280 this.queue_draw ();
281 return;
282 case "ISO_Level3_Shift":
283 this.iso_level3_shift = false;
284 this.queue_draw ();
285 return;
286 }
287 }else{
288 string res = keyvalue;
289 switch (res){
290 case "Control_L":
291 case "Control_R":
292 this.ctrl = true;
293 this.queue_draw ();
294 return;
295 case "Shift_L":
296 case "Shift_R":
297 this.shift = true;
298 this.queue_draw ();
299 return;
300 case "Alt_L":
301 case "Alt_R":
302 this.alt = true;
303 this.queue_draw ();
304 return;
305 case "Super_L":
306 case "Super_R":
307 this.super = true;
308 this.queue_draw ();
309 return;
310 case "ISO_Level3_Shift":
311 this.iso_level3_shift = true;
312 this.queue_draw ();
313 return;
314 case "Escape":
315 res = "Esc"; break;
316 case "Return":
317 res = "⏎"; break;
318 case "Delete":
319 res = "Del"; break;
320 case "Insert":
321 res = "Ins"; break;
322 case "comma":
323 res = ","; break;
324 case "period":
325 res = "."; break;
326 case "minus":
327 res = "-"; break;
328 case "plus":
329 res = "+"; break;
330 case "Tab":
331 res = "Tab"; break;
332 case "BackSpace":
333 res = "⌫"; break;
334 case "Left":
335 res = "◄"; break;
336 case "Right":
337 res = "►"; break;
338 case "Up":
339 res = "▲"; break;
340 case "Down":
341 res = "▼"; break;
342 case "space":
343 res = " "; break;
344 case "backslash":
345 res = "\\"; break;
346 case "bracketleft":
347 res = "["; break;
348 case "bracketright":
349 res = "]"; break;
350 case "braceleft":
351 res = "{"; break;
352 case "braceright":
353 res = "}"; break;
354 case "apostrophe":
355 res = "'"; break;
356 case "asciitilde":
357 res = "~"; break;
358 case "grave":
359 res = "`"; break;
360 case "bar":
361 res = "|"; break;
362 case "ampersand":
363 res = "&"; break;
364 case "parenleft":
365 res = "("; break;
366 case "parenright":
367 res = ")"; break;
368 case "less":
369 res = "<"; break;
370 case "greater":
371 res = ">"; break;
372 case "equal":
373 res = "="; break;
374 case "exclam":
375 res = "!"; break;
376 case "quotedbl":
377 res = "\""; break;
378 case "numbersign":
379 res = "\""; break;
380 case "dollar":
381 res = "$"; break;
382 case "slash":
383 res = "/"; break;
384 case "asterisk":
385 res = "*"; break;
386 case "colon":
387 res = ":"; break;
388 case "semicolon":
389 res = ";"; break;
390 case "underscore":
391 res = "_"; break;
392 case "Next":
393 res = "Pg▲"; break;
394 case "Prior":
395 res = "Pg▼"; break;
396 case "asciicircum":
397 res = "^"; break;
398 case "at":
399 res = "@"; break;
400 case "question":
401 res = "?"; break;
402 default:
403 if (keyvalue.length > 9)
404 res = keyvalue.substring (0, 9);
405 break;
406 }
407
408 if ((!keys.is_empty ()) &&
409 (keys.peek_head ().key == res) &&
410 (keys.peek_head ().ctrl == ctrl) &&
411 (keys.peek_head ().shift == shift) &&
412 (keys.peek_head ().alt == alt) &&
413 (keys.peek_head ().iso_level3_shift == iso_level3_shift)){
414 keys.peek_head ().count ++;
415 this.queue_draw ();
416 }else{
417 var key = new Key (res, ctrl, shift, alt, super, iso_level3_shift);
418 if (!released){
419 keys.push_head (key);
420 if (keys.length+2 > (screen_h / key_size))
421 keys.pop_tail ();
422 this.queue_draw ();
423 }
424 }
425 }
426 });267 });
427 }268 }
428269
270 void handle_key_event (string keyvalue, bool released) {
271 if (released){
272 switch (keyvalue){
273 case "Control_L":
274 case "Control_R":
275 this.ctrl = false;
276 this.queue_draw ();
277 break;
278 case "Shift_L":
279 case "Shift_R":
280 this.shift = false;
281 this.queue_draw ();
282 break;
283 case "Alt_L":
284 case "Alt_R":
285 this.alt = false;
286 this.queue_draw ();
287 break;
288 case "Super_L":
289 case "Super_R":
290 this.super = false;
291 this.queue_draw ();
292 return;
293 case "ISO_Level3_Shift":
294 this.iso_level3_shift = false;
295 this.queue_draw ();
296 return;
297 }
298 }else{
299 string res = keyvalue;
300 switch (res){
301 case "Control_L":
302 case "Control_R":
303 this.ctrl = true;
304 this.queue_draw ();
305 return;
306 case "Shift_L":
307 case "Shift_R":
308 this.shift = true;
309 this.queue_draw ();
310 return;
311 case "Alt_L":
312 case "Alt_R":
313 this.alt = true;
314 this.queue_draw ();
315 return;
316 case "Super_L":
317 case "Super_R":
318 this.super = true;
319 this.queue_draw ();
320 return;
321 case "ISO_Level3_Shift":
322 this.iso_level3_shift = true;
323 this.queue_draw ();
324 return;
325 case "Escape":
326 res = "Esc"; break;
327 case "Return":
328 res = "⏎"; break;
329 case "Delete":
330 res = "Del"; break;
331 case "Insert":
332 res = "Ins"; break;
333 case "comma":
334 res = ","; break;
335 case "period":
336 res = "."; break;
337 case "minus":
338 res = "-"; break;
339 case "plus":
340 res = "+"; break;
341 case "Tab":
342 res = "Tab"; break;
343 case "BackSpace":
344 res = "⌫"; break;
345 case "Left":
346 res = "◄"; break;
347 case "Right":
348 res = "►"; break;
349 case "Up":
350 res = "▲"; break;
351 case "Down":
352 res = "▼"; break;
353 case "space":
354 res = " "; break;
355 case "backslash":
356 res = "\\"; break;
357 case "bracketleft":
358 res = "["; break;
359 case "bracketright":
360 res = "]"; break;
361 case "braceleft":
362 res = "{"; break;
363 case "braceright":
364 res = "}"; break;
365 case "apostrophe":
366 res = "'"; break;
367 case "asciitilde":
368 res = "~"; break;
369 case "grave":
370 res = "`"; break;
371 case "bar":
372 res = "|"; break;
373 case "ampersand":
374 res = "&"; break;
375 case "parenleft":
376 res = "("; break;
377 case "parenright":
378 res = ")"; break;
379 case "less":
380 res = "<"; break;
381 case "greater":
382 res = ">"; break;
383 case "equal":
384 res = "="; break;
385 case "exclam":
386 res = "!"; break;
387 case "quotedbl":
388 res = "\""; break;
389 case "numbersign":
390 res = "\""; break;
391 case "dollar":
392 res = "$"; break;
393 case "slash":
394 res = "/"; break;
395 case "asterisk":
396 res = "*"; break;
397 case "colon":
398 res = ":"; break;
399 case "semicolon":
400 res = ";"; break;
401 case "underscore":
402 res = "_"; break;
403 case "Next":
404 res = "Pg▲"; break;
405 case "Prior":
406 res = "Pg▼"; break;
407 case "asciicircum":
408 res = "^"; break;
409 case "at":
410 res = "@"; break;
411 case "question":
412 res = "?"; break;
413 default:
414 if (keyvalue.length > 9)
415 res = keyvalue.substring (0, 9);
416 break;
417 }
418
419 if ((!keys.is_empty ()) &&
420 (keys.peek_head ().key == res) &&
421 (keys.peek_head ().ctrl == ctrl) &&
422 (keys.peek_head ().shift == shift) &&
423 (keys.peek_head ().alt == alt) &&
424 (keys.peek_head ().iso_level3_shift == iso_level3_shift)){
425 keys.peek_head ().count ++;
426 this.queue_draw ();
427 }else{
428 var key = new Key (res, ctrl, shift, alt, super, iso_level3_shift);
429 if (!released){
430 keys.push_head (key);
431 if (keys.length+2 > (screen_h / key_size))
432 keys.pop_tail ();
433 this.queue_draw ();
434 }
435 }
436 }
437 }
438
429 public void capture (){439 public void capture (){
430 try{440 try{
431 Thread.create<void*> (this.intercept_key_thread, true);441 Thread.create<void*> (this.intercept_key_thread, true);
432442
=== modified file 'src/Widgets/selectionarea.vala'
--- src/Widgets/selectionarea.vala 2012-04-04 00:02:38 +0000
+++ src/Widgets/selectionarea.vala 2015-01-04 16:20:24 +0000
@@ -42,38 +42,41 @@
42 });42 });
4343
44 this.configure_event.connect ((e) => {44 this.configure_event.connect ((e) => {
45 var screen_width = Gdk.Screen.width ();
46 var screen_height = Gdk.Screen.height ();
47
45 // check if coordinates are out of the screen and check48 // check if coordinates are out of the screen and check
46 // if coordinate + width/height is out of the screen, then49 // if coordinate + width/height is out of the screen, then
47 // adjust coordinates to keep width and height (and aspect50 // adjust coordinates to keep width and height (and aspect
48 // ratio) intact51 // ratio) intact
49 if( e.x < 0 || e.x > e.window.get_screen().width() ) {52 if( e.x < 0 || e.x > screen_width ) {
50 x = 0;53 x = 0;
51 } else if( e.x + e.width > e.window.get_screen().width()54 } else if( e.x + e.width > screen_width
52 && e.width < e.window.get_screen().width() ) {55 && e.width < screen_width ) {
53 x = e.window.get_screen().width() - e.width;56 x = screen_width - e.width;
54 } else {57 } else {
55 x = e.x;58 x = e.x;
56 }59 }
57 60
58 if( e.y < 0 ) {61 if( e.y < 0 ) {
59 y = 0;62 y = 0;
60 } else if( e.y + e.height >= e.window.get_screen().height()63 } else if( e.y + e.height >= screen_height
61 && e.height < e.window.get_screen().height() ) {64 && e.height < screen_height ) {
62 y = e.window.get_screen().height() - e.height - 1;65 y = screen_height - e.height - 1;
63 } else {66 } else {
64 y = e.y;67 y = e.y;
65 }68 }
6669
67 // just in case an edge is still outside of the screen70 // just in case an edge is still outside of the screen
68 // we'll modify the width/height if thats the case71 // we'll modify the width/height if thats the case
69 if( x + e.width > e.window.get_screen().width() ) {72 if( x + e.width > screen_width ) {
70 w = e.window.get_screen().width() - x;73 w = screen_width - x;
71 } else {74 } else {
72 w = e.width;75 w = e.width;
73 }76 }
7477
75 if( y + e.height > e.window.get_screen().height() ) {78 if( y + e.height > screen_height ) {
76 h = e.window.get_screen().height() - y;79 h = screen_height - y;
77 } else {80 } else {
78 h = e.height;81 h = e.height;
79 }82 }
8083
=== modified file 'src/eidete.vala'
--- src/eidete.vala 2014-05-29 17:08:23 +0000
+++ src/eidete.vala 2015-01-04 16:20:24 +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,10 @@
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 private Gtk.Stack tabs;
85 public Grid pause_grid;84 private Grid pause_grid;
86 public Image pause_icon;85 private Gtk.Grid main_box ;
86 private Gtk.StackSwitcher stack_switcher ;
87 public Wnck.Window win;87 public Wnck.Window win;
88 public Gdk.Screen screen;88 public Gdk.Screen screen;
89 public Gdk.Rectangle monitor_rec;89 public Gdk.Rectangle monitor_rec;
@@ -93,8 +93,8 @@
93 public bool recording;93 public bool recording;
94 public bool typing_size;94 public bool typing_size;
9595
96 public Gst.Bin videobin;96 public Gst.Bin videobin;
97 public Gst.Bin audiobin;97 public Gst.Bin audiobin;
9898
99 public EideteApp (){99 public EideteApp (){
100 }100 }
@@ -125,12 +125,7 @@
125 UI125 UI
126 */126 */
127127
128 tabs = new Granite.Widgets.StaticNotebook (false);128 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
134129
135 var grid = new Grid ();130 var grid = new Grid ();
136 grid.column_spacing = 12;131 grid.column_spacing = 12;
@@ -140,6 +135,7 @@
140 var monitors_combo = new ComboBoxText ();135 var monitors_combo = new ComboBoxText ();
141 monitors_combo.hexpand = true;136 monitors_combo.hexpand = true;
142 for (var i=0;i<Gdk.Screen.get_default ().get_n_monitors (); i++)137 for (var i=0;i<Gdk.Screen.get_default ().get_n_monitors (); i++)
138 // TODO proper translation here
143 monitors_combo.append (i.to_string (), _("Monitor")+" "+(i+1).to_string ());139 monitors_combo.append (i.to_string (), _("Monitor")+" "+(i+1).to_string ());
144 monitors_combo.active = 0;140 monitors_combo.active = 0;
145 if (Gdk.Screen.get_default ().get_n_monitors () == 1)141 if (Gdk.Screen.get_default ().get_n_monitors () == 1)
@@ -148,12 +144,10 @@
148 var width = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_width (), 1);144 var width = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_width (), 1);
149 width.max_length = 4;145 width.max_length = 4;
150 width.margin_left = 1;146 width.margin_left = 1;
151 width.margin_right = -4;
152147
153 var height = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_height (), 1);148 var height = new SpinButton.with_range (50, Gdk.Screen.get_default ().get_height (), 1);
154 height.max_length = 4;149 height.max_length = 4;
155 height.margin_left = 1;150 height.margin_left = 1;
156 height.margin_right = -4;
157 width.set_sensitive (false);151 width.set_sensitive (false);
158 height.set_sensitive (false);152 height.set_sensitive (false);
159 width.halign = Align.START;153 width.halign = Align.START;
@@ -181,23 +175,24 @@
181 audio_box.pack_start (use_audio, false, true, 0);175 audio_box.pack_start (use_audio, false, true, 0);
182 audio_box.pack_start (audio_source, true, true, 0);176 audio_box.pack_start (audio_source, true, true, 0);
183177
184 var sound = new LLabel.markup ("<b>"+_("Sound")+":"+"</b>");178 var sound = new LLabel.markup ("<b>"+_("Sound")+"</b>");
185 sound.margin_top = 18;179 sound.margin_top = 18;
186180
187 var video = new LLabel.markup ("<b>"+_("Video")+":"+"</b>");181 var video = new LLabel.markup ("<b>"+_("Video")+"</b>");
188 video.margin_top = 12;182 video.margin_top = 12;
189183
190 var keyboard = new LLabel.markup ("<b>"+_("Keyboard")+":"+"</b>");184 var keyboard = new LLabel.markup ("<b>"+_("Keyboard")+"</b>");
191 keyboard.margin_top = 18;185 keyboard.margin_top = 18;
192186
193 var mouse = new LLabel.markup ("<b>"+_("Mouse")+":"+"</b>");187 var mouse = new LLabel.markup ("<b>"+_("Mouse")+"</b>");
194 mouse.margin_top = 12;188 mouse.margin_top = 12;
195189
196 var start_bt = new Button.with_label (_("Start Recording"));190 var start_bt = new Button.with_label (_("Start Recording"));
197 start_bt.can_default = true;191 start_bt.can_default = true;
198 start_bt.get_style_context ().add_class ("noundo");192 start_bt.get_style_context ().add_class ("noundo");
199193 start_bt.get_style_context ().add_class ("suggested-action");
200 var cancel_bt = new Button.from_stock (Stock.CANCEL);194
195 var cancel_bt = new Button.with_label (_("Cancel"));
201196
202 var about_bt = new Button.with_label (_("About"));197 var about_bt = new Button.with_label (_("About"));
203 about_bt.image = new Image.from_stock (Stock.ABOUT, IconSize.BUTTON);198 about_bt.image = new Image.from_stock (Stock.ABOUT, IconSize.BUTTON);
@@ -212,7 +207,7 @@
212 this.main_window.set_default (start_bt);207 this.main_window.set_default (start_bt);
213208
214 grid.attach ((sound), 0, 0, 1, 1);209 grid.attach ((sound), 0, 0, 1, 1);
215 grid.attach (new LLabel.right (_("Record Computer Sounds")), 0, 1, 1, 1);210 grid.attach (new LLabel.right (_("Record Computer Sounds")+":"), 0, 1, 1, 1);
216 grid.attach (use_comp_sounds, 1, 1, 1, 1);211 grid.attach (use_comp_sounds, 1, 1, 1, 1);
217 grid.attach (new LLabel.right (_("Record from Microphone")+":"), 0, 2, 1, 1);212 grid.attach (new LLabel.right (_("Record from Microphone")+":"), 0, 2, 1, 1);
218 grid.attach (audio_box, 1, 2, 1, 1);213 grid.attach (audio_box, 1, 2, 1, 1);
@@ -258,10 +253,24 @@
258 grid2.row_spacing = 6;253 grid2.row_spacing = 6;
259 grid2.hexpand = true;254 grid2.hexpand = true;
260255
261 tabs.append_page (grid, new Label (_("Behavior")));256 tabs.add_titled (grid, "behavior", _("Behavior"));
262 tabs.append_page (grid2, new Label (_("Appearance")));257 tabs.add_titled (grid2, "apperance", _("Appearance"));
263258
264 this.main_window.add (tabs);259 main_box = new Gtk.Grid ();
260 stack_switcher = new Gtk.StackSwitcher ();
261 stack_switcher.stack = tabs;
262 stack_switcher.halign = Gtk.Align.CENTER;
263 build_pause_ui () ;
264 pause_grid.show_all();
265 pause_grid.hide();
266 pause_grid.no_show_all = true;
267 main_box.attach (stack_switcher, 0, 0, 1, 1);
268 main_box.attach (tabs, 0, 1, 1, 1);
269 main_box.attach (pause_grid, 0, 2, 1, 1);
270 main_box.margin = 12;
271
272 this.main_window.add (main_box);
273
265 this.main_window.show_all ();274 this.main_window.show_all ();
266 this.main_window.present ();275 this.main_window.present ();
267276
@@ -353,11 +362,7 @@
353 settings.audio = false;362 settings.audio = false;
354 use_audio.toggled.connect ( () => {363 use_audio.toggled.connect ( () => {
355 settings.audio = use_audio.active;364 settings.audio = use_audio.active;
356 if (use_audio.active){365 audio_source.set_sensitive (use_audio.active);
357 audio_source.set_sensitive (true);
358 }else{
359 audio_source.set_sensitive (false);
360 }
361 });366 });
362367
363368
@@ -433,6 +438,12 @@
433438
434 Granite.Services.Logger.initialize ("Eidete");439 Granite.Services.Logger.initialize ("Eidete");
435 Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.DEBUG;440 Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.DEBUG;
441 uint major ;
442 uint minor ;
443 uint micro ;
444 uint nano ;
445 Gst.version (out major, out minor, out micro, out nano) ;
446 message ("GStreamer version: %u.%u.%u.%u", major, minor, micro, nano ) ;
436 }447 }
437448
438 public override void activate (){449 public override void activate (){
@@ -451,7 +462,7 @@
451462
452 pause_grid = new Grid ();463 pause_grid = new Grid ();
453 pause_grid.margin = 12;464 pause_grid.margin = 12;
454 this.main_window.title = _("Recording paused");465 //this.main_window.title = _("Recording paused");
455466
456467
457 var img_text_grid = new Grid ();468 var img_text_grid = new Grid ();
@@ -477,6 +488,7 @@
477 var stop_bt = new Button.with_label (_("Finish"));488 var stop_bt = new Button.with_label (_("Finish"));
478 stop_bt.set_tooltip_text (_("Stop the recording and save the file"));489 stop_bt.set_tooltip_text (_("Stop the recording and save the file"));
479 stop_bt.image = new Image.from_stock (Stock.APPLY, IconSize.BUTTON);490 stop_bt.image = new Image.from_stock (Stock.APPLY, IconSize.BUTTON);
491 stop_bt.get_style_context ().add_class ("suggested-action");
480492
481 var cancel_bt = new Button.with_label (_("Cancel"));493 var cancel_bt = new Button.with_label (_("Cancel"));
482 cancel_bt.set_tooltip_text (_("Cancel the recording without saving the file"));494 cancel_bt.set_tooltip_text (_("Cancel the recording without saving the file"));
@@ -539,15 +551,25 @@
539 }551 }
540552
541 pipeline = new Pipeline ("screencast-pipe");553 pipeline = new Pipeline ("screencast-pipe");
554
555 #if GSTREAMER_0_10_IS_DEFINED
542 dynamic Element muxer = ElementFactory.make ("webmmux", "mux");556 dynamic Element muxer = ElementFactory.make ("webmmux", "mux");
543 dynamic Element sink = ElementFactory.make ("filesink", "sink");557 dynamic Element sink = ElementFactory.make ("filesink", "sink");
544558 #else
559 var muxer = ElementFactory.make ("webmmux", "mux");
560 var sink = ElementFactory.make ("filesink", "sink");
561 #endif
545 //video bin562 //video bin
546 this.videobin = new Gst.Bin ("video");563 this.videobin = new Gst.Bin ("video");
547 try {564 try {
548 videobin = (Gst.Bin)parse_bin_from_description (565 #if GSTREAMER_0_10_IS_DEFINED
549 "ximagesrc name=\"videosrc\" ! video/x-raw-rgb, framerate=15/1 !566 videobin = (Gst.Bin)parse_bin_from_description (
550 ffmpegcolorspace ! vp8enc name=\"encoder\" ! queue", true);567 "ximagesrc name=\"videosrc\" ! video/x-raw-rgb, framerate=15/1 !
568 ffmpegcolorspace ! vp8enc name=\"encoder\" ! queue", true);
569 #else
570 videobin = (Gst.Bin)parse_bin_from_description (
571 "ximagesrc name=\"videosrc\" ! video/x-raw, framerate=24/1 ! videoconvert ! vp8enc name=\"encoder\" ! queue", true);
572 #endif
551 }catch (Error e){ stderr.printf ("Error: %s\n", e.message);}573 }catch (Error e){ stderr.printf ("Error: %s\n", e.message);}
552574
553 //audio bin575 //audio bin
@@ -564,19 +586,32 @@
564 }catch (Error e){warning (e.message);}586 }catch (Error e){warning (e.message);}
565587
566 //configure588 //configure
589 assert( sink != null ) ;
567 sink.set ("location", settings.destination);590 sink.set ("location", settings.destination);
568 videobin.get_by_name ("videosrc").set ("startx", this.settings.sx);591 var src = videobin.get_by_name ("videosrc") ;
569 videobin.get_by_name ("videosrc").set ("starty", this.settings.sy);592 assert (src != null) ;
570 videobin.get_by_name ("videosrc").set ("endx", this.settings.ex);593 src.set ("startx", this.settings.sx);
571 videobin.get_by_name ("videosrc").set ("endy", this.settings.ey);594 src.set ("starty", this.settings.sy);
572 videobin.get_by_name ("videosrc").set ("use-damage", false);595 src.set ("endx", this.settings.ex);
573 videobin.get_by_name ("videosrc").set ("screen-num", this.settings.monitor);596 src.set ("endy", this.settings.ey);
597 src.set ("use-damage", false);
598 src.set ("screen-num", this.settings.monitor);
574599
575 //videobin.get_by_name ("encoder").set ("mode", 1);600 //videobin.get_by_name ("encoder").set ("mode", 1);
576 videobin.get_by_name ("encoder").set ("quality", 8.0);601 var encoder = videobin.get_by_name ("encoder") ;
577 videobin.get_by_name ("encoder").set ("speed", 6);602 assert (encoder != null) ;
578 videobin.get_by_name ("encoder").set ("max-keyframe-distance", 150);603 #if GSTREAMER_0_10_IS_DEFINED
579 videobin.get_by_name ("encoder").set ("threads", int.parse (cores.substring (2)));604 encoder.set ("quality", 8.0);
605 encoder.set ("speed", 6);
606 encoder.set ("max-keyframe-distance", 150);
607 #else
608 // From these values see https://mail.gnome.org/archives/commits-list/2012-September/msg08183.html
609 encoder.set ("min_quantizer", 13);
610 encoder.set ("max_quantizer", 13);
611 encoder.set ("cpu-used", 5);
612 encoder.set ("deadline", 1000000);
613 #endif
614 encoder.set ("threads", int.parse (cores.substring (2)));
580615
581616
582 if (pipeline==null||muxer==null||sink==null||videobin==null||audiobin==null){617 if (pipeline==null||muxer==null||sink==null||videobin==null||audiobin==null){
@@ -589,14 +624,28 @@
589 pipeline.add_many (videobin, muxer, sink);624 pipeline.add_many (videobin, muxer, sink);
590625
591626
592 videobin.get_static_pad ("src").link(muxer.get_request_pad ("video_%d"));627 var video_pad = videobin.get_static_pad ("src") ;
593 if (settings.audio)628 assert (video_pad != null ) ;
594 audiobin.get_static_pad ("src").link(muxer.get_request_pad ("audio_%d"));629 #if GSTREAMER_0_10_IS_DEFINED
595630 var m = muxer.get_request_pad ("video_%d") ;
631 #else
632 var m = muxer.get_request_pad ("video_%u") ;
633 #endif
634 assert (m != null ) ;
635 video_pad.link(m);
636 if (settings.audio){
637 #if GSTREAMER_0_10_IS_DEFINED
638 audiobin.get_static_pad ("src").link (muxer.get_request_pad ("audio_%d"));
639 #else
640 audiobin.get_static_pad ("src").link (muxer.get_request_pad ("audio_%u"));
641 #endif
642 }
596 muxer.link (sink);643 muxer.link (sink);
597644 #if GSTREAMER_0_10_IS_DEFINED
598 pipeline.get_bus ().add_watch (bus_message_cb);645 pipeline.get_bus ().add_watch (bus_message_cb);
599646 #else
647 pipeline.get_bus ().add_watch (Priority.DEFAULT, bus_message_cb);
648 #endif
600 pipeline.set_state (State.READY);649 pipeline.set_state (State.READY);
601650
602 if (selectionarea != null)651 if (selectionarea != null)
@@ -620,7 +669,10 @@
620 case Gst.MessageType.ERROR:669 case Gst.MessageType.ERROR:
621 GLib.Error err; string debug;670 GLib.Error err; string debug;
622 msg.parse_error (out err, out debug);671 msg.parse_error (out err, out debug);
623 stderr.printf ("Error: %s\n", err.message);672
673 display_error ("Eidete encountered a gstreamer error while recording, creating a screencast is not possible:\n%s\n\n[%s]"
674 .printf (err.message, debug), true);
675 stderr.printf ("Error: %s\n", debug);
624 pipeline.set_state (State.NULL);676 pipeline.set_state (State.NULL);
625 break;677 break;
626 case Gst.MessageType.EOS:678 case Gst.MessageType.EOS:
@@ -629,7 +681,7 @@
629 this.recording = false;681 this.recording = false;
630682
631 var end = new Eidete.Widgets.EndDialog (this);683 var end = new Eidete.Widgets.EndDialog (this);
632 end.show_all ();684 end.display ();
633 this.main_window.destroy ();685 this.main_window.destroy ();
634686
635 break;687 break;
@@ -644,26 +696,43 @@
644696
645 if (to_normal){697 if (to_normal){
646 this.main_window.title = _("Recording paused");698 this.main_window.title = _("Recording paused");
647 this.main_window.remove (pause_icon);699 tabs.hide () ;
648 if (pause_grid == null)700 stack_switcher.hide () ;
649 this.build_pause_ui ();701 pause_grid.show () ;
650 this.main_window.add (pause_grid);
651 this.main_window.icon_name = "eidete";702 this.main_window.icon_name = "eidete";
652 this.app_icon = "eidete";703 this.app_icon = "eidete";
653 this.main_window.show_all ();704
654 this.main_window.resize (1, 1);
655 }else{705 }else{
656 this.main_window.title = _("Pause recording");706 this.main_window.title = _("Pause recording");
657 if (this.main_window.get_child () == tabs)707 if (tabs.visible) {
658 this.main_window.remove (tabs);708 tabs.hide () ;
659 else709 stack_switcher.hide () ;
660 this.main_window.remove (pause_grid);710 pause_grid.show () ;
661 this.main_window.add (pause_icon);711 }
662 this.main_window.icon_name = "media-playback-pause";712 this.main_window.icon_name = "media-playback-pause";
663 this.app_icon = "media-playback-pause";713 this.app_icon = "media-playback-pause";
664 this.main_window.show_all ();714
665 }715 }
666 }716 }
717
718 /**
719 * Displays an error dialog with the given message to the user
720 *
721 * @param error The message to display
722 * @param fatal Quit eidete after the user dismissed the dialog
723 */
724 private void display_error (string error, bool fatal) {
725 var dialog = new Gtk.MessageDialog (main_window, Gtk.DialogFlags.MODAL,
726 Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, error);
727 dialog.show_all ();
728 dialog.response.connect (() => {
729 dialog.destroy ();
730
731 if (fatal)
732 main_window.destroy ();
733 });
734 dialog.run ();
735 }
667 }736 }
668}737}
669738
@@ -692,4 +761,4 @@
692 eidete = new Eidete.EideteApp ();761 eidete = new Eidete.EideteApp ();
693762
694 return eidete.run (args);763 return eidete.run (args);
695}
696\ No newline at end of file764\ No newline at end of file
765}
697766
=== modified file 'src/keycapture.c'
--- src/keycapture.c 2012-04-04 00:02:38 +0000
+++ src/keycapture.c 2015-01-04 16:20:24 +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");
@@ -47,6 +51,8 @@
47 default:51 default:
48 break;52 break;
49 }53 }
54
55 XRecordFreeData (d);
50}56}
5157
52void* intercept_key_thread (void *data) {58void* intercept_key_thread (void *data) {
5359
=== modified file 'src/videobin_uploader.vala'
--- src/videobin_uploader.vala 2012-01-03 12:54:48 +0000
+++ src/videobin_uploader.vala 2015-01-04 16:20:24 +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

to all changes: