Merge lp:~jflaker/scratch/BugFix1376573 into lp:scratch/2.x

Proposed by Jeffrey Flaker
Status: Superseded
Proposed branch: lp:~jflaker/scratch/BugFix1376573
Merge into: lp:scratch/2.x
Diff against target: 74092 lines (+24537/-28452) (has conflicts)
124 files modified
CMakeLists.txt (+34/-3)
README (+1/-1)
data/scratch-text-editor.desktop (+1/-1)
plugins/CMakeLists.txt (+1/-0)
plugins/brackets-completion/CMakeLists.txt (+5/-1)
plugins/browser-preview/CMakeLists.txt (+5/-1)
plugins/browser-preview/browser-preview.vala (+24/-16)
plugins/contractor/CMakeLists.txt (+5/-1)
plugins/contractor/contractor.vala (+10/-11)
plugins/filemanager/CMakeLists.txt (+5/-1)
plugins/filemanager/FileManagerPlugin.vala (+1/-8)
plugins/filemanager/FileView.vala (+28/-25)
plugins/folder-manager/CMakeLists.txt (+5/-1)
plugins/folder-manager/FileView.vala (+26/-18)
plugins/folder-manager/FolderManagerPlugin.vala (+7/-5)
plugins/highlight-word-selection/CMakeLists.txt (+28/-0)
plugins/highlight-word-selection/highlight-word-selection.plugin (+10/-0)
plugins/highlight-word-selection/highlight-word-selection.vala (+97/-0)
plugins/open-with/CMakeLists.txt (+5/-1)
plugins/outline/CMakeLists.txt (+10/-4)
plugins/outline/CtagsSymbolResolver.vala (+214/-208)
plugins/outline/OutlinePlugin.vala (+106/-85)
plugins/outline/ValaSymbolResolver.vala (+243/-251)
plugins/pastebin/CMakeLists.txt (+5/-1)
plugins/pastebin/pastebin.vala (+2/-1)
plugins/pastebin/pastebin_dialog.vala (+7/-5)
plugins/source-tree/CMakeLists.txt (+5/-1)
plugins/source-tree/SourceTreePlugin.vala (+261/-75)
plugins/spell/CMakeLists.txt (+5/-1)
plugins/spell/spell.vala (+10/-1)
plugins/strip-trailing-save/CMakeLists.txt (+5/-1)
plugins/strip-trailing-save/strip-trailing-save.vala (+3/-3)
plugins/terminal/CMakeLists.txt (+5/-1)
plugins/terminal/terminal.plugin (+1/-1)
plugins/terminal/terminal.vala (+54/-0)
plugins/vim-emulation/CMakeLists.txt (+5/-1)
plugins/word-completion/CMakeLists.txt (+5/-1)
plugins/word-completion/completion-provider.vala (+111/-74)
plugins/word-completion/engine.vala (+85/-89)
plugins/word-completion/plugin.vala (+133/-70)
po/am.po (+339/-317)
po/ar.po (+373/-100)
po/bg.po (+403/-376)
po/bs.po (+336/-311)
po/ca.po (+335/-310)
po/ca@valencia.po (+336/-311)
po/cs.po (+335/-310)
po/da.po (+336/-311)
po/de.po (+361/-336)
po/el.po (+392/-367)
po/en_AU.po (+401/-372)
po/en_CA.po (+334/-309)
po/en_GB.po (+335/-310)
po/eo.po (+333/-311)
po/es.po (+334/-309)
po/et.po (+344/-120)
po/eu.po (+341/-316)
po/fa.po (+338/-313)
po/fi.po (+351/-326)
po/fr.po (+335/-310)
po/fr_CA.po (+688/-0)
po/fy.po (+691/-0)
po/gl.po (+334/-309)
po/he.po (+334/-309)
po/hi.po (+333/-311)
po/hr.po (+339/-314)
po/hu.po (+373/-344)
po/id.po (+337/-312)
po/it.po (+339/-314)
po/ja.po (+336/-311)
po/jv.po (+333/-311)
po/km.po (+336/-311)
po/ko.po (+341/-316)
po/lt.po (+330/-311)
po/lv.po (+337/-312)
po/ml.po (+330/-311)
po/ms.po (+335/-310)
po/nb.po (+352/-328)
po/ne.po (+336/-311)
po/nl.po (+357/-329)
po/nn.po (+336/-317)
po/oc.po (+330/-311)
po/pl.po (+336/-311)
po/pt.po (+336/-311)
po/pt_BR.po (+341/-316)
po/ro.po (+336/-311)
po/ru.po (+375/-347)
po/rue.po (+336/-311)
po/scratch-text-editor.pot (+327/-308)
po/sk.po (+337/-312)
po/sl.po (+334/-309)
po/sr.po (+354/-327)
po/su.po (+330/-311)
po/sv.po (+338/-313)
po/ta.po (+688/-0)
po/th.po (+421/-393)
po/tr.po (+339/-314)
po/uk.po (+389/-360)
po/vi.po (+336/-311)
po/zh_CN.po (+336/-311)
po/zh_TW.po (+334/-309)
schemas/org.pantheon.scratch.gschema.xml (+27/-1)
src/CMakeLists.txt (+1/-1)
src/Dialogs/PreferencesDialog.vala (+58/-51)
src/MainWindow.vala (+103/-55)
src/Scratch.vala (+113/-37)
src/Services/Document.vala (+164/-23)
src/Services/Encoding.vala (+25/-13)
src/Services/PluginManager.vala (+6/-8)
src/Services/Settings.vala (+8/-2)
src/Services/TemplateManager.vala (+6/-4)
src/Services/ZeitgeistLogger.vala (+2/-0)
src/Utils.vala (+2/-2)
src/Widgets/DocumentView.vala (+92/-73)
src/Widgets/SearchManager.vala (+122/-95)
src/Widgets/SourceView.vala (+73/-15)
src/Widgets/SplitView.vala (+72/-39)
src/Widgets/ToolBar.vala (+15/-24)
src/scratch-ui.xml (+1/-1)
src/scratchcore.deps (+1/-1)
src/scratchcore.pc.cmake (+1/-1)
vapi/gobject-introspection-1.0.vapi (+0/-426)
vapi/gtk+-3.0.deps (+0/-7)
vapi/gtk+-3.0.vapi (+0/-8473)
Text conflict in CMakeLists.txt
Text conflict in plugins/brackets-completion/CMakeLists.txt
Text conflict in plugins/browser-preview/CMakeLists.txt
Text conflict in plugins/contractor/CMakeLists.txt
Text conflict in plugins/filemanager/CMakeLists.txt
Text conflict in plugins/folder-manager/CMakeLists.txt
Text conflict in plugins/open-with/CMakeLists.txt
Text conflict in plugins/outline/CMakeLists.txt
Text conflict in plugins/pastebin/CMakeLists.txt
Text conflict in plugins/source-tree/CMakeLists.txt
Text conflict in plugins/source-tree/SourceTreePlugin.vala
Text conflict in plugins/spell/CMakeLists.txt
Text conflict in plugins/strip-trailing-save/CMakeLists.txt
Text conflict in plugins/terminal/CMakeLists.txt
Text conflict in plugins/vim-emulation/CMakeLists.txt
Text conflict in plugins/word-completion/CMakeLists.txt
Text conflict in po/ar.po
Text conflict in po/et.po
Text conflict in src/Services/Document.vala
Contents conflict in src/Widgets/DynamicNotebook.vala
To merge this branch: bzr merge lp:~jflaker/scratch/BugFix1376573
Reviewer Review Type Date Requested Status
Danielle Foré Disapprove
Review via email: mp+237199@code.launchpad.net

This proposal has been superseded by a proposal from 2014-10-05.

Description of the change

fixed mis-spelling. "directoy" should be "directory"

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

OP, you've proposed merging into the wrong branch. Please repropose against lp:scratch

review: Disapprove
lp:~jflaker/scratch/BugFix1376573 updated
1391. By Jeffrey Flaker

Backed out changes to po/

Unmerged revisions

1391. By Jeffrey Flaker

Backed out changes to po/

1390. By Jeffrey Flaker

Fix for bug#1376573 - Mis-spelling of "directory" as "directoy"

1389. By Danielle Foré

swap out "secondary-toolbar" class for "search-bar"

1388. By ffabio-96-x

* Replace deprecated Granite.LightWindow with Gtk.Dialog in TemplateManager
* Replace deprecated Granite.SearchBar with Gtk.SearchEntry in SearchManager

1387. By Launchpad Translations on behalf of elementary-apps

Launchpad automatic translations update.

1386. By Launchpad Translations on behalf of elementary-apps

Launchpad automatic translations update.

1385. By Launchpad Translations on behalf of elementary-apps

Launchpad automatic translations update.

1384. By Launchpad Translations on behalf of elementary-apps

Launchpad automatic translations update.

1383. By Launchpad Translations on behalf of elementary-apps

Launchpad automatic translations update.

1382. By Launchpad Translations on behalf of elementary-apps

Launchpad automatic translations update.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-12-12 18:32:19 +0000
3+++ CMakeLists.txt 2014-10-05 21:35:48 +0000
4@@ -38,17 +38,48 @@
5 # Vala
6 find_package (Vala REQUIRED)
7 include (ValaVersion)
8-ensure_vala_version ("0.17.1" MINIMUM)
9+ensure_vala_version ("0.22" MINIMUM)
10 include (ValaPrecompile)
11
12 add_definitions(-DVALA_VERSION="${VALA_SHORTVER}")
13 add_definitions(-w) # Disable gcc warnings
14
15+option (USE_ZEITGEIST "Use Zeitgeist integration" ON)
16+
17+if (USE_ZEITGEIST)
18+ message ("-- Zeitgeist integration enabled")
19+ set (ZEITGEIST_DEPS zeitgeist-2.0)
20+ set (ZEITGEIST_OPTIONS --define=HAVE_ZEITGEIST)
21+else ()
22+ message ("-- Zeitgeist integration disabled")
23+endif ()
24+
25 # Dependencies
26+<<<<<<< TREE
27 set (SCRATCH_DEPS libpeas-1.0 libpeas-gtk-1.0 gtksourceview-3.0 gee-1.0 gobject-2.0 glib-2.0 gio-2.0 gtk+-3.0 granite zeitgeist-1.0)
28+=======
29+set (SCRATCH_DEPS
30+ libpeas-1.0
31+ libpeas-gtk-1.0
32+ gtksourceview-3.0
33+ gee-0.8
34+ gobject-2.0
35+ glib-2.0
36+ gio-2.0
37+ gtk+-3.0
38+ granite>=0.3.0
39+ ${ZEITGEIST_DEPS})
40+
41+>>>>>>> MERGE-SOURCE
42 find_package (PkgConfig)
43-pkg_check_modules (GTK+ REQUIRED "gtk+-3.0 >= 3.4")
44-pkg_check_modules (LIBSOURCE REQUIRED libpeas-gtk-1.0 gtksourceview-3.0>=3.0 gthread-2.0)
45+pkg_check_modules (GTK+ REQUIRED
46+ gtk+-3.0>=3.10)
47+
48+pkg_check_modules (LIBSOURCE REQUIRED
49+ libpeas-gtk-1.0
50+ gtksourceview-3.0>=3.10
51+ gthread-2.0)
52+
53 pkg_check_modules (DEPS REQUIRED ${SCRATCH_DEPS})
54
55 set(NORMAL_CFLAGS ${DEPS_CFLAGS} ${LIBSOURCE_CFLAGS} ${GCONF_CFLAGS})
56
57=== modified file 'README'
58--- README 2013-11-30 08:48:08 +0000
59+++ README 2014-10-05 21:35:48 +0000
60@@ -2,7 +2,7 @@
61 ------------
62 - libgtk-3.0-dev
63 - libgtksourceview-3.0-dev
64- - libgranite
65+ - libgranite >= 0.3.0
66 - libgconf-2.0-dev
67 - libzeitgeist-1.0
68
69
70=== modified file 'data/scratch-text-editor.desktop'
71--- data/scratch-text-editor.desktop 2013-05-02 21:04:35 +0000
72+++ data/scratch-text-editor.desktop 2014-10-05 21:35:48 +0000
73@@ -22,6 +22,6 @@
74
75 [NewWindow Shortcut Group]
76 Name=New Window
77-Exec=scratch-text-editor -n
78+Exec=scratch-text-editor --new-window
79 TargetEnvironment=Unity
80
81
82=== modified file 'plugins/CMakeLists.txt'
83--- plugins/CMakeLists.txt 2013-07-08 00:40:39 +0000
84+++ plugins/CMakeLists.txt 2014-10-05 21:35:48 +0000
85@@ -12,3 +12,4 @@
86 add_subdirectory (source-tree)
87 add_subdirectory (outline)
88 add_subdirectory (vim-emulation)
89+add_subdirectory (highlight-word-selection)
90\ No newline at end of file
91
92=== modified file 'plugins/brackets-completion/CMakeLists.txt'
93--- plugins/brackets-completion/CMakeLists.txt 2013-11-30 08:48:08 +0000
94+++ plugins/brackets-completion/CMakeLists.txt 2014-10-05 21:35:48 +0000
95@@ -8,9 +8,13 @@
96 granite
97 gtksourceview-3.0
98 scratchcore
99- gee-1.0
100+ gee-0.8
101 libpeas-1.0
102+<<<<<<< TREE
103 zeitgeist-1.0
104+=======
105+ ${ZEITGEIST_DEPS}
106+>>>>>>> MERGE-SOURCE
107 OPTIONS
108 --thread
109 --vapidir=${CMAKE_BINARY_DIR}
110
111=== modified file 'plugins/browser-preview/CMakeLists.txt'
112--- plugins/browser-preview/CMakeLists.txt 2013-11-30 08:48:08 +0000
113+++ plugins/browser-preview/CMakeLists.txt 2014-10-05 21:35:48 +0000
114@@ -15,9 +15,13 @@
115 granite
116 gtksourceview-3.0
117 scratchcore
118- gee-1.0
119+ gee-0.8
120 libpeas-1.0
121+<<<<<<< TREE
122 zeitgeist-1.0
123+=======
124+ ${ZEITGEIST_DEPS}
125+>>>>>>> MERGE-SOURCE
126 OPTIONS
127 --thread
128 --vapidir=${CMAKE_BINARY_DIR}
129
130=== modified file 'plugins/browser-preview/browser-preview.vala'
131--- plugins/browser-preview/browser-preview.vala 2013-08-06 15:21:11 +0000
132+++ plugins/browser-preview/browser-preview.vala 2014-10-05 21:35:48 +0000
133@@ -30,6 +30,8 @@
134 Gtk.ScrolledWindow? scrolled = null;
135 Scratch.Services.Document? doc = null;
136
137+ Gtk.Notebook notebook;
138+
139 Scratch.Services.Interface plugins;
140 public Object object { owned get; construct; }
141
142@@ -65,10 +67,14 @@
143 view.welcome_shown.connect (() => {
144 this.tool_button.visible = false;
145 this.tool_button.no_show_all = true;
146+ if (notebook.page_num (scrolled) != -1)
147+ notebook.remove (scrolled);
148 });
149 view.welcome_hidden.connect (() => {
150 this.tool_button.visible = true;
151 this.tool_button.no_show_all = false;
152+ if (notebook.page_num (scrolled) == -1)
153+ notebook.append_page (scrolled, new Gtk.Label (_("Web preview")));
154 });
155 }
156
157@@ -93,24 +99,26 @@
158 icon.show ();
159 tool_button.show ();
160
161- toolbar.insert (tool_button, toolbar.get_item_index (toolbar.find_button) + 1);
162+ toolbar.pack_start (tool_button);
163 }
164
165 void on_hook_context (Gtk.Notebook notebook) {
166- if (scrolled != null)
167- return;
168-
169- view = new WebView ();
170- // Enable local loading
171- var settings = view.get_settings ();
172- settings.enable_file_access_from_file_uris = true;
173-
174- scrolled = new Gtk.ScrolledWindow (null, null);
175- scrolled.add (view);
176-
177- notebook.append_page (scrolled, new Gtk.Label (_("Web preview")));
178-
179- scrolled.show_all ();
180+ if (scrolled != null)
181+ return;
182+
183+ this.notebook = notebook;
184+
185+ view = new WebView ();
186+ // Enable local loading
187+ var settings = view.get_settings ();
188+ settings.enable_file_access_from_file_uris = true;
189+
190+ scrolled = new Gtk.ScrolledWindow (null, null);
191+ scrolled.add (view);
192+
193+ notebook.append_page (scrolled, new Gtk.Label (_("Web preview")));
194+
195+ scrolled.show_all ();
196 }
197
198 }
199@@ -120,4 +128,4 @@
200 var objmodule = module as Peas.ObjectModule;
201 objmodule.register_extension_type (typeof (Peas.Activatable),
202 typeof (Scratch.Plugins.BrowserPreview));
203-}
204+}
205\ No newline at end of file
206
207=== modified file 'plugins/contractor/CMakeLists.txt'
208--- plugins/contractor/CMakeLists.txt 2013-11-30 08:48:08 +0000
209+++ plugins/contractor/CMakeLists.txt 2014-10-05 21:35:48 +0000
210@@ -9,9 +9,13 @@
211 granite
212 gtksourceview-3.0
213 scratchcore
214- gee-1.0
215+ gee-0.8
216 libpeas-1.0
217+<<<<<<< TREE
218 zeitgeist-1.0
219+=======
220+ ${ZEITGEIST_DEPS}
221+>>>>>>> MERGE-SOURCE
222 OPTIONS
223 --vapidir=${CMAKE_BINARY_DIR}
224 --vapidir=${CMAKE_BINARY_DIR}/src/
225
226=== modified file 'plugins/contractor/contractor.vala'
227--- plugins/contractor/contractor.vala 2013-06-07 21:00:59 +0000
228+++ plugins/contractor/contractor.vala 2014-10-05 21:35:48 +0000
229@@ -77,19 +77,18 @@
230 Gee.List<Granite.Services.Contract> contracts = null;
231 try {
232 contracts = Granite.Services.ContractorProxy.get_contracts_by_mime (doc.get_mime_type ());
233+
234+ for (int i = 0; i < contracts.size; i++) {
235+ var contract = contracts.get (i);
236+ Gtk.MenuItem menu_item;
237+
238+ menu_item = new ContractMenuItem (contract, doc.file);
239+ menu.append (menu_item);
240+ this.list.append (menu_item);
241+ }
242 } catch (Error e) {
243 warning (e.message);
244 }
245-
246- for (int i = 0; i < contracts.size; i++) {
247- var contract = contracts.get (i);
248- Gtk.MenuItem menu_item;
249-
250- menu_item = new ContractMenuItem (contract, doc.file);
251- menu.append (menu_item);
252- this.list.append (menu_item);
253- }
254-
255 });
256 }
257
258@@ -100,4 +99,4 @@
259 var objmodule = module as Peas.ObjectModule;
260 objmodule.register_extension_type (typeof (Peas.Activatable),
261 typeof (Scratch.Plugins.Contractor));
262-}
263+}
264\ No newline at end of file
265
266=== modified file 'plugins/filemanager/CMakeLists.txt'
267--- plugins/filemanager/CMakeLists.txt 2013-11-30 08:48:08 +0000
268+++ plugins/filemanager/CMakeLists.txt 2014-10-05 21:35:48 +0000
269@@ -7,12 +7,16 @@
270 FileView.vala
271 PACKAGES
272 gtk+-3.0
273- gee-1.0
274+ gee-0.8
275 granite
276 scratchcore
277 libpeas-1.0
278 gtksourceview-3.0
279+<<<<<<< TREE
280 zeitgeist-1.0
281+=======
282+ ${ZEITGEIST_DEPS}
283+>>>>>>> MERGE-SOURCE
284 OPTIONS
285 --vapidir=${CMAKE_BINARY_DIR}
286 --vapidir=${CMAKE_BINARY_DIR}/src/
287
288=== modified file 'plugins/filemanager/FileManagerPlugin.vala'
289--- plugins/filemanager/FileManagerPlugin.vala 2013-09-05 09:30:35 +0000
290+++ plugins/filemanager/FileManagerPlugin.vala 2014-10-05 21:35:48 +0000
291@@ -22,11 +22,9 @@
292 public const string DESCRIPTION = N_("Basic folder manager with file browsing");
293
294 namespace Scratch.Plugins {
295-
296- public Scratch.Services.Interface plugins;
297- public Gee.ArrayList<Scratch.Services.Document> documents;
298
299 public class FileManagerPlugin : Peas.ExtensionBase, Peas.Activatable {
300+ public Scratch.Services.Interface plugins;
301
302 Gtk.Box box;
303 FileManager.FileView view;
304@@ -38,13 +36,8 @@
305 }
306
307 public void activate () {
308- documents = new Gee.ArrayList<Scratch.Services.Document> ();
309 plugins = (Scratch.Services.Interface) object;
310 plugins.hook_notebook_sidebar.connect (on_hook_sidebar);
311- plugins.hook_document.connect ((doc) => {
312- if (!documents.contains (doc))
313- documents.add (doc);
314- });
315 }
316
317 public void deactivate () {
318
319=== modified file 'plugins/filemanager/FileView.vala'
320--- plugins/filemanager/FileView.vala 2013-07-21 21:11:23 +0000
321+++ plugins/filemanager/FileView.vala 2014-10-05 21:35:48 +0000
322@@ -43,11 +43,7 @@
323
324 settings = new Settings ();
325
326- this.set_sort_func ((a, b) => {
327- return File.compare ((a as Item).file, (b as Item).file);
328- });
329-
330- restore_sesttings ();
331+ restore_settings ();
332 }
333
334 /*public void open_folder (File folder) {
335@@ -131,7 +127,7 @@
336 settings.opened_folder = this.folder.file.file.get_path ();
337 }
338
339- private void restore_sesttings () {
340+ private void restore_settings () {
341 if (settings.opened_folder == "" || settings.opened_folder == null)
342 settings.opened_folder = GLib.Environment.get_home_dir ();
343 open_folder (new File (settings.opened_folder));
344@@ -177,25 +173,36 @@
345 }
346
347 /**
348- * Common interface for normal and expandable items.
349+ * Common abstract class for normal and expandable items.
350 */
351- internal interface Item : Granite.Widgets.SourceList.Item {
352- public abstract File file { get; construct; }
353- public abstract string path { get; }
354+ internal class Item : Granite.Widgets.SourceList.ExpandableItem, Granite.Widgets.SourceListSortable {
355+ public File file { get; construct; }
356+ public string path { get { return file.path; } }
357+
358+ public int compare (Granite.Widgets.SourceList.Item a,
359+ Granite.Widgets.SourceList.Item b) {
360+ if (a is FolderItem && b is FileItem) {
361+ return -1;
362+ } else if (a is FileItem && b is FolderItem) {
363+ return 1;
364+ }
365+ return File.compare ((a as Item).file, (b as Item).file);
366+ }
367+
368+ public bool allow_dnd_sorting () {
369+ return false;
370+ }
371 }
372
373 /**
374 * Normal item in the source list, represents a textfile.
375 * TODO Remove, Rename
376 */
377- internal class FileItem : Granite.Widgets.SourceList.Item, Item {
378+ internal class FileItem : Item {
379
380 //Gtk.Menu menu;
381 //Gtk.MenuItem item_trash;
382
383- public File file { get; construct; }
384- public string path { get { return file.path; } }
385-
386 public FileItem (File file) requires (file.is_valid_textfile) {
387 Object (file: file);
388
389@@ -208,11 +215,6 @@
390 public void rename (string new_name) {
391 string new_uri = file.file.get_parent ().get_uri () + "/" + new_name;
392 debug (new_uri);
393- for (int n = 0; n < documents.to_array ().length; n++) {
394- var doc = documents.to_array ()[n];
395- if (doc.file.get_uri () == file.file.get_uri ())
396- doc.file = GLib.File.new_for_uri (new_uri);
397- }
398 file.rename (new_name);
399 }
400
401@@ -231,7 +233,7 @@
402 * Monitored for changes inside the directory.
403 * TODO remove, rename, create new file
404 */
405- internal class FolderItem : Granite.Widgets.SourceList.ExpandableItem, Item {
406+ internal class FolderItem : Item {
407
408 //Gtk.Menu menu;
409 //Gtk.MenuItem item_trash;
410@@ -242,9 +244,6 @@
411
412 public FileView view { get; construct; }
413
414- public File file { get; construct; }
415- public string path { get { return file.path; } }
416-
417 public signal void folder_open (GLib.File folder);
418
419 public FolderItem (File file, FileView view) requires (file.is_valid_directory) {
420@@ -314,9 +313,13 @@
421 switch (event) {
422
423 case GLib.FileMonitorEvent.DELETED:
424- foreach (var item in children)
425- if ((item as Item).path == source.get_path ())
426+ var children_tmp = new Gee.ArrayList<Granite.Widgets.SourceList.Item> ();
427+ children_tmp.add_all (children);
428+ foreach (var item in children_tmp) {
429+ if ((item as Item).path == source.get_path ()) {
430 remove (item);
431+ }
432+ }
433 break;
434
435 case GLib.FileMonitorEvent.CREATED:
436
437=== modified file 'plugins/folder-manager/CMakeLists.txt'
438--- plugins/folder-manager/CMakeLists.txt 2013-11-30 08:48:08 +0000
439+++ plugins/folder-manager/CMakeLists.txt 2014-10-05 21:35:48 +0000
440@@ -7,12 +7,16 @@
441 FileView.vala
442 PACKAGES
443 gtk+-3.0
444- gee-1.0
445+ gee-0.8
446 granite
447 scratchcore
448 libpeas-1.0
449 gtksourceview-3.0
450+<<<<<<< TREE
451 zeitgeist-1.0
452+=======
453+ ${ZEITGEIST_DEPS}
454+>>>>>>> MERGE-SOURCE
455 OPTIONS
456 --vapidir=${CMAKE_BINARY_DIR}
457 --vapidir=${CMAKE_BINARY_DIR}/src/
458
459=== modified file 'plugins/folder-manager/FileView.vala'
460--- plugins/folder-manager/FileView.vala 2013-06-02 13:07:08 +0000
461+++ plugins/folder-manager/FileView.vala 2014-10-05 21:35:48 +0000
462@@ -37,10 +37,6 @@
463 });
464
465 settings = new Settings ();
466-
467- this.set_sort_func ((a, b) => {
468- return File.compare ((a as Item).file, (b as Item).file);
469- });
470 }
471
472 public void restore_saved_state () {
473@@ -147,25 +143,36 @@
474 }
475
476 /**
477- * Common interface for normal and expandable items.
478+ * Common abstract class for file and filder items.
479 */
480- internal interface Item : Granite.Widgets.SourceList.Item {
481- public abstract File file { get; construct; }
482- public abstract string path { get; }
483+ internal class Item: Granite.Widgets.SourceList.ExpandableItem, Granite.Widgets.SourceListSortable {
484+ public File file { get; construct; }
485+ public string path { get { return file.path; } }
486+
487+ public int compare (Granite.Widgets.SourceList.Item a,
488+ Granite.Widgets.SourceList.Item b) {
489+ if (a is FolderItem && b is FileItem) {
490+ return -1;
491+ } else if (a is FileItem && b is FolderItem) {
492+ return 1;
493+ }
494+ return File.compare ((a as Item).file, (b as Item).file);
495+ }
496+
497+ public bool allow_dnd_sorting () {
498+ return false;
499+ }
500 }
501
502 /**
503 * Normal item in the source list, represents a textfile.
504 * TODO Remove, Rename
505 */
506- internal class FileItem : Granite.Widgets.SourceList.Item, Item {
507+ internal class FileItem : Item {
508
509 //Gtk.Menu menu;
510 //Gtk.MenuItem item_trash;
511
512- public File file { get; construct; }
513- public string path { get { return file.path; } }
514-
515 public FileItem (File file) requires (file.is_valid_textfile) {
516 Object (file: file);
517
518@@ -194,7 +201,7 @@
519 * Monitored for changes inside the directory.
520 * TODO remove, rename, create new file
521 */
522- internal class FolderItem : Granite.Widgets.SourceList.ExpandableItem, Item {
523+ internal class FolderItem : Item {
524
525 //Gtk.Menu menu;
526 //Gtk.MenuItem item_trash;
527@@ -203,9 +210,6 @@
528 private GLib.FileMonitor monitor;
529 private bool children_loaded = false;
530
531- public File file { get; construct; }
532- public string path { get { return file.path; } }
533-
534 public FolderItem (File file) requires (file.is_valid_directory) {
535 Object (file: file);
536
537@@ -274,9 +278,13 @@
538 switch (event) {
539
540 case GLib.FileMonitorEvent.DELETED:
541- foreach (var item in children)
542- if ((item as Item).path == source.get_path ())
543+ var children_tmp = new Gee.ArrayList<Granite.Widgets.SourceList.Item> ();
544+ children_tmp.add_all (children);
545+ foreach (var item in children_tmp) {
546+ if ((item as Item).path == source.get_path ()) {
547 remove (item);
548+ }
549+ }
550 break;
551
552 case GLib.FileMonitorEvent.CREATED:
553
554=== modified file 'plugins/folder-manager/FolderManagerPlugin.vala'
555--- plugins/folder-manager/FolderManagerPlugin.vala 2013-06-07 21:00:59 +0000
556+++ plugins/folder-manager/FolderManagerPlugin.vala 2014-10-05 21:35:48 +0000
557@@ -80,7 +80,7 @@
558 view.restore_saved_state ();
559 }
560
561- void on_hook_toolbar (Gtk.Toolbar toolbar) {
562+ void on_hook_toolbar (Gtk.HeaderBar toolbar) {
563 if (tool_button != null)
564 return;
565
566@@ -89,10 +89,11 @@
567 tool_button = new Gtk.ToolButton (icon, _("Open a folder"));
568 tool_button.tooltip_text = _("Open a folder");
569 tool_button.clicked.connect (() => {
570+ Gtk.Window window = plugins.manager.window;
571 Gtk.FileChooserDialog chooser = new Gtk.FileChooserDialog (
572- "Select a folder.", null, Gtk.FileChooserAction.SELECT_FOLDER,
573- Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL,
574- Gtk.Stock.OPEN, Gtk.ResponseType.ACCEPT);
575+ "Select a folder.", window, Gtk.FileChooserAction.SELECT_FOLDER,
576+ _("_Cancel"), Gtk.ResponseType.CANCEL,
577+ _("_Open"), Gtk.ResponseType.ACCEPT);
578 chooser.select_multiple = true;
579
580 if (chooser.run () == Gtk.ResponseType.ACCEPT) {
581@@ -109,7 +110,8 @@
582 icon.show ();
583 tool_button.show ();
584
585- toolbar.insert (tool_button, 1);
586+ toolbar.pack_start (tool_button);
587+ //toolbar.insert (tool_button, 1);
588 }
589 }
590 }
591
592=== added directory 'plugins/highlight-word-selection'
593=== added file 'plugins/highlight-word-selection/CMakeLists.txt'
594--- plugins/highlight-word-selection/CMakeLists.txt 1970-01-01 00:00:00 +0000
595+++ plugins/highlight-word-selection/CMakeLists.txt 2014-10-05 21:35:48 +0000
596@@ -0,0 +1,28 @@
597+add_definitions(${NORMAL_CFLAGS})
598+include_directories(${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/scratchcore/)
599+link_directories(${NORMAL_LINK_DIRS})
600+
601+vala_precompile(VALA_C
602+ highlight-word-selection.vala
603+PACKAGES
604+ granite
605+ gtksourceview-3.0
606+ scratchcore
607+ gee-0.8
608+ libpeas-1.0
609+ ${ZEITGEIST_DEPS}
610+OPTIONS
611+ --thread
612+ --vapidir=${CMAKE_BINARY_DIR}
613+ --vapidir=${CMAKE_BINARY_DIR}/src/
614+ --vapidir=${CMAKE_SOURCE_DIR}/vapi/
615+ --vapidir=${CMAKE_BINARY_DIR}/scratchcore/
616+)
617+
618+add_library(highlight-word-selection MODULE ${VALA_C})
619+add_dependencies(highlight-word-selection scratchcore scratch)
620+
621+install(TARGETS highlight-word-selection DESTINATION lib/scratch/plugins/highlight-word-selection/)
622+install(FILES highlight-word-selection.plugin DESTINATION lib/scratch/plugins/highlight-word-selection/)
623+
624+message("-- Highlight words plugin will be compiled")
625
626=== added file 'plugins/highlight-word-selection/highlight-word-selection.plugin'
627--- plugins/highlight-word-selection/highlight-word-selection.plugin 1970-01-01 00:00:00 +0000
628+++ plugins/highlight-word-selection/highlight-word-selection.plugin 2014-10-05 21:35:48 +0000
629@@ -0,0 +1,10 @@
630+[Plugin]
631+Module=highlight-word-selection
632+Loader=C
633+IAge=2
634+Name=Highlight Word Selection
635+Description=Highlights all occurrences of words that are selected
636+Authors=Madelynn May <madelynnmay@madelynnmay.com>
637+Copyright=Copyright © 2014 Scratch and Euclide Developers
638+Website=http://launchpad.net/scratch
639+Hidden=false
640
641=== added file 'plugins/highlight-word-selection/highlight-word-selection.vala'
642--- plugins/highlight-word-selection/highlight-word-selection.vala 1970-01-01 00:00:00 +0000
643+++ plugins/highlight-word-selection/highlight-word-selection.vala 2014-10-05 21:35:48 +0000
644@@ -0,0 +1,97 @@
645+// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
646+/***
647+ BEGIN LICENSE
648+
649+ Copyright (C) 2013 Madelynn May <madelynnmay@madelynnmay.com>
650+ This program is free software: you can redistribute it and/or modify it
651+ under the terms of the GNU Lesser General Public License version 3, as published
652+ by the Free Software Foundation.
653+
654+ This program is distributed in the hope that it will be useful, but
655+ WITHOUT ANY WARRANTY; without even the implied warranties of
656+ MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
657+ PURPOSE. See the GNU General Public License for more details.
658+
659+ You should have received a copy of the GNU General Public License along
660+ with this program. If not, see <http://www.gnu.org/licenses/>
661+
662+ END LICENSE
663+***/
664+
665+public const string NAME = N_("Highlight Selected Words");
666+public const string DESCRIPTION = N_("Highlights all occurrences of words that are selected");
667+
668+public class Scratch.Plugins.HighlightSelectedWords : Peas.ExtensionBase, Peas.Activatable {
669+ // Properties
670+ List<Scratch.Widgets.SourceView> source_views;
671+ Gee.HashMap<Scratch.Widgets.SourceView, Gtk.SourceSearchContext> search_contexts;
672+ Scratch.Widgets.SourceView current_source;
673+
674+ // Consts
675+ // Pneumonoultramicroscopicsilicovolcanoconiosis longest word in a major dictionary @ 45
676+ private const uint SELECTION_HIGHLIGHT_MAX_CHARS = 45;
677+
678+ Scratch.Services.Interface plugins;
679+ public Object object { owned get; construct; }
680+
681+ public void update_state () {
682+ }
683+
684+ public void activate () {
685+ this.source_views = new List<Scratch.Widgets.SourceView> ();
686+ this.search_contexts = new Gee.HashMap<Scratch.Widgets.SourceView, Gtk.SourceSearchContext> ();
687+
688+ plugins = (Scratch.Services.Interface) object;
689+ plugins.hook_document.connect ((doc) => {
690+ var src = doc.source_view;
691+ src.deselected.disconnect (on_deselection);
692+ src.deselected.connect (on_deselection);
693+ src.selection_changed.disconnect (on_selection_changed);
694+ src.selection_changed.connect (on_selection_changed);
695+ this.source_views.append (src);
696+ this.search_contexts.set (src, new Gtk.SourceSearchContext (src.buffer,null));
697+ this.current_source = src;
698+ });
699+ }
700+
701+ public void on_selection_changed (Gtk.TextIter start,Gtk.TextIter end) {
702+ if (this.current_source.buffer.get_has_selection ())
703+ {
704+ // Expand highlight to current word on
705+ if (!start.starts_word ())
706+ start.backward_word_start ();
707+ if (!end.ends_word ())
708+ end.forward_word_end ();
709+ string selected_text = this.current_source.buffer.get_text (start,end,false);
710+ if (selected_text.length > SELECTION_HIGHLIGHT_MAX_CHARS)
711+ return;
712+ Gtk.SourceSearchContext context = search_contexts.get (this.current_source);
713+ context.settings.search_text = selected_text;
714+ context.set_highlight (true);
715+ }
716+ }
717+
718+ public void on_deselection () {
719+ Gtk.SourceSearchContext context = search_contexts.get (this.current_source);
720+ context.settings.search_text = null;
721+ context.set_highlight (false);
722+ }
723+
724+ public void deactivate () {
725+ source_views.foreach ((src) => {
726+ src.deselected.disconnect (on_deselection);
727+ src.selection_changed.disconnect (on_selection_changed);
728+ Gtk.SourceSearchContext context = search_contexts.get (src);
729+ context.settings.search_text = null;
730+ context.set_highlight (false);
731+ });
732+ }
733+
734+}
735+
736+[ModuleInit]
737+public void peas_register_types (TypeModule module) {
738+ var objmodule = module as Peas.ObjectModule;
739+ objmodule.register_extension_type (typeof (Peas.Activatable),
740+ typeof (Scratch.Plugins.HighlightSelectedWords));
741+}
742
743=== modified file 'plugins/open-with/CMakeLists.txt'
744--- plugins/open-with/CMakeLists.txt 2013-11-30 08:48:08 +0000
745+++ plugins/open-with/CMakeLists.txt 2014-10-05 21:35:48 +0000
746@@ -7,9 +7,13 @@
747 granite
748 gtksourceview-3.0
749 scratchcore
750- gee-1.0
751+ gee-0.8
752 libpeas-1.0
753+<<<<<<< TREE
754 zeitgeist-1.0
755+=======
756+ ${ZEITGEIST_DEPS}
757+>>>>>>> MERGE-SOURCE
758 OPTIONS
759 --vapidir=${CMAKE_BINARY_DIR}
760 --vapidir=${CMAKE_BINARY_DIR}/src/
761
762=== modified file 'plugins/outline/CMakeLists.txt'
763--- plugins/outline/CMakeLists.txt 2013-11-30 08:48:08 +0000
764+++ plugins/outline/CMakeLists.txt 2014-10-05 21:35:48 +0000
765@@ -1,22 +1,28 @@
766 add_definitions(${NORMAL_CFLAGS})
767 link_directories(${NORMAL_LINK_DIRS})
768 vala_precompile(VALA_C
769- OutlinePlugin.vala
770- ValaSymbolResolver.vala
771- CtagsSymbolResolver.vala
772+ OutlinePlugin.vala
773+ ValaSymbolResolver.vala
774+ CtagsSymbolResolver.vala
775 PACKAGES
776 gtk+-3.0
777- gee-1.0
778+ gee-0.8
779 granite
780 scratchcore
781 libpeas-1.0
782 gtksourceview-3.0
783+<<<<<<< TREE
784 zeitgeist-1.0
785 libvala-${VALA_SHORTVER}
786+=======
787+ ${ZEITGEIST_DEPS}
788+ libvala-${VALA_SHORTVER}
789+>>>>>>> MERGE-SOURCE
790 OPTIONS
791 --vapidir=${CMAKE_BINARY_DIR}
792 --vapidir=${CMAKE_BINARY_DIR}/src/
793 --vapidir=${CMAKE_BINARY_DIR}/scratchcore/
794+ --target-glib=2.32
795 )
796
797 pkg_check_modules(OUTLINE_DEPS libvala-${VALA_SHORTVER})
798
799=== modified file 'plugins/outline/CtagsSymbolResolver.vala'
800--- plugins/outline/CtagsSymbolResolver.vala 2013-07-09 14:17:42 +0000
801+++ plugins/outline/CtagsSymbolResolver.vala 2014-10-05 21:35:48 +0000
802@@ -1,221 +1,227 @@
803
804 public class CtagsSymbol : Granite.Widgets.SourceList.ExpandableItem
805 {
806- public Scratch.Services.Document doc { get; construct set; }
807- public int line { get; construct set; }
808+ public Scratch.Services.Document doc { get; construct set; }
809+ public int line { get; construct set; }
810
811- public CtagsSymbol (Scratch.Services.Document doc, string name, int line, Icon? _icon)
812- {
813- Object (doc: doc, name: name, line: line);
814- icon = _icon;
815- }
816+ public CtagsSymbol (Scratch.Services.Document doc, string name, int line, Icon? _icon)
817+ {
818+ Object (doc: doc, name: name, line: line);
819+ icon = _icon;
820+ }
821 }
822
823 class CtagsSymbolIter : Object
824 {
825- public string name { get; construct set; }
826- public string parent { get; construct set; }
827- public int line { get; construct set; }
828- public Icon icon { get; construct set; }
829+ public string name { get; construct set; }
830+ public string parent { get; construct set; }
831+ public int line { get; construct set; }
832+ public Icon icon { get; construct set; }
833
834- public CtagsSymbolIter (string name, string parent, int line, Icon icon)
835- {
836- Object(name: name, parent: parent, line: line, icon: icon);
837- }
838+ public CtagsSymbolIter (string name, string parent, int line, Icon icon)
839+ {
840+ Object(name: name, parent: parent, line: line, icon: icon);
841+ }
842 }
843
844 public class CtagsSymbolOutline : Object, SymbolOutline
845 {
846- public Scratch.Services.Document doc { get; protected set; }
847- Granite.Widgets.SourceList store;
848- Granite.Widgets.SourceList.ExpandableItem root;
849-
850- public CtagsSymbolOutline (Scratch.Services.Document _doc)
851- {
852- doc = _doc;
853- doc.doc_closed.connect (doc_closed);
854-
855- root = new Granite.Widgets.SourceList.ExpandableItem (_("Symbols"));
856-
857- store = new Granite.Widgets.SourceList ();
858- store.get_style_context ().add_class ("sidebar");
859- store.item_selected.connect ((selected) => {
860- if (selected == null) return;
861- goto (doc, (selected as CtagsSymbol).line);
862- store.selected = null;
863- });
864- store.root.add (root);
865- }
866-
867- ~CtagsSymbolOutline ()
868- {
869- doc.doc_closed.disconnect (doc_closed);
870- }
871-
872- void doc_closed (Scratch.Services.Document doc)
873- {
874- closed ();
875- }
876-
877- public void parse_symbols ()
878- {
879- var command = new Granite.Services.SimpleCommand (Environment.get_home_dir (),
880- "/usr/bin/ctags -f - --format=2 --excmd=n --fields=nsK --extra= "+
881- "--sort=no " + doc.file.get_path ());
882- command.done.connect (parse_output);
883- command.run ();
884- }
885-
886- void parse_output (Granite.Services.SimpleCommand command, int status)
887- {
888- root.clear ();
889- var parent_dependent = new Gee.LinkedList<CtagsSymbolIter> ();
890-
891- if (status != 0)
892- error ("Ctags failed\n");
893-
894- var symbols = command.standard_output_str.split ("\n");
895- foreach (var symbol in symbols) {
896- if (symbol == "")
897- continue;
898-
899- var parts = symbol.split ("\t");
900- var name = parts[0];
901- // 1 => filename
902- // 2 => line number with weird trailing chars
903- var type = parts[3];
904- int line = 0;
905- string? parent = null;
906- parse_fields (string.joinv (" ", parts[4:parts.length - 1]), out line, out parent);
907-
908- Icon? icon = null;
909- switch (type) {
910- case "class":
911- case "struct":
912- icon = new ThemedIcon.from_names ({"user-home-symbolic", "go-home-symbolic", "user-home", "go-home", "home"});
913- break;
914- case "field":
915- case "constant":
916- case "enumerator":
917- case "member":
918- case "variable":
919- icon = new ThemedIcon.with_default_fallbacks ("view-grid-symbolic");
920- break;
921- case "constructor":
922- icon = new ThemedIcon.with_default_fallbacks ("media-playback-start-symbolic");
923- break;
924- case "desctructor":
925- icon = new ThemedIcon.with_default_fallbacks ("edit-delete-symbolic");
926- break;
927- case "enum":
928- case "typedef":
929- icon = new ThemedIcon.with_default_fallbacks ("view-list-compact-symbolic");
930- break;
931- case "method":
932- case "function":
933- icon = new ThemedIcon.with_default_fallbacks ("document-properties-symbolic");
934- break;
935- case "namespace":
936- case "package":
937- icon = new ThemedIcon.with_default_fallbacks ("view-fullscreen-symbolic");
938- break;
939- case "property":
940- icon = new ThemedIcon.with_default_fallbacks ("format-indent-more-symbolic");
941- break;
942- case "macro":
943- icon = new ThemedIcon.with_default_fallbacks ("mail-attachment-symbolic");
944- break;
945- }
946-
947- if (parent == null) {
948- var s = new CtagsSymbol (doc, name, line, icon);
949- root.add (s);
950- } else
951- parent_dependent.add (new CtagsSymbolIter (name, parent, line, icon));
952- }
953-
954- var found_something = true;
955- while (found_something && parent_dependent.size > 0) {
956- found_something = false;
957- var iter = parent_dependent.iterator ();
958- while (iter.has_next ()) {
959- iter.next ();
960- var i = iter.get ();
961-
962- var parent = find_existing (i.parent, root);
963- if (parent != null) {
964- found_something = true;
965- parent.add (new CtagsSymbol (doc, i.name, i.line, i.icon));
966- iter.remove ();
967- } else {
968- // anonymous enum
969- if (i.parent.substring (0, 6) == "__anon") {
970- var e = new CtagsSymbol (doc, i.parent, i.line - 1,
971- new ThemedIcon.with_default_fallbacks ("view-list-compact-symbolic"));
972- root.add (e);
973-
974- e.add (new CtagsSymbol (doc, i.name, i.line, i.icon));
975- iter.remove ();
976- }
977- }
978- }
979- }
980- // just add the rest
981- foreach (var symbol in parent_dependent) {
982- root.add (new CtagsSymbol (doc, symbol.name, symbol.line, symbol.icon));
983- }
984-
985- store.root.expand_all ();
986- store.show_all ();
987- store.get_parent ().show_all ();
988- }
989-
990- void parse_fields (string fields, out int line, out string parent)
991- {
992- var index = -1;
993- if ((index = fields.index_of ("line:")) > -1) {
994- line = int.parse (fields.substring (index + 5, int.max (fields.index_of (" ", index + 6) - index, -1)));
995- }
996- if ((index = fields.index_of ("class:")) > -1) {
997- parent = fields.substring (index + 6, int.max (fields.index_of (" ", index + 7) - index, -1));
998- }
999- if ((index = fields.index_of ("struct:")) > -1) {
1000- parent = fields.substring (index + 7, int.max (fields.index_of (" ", index + 7) - index, -1));
1001- }
1002- if ((index = fields.index_of ("enum:")) > -1) {
1003- parent = fields.substring (index + 5, int.max (fields.index_of (" ", index + 7) - index, -1));
1004- }
1005- }
1006-
1007- CtagsSymbol? find_existing (string name, Granite.Widgets.SourceList.ExpandableItem parent)
1008- {
1009- CtagsSymbol match = null;
1010- foreach (var child in parent.children) {
1011- var child_symbol = child as CtagsSymbol;
1012- if (child_symbol.name == name) {
1013- match = child_symbol;
1014- break;
1015- } else {
1016- var res = find_existing (name, child_symbol);
1017- if (res != null)
1018- return res;
1019- }
1020- }
1021- return match;
1022- }
1023-
1024- public static string[] get_supported_types ()
1025- {
1026- string stdout;
1027- try {
1028- Process.spawn_sync (null, {"/usr/bin/ctags", "--list-languages"}, null, 0, null, out stdout);
1029- } catch (Error e) { error (e.message); }
1030- return stdout.split ("\n");
1031- }
1032-
1033- public Granite.Widgets.SourceList get_source_list ()
1034- {
1035- return store;
1036- }
1037-}
1038-
1039+ public Scratch.Services.Document doc { get; protected set; }
1040+ Granite.Widgets.SourceList store;
1041+ Granite.Widgets.SourceList.ExpandableItem root;
1042+
1043+ public int n_symbols { get; protected set; }
1044+
1045+ public CtagsSymbolOutline (Scratch.Services.Document _doc)
1046+ {
1047+ doc = _doc;
1048+ doc.doc_closed.connect (doc_closed);
1049+
1050+ root = new Granite.Widgets.SourceList.ExpandableItem (_("Symbols"));
1051+
1052+ this.n_symbols = 0;
1053+
1054+ store = new Granite.Widgets.SourceList ();
1055+ store.get_style_context ().add_class ("sidebar");
1056+ store.item_selected.connect ((selected) => {
1057+ if (selected == null) return;
1058+ goto (doc, (selected as CtagsSymbol).line);
1059+ store.selected = null;
1060+ });
1061+ store.root.add (root);
1062+ }
1063+
1064+ ~CtagsSymbolOutline ()
1065+ {
1066+ doc.doc_closed.disconnect (doc_closed);
1067+ }
1068+
1069+ void doc_closed (Scratch.Services.Document doc)
1070+ {
1071+ closed ();
1072+ }
1073+
1074+ public void parse_symbols ()
1075+ {
1076+ var command = new Granite.Services.SimpleCommand (Environment.get_home_dir (),
1077+ "/usr/bin/ctags -f - --format=2 --excmd=n --fields=nsK --extra= "+
1078+ "--sort=no " + doc.file.get_path ());
1079+ command.done.connect (parse_output);
1080+ command.run ();
1081+ }
1082+
1083+ void parse_output (Granite.Services.SimpleCommand command, int status)
1084+ {
1085+ root.clear ();
1086+ var parent_dependent = new Gee.LinkedList<CtagsSymbolIter> ();
1087+
1088+ if (status != 0)
1089+ error ("Ctags failed\n");
1090+
1091+ var symbols = command.standard_output_str.split ("\n");
1092+ foreach (var symbol in symbols) {
1093+ if (symbol == "")
1094+ continue;
1095+
1096+ var parts = symbol.split ("\t");
1097+ var name = parts[0];
1098+ // 1 => filename
1099+ // 2 => line number with weird trailing chars
1100+ var type = parts[3];
1101+ int line = 0;
1102+ string? parent = null;
1103+ parse_fields (string.joinv (" ", parts[4:parts.length]), out line, out parent);
1104+
1105+ Icon? icon = null;
1106+ switch (type) {
1107+ case "class":
1108+ case "struct":
1109+ icon = new ThemedIcon.from_names ({"user-home-symbolic", "go-home-symbolic", "user-home", "go-home", "home"});
1110+ break;
1111+ case "field":
1112+ case "constant":
1113+ case "enumerator":
1114+ case "member":
1115+ case "variable":
1116+ icon = new ThemedIcon.with_default_fallbacks ("view-grid-symbolic");
1117+ break;
1118+ case "constructor":
1119+ icon = new ThemedIcon.with_default_fallbacks ("media-playback-start-symbolic");
1120+ break;
1121+ case "desctructor":
1122+ icon = new ThemedIcon.with_default_fallbacks ("edit-delete-symbolic");
1123+ break;
1124+ case "enum":
1125+ case "typedef":
1126+ icon = new ThemedIcon.with_default_fallbacks ("view-list-compact-symbolic");
1127+ break;
1128+ case "method":
1129+ case "function":
1130+ icon = new ThemedIcon.with_default_fallbacks ("document-properties-symbolic");
1131+ break;
1132+ case "namespace":
1133+ case "package":
1134+ icon = new ThemedIcon.with_default_fallbacks ("view-fullscreen-symbolic");
1135+ break;
1136+ case "property":
1137+ icon = new ThemedIcon.with_default_fallbacks ("format-indent-more-symbolic");
1138+ break;
1139+ case "macro":
1140+ icon = new ThemedIcon.with_default_fallbacks ("mail-attachment-symbolic");
1141+ break;
1142+ }
1143+
1144+ if (parent == null) {
1145+ var s = new CtagsSymbol (doc, name, line, icon);
1146+ root.add (s);
1147+ } else
1148+ parent_dependent.add (new CtagsSymbolIter (name, parent, line, icon));
1149+ }
1150+ this.n_symbols++;
1151+
1152+ var found_something = true;
1153+ while (found_something && parent_dependent.size > 0) {
1154+ found_something = false;
1155+ var iter = parent_dependent.iterator ();
1156+ while (iter.has_next ()) {
1157+ iter.next ();
1158+ var i = iter.get ();
1159+
1160+ var parent = find_existing (i.parent, root);
1161+ if (parent != null) {
1162+ found_something = true;
1163+ parent.add (new CtagsSymbol (doc, i.name, i.line, i.icon));
1164+ iter.remove ();
1165+ } else {
1166+ // anonymous enum
1167+ if (i.parent.substring (0, 6) == "__anon") {
1168+ var e = new CtagsSymbol (doc, i.parent, i.line - 1,
1169+ new ThemedIcon.with_default_fallbacks ("view-list-compact-symbolic"));
1170+ root.add (e);
1171+
1172+ e.add (new CtagsSymbol (doc, i.name, i.line, i.icon));
1173+ iter.remove ();
1174+ }
1175+ }
1176+ }
1177+ }
1178+ // just add the rest
1179+ foreach (var symbol in parent_dependent) {
1180+ root.add (new CtagsSymbol (doc, symbol.name, symbol.line, symbol.icon));
1181+ }
1182+
1183+ store.root.expand_all ();
1184+ store.show_all ();
1185+ store.get_parent ().show_all ();
1186+ }
1187+
1188+ void parse_fields (string fields, out int line, out string parent)
1189+ {
1190+ var index = -1;
1191+ line = -1;
1192+ parent = null;
1193+ if ((index = fields.index_of ("line:")) > -1) {
1194+ line = int.parse (fields.substring (index + 5, int.max (fields.index_of (" ", index + 6) - index, -1)));
1195+ }
1196+ if ((index = fields.index_of ("class:")) > -1) {
1197+ parent = fields.substring (index + 6, int.max (fields.index_of (" ", index + 7) - index, -1));
1198+ }
1199+ if ((index = fields.index_of ("struct:")) > -1) {
1200+ parent = fields.substring (index + 7, int.max (fields.index_of (" ", index + 7) - index, -1));
1201+ }
1202+ if ((index = fields.index_of ("enum:")) > -1) {
1203+ parent = fields.substring (index + 5, int.max (fields.index_of (" ", index + 7) - index, -1));
1204+ }
1205+ }
1206+
1207+ CtagsSymbol? find_existing (string name, Granite.Widgets.SourceList.ExpandableItem parent)
1208+ {
1209+ CtagsSymbol match = null;
1210+ foreach (var child in parent.children) {
1211+ var child_symbol = child as CtagsSymbol;
1212+ if (child_symbol.name == name) {
1213+ match = child_symbol;
1214+ break;
1215+ } else {
1216+ var res = find_existing (name, child_symbol);
1217+ if (res != null)
1218+ return res;
1219+ }
1220+ }
1221+ return match;
1222+ }
1223+
1224+ public static string[] get_supported_types ()
1225+ {
1226+ string stdout;
1227+ try {
1228+ Process.spawn_sync (null, {"/usr/bin/ctags", "--list-languages"}, null, 0, null, out stdout);
1229+ } catch (Error e) { error (e.message); }
1230+ return stdout.split ("\n");
1231+ }
1232+
1233+ public Granite.Widgets.SourceList get_source_list ()
1234+ {
1235+ return store;
1236+ }
1237+}
1238\ No newline at end of file
1239
1240=== modified file 'plugins/outline/OutlinePlugin.vala'
1241--- plugins/outline/OutlinePlugin.vala 2013-07-17 09:02:47 +0000
1242+++ plugins/outline/OutlinePlugin.vala 2014-10-05 21:35:48 +0000
1243@@ -23,31 +23,33 @@
1244
1245 public interface SymbolOutline : Object
1246 {
1247- public abstract Scratch.Services.Document doc { get; protected set; }
1248- public abstract void parse_symbols ();
1249- public abstract Granite.Widgets.SourceList get_source_list ();
1250- public signal void closed ();
1251- public signal void goto (Scratch.Services.Document doc, int line);
1252+ public abstract Scratch.Services.Document doc { get; protected set; }
1253+ public abstract void parse_symbols ();
1254+ public abstract int n_symbols { get; protected set; }
1255+ public abstract Granite.Widgets.SourceList get_source_list ();
1256+ public signal void closed ();
1257+ public signal void goto (Scratch.Services.Document doc, int line);
1258 }
1259
1260 namespace Scratch.Plugins {
1261 public class OutlinePlugin : Peas.ExtensionBase, Peas.Activatable {
1262 public Object object { owned get; construct; }
1263
1264- Scratch.Services.Interface scratch_interface;
1265- SymbolOutline? current_view = null;
1266- Gtk.EventBox? container = null;
1267-
1268- uint refresh_timeout = 0;
1269-
1270- Gee.List<SymbolOutline> views;
1271+ Scratch.Services.Interface scratch_interface;
1272+ SymbolOutline? current_view = null;
1273+ Gtk.EventBox? container = null;
1274+ Gtk.Notebook? notebook = null;
1275+
1276+ uint refresh_timeout = 0;
1277+
1278+ Gee.List<SymbolOutline> views;
1279
1280 public void activate () {
1281- scratch_interface = (Scratch.Services.Interface)object;
1282+ scratch_interface = (Scratch.Services.Interface)object;
1283 scratch_interface.hook_notebook_context.connect (on_hook_context);
1284- scratch_interface.hook_document.connect (on_hook_document);
1285- scratch_interface.hook_split_view.connect (on_hook_split_view);
1286- views = new Gee.LinkedList<SymbolOutline> ();
1287+ scratch_interface.hook_document.connect (on_hook_document);
1288+ scratch_interface.hook_split_view.connect (on_hook_split_view);
1289+ views = new Gee.LinkedList<SymbolOutline> ();
1290 }
1291
1292 public void deactivate () {
1293@@ -60,83 +62,102 @@
1294 void on_hook_context (Gtk.Notebook notebook) {
1295 if (container != null)
1296 return;
1297-
1298+ if (this.notebook == null)
1299+ this.notebook = notebook;
1300+
1301 container = new Gtk.EventBox ();
1302- container.visible = false;
1303- notebook.append_page (container, new Gtk.Label (_("Symbols")));
1304- container.show_all ();
1305- }
1306-
1307- void on_hook_document (Scratch.Services.Document doc) {
1308- if (current_view != null && current_view.doc == doc)
1309- return;
1310-
1311- if (current_view != null)
1312- container.remove (current_view.get_source_list ());
1313-
1314- SymbolOutline view = null;
1315- foreach (var v in views) {
1316- if (v.doc == doc) {
1317- view = v;
1318- break;
1319- }
1320- }
1321- if (view == null) {
1322- if (doc.get_mime_type () == "text/x-vala") {
1323- view = new ValaSymbolOutline (doc);
1324- } else {
1325- view = new CtagsSymbolOutline (doc);
1326- }
1327- view.closed.connect (remove_view);
1328- view.goto.connect (goto);
1329- views.add (view);
1330- view.parse_symbols ();
1331-
1332- doc.doc_saved.connect (update_timeout);
1333- }
1334-
1335- container.add (view.get_source_list ());
1336- container.show_all ();
1337- current_view = view;
1338- }
1339+ container.visible = false;
1340+ }
1341+
1342+ void on_hook_document (Scratch.Services.Document doc) {
1343+ if (current_view != null && current_view.doc == doc)
1344+ return;
1345+
1346+ if (current_view != null)
1347+ container.remove (current_view.get_source_list ());
1348+
1349+ SymbolOutline view = null;
1350+ foreach (var v in views) {
1351+ if (v.doc == doc) {
1352+ view = v;
1353+ break;
1354+ }
1355+ }
1356+ if (view == null && doc.file != null) {
1357+ if (doc.get_mime_type () == "text/x-vala") {
1358+ view = new ValaSymbolOutline (doc);
1359+ } else {
1360+ view = new CtagsSymbolOutline (doc);
1361+ }
1362+ view.closed.connect (remove_view);
1363+ view.goto.connect (goto);
1364+ views.add (view);
1365+ view.parse_symbols ();
1366+
1367+ doc.doc_saved.connect (update_timeout);
1368+ }
1369+
1370+ container.add (view.get_source_list ());
1371+ container.show_all ();
1372+ current_view = view;
1373+
1374+ if (view.n_symbols > 1) {
1375+ add_container ();
1376+ }
1377+ else if (doc.file == null || view.n_symbols <= 1) {
1378+ remove_container ();
1379+ }
1380+ }
1381+
1382+ void add_container () {
1383+ if(notebook.page_num (container) == -1) {
1384+ notebook.append_page (container, new Gtk.Label (_("Symbols")));
1385+ container.show_all ();
1386+ }
1387+ }
1388+
1389+ void remove_container () {
1390+ if (notebook.page_num (container) != -1)
1391+ notebook.remove (container);
1392+ }
1393
1394 void on_hook_split_view (Scratch.Widgets.SplitView view) {
1395 view.welcome_shown.connect (() => {
1396- container.visible = false;
1397+ remove_container ();
1398 });
1399 view.welcome_hidden.connect (() => {
1400- container.visible = true;
1401+ add_container ();
1402 });
1403 }
1404
1405- void update_timeout () {
1406- if (refresh_timeout != 0)
1407- Source.remove (refresh_timeout);
1408-
1409- refresh_timeout = Timeout.add (1000, () => {
1410- current_view.parse_symbols ();
1411- refresh_timeout = 0;
1412- return false;
1413- });
1414- }
1415-
1416- void remove_view (SymbolOutline view) {
1417- views.remove (view);
1418- view.doc.doc_saved.disconnect (update_timeout);
1419- view.closed.disconnect (remove_view);
1420- view.goto.disconnect (goto);
1421- }
1422-
1423- void goto (Scratch.Services.Document doc, int line) {
1424- scratch_interface.open_file (doc.file);
1425-
1426- var text = doc.source_view;
1427- Gtk.TextIter iter;
1428- text.buffer.get_iter_at_line (out iter, line - 1);
1429- text.buffer.place_cursor (iter);
1430- text.scroll_to_iter (iter, 0.0, true, 0.5, 0.5);
1431- }
1432- }
1433+ void update_timeout () {
1434+ if (refresh_timeout != 0)
1435+ Source.remove (refresh_timeout);
1436+
1437+ refresh_timeout = Timeout.add (1000, () => {
1438+ current_view.parse_symbols ();
1439+ refresh_timeout = 0;
1440+ return false;
1441+ });
1442+ }
1443+
1444+ void remove_view (SymbolOutline view) {
1445+ views.remove (view);
1446+ view.doc.doc_saved.disconnect (update_timeout);
1447+ view.closed.disconnect (remove_view);
1448+ view.goto.disconnect (goto);
1449+ }
1450+
1451+ void goto (Scratch.Services.Document doc, int line) {
1452+ scratch_interface.open_file (doc.file);
1453+
1454+ var text = doc.source_view;
1455+ Gtk.TextIter iter;
1456+ text.buffer.get_iter_at_line (out iter, line - 1);
1457+ text.buffer.place_cursor (iter);
1458+ text.scroll_to_iter (iter, 0.0, true, 0.5, 0.5);
1459+ }
1460+ }
1461 }
1462
1463 [ModuleInit]
1464@@ -144,4 +165,4 @@
1465 {
1466 var objmodule = module as Peas.ObjectModule;
1467 objmodule.register_extension_type (typeof (Peas.Activatable), typeof (Scratch.Plugins.OutlinePlugin));
1468-}
1469+}
1470\ No newline at end of file
1471
1472=== modified file 'plugins/outline/ValaSymbolResolver.vala'
1473--- plugins/outline/ValaSymbolResolver.vala 2013-07-09 09:15:52 +0000
1474+++ plugins/outline/ValaSymbolResolver.vala 2014-10-05 21:35:48 +0000
1475@@ -1,272 +1,264 @@
1476
1477 public class Report : Vala.Report
1478 {
1479- // just mute everything
1480- public override void err (Vala.SourceReference? ref, string msg) {}
1481- public override void warn (Vala.SourceReference? ref, string msg) {}
1482- public override void note (Vala.SourceReference? ref, string msg) {}
1483- public override void depr (Vala.SourceReference? ref, string msg) {}
1484+ // just mute everything
1485+ public override void err (Vala.SourceReference? ref, string msg) {}
1486+ public override void warn (Vala.SourceReference? ref, string msg) {}
1487+ public override void note (Vala.SourceReference? ref, string msg) {}
1488+ public override void depr (Vala.SourceReference? ref, string msg) {}
1489 }
1490
1491 public class Symbol : Granite.Widgets.SourceList.ExpandableItem
1492 {
1493- public Scratch.Services.Document doc { get; construct set; }
1494- public Vala.Symbol symbol { get; construct set; }
1495+ public Scratch.Services.Document doc { get; construct set; }
1496+ public Vala.Symbol symbol { get; construct set; }
1497
1498- public Symbol (Scratch.Services.Document doc, Vala.Symbol symbol)
1499- {
1500- Object (symbol: symbol, name: symbol.name, doc: doc);
1501- }
1502+ public Symbol (Scratch.Services.Document doc, Vala.Symbol symbol)
1503+ {
1504+ Object (symbol: symbol, name: symbol.name, doc: doc);
1505+ }
1506 }
1507
1508 class SymbolIter : Object
1509 {
1510- public Vala.Symbol? symbol { get; construct set; default = null; }
1511- public Icon? icon { get; construct set; default = null; }
1512- public Gee.LinkedList<SymbolIter> children { get; private set; }
1513+ public Vala.Symbol? symbol { get; construct set; default = null; }
1514+ public Icon? icon { get; construct set; default = null; }
1515+ public Gee.LinkedList<SymbolIter> children { get; private set; }
1516
1517- public SymbolIter (Vala.Symbol? symbol = null, Icon? icon = null)
1518- {
1519- Object(symbol: symbol, icon: icon);
1520- children = new Gee.LinkedList<SymbolIter> ();
1521- }
1522+ public SymbolIter (Vala.Symbol? symbol = null, Icon? icon = null)
1523+ {
1524+ Object(symbol: symbol, icon: icon);
1525+ children = new Gee.LinkedList<SymbolIter> ();
1526+ }
1527 }
1528
1529 public class ValaSymbolOutline : Object, SymbolOutline
1530 {
1531- public Scratch.Services.Document doc { get; protected set; }
1532- public Granite.Widgets.SourceList store { get; private set; }
1533- Granite.Widgets.SourceList.ExpandableItem root;
1534- Vala.CodeContext context;
1535- Vala.Parser parser;
1536- SymbolResolver resolver;
1537-
1538- SymbolIter cache;
1539-
1540- Gee.List<Vala.Field> field_blacklist;
1541-
1542- public ValaSymbolOutline (Scratch.Services.Document _doc)
1543- {
1544- doc = _doc;
1545- doc.doc_closed.connect (doc_closed);
1546-
1547- field_blacklist = new Gee.LinkedList<Vala.Field> ();
1548- cache = new SymbolIter ();
1549-
1550- store = new Granite.Widgets.SourceList ();
1551- store.get_style_context ().add_class ("sidebar");
1552- store.item_selected.connect ((selected) => {
1553- if (selected == null) return;
1554- goto (doc, (selected as Symbol).symbol.source_reference.begin.line);
1555- store.selected = null;
1556- });
1557- root = new Granite.Widgets.SourceList.ExpandableItem (_("Symbols"));
1558- store.root.add (root);
1559-
1560- parser = new Vala.Parser ();
1561- resolver = new SymbolResolver ();
1562- resolver.add_symbol.connect (add_symbol);
1563- resolver.blacklist.connect ((f) => {
1564- field_blacklist.add (f);
1565- });
1566-
1567- init_context ();
1568- }
1569-
1570- void init_context ()
1571- {
1572- context = new Vala.CodeContext ();
1573- context.profile = Vala.Profile.GOBJECT;
1574- context.add_source_filename (doc.file.get_path ());
1575- context.report = new Report ();
1576- }
1577-
1578- ~ValaSymbolResolver ()
1579- {
1580- doc.doc_closed.disconnect (doc_closed);
1581- }
1582-
1583- void doc_closed (Scratch.Services.Document doc)
1584- {
1585- closed ();
1586- }
1587-
1588- public Granite.Widgets.SourceList get_source_list ()
1589- {
1590- return store;
1591- }
1592-
1593- async void parse_symbols_async ()
1594- {
1595- field_blacklist.clear ();
1596-
1597- lock (context)
1598- {
1599- Vala.CodeContext.push (context);
1600-
1601- parser.parse (context);
1602- resolver.resolve (context);
1603-
1604- Vala.CodeContext.pop ();
1605- }
1606- }
1607-
1608- public void parse_symbols ()
1609- {
1610- cache.children.clear ();
1611- init_context ();
1612-
1613- unowned Thread<void*> thread = Thread.create<void*> (() => {
1614- parse_symbols_async ();
1615- return null;
1616- }, true);
1617-
1618- thread.join ();
1619-
1620- root.clear ();
1621- construct_tree (cache, root);
1622-
1623- filter_generated_fields (root);
1624-
1625- store.root.expand_all ();
1626- }
1627-
1628- void construct_tree (SymbolIter iter_parent,
1629- Granite.Widgets.SourceList.ExpandableItem tree_parent)
1630- {
1631- foreach (var iter_child in iter_parent.children) {
1632- var tree_child = new Symbol (doc, iter_child.symbol);
1633- tree_child.icon = iter_child.icon;
1634- tree_parent.add (tree_child);
1635-
1636- construct_tree (iter_child, tree_child);
1637- }
1638- }
1639-
1640- SymbolIter? find_existing (Vala.Symbol symbol, SymbolIter parent = cache)
1641- {
1642- SymbolIter match = null;
1643- foreach (var child in parent.children) {
1644- if (child.symbol== symbol) {
1645- match = child;
1646- break;
1647- } else {
1648- var res = find_existing (symbol, child);
1649- if (res != null)
1650- return res;
1651- }
1652- }
1653- return match;
1654- }
1655-
1656- // vala generates for each property a field which we do not want to display
1657- void filter_generated_fields (Granite.Widgets.SourceList.ExpandableItem parent)
1658- {
1659- foreach (var child in parent.children) {
1660- var child_symbol = child as Symbol;
1661- if (field_blacklist.contains (child_symbol.symbol as Vala.Field)) {
1662- parent.remove (child);
1663- }
1664- filter_generated_fields (child_symbol);
1665- }
1666- }
1667-
1668- void add_symbol (Vala.Symbol symbol, string icon = "", Icon? real_icon = null)
1669- {
1670- if (symbol.name == null)
1671- return;
1672-
1673- SymbolIter parent;
1674- if (symbol.scope.parent_scope.owner.name == null)
1675- parent = cache;
1676- else
1677- parent = find_existing (symbol.scope.parent_scope.owner);
1678-
1679- if (parent == null) {
1680- warning ("Could not find parent scope of symbol");
1681- return;
1682- }
1683-
1684- var i = real_icon != null ? real_icon : new ThemedIcon.with_default_fallbacks (icon);
1685- var s = new SymbolIter (symbol, i);
1686- parent.children.add (s);
1687- }
1688+ public Scratch.Services.Document doc { get; protected set; }
1689+ public Granite.Widgets.SourceList store { get; private set; }
1690+ Granite.Widgets.SourceList.ExpandableItem root;
1691+ Vala.CodeContext context;
1692+ Vala.Parser parser;
1693+ SymbolResolver resolver;
1694+
1695+ public int n_symbols { get; protected set; }
1696+
1697+ SymbolIter cache;
1698+
1699+ Gee.List<Vala.Field> field_blacklist;
1700+
1701+ public ValaSymbolOutline (Scratch.Services.Document _doc)
1702+ {
1703+ doc = _doc;
1704+ doc.doc_closed.connect (doc_closed);
1705+
1706+ field_blacklist = new Gee.LinkedList<Vala.Field> ();
1707+ cache = new SymbolIter ();
1708+
1709+ store = new Granite.Widgets.SourceList ();
1710+ store.get_style_context ().add_class ("sidebar");
1711+ store.item_selected.connect ((selected) => {
1712+ if (selected == null) return;
1713+ goto (doc, (selected as Symbol).symbol.source_reference.begin.line);
1714+ store.selected = null;
1715+ });
1716+ root = new Granite.Widgets.SourceList.ExpandableItem (_("Symbols"));
1717+ store.root.add (root);
1718+
1719+ parser = new Vala.Parser ();
1720+ resolver = new SymbolResolver ();
1721+ resolver.add_symbol.connect (add_symbol);
1722+ resolver.blacklist.connect ((f) => {
1723+ field_blacklist.add (f);
1724+ });
1725+
1726+ this.n_symbols = 0;
1727+
1728+ init_context ();
1729+ }
1730+
1731+ void init_context ()
1732+ {
1733+ context = new Vala.CodeContext ();
1734+ context.profile = Vala.Profile.GOBJECT;
1735+ context.add_source_filename (doc.file.get_path ());
1736+ context.report = new Report ();
1737+ }
1738+
1739+ ~ValaSymbolResolver ()
1740+ {
1741+ doc.doc_closed.disconnect (doc_closed);
1742+ }
1743+
1744+ void doc_closed (Scratch.Services.Document doc)
1745+ {
1746+ closed ();
1747+ }
1748+
1749+ public Granite.Widgets.SourceList get_source_list ()
1750+ {
1751+ return store;
1752+ }
1753+
1754+ async void parse_symbols_async ()
1755+ {
1756+ field_blacklist.clear ();
1757+
1758+ lock (context)
1759+ {
1760+ Vala.CodeContext.push (context);
1761+
1762+ parser.parse (context);
1763+ resolver.resolve (context);
1764+
1765+ Vala.CodeContext.pop ();
1766+ }
1767+ }
1768+
1769+ public void parse_symbols ()
1770+ {
1771+ cache.children.clear ();
1772+ init_context ();
1773+
1774+ Thread<void*> thread = new Thread<void*>("parse-symbols", () => {
1775+ parse_symbols_async.begin ();
1776+ return null;
1777+ });
1778+
1779+ thread.join ();
1780+
1781+ root.clear ();
1782+ construct_tree (cache, root);
1783+
1784+ store.root.expand_all ();
1785+ }
1786+
1787+ void construct_tree (SymbolIter iter_parent,
1788+ Granite.Widgets.SourceList.ExpandableItem tree_parent)
1789+ {
1790+ foreach (var iter_child in iter_parent.children) {
1791+ if (iter_child == null)
1792+ continue;
1793+ var tree_child = new Symbol (doc, iter_child.symbol);
1794+ tree_child.icon = iter_child.icon;
1795+ tree_parent.add (tree_child);
1796+
1797+ construct_tree (iter_child, tree_child);
1798+ this.n_symbols++;
1799+ }
1800+ }
1801+
1802+ SymbolIter? find_existing (Vala.Symbol symbol, SymbolIter parent = cache)
1803+ {
1804+ SymbolIter match = null;
1805+ foreach (var child in parent.children) {
1806+ if (child.symbol== symbol) {
1807+ match = child;
1808+ break;
1809+ } else {
1810+ var res = find_existing (symbol, child);
1811+ if (res != null)
1812+ return res;
1813+ }
1814+ }
1815+ return match;
1816+ }
1817+
1818+ void add_symbol (Vala.Symbol symbol, string icon = "", Icon? real_icon = null)
1819+ {
1820+ if (symbol.name == null)
1821+ return;
1822+
1823+ SymbolIter parent;
1824+ if (symbol.scope.parent_scope.owner.name == null)
1825+ parent = cache;
1826+ else
1827+ parent = find_existing (symbol.scope.parent_scope.owner);
1828+
1829+ if (parent == null) {
1830+ warning ("Could not find parent scope of symbol");
1831+ return;
1832+ }
1833+
1834+ var i = real_icon != null ? real_icon : new ThemedIcon.with_default_fallbacks (icon);
1835+ var s = new SymbolIter (symbol, i);
1836+ parent.children.add (s);
1837+ }
1838 }
1839
1840 public class SymbolResolver : Vala.SymbolResolver
1841 {
1842- public signal void add_symbol (Vala.Symbol s, string icon = "", Icon? real_icon = null);
1843- public signal void blacklist (Vala.Field f);
1844-
1845- public override void visit_class (Vala.Class s)
1846- {
1847- add_symbol (s, "user-home-symbolic",
1848- new ThemedIcon.from_names ({"user-home-symbolic", "go-home-symbolic", "user-home", "go-home", "home"}));
1849- base.visit_class (s);
1850- }
1851- public override void visit_constant (Vala.Constant s)
1852- {
1853- add_symbol (s, "view-grid-symbolic");
1854- base.visit_constant (s);
1855- }
1856- public override void visit_delegate (Vala.Delegate s)
1857- {
1858- add_symbol (s);
1859- base.visit_delegate (s);
1860- }
1861- //FIXME both constructor and destructor are currently not added for some reason
1862- public override void visit_constructor (Vala.Constructor s)
1863- {
1864- add_symbol (s, "media-playback-start-symbolic");
1865- base.visit_constructor (s);
1866- }
1867- public override void visit_destructor (Vala.Destructor s)
1868- {
1869- add_symbol (s, "edit-delete-symbolic");
1870- base.visit_destructor (s);
1871- }
1872- public override void visit_enum (Vala.Enum s)
1873- {
1874- add_symbol (s, "view-list-compact-symbolic");
1875- base.visit_enum (s);
1876- }
1877- public override void visit_field (Vala.Field s)
1878- {
1879- add_symbol (s, "view-grid-symbolic");
1880- base.visit_field (s);
1881- }
1882- public override void visit_interface (Vala.Interface s)
1883- {
1884- add_symbol (s, "",
1885- new ThemedIcon.from_names ({"dialog-information-symbolic", "help-info-symbolic", "dialog-information", "help-info", "information", "info"}));
1886- base.visit_interface (s);
1887- }
1888- public override void visit_method (Vala.Method s)
1889- {
1890- add_symbol (s, "document-properties-symbolic");
1891- base.visit_method (s);
1892- }
1893- public override void visit_namespace (Vala.Namespace s)
1894- {
1895- add_symbol (s, "view-fullscreen-symbolic");
1896- base.visit_namespace (s);
1897- }
1898- public override void visit_property (Vala.Property s)
1899- {
1900- add_symbol (s, "format-indent-more-symbolic");
1901- blacklist (s.field);
1902- base.visit_property (s);
1903- }
1904- public override void visit_signal (Vala.Signal s)
1905- {
1906- add_symbol (s);
1907- base.visit_signal (s);
1908- }
1909- public override void visit_struct (Vala.Struct s)
1910- {
1911- add_symbol (s, "user-home-symbolic",
1912- new ThemedIcon.from_names ({"user-home-symbolic", "go-home-symbolic", "user-home", "go-home", "home"}));
1913- base.visit_struct (s);
1914- }
1915-}
1916-
1917+ public signal void add_symbol (Vala.Symbol s, string icon = "", Icon? real_icon = null);
1918+ public signal void blacklist (Vala.Field f);
1919+
1920+ public override void visit_class (Vala.Class s)
1921+ {
1922+ add_symbol (s, "user-home-symbolic",
1923+ new ThemedIcon.from_names ({"user-home-symbolic", "go-home-symbolic", "user-home", "go-home", "home"}));
1924+ base.visit_class (s);
1925+ }
1926+ public override void visit_constant (Vala.Constant s)
1927+ {
1928+ add_symbol (s, "view-grid-symbolic");
1929+ base.visit_constant (s);
1930+ }
1931+ public override void visit_delegate (Vala.Delegate s)
1932+ {
1933+ add_symbol (s);
1934+ base.visit_delegate (s);
1935+ }
1936+ //FIXME both constructor and destructor are currently not added for some reason
1937+ public override void visit_constructor (Vala.Constructor s)
1938+ {
1939+ add_symbol (s, "media-playback-start-symbolic");
1940+ base.visit_constructor (s);
1941+ }
1942+ public override void visit_destructor (Vala.Destructor s)
1943+ {
1944+ add_symbol (s, "edit-delete-symbolic");
1945+ base.visit_destructor (s);
1946+ }
1947+ public override void visit_enum (Vala.Enum s)
1948+ {
1949+ add_symbol (s, "view-list-compact-symbolic");
1950+ base.visit_enum (s);
1951+ }
1952+ public override void visit_field (Vala.Field s)
1953+ {
1954+ add_symbol (s, "view-grid-symbolic");
1955+ base.visit_field (s);
1956+ }
1957+ public override void visit_interface (Vala.Interface s)
1958+ {
1959+ add_symbol (s, "",
1960+ new ThemedIcon.from_names ({"dialog-information-symbolic", "help-info-symbolic", "dialog-information", "help-info", "information", "info"}));
1961+ base.visit_interface (s);
1962+ }
1963+ public override void visit_method (Vala.Method s)
1964+ {
1965+ add_symbol (s, "document-properties-symbolic");
1966+ base.visit_method (s);
1967+ }
1968+ public override void visit_namespace (Vala.Namespace s)
1969+ {
1970+ add_symbol (s, "view-fullscreen-symbolic");
1971+ base.visit_namespace (s);
1972+ }
1973+ public override void visit_property (Vala.Property s)
1974+ {
1975+ add_symbol (s, "format-indent-more-symbolic");
1976+ blacklist (s.field);
1977+ base.visit_property (s);
1978+ }
1979+ public override void visit_signal (Vala.Signal s)
1980+ {
1981+ add_symbol (s);
1982+ base.visit_signal (s);
1983+ }
1984+ public override void visit_struct (Vala.Struct s)
1985+ {
1986+ add_symbol (s, "user-home-symbolic",
1987+ new ThemedIcon.from_names ({"user-home-symbolic", "go-home-symbolic", "user-home", "go-home", "home"}));
1988+ base.visit_struct (s);
1989+ }
1990+}
1991\ No newline at end of file
1992
1993=== modified file 'plugins/pastebin/CMakeLists.txt'
1994--- plugins/pastebin/CMakeLists.txt 2013-11-30 08:48:08 +0000
1995+++ plugins/pastebin/CMakeLists.txt 2014-10-05 21:35:48 +0000
1996@@ -11,9 +11,13 @@
1997 granite
1998 gtksourceview-3.0
1999 scratchcore
2000- gee-1.0
2001+ gee-0.8
2002 libpeas-1.0
2003+<<<<<<< TREE
2004 zeitgeist-1.0
2005+=======
2006+ ${ZEITGEIST_DEPS}
2007+>>>>>>> MERGE-SOURCE
2008 OPTIONS
2009 --vapidir=${CMAKE_BINARY_DIR}
2010 --vapidir=${CMAKE_BINARY_DIR}/src/
2011
2012=== modified file 'plugins/pastebin/pastebin.vala'
2013--- plugins/pastebin/pastebin.vala 2013-06-07 21:00:59 +0000
2014+++ plugins/pastebin/pastebin.vala 2014-10-05 21:35:48 +0000
2015@@ -133,7 +133,8 @@
2016 menuitem.destroy ();
2017 menuitem = new Gtk.MenuItem.with_label (_("Upload to Pastebin"));
2018 menuitem.activate.connect (() => {
2019- new Dialogs.PasteBinDialog (doc);
2020+ MainWindow window = plugins.manager.window;
2021+ new Dialogs.PasteBinDialog (window, doc);
2022 });
2023 menu.append (menuitem);
2024 menuitem.show_all ();
2025
2026=== modified file 'plugins/pastebin/pastebin_dialog.vala'
2027--- plugins/pastebin/pastebin_dialog.vala 2013-04-27 17:25:01 +0000
2028+++ plugins/pastebin/pastebin_dialog.vala 2014-10-05 21:35:48 +0000
2029@@ -246,9 +246,11 @@
2030 private Button send_button;
2031
2032
2033- public PasteBinDialog (Scratch.Services.Document doc) {
2034+ public PasteBinDialog (Gtk.Window? parent, Scratch.Services.Document doc) {
2035 this.doc = doc;
2036
2037+ if (parent != null)
2038+ this.set_transient_for (parent);
2039 this.title = _("Share via PasteBin");
2040 this.type_hint = Gdk.WindowTypeHint.DIALOG;
2041
2042@@ -355,12 +357,12 @@
2043 var format_others_scroll = new ScrolledWindow(null, null);
2044 format_others_scroll.add(format_others_view);
2045
2046- var format_others_ok = new Button.from_stock(Stock.OK);
2047+ var format_others_ok = new Button.from_stock ("gtk-ok");
2048 format_others_ok.clicked.connect (format_others_ok_clicked);
2049- var format_others_cancel = new Button.from_stock(Stock.CANCEL);
2050+ var format_others_cancel = new Button.from_stock ("gtk-cancel");
2051 format_others_cancel.clicked.connect (format_others_cancel_clicked);
2052- var format_others_buttons = new ButtonBox(Orientation.HORIZONTAL);
2053- format_others_buttons.set_layout(ButtonBoxStyle.CENTER);
2054+ var format_others_buttons = new ButtonBox (Orientation.HORIZONTAL);
2055+ format_others_buttons.set_layout (ButtonBoxStyle.CENTER);
2056 format_others_buttons.pack_start (format_others_cancel);
2057 format_others_buttons.pack_start (format_others_ok);
2058
2059
2060=== modified file 'plugins/source-tree/CMakeLists.txt'
2061--- plugins/source-tree/CMakeLists.txt 2013-11-30 08:48:08 +0000
2062+++ plugins/source-tree/CMakeLists.txt 2014-10-05 21:35:48 +0000
2063@@ -4,12 +4,16 @@
2064 SourceTreePlugin.vala
2065 PACKAGES
2066 gtk+-3.0
2067- gee-1.0
2068+ gee-0.8
2069 granite
2070 scratchcore
2071 libpeas-1.0
2072 gtksourceview-3.0
2073+<<<<<<< TREE
2074 zeitgeist-1.0
2075+=======
2076+ ${ZEITGEIST_DEPS}
2077+>>>>>>> MERGE-SOURCE
2078 OPTIONS
2079 --vapidir=${CMAKE_BINARY_DIR}
2080 --vapidir=${CMAKE_BINARY_DIR}/src/
2081
2082=== modified file 'plugins/source-tree/SourceTreePlugin.vala'
2083--- plugins/source-tree/SourceTreePlugin.vala 2013-12-16 12:44:43 +0000
2084+++ plugins/source-tree/SourceTreePlugin.vala 2014-10-05 21:35:48 +0000
2085@@ -1,4 +1,3 @@
2086-// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2087 /***
2088 BEGIN LICENSE
2089
2090@@ -22,11 +21,11 @@
2091 public const string DESCRIPTION = N_("Have a look at your sources organized in a nice tree");
2092
2093 const bool HIDE_TOOLBAR = true;
2094-const bool DARK_THEME = true;
2095
2096 Scratch.Services.Interface scratch_interface;
2097
2098 public class Folder : Granite.Widgets.SourceList.ExpandableItem {
2099+<<<<<<< TREE
2100 public File file { get; construct set; }
2101 bool loaded = false;
2102
2103@@ -87,62 +86,126 @@
2104 }
2105 } catch (Error e) { warning (e.message); }
2106 }
2107+=======
2108+ public File file { get; construct set; }
2109+ bool loaded = false;
2110+
2111+ const string ATTRIBUTES = FileAttribute.STANDARD_NAME + "," + FileAttribute.STANDARD_TYPE +
2112+ "," + FileAttribute.STANDARD_ICON;
2113+ const string[] IGNORED = { "pyc", "class", "pyo", "o" };
2114+
2115+
2116+ public Folder (File dir) {
2117+ file = dir;
2118+ name = dir.get_basename ();
2119+ selectable = false;
2120+
2121+ //need to add one item to make the folder appear
2122+ add (new Granite.Widgets.SourceList.Item (_("Loading...")));
2123+
2124+ toggled.connect (() => {
2125+ if (!expanded || loaded)
2126+ return;
2127+
2128+ loaded = true;
2129+
2130+ load ();
2131+ var children_tmp = new Gee.ArrayList<Granite.Widgets.SourceList.Item> ();
2132+ children_tmp.add_all (children);
2133+ foreach (var child in children_tmp) {
2134+ if (!(child is Document) && !(child is Folder))
2135+ remove (child);
2136+ }
2137+ });
2138+ }
2139+
2140+ public void load () {
2141+ try {
2142+ var enumerator = file.enumerate_children (ATTRIBUTES, FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null);
2143+ FileInfo? file_info = null;
2144+
2145+ while ((file_info = enumerator.next_file ()) != null) {
2146+ var file_name = file_info.get_name ();
2147+ var file_type = file_info.get_file_type ();
2148+
2149+ if (file_type == FileType.REGULAR && !file_name.has_suffix ("~") && !file_name.has_prefix (".")) {
2150+ // Ignore some kind of temporany files
2151+
2152+ bool ignore = false;
2153+ for (int n = 0; n < IGNORED.length; n++) {
2154+ string ignored_suffix = IGNORED[n];
2155+ debug (ignored_suffix);
2156+ var tmp = file_name.split (".");
2157+ string suffix = tmp[tmp.length-1];
2158+ if (suffix == ignored_suffix)
2159+ ignore = true;
2160+ }
2161+ if (!ignore)
2162+ add (new Document (file.get_child (file_name), file_info.get_icon ()));
2163+
2164+ } else if (file_type == FileType.DIRECTORY && !file_name.has_prefix (".")) {
2165+ add (new Folder (file.get_child (file_name)));
2166+ }
2167+ }
2168+ } catch (Error e) { warning (e.message); }
2169+ }
2170+>>>>>>> MERGE-SOURCE
2171 }
2172
2173 public class Document : Granite.Widgets.SourceList.Item
2174 {
2175- public Scratch.Services.Document? doc { get; private set; }
2176- public File file { get; construct set; }
2177+ public Scratch.Services.Document? doc { get; private set; }
2178+ public File file { get; construct set; }
2179
2180- public Document (File file, Icon icon)
2181- {
2182- Object (file: file, icon: icon);
2183-
2184- name = file.get_basename ();
2185-
2186- action_activated.connect (() => {
2187- if (parent == null)
2188- return;
2189-
2190+ public Document (File file, Icon icon)
2191+ {
2192+ Object (file: file, icon: icon);
2193+
2194+ name = file.get_basename ();
2195+
2196+ action_activated.connect (() => {
2197+ if (parent == null)
2198+ return;
2199+
2200 scratch_interface.close_document (doc);
2201- parent.remove (this);
2202- });
2203- }
2204+ parent.remove (this);
2205+ });
2206+ }
2207
2208- public Document.scratch (Scratch.Services.Document _doc)
2209- {
2210- Icon icon = new FileIcon (_doc.file);
2211- try {
2212- icon = _doc.file.query_info (FileAttribute.STANDARD_ICON, 0).get_icon ();
2213- } catch (Error e) { warning (e.message); }
2214- this (_doc.file, icon);
2215- doc = _doc;
2216- try {
2217- activatable = Gtk.IconTheme.get_default ().lookup_by_gicon (new ThemedIcon ("window-close-symbolic"), 16, 0).load_symbolic ({1, 1, 1, 1});
2218- } catch (Error e) { warning (e.message); }
2219- }
2220+ public Document.scratch (Scratch.Services.Document _doc)
2221+ {
2222+ Icon icon = new FileIcon (_doc.file);
2223+ try {
2224+ icon = _doc.file.query_info (FileAttribute.STANDARD_ICON, 0).get_icon ();
2225+ } catch (Error e) { warning (e.message); }
2226+ this (_doc.file, icon);
2227+ doc = _doc;
2228+ try {
2229+ activatable = Gtk.IconTheme.get_default ().lookup_by_gicon (new ThemedIcon ("window-close-symbolic"), 16, 0).load_symbolic ({1, 1, 1, 1});
2230+ } catch (Error e) { warning (e.message); }
2231+ }
2232 }
2233
2234 public class Bookmark : Granite.Widgets.SourceList.Item
2235 {
2236- public Scratch.Services.Document doc { get; construct set; }
2237- public Gtk.TextIter iter { get; construct set; }
2238-
2239- public Bookmark (Scratch.Services.Document doc, Gtk.TextIter iter)
2240- {
2241- Object(name: doc.get_basename () + ":" + (iter.get_line () + 1).to_string (),
2242- doc: doc, iter: iter, icon: new ThemedIcon ("tag-new"));
2243- try {
2244- activatable = Gtk.IconTheme.get_default ().lookup_by_gicon (new ThemedIcon ("window-close-symbolic"), 16, 0).load_symbolic ({1, 1, 1, 1});
2245- } catch (Error e) { warning (e.message); }
2246-
2247- action_activated.connect (() => {
2248- if (parent == null)
2249- return;
2250-
2251- parent.remove (this);
2252- });
2253- }
2254+ public Scratch.Services.Document doc { get; construct set; }
2255+ public Gtk.TextIter iter { get; construct set; }
2256+
2257+ public Bookmark (Scratch.Services.Document doc, Gtk.TextIter iter)
2258+ {
2259+ Object(name: doc.get_basename () + ":" + (iter.get_line () + 1).to_string (),
2260+ doc: doc, iter: iter, icon: new ThemedIcon ("tag-new"));
2261+ try {
2262+ activatable = Gtk.IconTheme.get_default ().lookup_by_gicon (new ThemedIcon ("window-close-symbolic"), 16, 0).load_symbolic ({1, 1, 1, 1});
2263+ } catch (Error e) { warning (e.message); }
2264+
2265+ action_activated.connect (() => {
2266+ if (parent == null)
2267+ return;
2268+
2269+ parent.remove (this);
2270+ });
2271+ }
2272 }
2273
2274 namespace Scratch.Plugins {
2275@@ -152,47 +215,53 @@
2276
2277 Gtk.ToolButton? new_button = null;
2278 Gtk.ToolButton? bookmark_tool_button = null;
2279- Gtk.Notebook scratch_notebook;
2280- Granite.Widgets.SourceList view;
2281- Granite.Widgets.SourceList.ExpandableItem category_files;
2282- Granite.Widgets.SourceList.ExpandableItem category_project;
2283- Granite.Widgets.SourceList.ExpandableItem category_bookmarks;
2284-
2285- File? root = null;
2286-
2287- bool my_select = false;
2288+ Gtk.Notebook scratch_notebook;
2289+ Gtk.Notebook side_notebook;
2290+ Granite.Widgets.SourceList view;
2291+ Granite.Widgets.SourceList.ExpandableItem category_files;
2292+ Granite.Widgets.SourceList.ExpandableItem category_project;
2293+ Granite.Widgets.SourceList.ExpandableItem category_bookmarks;
2294+
2295+ File? root = null;
2296+
2297+ bool my_select = false;
2298
2299 public void activate () {
2300- if (DARK_THEME)
2301- Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
2302-
2303 plugins = (Scratch.Services.Interface) object;
2304 plugins.hook_notebook_sidebar.connect (on_hook_sidebar);
2305- plugins.hook_document.connect (on_hook_document);
2306- plugins.hook_toolbar.connect ((toolbar) => {
2307- if (this.bookmark_tool_button != null && this.new_button != null)
2308- return;
2309- this.new_button = main_actions.get_action ("NewTab").create_tool_item() as Gtk.ToolButton;
2310- this.bookmark_tool_button = new Gtk.ToolButton (new Gtk.Image.from_icon_name ("bookmark-new", Gtk.IconSize.LARGE_TOOLBAR), _("Bookmark"));
2311- bookmark_tool_button.show_all ();
2312- bookmark_tool_button.clicked.connect (() => add_bookmark ());
2313- toolbar.insert (bookmark_tool_button, toolbar.get_item_index (toolbar.find_button) + 1);
2314- toolbar.insert (new_button, 0);
2315- });
2316- plugins.hook_split_view.connect ((view) => {
2317- this.bookmark_tool_button.visible = ! view.is_empty ();
2318+ plugins.hook_document.connect (on_hook_document);
2319+ plugins.hook_toolbar.connect ((toolbar) => {
2320+ MainWindow window = plugins.manager.window;
2321+ if (this.bookmark_tool_button != null && this.new_button != null)
2322+ return;
2323+ this.new_button = window.main_actions.get_action ("NewTab").create_tool_item() as Gtk.ToolButton;
2324+ this.bookmark_tool_button = new Gtk.ToolButton (new Gtk.Image.from_icon_name ("bookmark-new", Gtk.IconSize.LARGE_TOOLBAR), _("Bookmark"));
2325+ bookmark_tool_button.show_all ();
2326+ bookmark_tool_button.clicked.connect (() => add_bookmark ());
2327+ toolbar.pack_start (bookmark_tool_button);
2328+ toolbar.pack_start (new_button);
2329+ //toolbar.insert (bookmark_tool_button, toolbar.get_item_index (toolbar.find_button) + 1);
2330+ //toolbar.insert (new_button, 0);
2331+ });
2332+ plugins.hook_split_view.connect ((view) => {
2333+ this.bookmark_tool_button.visible = ! view.is_empty ();
2334 this.bookmark_tool_button.no_show_all = view.is_empty ();
2335 view.welcome_shown.connect (() => {
2336 this.bookmark_tool_button.visible = false;
2337 this.bookmark_tool_button.no_show_all = true;
2338+ int current_page = this.side_notebook.get_current_page ();
2339+ if (this.side_notebook.get_nth_page (current_page) == this.view) {
2340+ this.side_notebook.remove_page (current_page);
2341+ }
2342 });
2343 view.welcome_hidden.connect (() => {
2344 this.bookmark_tool_button.visible = true;
2345 this.bookmark_tool_button.no_show_all = false;
2346+ this.side_notebook.append_page (this.view, new Gtk.Label (_("Source Tree")));
2347 });
2348- });
2349-
2350- scratch_interface = ((Scratch.Services.Interface)object);
2351+ });
2352+
2353+ scratch_interface = ((Scratch.Services.Interface)object);
2354 }
2355
2356 public void deactivate () {
2357@@ -211,6 +280,7 @@
2358 void on_hook_sidebar (Gtk.Notebook notebook) {
2359 if (view != null)
2360 return;
2361+<<<<<<< TREE
2362
2363 view = new Granite.Widgets.SourceList ();
2364 view.set_sort_func ((a, b) => {
2365@@ -326,6 +396,122 @@
2366 return dir;
2367 }
2368 }
2369+=======
2370+ side_notebook = notebook;
2371+ view = new Granite.Widgets.SourceList ();
2372+ view.set_sort_func ((a, b) => {
2373+ if (a is Folder && b is Folder)
2374+ return a.name.collate (b.name);
2375+ if (a is Folder)
2376+ return -1;
2377+ if (b is Folder)
2378+ return 1;
2379+
2380+ return a.parent == view.root && a.name == "Bookmarks" ? 1 : a.name.collate (b.name);
2381+ });
2382+
2383+ view.get_style_context ().add_class ("sidebar");
2384+ category_files = new Granite.Widgets.SourceList.ExpandableItem (_("Files"));
2385+ category_project = new Granite.Widgets.SourceList.ExpandableItem (_("Project"));
2386+ category_bookmarks = new Granite.Widgets.SourceList.ExpandableItem (_("Bookmarks"));
2387+ view.root.add (category_files);
2388+ view.root.add (category_project);
2389+ view.root.add (category_bookmarks);
2390+ view.show_all ();
2391+
2392+ view.item_selected.connect ((new_current) => {
2393+ if (my_select) return;
2394+
2395+ if (new_current is Bookmark) {
2396+ var bookmark = new_current as Bookmark;
2397+ ((Scratch.Services.Interface)object).open_file (bookmark.doc.file);
2398+ var text = bookmark.doc.source_view;
2399+ text.buffer.place_cursor (bookmark.iter);
2400+ text.scroll_to_iter (bookmark.iter, 0.0, true, 0.5, 0.5);
2401+ return;
2402+ }
2403+
2404+ var doc = new_current as Document;
2405+ ((Scratch.Services.Interface)object).open_file (doc.file);
2406+ });
2407+
2408+ }
2409+
2410+ void on_hook_document (Scratch.Services.Document doc) {
2411+ scratch_notebook = (doc.get_parent () as Gtk.Notebook);
2412+ scratch_notebook.set_show_tabs (!HIDE_TOOLBAR);
2413+
2414+ foreach (var d in category_files.children) {
2415+ if ((d as Document).file == doc.file) {
2416+ view.selected = d;
2417+ return;
2418+ }
2419+ }
2420+
2421+ if (doc.file == null) {
2422+ doc.doc_saved.connect (wait_for_save);
2423+ return;
2424+ }
2425+
2426+ add_doc (doc);
2427+ }
2428+
2429+ void wait_for_save (Scratch.Services.Document doc) {
2430+ doc.doc_saved.disconnect (wait_for_save);
2431+ add_doc (doc);
2432+ }
2433+
2434+ void add_doc (Scratch.Services.Document doc) {
2435+ var item = new Document.scratch (doc);
2436+ category_files.add (item);
2437+ my_select = true;
2438+ view.selected = item;
2439+ my_select = false;
2440+
2441+ var new_root = detect_project (doc.file);
2442+ if (root == null || root.get_path () != new_root.get_path ()) {
2443+ root = new_root;
2444+ category_project.clear ();
2445+ category_project.expand_all ();
2446+ category_project.add (new Folder (root));
2447+ }
2448+ }
2449+
2450+ void add_bookmark () {
2451+ var doc = (view.selected as Document).doc as Scratch.Services.Document;
2452+ var buffer = doc.source_view.buffer;
2453+ Gtk.TextIter iter;
2454+ buffer.get_iter_at_offset (out iter, buffer.cursor_position);
2455+
2456+ var bookmark = new Bookmark (doc, iter);
2457+ category_bookmarks.add (bookmark);
2458+ category_bookmarks.expand_all ();
2459+ }
2460+
2461+ const string [] vcss = {".bzr", ".git", ".hg"};
2462+ File? detect_project (File opened) {
2463+ //go up looking for a vcs indicating folder
2464+ var dir = opened;
2465+ while ((dir = dir.get_parent ()) != null) {
2466+ foreach (var vcs in vcss) {
2467+ if (dir.get_child (vcs).query_exists ()) {
2468+ return dir;
2469+ }
2470+ }
2471+ }
2472+
2473+ //checking for src, might not be under version control yet
2474+ dir = opened.get_parent ();
2475+ if (dir.get_basename () == "src") {
2476+ dir = dir.get_parent ();
2477+ } else if (dir.get_parent ().get_basename () == "src") {
2478+ dir = dir.get_parent ().get_parent ();
2479+ }
2480+
2481+ return dir;
2482+ }
2483+ }
2484+>>>>>>> MERGE-SOURCE
2485 }
2486
2487 [ModuleInit]
2488
2489=== modified file 'plugins/spell/CMakeLists.txt'
2490--- plugins/spell/CMakeLists.txt 2013-11-30 08:48:08 +0000
2491+++ plugins/spell/CMakeLists.txt 2014-10-05 21:35:48 +0000
2492@@ -27,9 +27,13 @@
2493 granite
2494 gtksourceview-3.0
2495 scratchcore
2496- gee-1.0
2497+ gee-0.8
2498 libpeas-1.0
2499+<<<<<<< TREE
2500 zeitgeist-1.0
2501+=======
2502+ ${ZEITGEIST_DEPS}
2503+>>>>>>> MERGE-SOURCE
2504 OPTIONS
2505 --thread
2506 --vapidir=${CMAKE_BINARY_DIR}
2507
2508=== modified file 'plugins/spell/spell.vala'
2509--- plugins/spell/spell.vala 2013-08-17 13:14:44 +0000
2510+++ plugins/spell/spell.vala 2014-10-05 21:35:48 +0000
2511@@ -53,6 +53,15 @@
2512 if (info.get_module_name () == "spell")
2513 spell.detach ();
2514 });
2515+ // Deactivate Spell checker when we are editing a code file
2516+ var lang = d.source_view.buffer.language;
2517+ if (lang != null)
2518+ spell.detach ();
2519+ // Detect language changed event
2520+ view.language_changed.connect ((lang) => {
2521+ if (lang != null)
2522+ spell.detach ();
2523+ });
2524 }
2525 });
2526 }
2527@@ -67,4 +76,4 @@
2528 var objmodule = module as Peas.ObjectModule;
2529 objmodule.register_extension_type (typeof(Peas.Activatable),
2530 typeof(Scratch.Plugins.Spell));
2531-}
2532+}
2533\ No newline at end of file
2534
2535=== modified file 'plugins/strip-trailing-save/CMakeLists.txt'
2536--- plugins/strip-trailing-save/CMakeLists.txt 2013-11-30 08:48:08 +0000
2537+++ plugins/strip-trailing-save/CMakeLists.txt 2014-10-05 21:35:48 +0000
2538@@ -8,9 +8,13 @@
2539 granite
2540 gtksourceview-3.0
2541 scratchcore
2542- gee-1.0
2543+ gee-0.8
2544 libpeas-1.0
2545+<<<<<<< TREE
2546 zeitgeist-1.0
2547+=======
2548+ ${ZEITGEIST_DEPS}
2549+>>>>>>> MERGE-SOURCE
2550 OPTIONS
2551 --thread
2552 --vapidir=${CMAKE_BINARY_DIR}
2553
2554=== modified file 'plugins/strip-trailing-save/strip-trailing-save.vala'
2555--- plugins/strip-trailing-save/strip-trailing-save.vala 2013-06-07 21:00:59 +0000
2556+++ plugins/strip-trailing-save/strip-trailing-save.vala 2014-10-05 21:35:48 +0000
2557@@ -33,8 +33,8 @@
2558 plugins = (Scratch.Services.Interface) object;
2559 plugins.hook_window.connect ((w) => {
2560 this.main_window = w;
2561- main_actions.pre_activate.connect (on_save);
2562- action_save = main_actions.get_action ("SaveFile");
2563+ w.main_actions.pre_activate.connect (on_save);
2564+ action_save = w.main_actions.get_action ("SaveFile");
2565 });
2566 }
2567
2568@@ -42,7 +42,7 @@
2569 * Deactivate plugin.
2570 */
2571 public void deactivate () {
2572- main_actions.pre_activate.disconnect(on_save);
2573+ this.main_window.main_actions.pre_activate.disconnect(on_save);
2574 }
2575
2576 /*
2577
2578=== modified file 'plugins/terminal/CMakeLists.txt'
2579--- plugins/terminal/CMakeLists.txt 2013-11-30 08:48:08 +0000
2580+++ plugins/terminal/CMakeLists.txt 2014-10-05 21:35:48 +0000
2581@@ -15,9 +15,13 @@
2582 granite
2583 gtksourceview-3.0
2584 scratchcore
2585- gee-1.0
2586+ gee-0.8
2587 libpeas-1.0
2588+<<<<<<< TREE
2589 zeitgeist-1.0
2590+=======
2591+ ${ZEITGEIST_DEPS}
2592+>>>>>>> MERGE-SOURCE
2593 OPTIONS
2594 --thread
2595 --vapidir=${CMAKE_BINARY_DIR}
2596
2597=== modified file 'plugins/terminal/terminal.plugin'
2598--- plugins/terminal/terminal.plugin 2013-09-05 09:31:34 +0000
2599+++ plugins/terminal/terminal.plugin 2014-10-05 21:35:48 +0000
2600@@ -4,7 +4,7 @@
2601 IAge=2
2602 Name=Terminal
2603 Description=A terminal in your text editor
2604-Icon=terminal
2605+Icon=utilities-terminal
2606 Authors=Mario Guerriero <mario@elementaryos.org>
2607 Copyright=Copyright © 2012 Scratch and Euclide Developers
2608 Website=http://launchpad.net/scratch
2609
2610=== modified file 'plugins/terminal/terminal.vala'
2611--- plugins/terminal/terminal.vala 2013-07-26 20:20:37 +0000
2612+++ plugins/terminal/terminal.vala 2014-10-05 21:35:48 +0000
2613@@ -61,6 +61,60 @@
2614 string font_name = system_settings.get_string ("monospace-font-name");
2615 this.terminal.set_font_from_string (font_name);
2616
2617+ // Set allow-bold, audible-bell, background, foreground, and palette of pantheon-terminal
2618+ var schema_source = SettingsSchemaSource.get_default ();
2619+ var terminal_schema = schema_source.lookup ("org.pantheon.terminal.settings", true);
2620+ if (terminal_schema != null) {
2621+ var pantheon_terminal_settings = new GLib.Settings ("org.pantheon.terminal.settings");
2622+
2623+ bool allow_bold_setting = pantheon_terminal_settings.get_boolean ("allow-bold");
2624+ this.terminal.set_allow_bold (allow_bold_setting);
2625+
2626+ bool audible_bell_setting = pantheon_terminal_settings.get_boolean ("audible-bell");
2627+ this.terminal.set_audible_bell (audible_bell_setting);
2628+
2629+ this.terminal.set_background_image (null); // allows background and foreground settings to take effect
2630+
2631+ string background_setting = pantheon_terminal_settings.get_string ("background");
2632+ Gdk.Color background_color;
2633+ Gdk.Color.parse (background_setting, out background_color);
2634+
2635+ string foreground_setting = pantheon_terminal_settings.get_string ("foreground");
2636+ Gdk.Color foreground_color;
2637+ Gdk.Color.parse (foreground_setting, out foreground_color);
2638+
2639+ string palette_setting = pantheon_terminal_settings.get_string ("palette");
2640+
2641+ string[] hex_palette = {"#000000", "#FF6C60", "#A8FF60", "#FFFFCC", "#96CBFE",
2642+ "#FF73FE", "#C6C5FE", "#EEEEEE", "#000000", "#FF6C60",
2643+ "#A8FF60", "#FFFFB6", "#96CBFE", "#FF73FE", "#C6C5FE",
2644+ "#EEEEEE"};
2645+
2646+ string current_string = "";
2647+ int current_color = 0;
2648+ for (var i = 0; i < palette_setting.length; i++) {
2649+ if (palette_setting[i] == ':') {
2650+ hex_palette[current_color] = current_string;
2651+ current_string = "";
2652+ current_color++;
2653+ } else {
2654+ current_string += palette_setting[i].to_string ();
2655+ }
2656+ }
2657+
2658+ Gdk.Color[] palette = new Gdk.Color[16];
2659+
2660+ for (int i = 0; i < hex_palette.length; i++) {
2661+ Gdk.Color new_color;
2662+ Gdk.Color.parse (hex_palette[i], out new_color);
2663+
2664+ palette[i] = new_color;
2665+ }
2666+
2667+ this.terminal.set_colors (foreground_color, background_color, palette);
2668+
2669+ } // end pantheon-terminal settings
2670+
2671 // Popup menu
2672 var menu = new Gtk.Menu ();
2673
2674
2675=== modified file 'plugins/vim-emulation/CMakeLists.txt'
2676--- plugins/vim-emulation/CMakeLists.txt 2013-11-30 08:48:08 +0000
2677+++ plugins/vim-emulation/CMakeLists.txt 2014-10-05 21:35:48 +0000
2678@@ -9,9 +9,13 @@
2679 granite
2680 gtksourceview-3.0
2681 scratchcore
2682- gee-1.0
2683+ gee-0.8
2684 libpeas-1.0
2685+<<<<<<< TREE
2686 zeitgeist-1.0
2687+=======
2688+ ${ZEITGEIST_DEPS}
2689+>>>>>>> MERGE-SOURCE
2690 OPTIONS
2691 --thread
2692 --vapidir=${CMAKE_BINARY_DIR}
2693
2694=== modified file 'plugins/word-completion/CMakeLists.txt'
2695--- plugins/word-completion/CMakeLists.txt 2013-11-30 08:48:08 +0000
2696+++ plugins/word-completion/CMakeLists.txt 2014-10-05 21:35:48 +0000
2697@@ -10,9 +10,13 @@
2698 granite
2699 gtksourceview-3.0
2700 scratchcore
2701- gee-1.0
2702+ gee-0.8
2703 libpeas-1.0
2704+<<<<<<< TREE
2705 zeitgeist-1.0
2706+=======
2707+ ${ZEITGEIST_DEPS}
2708+>>>>>>> MERGE-SOURCE
2709 OPTIONS
2710 --thread
2711 --vapidir=${CMAKE_BINARY_DIR}
2712
2713=== modified file 'plugins/word-completion/completion-provider.vala'
2714--- plugins/word-completion/completion-provider.vala 2013-06-01 23:12:09 +0000
2715+++ plugins/word-completion/completion-provider.vala 2014-10-05 21:35:48 +0000
2716@@ -18,17 +18,33 @@
2717 *
2718 */
2719
2720-using Gtk;
2721-
2722-public class CompletionProvider : Gtk.SourceCompletionProvider, Object {
2723-
2724- static const unichar[] stoppers = {' ', '\n', '(', ';', '}', '{', '.'};
2725- TextMark completion_mark; /* The mark at which the proposals were generated */
2726-
2727- Gdk.Pixbuf icon;
2728+public class Scratch.Plugins.CompletionProvider : Gtk.SourceCompletionProvider, Object {
2729 public string name;
2730 public int priority;
2731
2732+ public const string COMPLETION_END_MARK_NAME = "ScratchWordCompletionEnd";
2733+ public const string COMPLETION_START_MARK_NAME = "ScratchWordCompletionStart";
2734+
2735+ private Gdk.Pixbuf icon;
2736+ private Gtk.TextView? view;
2737+ private Gtk.TextBuffer? buffer;
2738+ private Euclide.Completion.Parser parser;
2739+ private bool proposals_found = false;
2740+ private Gtk.TextMark completion_end_mark;
2741+ private Gtk.TextMark completion_start_mark;
2742+
2743+ public signal void can_propose (bool b);
2744+
2745+ public CompletionProvider (Scratch.Plugins.Completion completion) {
2746+ this.view = completion.current_view as Gtk.TextView;
2747+ this.buffer = completion.current_view.buffer;
2748+ this.parser = completion.parser;
2749+ Gtk.TextIter iter;
2750+ buffer.get_iter_at_offset (out iter, 0);
2751+ completion_end_mark = buffer.create_mark (COMPLETION_END_MARK_NAME, iter, false);
2752+ completion_start_mark = buffer.create_mark (COMPLETION_START_MARK_NAME, iter, false);
2753+ }
2754+
2755 public string get_name () {
2756 return this.name;
2757 }
2758@@ -40,22 +56,19 @@
2759 public bool match (Gtk.SourceCompletionContext context) {
2760 return true;
2761 }
2762-
2763- public void populate (Gtk.SourceCompletionContext context) {
2764- var file_props = get_file_proposals ();
2765-
2766- /* Get current line */
2767- completion_mark = current_buffer.get_insert ();
2768- TextIter iter;
2769- current_buffer.get_iter_at_mark (out iter, completion_mark);
2770- var line = iter.get_line () + 1;
2771-
2772- TextIter iter_start;
2773- current_buffer.get_iter_at_line (out iter_start, line - 1);
2774-
2775- // Proposal itself
2776- if (file_props != null)
2777+
2778+ public void populate (Gtk.SourceCompletionContext context) {
2779+ /*Store current insertion point for use in activate_proposal */
2780+ GLib.List<Gtk.SourceCompletionItem>? file_props;
2781+ bool no_minimum = (context.get_activation () == Gtk.SourceCompletionActivation.USER_REQUESTED);
2782+ proposals_found = get_proposals (out file_props, no_minimum);
2783+
2784+ if (proposals_found)
2785 context.add_proposals (this, file_props, true);
2786+
2787+ /* Signal to plugin whether proposals are available
2788+ * If none, the completion will be active but not visible */
2789+ can_propose (proposals_found);
2790 }
2791
2792 public unowned Gdk.Pixbuf? get_icon () {
2793@@ -72,15 +85,22 @@
2794
2795 public bool activate_proposal (Gtk.SourceCompletionProposal proposal,
2796 Gtk.TextIter iter) {
2797-
2798- // Count backward from completion_mark instead of iter (avoids wrong insertion if the user is typing fast)
2799- TextIter start;
2800- current_buffer.get_iter_at_mark (out start, completion_mark);
2801-
2802- start.backward_word_start ();
2803-
2804- current_buffer.delete (ref start, ref iter);
2805- current_buffer.insert (ref start, proposal.get_text (), proposal.get_text ().length);
2806+ if (proposals_found) {
2807+ /* Count backward from completion_mark instead of iter
2808+ * (avoids wrong insertion if the user is typing fast) */
2809+ Gtk.TextIter start;
2810+ Gtk.TextIter end;
2811+ Gtk.TextMark mark;
2812+
2813+ mark = buffer.get_mark (COMPLETION_END_MARK_NAME);
2814+ buffer.get_iter_at_mark (out end, mark);
2815+
2816+ mark = buffer.get_mark (COMPLETION_START_MARK_NAME);
2817+ buffer.get_iter_at_mark (out start, mark);
2818+
2819+ buffer.@delete (ref start, ref end);
2820+ buffer.insert (ref start, proposal.get_text (), proposal.get_text ().length);
2821+ }
2822 return true;
2823 }
2824
2825@@ -89,65 +109,82 @@
2826 Gtk.SourceCompletionActivation.USER_REQUESTED;
2827 }
2828
2829- Box box_info_frame = new Box (Orientation.VERTICAL, 0);
2830 public unowned Gtk.Widget? get_info_widget (Gtk.SourceCompletionProposal proposal) {
2831- return box_info_frame;
2832+ /* As no additional info is provided no widget is needed */
2833+ return null;
2834 }
2835
2836- public int get_interactive_dela () {
2837+ public int get_interactive_delay () {
2838+ /* Use default delay (250 milliseconds) */
2839 return -1;
2840 }
2841
2842- public bool get_start_it (Gtk.SourceCompletionContext context,
2843+ public bool get_start_iter (Gtk.SourceCompletionContext context,
2844 Gtk.SourceCompletionProposal proposal,
2845 Gtk.TextIter iter) {
2846- var mark = current_buffer.get_insert ();
2847- TextIter cursor_iter;
2848- current_buffer.get_iter_at_mark (out cursor_iter, mark);
2849-
2850+ var mark = buffer.get_insert ();
2851+ Gtk.TextIter cursor_iter;
2852+ buffer.get_iter_at_mark (out cursor_iter, mark);
2853+
2854 iter = cursor_iter;
2855 iter.backward_word_start ();
2856 return true;
2857 }
2858
2859 public void update_info (Gtk.SourceCompletionProposal proposal, Gtk.SourceCompletionInfo info) {
2860+ /* No additional info provided on proposals */
2861 return;
2862 }
2863-
2864- public GLib.List<Gtk.SourceCompletionItem>? get_file_proposals () {
2865- /* Compute the string we want compute */
2866+
2867+ private bool get_proposals (out GLib.List<Gtk.SourceCompletionItem>? props, bool no_minimum) {
2868 string to_find = "";
2869- string last_to_find;
2870 Gtk.TextIter iter;
2871- Gtk.TextBuffer buffer = current_buffer;
2872- buffer.get_iter_at_offset (out iter, buffer.cursor_position);
2873- iter.backward_find_char ((c) => {
2874- bool valid = c in stoppers;
2875- if (!valid)
2876- to_find += c.to_string ();
2877- return valid;
2878- }, null);
2879-
2880- to_find = to_find.reverse ();
2881- last_to_find = to_find;
2882-
2883-
2884- if (to_find == "")
2885- return null;
2886-
2887- var props = new GLib.List<Gtk.SourceCompletionItem> ();
2888-
2889- foreach (var word in parser.get_for_word (to_find)) {
2890- GLib.debug (word);
2891- var item = new Gtk.SourceCompletionItem (word,
2892- word,
2893- null,
2894- null);
2895- props.append (item);
2896- }
2897-
2898- current_view.grab_focus ();
2899-
2900- return props;
2901+ Gtk.TextBuffer temp_buffer = buffer;
2902+ props = null;
2903+
2904+ Gtk.TextIter start, end;
2905+ buffer.get_selection_bounds (out start, out end);
2906+
2907+ to_find = temp_buffer.get_text (start, end, true);
2908+
2909+ if (to_find.length == 0) {
2910+ /* Find start of current word */
2911+ temp_buffer.get_iter_at_offset (out iter, buffer.cursor_position);
2912+ /* Mark current insertion point as end point for use in activate proposal */
2913+ buffer.move_mark_by_name (COMPLETION_END_MARK_NAME, iter);
2914+ /* TODO - Use iter.backward_word_start? */
2915+ iter.backward_find_char ((c) => {
2916+ bool valid = parser.is_delimiter (c);
2917+ if (!valid)
2918+ to_find += c.to_string ();
2919+
2920+ return valid;
2921+ }, null);
2922+ iter.forward_cursor_position ();
2923+ /* Mark start of delimited text as start point for use in activate proposal */
2924+ buffer.move_mark_by_name (COMPLETION_START_MARK_NAME, iter);
2925+ to_find = to_find.reverse ();
2926+ } else {
2927+ /* mark start and end of the selection */
2928+ buffer.move_mark_by_name (COMPLETION_END_MARK_NAME, end);
2929+ buffer.move_mark_by_name (COMPLETION_START_MARK_NAME, start);
2930+ }
2931+
2932+ /* There is no minimum length of word to find if the user requested a completion */
2933+ if (no_minimum || to_find.length >= Euclide.Completion.Parser.MINIMUM_WORD_LENGTH) {
2934+ /* Get proposals, if any */
2935+ var prop_word_list = new GLib.List<string> ();
2936+ if (parser.get_for_word (to_find, out prop_word_list)) {
2937+ foreach (var word in prop_word_list) {
2938+ var item = new Gtk.SourceCompletionItem (word,
2939+ word,
2940+ null,
2941+ null);
2942+ props.prepend (item);
2943+ }
2944+ return true;
2945+ }
2946+ }
2947+ return false;
2948 }
2949 }
2950
2951=== modified file 'plugins/word-completion/engine.vala'
2952--- plugins/word-completion/engine.vala 2013-06-01 23:12:09 +0000
2953+++ plugins/word-completion/engine.vala 2014-10-05 21:35:48 +0000
2954@@ -19,98 +19,94 @@
2955 */
2956
2957 public class Euclide.Completion.Parser : GLib.Object {
2958- const char[] stoppers = {'\n', ' ', '.', ';', '\t', '(', ')', ',', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '-', '"', '\'', '&', '|'};
2959- const string[] to_ignore = {"ref", "var"};
2960- /* Read-only for external use */
2961- public Gee.ArrayList<string> words;
2962- public Gee.HashMap<Gtk.TextView,Gee.LinkedList<string>> text_views;
2963+ public const int MINIMUM_WORD_LENGTH = 3;
2964+ public const int MAX_TOKENS = 1000000;
2965+
2966+ public const string delimiters = " .,;:?{}[]()0123456789+-=&|-<>*\\/\n\t\'\"";
2967+ public bool is_delimiter (unichar c) {
2968+ return delimiters.index_of_char (c) >= 0;
2969+ }
2970+
2971+ public Gee.HashMap<Gtk.TextView,Gee.ArrayList<string>> text_view_words;
2972+ public bool parsing_cancelled = false;
2973+
2974+ private Gee.ArrayList<string> words;
2975+ private Mutex words_lock;
2976+ private string last_word = "";
2977+
2978 public Parser () {
2979- words = new Gee.ArrayList<string> ();
2980- text_views = new Gee.HashMap<Gtk.TextView,Gee.LinkedList<string>> ();
2981- }
2982-
2983- public void clear () {
2984- lock (words) {
2985- words.clear ();
2986- }
2987- }
2988-
2989- public void parse_string (string text, Gee.List<string>? words_ = null) {
2990- in_comment = false;
2991- in_string = false;
2992- in_single_string = false;
2993- words_ = words_ ?? words;
2994- lock (words) {
2995- string current_word = "";
2996- for (int i = 0; i < text.length; i++) {
2997- var text_char = text[i];
2998- if (text_char in stoppers) {
2999- if (current_word != "") {
3000- parse_word (current_word);
3001- current_word = "";
3002- }
3003- if (text_char == '\'')
3004- in_single_string = !in_single_string;
3005- if (text_char == '"')
3006- in_string = !in_string;
3007+ words_lock = new Mutex ();
3008+ text_view_words = new Gee.HashMap<Gtk.TextView,Gee.ArrayList<string>> ();
3009+ }
3010+
3011+ public void add_last_word () {
3012+ add_word (last_word);
3013+ }
3014+
3015+ public bool get_for_word (string to_find, out List<string> list) {
3016+ bool success = false;
3017+ uint length = to_find.length;
3018+
3019+ list = null;
3020+ last_word = to_find;
3021+
3022+ if (words != null && words_lock.trylock ()) {
3023+ foreach (var word in words) {
3024+ if (word.length > length && word.slice (0, length) == to_find) {
3025+ success = true;
3026+ list.prepend (word);
3027 }
3028- else
3029- current_word += text_char.to_string ();
3030- }
3031- }
3032- }
3033-
3034- bool in_comment;
3035- bool in_string;
3036- bool in_single_string;
3037-
3038- void parse_word (string word, Gee.List<string>? words_ = null) {
3039- if (word.contains ("/*"))
3040- in_comment = true;
3041- if (word.contains ("*/"))
3042- in_comment = false;
3043- if (in_comment || in_single_string || in_string)
3044- return;
3045- words_ = words_ ?? words;
3046- assert (word != "");
3047- if (word in to_ignore || word in words_) {
3048- return;
3049- }
3050- words_.add (word);
3051- }
3052-
3053- public List<string> get_for_word (string to_find) {
3054- List<string> list = new List<string> ();
3055- foreach (var word in words) {
3056- if (word.length > to_find.length
3057- && word.slice (0, to_find.length) == to_find) {
3058- list.append (word);
3059- }
3060- }
3061- return list;
3062- }
3063-
3064- void add_list (Gee.LinkedList<string> list) {
3065- foreach (var word in list) parse_word (word);
3066- }
3067-
3068+ }
3069+ words_lock.unlock ();
3070+ }
3071+ return success;
3072+ }
3073+
3074+ public void rebuild_word_list (Gtk.TextView view) {
3075+ words_lock.lock ();
3076+ words.clear ();
3077+ words_lock.unlock ();
3078+ parse_text_view (view);
3079+ }
3080+
3081 public void parse_text_view (Gtk.TextView view) {
3082- if (text_views.has_key (view)) {
3083- if (!view.get_data<bool> ("damaged"))
3084- add_list (text_views[view]);
3085- else {
3086- text_views[view].clear ();
3087- parse_string (view.buffer.text, text_views[view]);
3088- add_list (text_views[view]);
3089- view.set_data<bool> ("damaged", false);
3090+ /* If this view has already been parsed, restore the word list */
3091+ if (text_view_words.has_key (view)) {
3092+ words = text_view_words.@get (view);
3093+ } else {
3094+ /* Else create a new word list and parse the buffer text */
3095+ words = new Gee.ArrayList<string> ();
3096+ }
3097+ if (view.buffer.text.length > 0) {
3098+ parse_string (view.buffer.text);
3099+ text_view_words.@set (view, words);
3100+ }
3101+ }
3102+
3103+ private void add_word (string word) {
3104+ if (word.length < MINIMUM_WORD_LENGTH)
3105+ return;
3106+
3107+ if (!(word in words) && words_lock.trylock ()) {
3108+ words.add (word);
3109+ words_lock.unlock ();
3110+ }
3111+ }
3112+
3113+ public void cancel_parsing () {
3114+ parsing_cancelled = true;
3115+ }
3116+
3117+ private bool parse_string (string text) {
3118+ parsing_cancelled = false;
3119+ string [] word_array = text.split_set (delimiters, MAX_TOKENS);
3120+ foreach (var current_word in word_array ) {
3121+ if (parsing_cancelled) {
3122+ debug ("Cancelling parse");
3123+ return false;
3124 }
3125- }
3126- else {
3127- text_views[view] = new Gee.LinkedList<string> ();
3128- parse_string (view.buffer.text, text_views[view]);
3129- add_list (text_views[view]);
3130- view.set_data<bool> ("damaged", false);
3131- view.key_press_event.connect (() => { view.set_data<bool> ("damaged", true); return false; });
3132- }
3133+ add_word (current_word);
3134+ }
3135+ return true;
3136 }
3137 }
3138
3139=== modified file 'plugins/word-completion/plugin.vala'
3140--- plugins/word-completion/plugin.vala 2013-06-09 18:40:28 +0000
3141+++ plugins/word-completion/plugin.vala 2014-10-05 21:35:48 +0000
3142@@ -19,120 +19,183 @@
3143 */
3144
3145
3146-using Scratch;
3147-using Scratch.Services;
3148-
3149-public Euclide.Completion.Parser? parser = null;
3150-public Document? current_document = null;
3151-public Gtk.SourceView? current_view = null;
3152-public Gtk.SourceBuffer? current_buffer = null;
3153-
3154-public const string NAME = N_("Words Completion");
3155-public const string DESCRIPTION = N_("Show a completion dialog with most used words from your files");
3156-
3157 public class Scratch.Plugins.Completion : Peas.ExtensionBase, Peas.Activatable {
3158
3159 MainWindow main_window;
3160
3161 public Object object { owned get; construct; }
3162 Scratch.Services.Interface plugins;
3163-
3164- static const unichar[] stoppers = {' ', '\n', '(', ';', '}', '{', '.'};
3165-
3166- List<Gtk.SourceView> text_view = new List<Gtk.SourceView> ();
3167-
3168- uint timeout = 0;
3169- uint timeout_parse = -1;
3170-
3171+
3172+ private List<Gtk.SourceView> text_view_list = new List<Gtk.SourceView> ();
3173+ public Euclide.Completion.Parser parser {get; private set;}
3174+ public Gtk.SourceView? current_view {get; private set;}
3175+ public Scratch.Services.Document current_document {get; private set;}
3176+
3177+ private const string NAME = N_("Words Completion");
3178+ private const string DESCRIPTION = N_("Show a completion dialog with most used words from your files");
3179+
3180+ private const uint [] activate_keys = {Gdk.Key.Return,
3181+ Gdk.Key.KP_Enter,
3182+ Gdk.Key.ISO_Enter,
3183+ Gdk.Key.Tab,
3184+ Gdk.Key.KP_Tab,
3185+ Gdk.Key.ISO_Left_Tab,
3186+ };
3187+
3188+ private const uint USER_REQUESTED_KEY = Gdk.Key.backslash;
3189+
3190+ private uint timeout_id = 0;
3191+ private bool completion_visible = false;
3192+
3193 public void activate () {
3194 plugins = (Scratch.Services.Interface) object;
3195 parser = new Euclide.Completion.Parser ();
3196- timeout_parse = Timeout.add (5000, on_timeout_update);
3197-
3198 plugins.hook_window.connect ((w) => {
3199 this.main_window = w;
3200 });
3201-
3202+
3203 plugins.hook_document.connect (on_new_source_view);
3204 }
3205
3206 public void deactivate () {
3207- if (timeout_parse > 0) Source.remove (timeout_parse);
3208- text_view.foreach ((v) => {
3209- v.completion.get_providers ().foreach ((p) => {
3210- try {
3211- v.completion.remove_provider (p);
3212- } catch (Error e) {
3213- warning (e.message);
3214- }
3215- });
3216- });
3217+ text_view_list.@foreach (cleanup);
3218 }
3219
3220 public void update_state () {
3221-
3222+
3223 }
3224
3225 public void on_new_source_view (Scratch.Services.Document doc) {
3226- // Globals vars
3227+ if (current_view != null) {
3228+ if (current_view == doc.source_view)
3229+ return;
3230+
3231+ parser.cancel_parsing ();
3232+
3233+ if (timeout_id > 0)
3234+ GLib.Source.remove (timeout_id);
3235+
3236+ cleanup (current_view);
3237+ }
3238+
3239 current_document = doc;
3240 current_view = doc.source_view;
3241- current_buffer = doc.source_view.buffer;
3242-
3243- var view = doc.source_view;
3244- //assert(view != null);
3245- view.key_press_event.connect (on_key_press);
3246- //view.focus_out_event.connect (() => { window.hide(); return false; });
3247- //view.button_press_event.connect( () => { window.hide(); return false;});
3248- text_view.append (view);
3249-
3250- // Provider
3251- current_view.completion.get_providers ().foreach ((p) => {
3252- try {
3253- current_view.completion.remove_provider (p);
3254- } catch (Error e) {
3255- warning (e.message);
3256- }
3257- });
3258- var comp_provider = new CompletionProvider ();
3259+ current_view.key_press_event.connect (on_key_press);
3260+ current_view.completion.show.connect (on_completion_shown);
3261+ current_view.completion.hide.connect (on_completion_hidden);
3262+
3263+ if (text_view_list.find (current_view) == null)
3264+ text_view_list.append (current_view);
3265+
3266+
3267+ var comp_provider = new Scratch.Plugins.CompletionProvider (this);
3268 comp_provider.priority = 1;
3269- comp_provider.name = _("%s - Word Completion").printf (doc.get_basename ());
3270+ comp_provider.name = provider_name_from_document (doc);
3271+ comp_provider.can_propose.connect (on_propose);
3272+
3273 try {
3274 current_view.completion.add_provider (comp_provider);
3275+ current_view.completion.show_headers = true;
3276+ current_view.completion.show_icons = true;
3277+ /* Wait a bit to allow text to load then run parser*/
3278+ timeout_id = Timeout.add (1000, on_timeout_update);
3279+
3280 } catch (Error e) {
3281 warning (e.message);
3282 }
3283 }
3284-
3285- bool on_timeout_update () {
3286+
3287+ private bool on_timeout_update () {
3288 try {
3289- unowned Thread<void*> thread_a = Thread.create<void*> (threaded_update, true);
3290- thread_a.set_priority (ThreadPriority.LOW);
3291+ GLib.Thread.create<void*> (threaded_update, true);
3292 } catch (ThreadError e) {
3293 warning (e.message);
3294 }
3295- return true;
3296+
3297+ timeout_id = 0;
3298+ return false;
3299 }
3300-
3301+
3302 void* threaded_update () {
3303- parser.clear ();
3304- foreach (var view in text_view) {
3305- if (view != null)
3306- parser.parse_text_view (view);
3307- }
3308+ if (current_view != null)
3309+ parser.parse_text_view (current_view as Gtk.TextView);
3310+
3311 return null;
3312 }
3313-
3314- bool on_key_press (Gtk.Widget view, Gdk.EventKey event) {
3315- if (timeout > 0) Source.remove (timeout);
3316- if (event.str.get_char () in stoppers) {
3317- //message ("The auto completion box should hide now");
3318+
3319+ private bool on_key_press (Gtk.Widget view, Gdk.EventKey event) {
3320+ uint kv = event.keyval;
3321+ unichar uc = (unichar)(Gdk.keyval_to_unicode (kv));
3322+
3323+ /* Pass through any modified keypress except Shift or Capslock */
3324+ Gdk.ModifierType mods = event.state & Gdk.ModifierType.MODIFIER_MASK
3325+ & ~Gdk.ModifierType.SHIFT_MASK
3326+ & ~Gdk.ModifierType.LOCK_MASK;
3327+ if (mods > 0 ) {
3328+ /* Default key for USER_REQUESTED completion is ControlSpace
3329+ * but this is trapped elsewhere. Control + USER_REQUESTED_KEY acts as an
3330+ * alternative and also purges spelling mistakes and unused words from the list.
3331+ * If used when a word or part of a word is selected, the selection will be
3332+ * used as the word to find. */
3333+ if ((mods & Gdk.ModifierType.CONTROL_MASK) > 0 && (kv == USER_REQUESTED_KEY)) {
3334+ parser.rebuild_word_list (current_view);
3335+ current_view.show_completion ();
3336+ return true;
3337+ } else
3338+ return false;
3339+ }
3340+
3341+ bool activating = kv in activate_keys;
3342+
3343+ if (completion_visible && activating) {
3344+ current_view.completion.activate_proposal ();
3345+ parser.add_last_word ();
3346+ return true;
3347+ }
3348+
3349+ if (activating || (uc.isprint () && parser.is_delimiter (uc) )) {
3350+ parser.add_last_word ();
3351 current_view.completion.hide ();
3352 }
3353- //timeout = Timeout.add (100, () => { update_completion (); return false; });
3354+
3355 return false;
3356 }
3357
3358+ private void on_completion_shown () {
3359+ completion_visible = true;
3360+ }
3361+
3362+ private void on_completion_hidden () {
3363+ completion_visible = false;
3364+ }
3365+
3366+ private void on_propose (bool can_propose) {
3367+ completion_visible = can_propose;
3368+ }
3369+
3370+ private string provider_name_from_document (Scratch.Services.Document doc) {
3371+ return _("%s - Word Completion").printf (doc.get_basename ());
3372+ }
3373+
3374+ private void cleanup (Gtk.SourceView view) {
3375+ current_view.key_press_event.disconnect (on_key_press);
3376+ current_view.completion.show.disconnect (on_completion_shown);
3377+ current_view.completion.hide.disconnect (on_completion_hidden);
3378+
3379+ current_view.completion.get_providers ().foreach ((p) => {
3380+ try {
3381+ /* Only remove provider added by this plug in */
3382+ if (p.get_name () == provider_name_from_document (current_document)) {
3383+ debug ("removing provider %s", p.get_name ());
3384+ current_view.completion.remove_provider (p);
3385+ }
3386+ } catch (Error e) {
3387+ warning (e.message);
3388+ }
3389+ });
3390+
3391+ completion_visible = false;
3392+ }
3393 }
3394
3395 [ModuleInit]
3396
3397=== modified file 'po/am.po'
3398--- po/am.po 2013-11-07 05:42:04 +0000
3399+++ po/am.po 2014-10-05 21:35:48 +0000
3400@@ -7,431 +7,441 @@
3401 msgstr ""
3402 "Project-Id-Version: scratch\n"
3403 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
3404-"POT-Creation-Date: 2013-08-02 16:03+0200\n"
3405-"PO-Revision-Date: 2012-11-01 00:40+0000\n"
3406+"POT-Creation-Date: 2014-08-30 09:08-0500\n"
3407+"PO-Revision-Date: 2014-03-26 16:00+0000\n"
3408 "Last-Translator: samson <Unknown>\n"
3409 "Language-Team: Amharic <am@li.org>\n"
3410 "MIME-Version: 1.0\n"
3411 "Content-Type: text/plain; charset=UTF-8\n"
3412 "Content-Transfer-Encoding: 8bit\n"
3413-"X-Launchpad-Export-Date: 2013-11-07 05:41+0000\n"
3414-"X-Generator: Launchpad (build 16820)\n"
3415-
3416-#: /home/mario/elementary/scratch/po/../src/Utils.vala:42
3417-msgid "All files"
3418-msgstr "ሁሉንም ፋይሎች"
3419-
3420-#: /home/mario/elementary/scratch/po/../src/Utils.vala:45
3421-msgid "Text files"
3422-msgstr "የጽሁፍ ፋይሎች"
3423-
3424-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:85
3425+"X-Launchpad-Export-Date: 2014-08-31 07:11+0000\n"
3426+"X-Generator: Launchpad (build 17176)\n"
3427+
3428+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:52
3429+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:722
3430+msgid "Preferences"
3431+msgstr "ምርጫዎች"
3432+
3433+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:70
3434+msgid "Behavior"
3435+msgstr "ባህሪ"
3436+
3437+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:73
3438+msgid "Interface"
3439+msgstr "ግንኙነት"
3440+
3441+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:86
3442+msgid "Extensions"
3443+msgstr "ተጨማሪዎች"
3444+
3445+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:90
3446+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:666
3447+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:667
3448+msgid "Close"
3449+msgstr "መዝጊያ"
3450+
3451+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:135
3452+msgid "Show welcome screen"
3453+msgstr ""
3454+
3455+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:136
3456+msgid "Show last open tabs"
3457+msgstr ""
3458+
3459+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:152
3460+msgid "General:"
3461+msgstr "ባጠቃላይ :"
3462+
3463+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:158
3464+msgid "When Scratch starts:"
3465+msgstr ""
3466+
3467+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:161
3468+msgid "Save files when changed:"
3469+msgstr ""
3470+
3471+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:166
3472+msgid "Tabs:"
3473+msgstr ""
3474+
3475+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:171
3476+msgid "Automatic indentation:"
3477+msgstr ""
3478+
3479+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:174
3480+msgid "Insert spaces instead of tabs:"
3481+msgstr ""
3482+
3483+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:178
3484+msgid "Tab width:"
3485+msgstr ""
3486+
3487+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:206
3488+msgid "Editor:"
3489+msgstr ""
3490+
3491+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:224
3492+msgid "Highlight current line:"
3493+msgstr ""
3494+
3495+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:225
3496+msgid "Highlight matching brackets:"
3497+msgstr ""
3498+
3499+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:226
3500+msgid "Split long text in many lines:"
3501+msgstr ""
3502+
3503+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:227
3504+msgid "Draw spaces:"
3505+msgstr ""
3506+
3507+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:228
3508+msgid "Show line numbers:"
3509+msgstr ""
3510+
3511+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:231
3512+msgid "Line width guide:"
3513+msgstr ""
3514+
3515+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:247
3516+msgid "Font and Color Scheme:"
3517+msgstr ""
3518+
3519+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:261
3520+msgid "Select font:"
3521+msgstr "ፊደል ይምረጡ :"
3522+
3523+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:264
3524+msgid "Color scheme:"
3525+msgstr ""
3526+
3527+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:269
3528+msgid "Custom font:"
3529+msgstr ""
3530+
3531+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:99
3532 msgid "Zeitgeist Datasource for Scratch"
3533 msgstr ""
3534
3535-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:160
3536+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:181
3537 msgid "Trash"
3538 msgstr "ቆሻሻ"
3539
3540-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:448
3541+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:504
3542 msgid "Open some files"
3543-msgstr ""
3544+msgstr "አንዳንድ ፋይሎች መክፈቻ"
3545
3546-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:539
3547+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:599
3548 msgid "Hide search bar"
3549 msgstr "የመፈለጊያ ባሩን መደበቂያ"
3550
3551-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:552
3552-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:553
3553+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:654
3554+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:655
3555 msgid "Find…"
3556-msgstr ""
3557+msgstr "መፈለጊያ…"
3558
3559-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:556
3560-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:557
3561+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:658
3562+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:659
3563 msgid "Go to line…"
3564-msgstr ""
3565+msgstr "ወደ መስመር መሄጃ"
3566
3567-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:560
3568-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:561
3569+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:662
3570+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:663
3571 msgid "Quit"
3572-msgstr "ማቋረጫ"
3573-
3574-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:564
3575-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:565
3576-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:84
3577-msgid "Close"
3578-msgstr "መዝጊያ"
3579-
3580-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:568
3581-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:569
3582+msgstr "ማጥፊያ"
3583+
3584+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:670
3585+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:671
3586+#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:111
3587 msgid "Replace"
3588 msgstr "መቀየሪያ"
3589
3590-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:572
3591+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:674
3592 msgid "Reopen closed document"
3593 msgstr ""
3594
3595-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:573
3596+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:675
3597 msgid "Open last closed document in a new tab"
3598 msgstr ""
3599
3600-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:576
3601+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:678
3602 msgid "Add New Tab"
3603 msgstr ""
3604
3605-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:577
3606+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:679
3607 msgid "Add a new tab"
3608 msgstr ""
3609
3610-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:580
3611+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:682
3612 msgid "Add New View"
3613 msgstr "አዲስ መመለከቻ መጨመሪያ"
3614
3615-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:581
3616+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:683
3617 msgid "Add a new view"
3618 msgstr "አዲስ መመለከቻ መጨመሪያ"
3619
3620-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:584
3621+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:686
3622 msgid "Remove Current View"
3623 msgstr ""
3624
3625-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:585
3626+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:687
3627 msgid "Remove this view"
3628 msgstr ""
3629
3630-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:588
3631+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:690
3632 msgid "Undo"
3633 msgstr "መተው"
3634
3635-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:589
3636+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:691
3637 msgid "Undo the last action"
3638 msgstr "የመጨረሻውን ተግባር መተው"
3639
3640-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:592
3641+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:694
3642 msgid "Redo"
3643 msgstr "እንደገና መስሪያ"
3644
3645-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:593
3646+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:695
3647 msgid "Redo the last undone action"
3648 msgstr "መጨረሻ የተተወውን ተግባር እንደገና መስሪያ"
3649
3650-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:596
3651+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:698
3652 msgid "Revert"
3653 msgstr "ወደ ነበረበት መመለሻ"
3654
3655-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:597
3656+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:699
3657 msgid "Restore this file"
3658 msgstr "ይህን ፋይል እንደነበር መመለሻ"
3659
3660-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:600
3661-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:601
3662+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:702
3663+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:703
3664 msgid "Duplicate selected strings"
3665 msgstr ""
3666
3667-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:604
3668-#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileView.vala:282
3669+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:706
3670+#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileView.vala:281
3671 msgid "Open"
3672 msgstr "መክፈቻ"
3673
3674-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:605
3675+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:707
3676 msgid "Open a file"
3677 msgstr "ፋይል መክፈቻ"
3678
3679-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:608
3680-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:495
3681+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:710
3682+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:584
3683 msgid "Save"
3684 msgstr "ማስቀመጫ"
3685
3686-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:609
3687-msgid "Save the current file"
3688-msgstr "የአሁኑን ፋይል ማስቀመጫ"
3689-
3690-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:612
3691+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:711
3692+msgid "Save this file"
3693+msgstr ""
3694+
3695+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:714
3696+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:576
3697+msgid "Save As…"
3698+msgstr ""
3699+
3700+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:715
3701+msgid "Save this file with a different name"
3702+msgstr ""
3703+
3704+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:718
3705 #: /home/mario/elementary/scratch/po/../src/Services/TemplateManager.vala:230
3706 msgid "Templates"
3707 msgstr "ቴምፕሌትስ"
3708
3709-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:613
3710+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:719
3711 msgid "Project templates"
3712 msgstr ""
3713
3714-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:616
3715-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:45
3716-msgid "Preferences"
3717-msgstr "ምርጫዎች"
3718-
3719-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:617
3720+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:723
3721 msgid "Change Scratch settings"
3722 msgstr ""
3723
3724-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:623
3725-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:624
3726+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:726
3727+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:727
3728+msgid "Next Tab"
3729+msgstr ""
3730+
3731+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:730
3732+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:731
3733+msgid "Previous Tab"
3734+msgstr ""
3735+
3736+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:747
3737+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:748
3738 msgid "Fullscreen"
3739 msgstr "በሙሉ መመልከቻ ዘዴ"
3740
3741-#: /home/mario/elementary/scratch/po/../src/config.vala:15
3742-msgid "Edit text files"
3743-msgstr "የጽሁፍ ፋይሎች ማረሚያ"
3744-
3745-#: /home/mario/elementary/scratch/po/../src/config.vala:16
3746-msgid "Text Editor"
3747-msgstr "የጽሁፍ ማረሚያ"
3748-
3749-#: /home/mario/elementary/scratch/po/../src/config.vala:17
3750-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:322
3751-msgid "New Document"
3752-msgstr "አዲስ ሰነድ"
3753-
3754-#: /home/mario/elementary/scratch/po/../src/config.vala:18
3755-msgid "New Window"
3756-msgstr "አዲስ መስኮት"
3757-
3758-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:62
3759-msgid "Behavior"
3760-msgstr "ባህሪ"
3761-
3762-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:66
3763-msgid "Interface"
3764-msgstr "ግንኙነት"
3765-
3766-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:74
3767-msgid "Extensions"
3768-msgstr "ተጨማሪዎች"
3769-
3770-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:128
3771-msgid "Show welcome screen"
3772-msgstr ""
3773-
3774-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:129
3775-msgid "Show last open tabs"
3776-msgstr ""
3777-
3778-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:145
3779-msgid "General:"
3780-msgstr "ባጠቃላይ :"
3781-
3782-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:151
3783-msgid "When Scratch starts:"
3784-msgstr ""
3785-
3786-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:154
3787-msgid "Save files when changed:"
3788-msgstr ""
3789-
3790-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:159
3791-msgid "Tabs:"
3792-msgstr ""
3793-
3794-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:164
3795-msgid "Automatic indentation:"
3796-msgstr ""
3797-
3798-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:167
3799-msgid "Insert spaces instead of tabs:"
3800-msgstr ""
3801-
3802-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:171
3803-msgid "Tab width:"
3804-msgstr ""
3805-
3806-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:199
3807-msgid "Editor:"
3808-msgstr ""
3809-
3810-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:217
3811-msgid "Highlight current line:"
3812-msgstr ""
3813-
3814-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:218
3815-msgid "Highlight matching brackets:"
3816-msgstr ""
3817-
3818-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:219
3819-msgid "Split long text in many lines:"
3820-msgstr ""
3821-
3822-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:220
3823-msgid "Draw spaces:"
3824-msgstr ""
3825-
3826-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:221
3827-msgid "Show line numbers:"
3828-msgstr ""
3829-
3830-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:224
3831-msgid "Line width guide:"
3832-msgstr ""
3833-
3834-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:240
3835-msgid "Font and Color Scheme:"
3836-msgstr ""
3837-
3838-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:254
3839-msgid "Select font:"
3840-msgstr "ፊደል ይምረጡ :"
3841-
3842-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:257
3843-msgid "Color scheme:"
3844-msgstr ""
3845-
3846-#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:262
3847-msgid "Custom font:"
3848-msgstr ""
3849-
3850-#: /home/mario/elementary/scratch/po/../src/Scratch.vala:160
3851-msgid "Set of plugins"
3852-msgstr ""
3853-
3854-#: /home/mario/elementary/scratch/po/../src/Scratch.vala:161
3855-msgid "Create a new instance"
3856-msgstr ""
3857-
3858-#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:65
3859-msgid "Find"
3860-msgstr "መፈለጊያ"
3861-
3862-#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:84
3863-msgid "Replace With"
3864-msgstr "መተኪያ በ"
3865-
3866-#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:113
3867-msgid "Go To Line:"
3868-msgstr "ወደ መስመር መሄጃ :"
3869-
3870-#: /home/mario/elementary/scratch/po/../src/Widgets/SourceView.vala:82
3871-msgid "Syntax Highlighting"
3872-msgstr ""
3873-
3874-#: /home/mario/elementary/scratch/po/../src/Widgets/SourceView.vala:93
3875-msgid "Normal Text"
3876-msgstr ""
3877-
3878-#: /home/mario/elementary/scratch/po/../src/Widgets/LoadingView.vala:36
3879-msgid "Wait while restoring last session..."
3880-msgstr ""
3881-
3882-#: /home/mario/elementary/scratch/po/../src/Widgets/DynamicNotebook.vala:112
3883-#: /home/mario/elementary/scratch/po/../src/Widgets/DynamicNotebook.vala:135
3884-msgid "Close Tab"
3885-msgstr ""
3886-
3887-#: /home/mario/elementary/scratch/po/../src/Widgets/DynamicNotebook.vala:137
3888-msgid "Open in a new Window"
3889-msgstr ""
3890-
3891-#: /home/mario/elementary/scratch/po/../src/Widgets/DynamicNotebook.vala:138
3892-msgid "Duplicate"
3893-msgstr ""
3894-
3895-#: /home/mario/elementary/scratch/po/../src/Widgets/DynamicNotebook.vala:186
3896-msgid "Close Other Tab"
3897-msgstr ""
3898-
3899-#: /home/mario/elementary/scratch/po/../src/Widgets/DynamicNotebook.vala:186
3900-msgid "Close Other Tabs"
3901-msgstr ""
3902-
3903-#: /home/mario/elementary/scratch/po/../src/Widgets/DynamicNotebook.vala:474
3904-#: /home/mario/elementary/scratch/po/../src/Widgets/DynamicNotebook.vala:501
3905-msgid "New Tab"
3906-msgstr ""
3907-
3908-#: /home/mario/elementary/scratch/po/../src/Widgets/DynamicNotebook.vala:475
3909-msgid "Undo Close Tab"
3910-msgstr ""
3911-
3912-#: /home/mario/elementary/scratch/po/../src/Widgets/DynamicNotebook.vala:510
3913-msgid "Closed Tabs"
3914-msgstr ""
3915-
3916-#: /home/mario/elementary/scratch/po/../src/Widgets/ToolBar.vala:59
3917+#: /home/mario/elementary/scratch/po/../src/Widgets/ToolBar.vala:57
3918 msgid "Share"
3919 msgstr "ማካፈያ"
3920
3921-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:42
3922+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:46
3923 msgid "No Files Open"
3924 msgstr ""
3925
3926-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:43
3927+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:47
3928 msgid "Open a file to begin editing."
3929 msgstr ""
3930
3931-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:47
3932+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:51
3933 msgid "New file"
3934 msgstr "አዲስ ፋይል"
3935
3936-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:47
3937+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:51
3938 msgid "Create a new empty file."
3939 msgstr ""
3940
3941-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:48
3942+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:52
3943 msgid "Open file"
3944 msgstr "ፋይል መክፈቻ"
3945
3946-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:48
3947+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:52
3948 msgid "Open a saved file."
3949 msgstr "የተቀመጠ ፋይል መክፈቻ"
3950
3951-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:165
3952+#: /home/mario/elementary/scratch/po/../src/Widgets/SourceView.vala:97
3953+msgid "Syntax Highlighting"
3954+msgstr ""
3955+
3956+#: /home/mario/elementary/scratch/po/../src/Widgets/SourceView.vala:108
3957+msgid "Normal Text"
3958+msgstr ""
3959+
3960+#: /home/mario/elementary/scratch/po/../src/Widgets/LoadingView.vala:36
3961+msgid "Wait while restoring last session..."
3962+msgstr ""
3963+
3964+#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:71
3965+msgid "Find"
3966+msgstr "መፈለጊያ"
3967+
3968+#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:90
3969+msgid "Replace With"
3970+msgstr "መተኪያ በ"
3971+
3972+#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:115
3973+msgid "Replace all"
3974+msgstr ""
3975+
3976+#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:123
3977+msgid "Go To Line:"
3978+msgstr "ወደ መስመር መሄጃ :"
3979+
3980+#: /home/mario/elementary/scratch/po/../src/Scratch.vala:222
3981+msgid "New Tab"
3982+msgstr ""
3983+
3984+#: /home/mario/elementary/scratch/po/../src/Scratch.vala:223
3985+#: /home/mario/elementary/scratch/po/../src/config.vala:18
3986+msgid "New Window"
3987+msgstr "አዲስ መስኮት"
3988+
3989+#: /home/mario/elementary/scratch/po/../src/Scratch.vala:224
3990+msgid "Print version info and exit"
3991+msgstr ""
3992+
3993+#: /home/mario/elementary/scratch/po/../src/Scratch.vala:225
3994+msgid "Set of plugins"
3995+msgstr ""
3996+
3997+#: /home/mario/elementary/scratch/po/../src/Scratch.vala:226
3998+msgid "Current working directory"
3999+msgstr ""
4000+
4001+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:248
4002 #, c-format
4003 msgid "Save changes to document %s before closing?"
4004 msgstr ""
4005
4006-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:168
4007+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:251
4008 msgid ""
4009 "If you don't save, changes from the last 4 seconds will be permanently lost."
4010 msgstr ""
4011
4012-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:170
4013+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:253
4014 msgid "Close without saving"
4015 msgstr ""
4016
4017-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:239
4018+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:331
4019 msgid "Save File"
4020 msgstr ""
4021
4022-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:477
4023+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:419
4024+#: /home/mario/elementary/scratch/po/../src/config.vala:17
4025+msgid "New Document"
4026+msgstr "አዲስ ሰነድ"
4027+
4028+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:556
4029 #, c-format
4030 msgid ""
4031 "File \"<b>%s</b>\" cannot be read. Maybe it is corrupt\n"
4032 "or you do not have the necessary permissions to read it."
4033 msgstr ""
4034
4035-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:492
4036-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:533
4037-msgid "File "
4038-msgstr ""
4039-
4040-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:493
4041+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:573
4042+msgid "The location containing the file"
4043+msgstr ""
4044+
4045+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:574
4046+msgid "was unmounted. Do you want to save somewhere else?"
4047+msgstr ""
4048+
4049+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:581
4050+msgid "File"
4051+msgstr ""
4052+
4053+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:582
4054 msgid "was deleted. Do you want to save it anyway?"
4055 msgstr ""
4056
4057-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:505
4058+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:595
4059 msgid "You cannot save changes on file"
4060 msgstr ""
4061
4062-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:506
4063+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:596
4064 msgid "Do you want to save the changes to this file in a different location?"
4065 msgstr ""
4066
4067-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:508
4068+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:598
4069 msgid "Save changes elsewhere"
4070 msgstr ""
4071
4072-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:534
4073+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:623
4074+msgid "File "
4075+msgstr ""
4076+
4077+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:624
4078 msgid ""
4079 "was modified by an external application. Do you want to load it again or "
4080 "continue your editing?"
4081 msgstr ""
4082
4083-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:536
4084+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:626
4085 msgid "Load"
4086 msgstr ""
4087
4088-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:539
4089+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:629
4090 msgid "Continue"
4091 msgstr ""
4092
4093+#: /home/mario/elementary/scratch/po/../src/Utils.vala:42
4094+msgid "All files"
4095+msgstr "ሁሉንም ፋይሎች"
4096+
4097+#: /home/mario/elementary/scratch/po/../src/Utils.vala:45
4098+msgid "Text files"
4099+msgstr "የጽሁፍ ፋይሎች"
4100+
4101+#: /home/mario/elementary/scratch/po/../src/config.vala:15
4102+msgid "Edit text files"
4103+msgstr "የጽሁፍ ፋይሎች ማረሚያ"
4104+
4105+#: /home/mario/elementary/scratch/po/../src/config.vala:16
4106+msgid "Text Editor"
4107+msgstr "የጽሁፍ ማረሚያ"
4108+
4109 #: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin.vala:23
4110 msgid "Pastebin"
4111 msgstr ""
4112@@ -444,90 +454,90 @@
4113 msgid "Upload to Pastebin"
4114 msgstr ""
4115
4116-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:252
4117+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:254
4118 msgid "Share via PasteBin"
4119 msgstr ""
4120
4121-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:270
4122+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:272
4123 msgid "Name:"
4124 msgstr "ስም :"
4125
4126-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:276
4127+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:278
4128 msgid "Format: "
4129 msgstr "አቀራረብ : "
4130
4131-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:278
4132+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:280
4133 msgid "Others..."
4134 msgstr "ሌሎች..."
4135
4136-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:303
4137+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:305
4138 msgid "Expiry time:"
4139 msgstr ""
4140
4141-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:308
4142+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:310
4143 msgid "Keep this paste private"
4144 msgstr ""
4145
4146-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:310
4147+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:312
4148 msgid "Upload"
4149 msgstr "መጫኛ"
4150
4151-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:340
4152+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:342
4153 msgid "Other formats"
4154 msgstr "ለሎች አቀራረቦች"
4155
4156-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:509
4157+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:511
4158 msgid "Never"
4159 msgstr "በፍጹም"
4160
4161-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:510
4162+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:512
4163 msgid "Ten minutes"
4164 msgstr "አስር ደቂቃ"
4165
4166-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:511
4167+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:513
4168 msgid "One hour"
4169 msgstr "አንድ ሰአት"
4170
4171-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:512
4172+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:514
4173 msgid "One day"
4174 msgstr ""
4175
4176-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:513
4177+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:515
4178 msgid "One month"
4179 msgstr ""
4180
4181-#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileView.vala:94
4182+#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileView.vala:90
4183 msgid "/New File"
4184 msgstr ""
4185
4186-#: /home/mario/elementary/scratch/po/../plugins/filemanager/FolderManagerPlugin.vala:21
4187+#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileManagerPlugin.vala:21
4188 #: /home/mario/elementary/scratch/po/../plugins/folder-manager/FolderManagerPlugin.vala:21
4189 msgid "Folder Manager"
4190 msgstr ""
4191
4192-#: /home/mario/elementary/scratch/po/../plugins/filemanager/FolderManagerPlugin.vala:22
4193+#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileManagerPlugin.vala:22
4194 #: /home/mario/elementary/scratch/po/../plugins/folder-manager/FolderManagerPlugin.vala:22
4195 msgid "Basic folder manager with file browsing"
4196 msgstr ""
4197
4198-#: /home/mario/elementary/scratch/po/../plugins/filemanager/FolderManagerPlugin.vala:77
4199+#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileManagerPlugin.vala:71
4200 msgid "Go to parent"
4201 msgstr ""
4202
4203-#: /home/mario/elementary/scratch/po/../plugins/filemanager/FolderManagerPlugin.vala:88
4204+#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileManagerPlugin.vala:82
4205 msgid "Add file"
4206 msgstr ""
4207
4208-#: /home/mario/elementary/scratch/po/../plugins/filemanager/FolderManagerPlugin.vala:95
4209+#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileManagerPlugin.vala:89
4210 msgid "Remove file"
4211 msgstr ""
4212
4213-#: /home/mario/elementary/scratch/po/../plugins/filemanager/FolderManagerPlugin.vala:110
4214+#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileManagerPlugin.vala:104
4215 msgid "File Manager"
4216 msgstr ""
4217
4218 #: /home/mario/elementary/scratch/po/../plugins/terminal/terminal.vala:23
4219-#: /home/mario/elementary/scratch/po/../plugins/terminal/terminal.vala:104
4220+#: /home/mario/elementary/scratch/po/../plugins/terminal/terminal.vala:158
4221 msgid "Terminal"
4222 msgstr ""
4223
4224@@ -535,11 +545,11 @@
4225 msgid "A terminal in your text editor"
4226 msgstr ""
4227
4228-#: /home/mario/elementary/scratch/po/../plugins/terminal/terminal.vala:67
4229+#: /home/mario/elementary/scratch/po/../plugins/terminal/terminal.vala:121
4230 msgid "Copy"
4231 msgstr ""
4232
4233-#: /home/mario/elementary/scratch/po/../plugins/terminal/terminal.vala:74
4234+#: /home/mario/elementary/scratch/po/../plugins/terminal/terminal.vala:128
4235 msgid "Paste"
4236 msgstr ""
4237
4238@@ -551,15 +561,16 @@
4239 msgid "Get a preview your work in a web page"
4240 msgstr ""
4241
4242-#: /home/mario/elementary/scratch/po/../plugins/browser-preview/browser-preview.vala:80
4243-#: /home/mario/elementary/scratch/po/../plugins/browser-preview/browser-preview.vala:81
4244+#: /home/mario/elementary/scratch/po/../plugins/browser-preview/browser-preview.vala:77
4245+#: /home/mario/elementary/scratch/po/../plugins/browser-preview/browser-preview.vala:119
4246+msgid "Web preview"
4247+msgstr ""
4248+
4249+#: /home/mario/elementary/scratch/po/../plugins/browser-preview/browser-preview.vala:86
4250+#: /home/mario/elementary/scratch/po/../plugins/browser-preview/browser-preview.vala:87
4251 msgid "Get preview!"
4252 msgstr ""
4253
4254-#: /home/mario/elementary/scratch/po/../plugins/browser-preview/browser-preview.vala:111
4255-msgid "Web preview"
4256-msgstr ""
4257-
4258 #: /home/mario/elementary/scratch/po/../plugins/spell/spell.vala:18
4259 msgid "Spell Checker"
4260 msgstr ""
4261@@ -588,28 +599,24 @@
4262 msgid "Complete brackets while typing"
4263 msgstr ""
4264
4265-#: /home/mario/elementary/scratch/po/../plugins/word-completion/completion-provider.vala:67
4266+#: /home/mario/elementary/scratch/po/../plugins/word-completion/completion-provider.vala:80
4267 #, c-format
4268 msgid "Could not load icon theme: %s\n"
4269 msgstr ""
4270
4271-#: /home/mario/elementary/scratch/po/../plugins/word-completion/plugin.vala:30
4272+#: /home/mario/elementary/scratch/po/../plugins/word-completion/plugin.vala:34
4273 msgid "Words Completion"
4274 msgstr ""
4275
4276-#: /home/mario/elementary/scratch/po/../plugins/word-completion/plugin.vala:31
4277+#: /home/mario/elementary/scratch/po/../plugins/word-completion/plugin.vala:35
4278 msgid "Show a completion dialog with most used words from your files"
4279 msgstr ""
4280
4281-#: /home/mario/elementary/scratch/po/../plugins/word-completion/plugin.vala:99
4282+#: /home/mario/elementary/scratch/po/../plugins/word-completion/plugin.vala:177
4283 #, c-format
4284 msgid "%s - Word Completion"
4285 msgstr ""
4286
4287-#: /home/mario/elementary/scratch/po/../plugins/folder-manager/FileView.vala:322
4288-msgid "Close Folder"
4289-msgstr ""
4290-
4291 #: /home/mario/elementary/scratch/po/../plugins/folder-manager/FolderManagerPlugin.vala:71
4292 msgid "Folders"
4293 msgstr ""
4294@@ -619,6 +626,18 @@
4295 msgid "Open a folder"
4296 msgstr ""
4297
4298+#: /home/mario/elementary/scratch/po/../plugins/folder-manager/FolderManagerPlugin.vala:95
4299+msgid "_Cancel"
4300+msgstr ""
4301+
4302+#: /home/mario/elementary/scratch/po/../plugins/folder-manager/FolderManagerPlugin.vala:96
4303+msgid "_Open"
4304+msgstr ""
4305+
4306+#: /home/mario/elementary/scratch/po/../plugins/folder-manager/FileView.vala:330
4307+msgid "Close Folder"
4308+msgstr ""
4309+
4310 #: /home/mario/elementary/scratch/po/../plugins/contractor/contractor.vala:21
4311 msgid "Share your files with Contractor"
4312 msgstr ""
4313@@ -631,32 +650,32 @@
4314 msgid "Strip trailing whitespace on save"
4315 msgstr ""
4316
4317+#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:20
4318+#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:197
4319+msgid "Source Tree"
4320+msgstr ""
4321+
4322 #: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:21
4323-#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:231
4324-msgid "Source Tree"
4325-msgstr ""
4326-
4327-#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:22
4328 msgid "Have a look at your sources organized in a nice tree"
4329 msgstr ""
4330
4331-#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:39
4332+#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:42
4333 msgid "Loading..."
4334 msgstr ""
4335
4336-#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:158
4337+#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:175
4338 msgid "Bookmark"
4339 msgstr ""
4340
4341-#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:207
4342+#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:234
4343 msgid "Files"
4344 msgstr ""
4345
4346-#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:208
4347+#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:235
4348 msgid "Project"
4349 msgstr ""
4350
4351-#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:209
4352+#: /home/mario/elementary/scratch/po/../plugins/source-tree/SourceTreePlugin.vala:236
4353 msgid "Bookmarks"
4354 msgstr ""
4355
4356@@ -689,6 +708,9 @@
4357 #~ msgid "Save as"
4358 #~ msgstr "ማስቀመጫ እንደ"
4359
4360+#~ msgid "Save the current file"
4361+#~ msgstr "የአሁኑን ፋይል ማስቀመጫ"
4362+
4363 #~ msgid "Save the current file with a different name"
4364 #~ msgstr "የአሁኑን ፋይል በሌላ ስም ማስቀመጫ"
4365
4366
4367=== modified file 'po/ar.po'
4368--- po/ar.po 2013-12-16 12:35:47 +0000
4369+++ po/ar.po 2014-10-05 21:35:48 +0000
4370@@ -7,13 +7,19 @@
4371 msgstr ""
4372 "Project-Id-Version: scratch\n"
4373 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
4374+<<<<<<< TREE
4375 "POT-Creation-Date: 2013-08-02 16:03+0200\n"
4376 "PO-Revision-Date: 2013-11-30 11:28+0000\n"
4377+=======
4378+"POT-Creation-Date: 2014-08-30 09:08-0500\n"
4379+"PO-Revision-Date: 2013-11-30 11:28+0000\n"
4380+>>>>>>> MERGE-SOURCE
4381 "Last-Translator: abdXelrhman <abdXelrhman@gmail.com>\n"
4382 "Language-Team: Arabic <ar@li.org>\n"
4383 "MIME-Version: 1.0\n"
4384 "Content-Type: text/plain; charset=UTF-8\n"
4385 "Content-Transfer-Encoding: 8bit\n"
4386+<<<<<<< TREE
4387 "X-Launchpad-Export-Date: 2013-12-01 05:39+0000\n"
4388 "X-Generator: Launchpad (build 16856)\n"
4389
4390@@ -26,34 +32,144 @@
4391 msgstr "ملفات نصية"
4392
4393 #: /home/mario/elementary/scratch/po/../src/MainWindow.vala:85
4394+=======
4395+"X-Launchpad-Export-Date: 2014-08-31 07:11+0000\n"
4396+"X-Generator: Launchpad (build 17176)\n"
4397+
4398+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:52
4399+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:722
4400+msgid "Preferences"
4401+msgstr "اﻹعدادات"
4402+
4403+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:70
4404+msgid "Behavior"
4405+msgstr ""
4406+
4407+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:73
4408+msgid "Interface"
4409+msgstr "الواجهة"
4410+
4411+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:86
4412+msgid "Extensions"
4413+msgstr "الامتدادات"
4414+
4415+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:90
4416+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:666
4417+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:667
4418+msgid "Close"
4419+msgstr "اغلق"
4420+
4421+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:135
4422+msgid "Show welcome screen"
4423+msgstr "إعرض نافذه الترحيب"
4424+
4425+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:136
4426+msgid "Show last open tabs"
4427+msgstr "إعرض اخر اﻷلسنه المفتوحه"
4428+
4429+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:152
4430+msgid "General:"
4431+msgstr "عام"
4432+
4433+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:158
4434+msgid "When Scratch starts:"
4435+msgstr "عند بدأ خربشات:"
4436+
4437+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:161
4438+msgid "Save files when changed:"
4439+msgstr "إحفظ الملفات عند تغييرها:"
4440+
4441+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:166
4442+msgid "Tabs:"
4443+msgstr "الألسنة:"
4444+
4445+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:171
4446+msgid "Automatic indentation:"
4447+msgstr ""
4448+
4449+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:174
4450+msgid "Insert spaces instead of tabs:"
4451+msgstr ""
4452+
4453+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:178
4454+msgid "Tab width:"
4455+msgstr ""
4456+
4457+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:206
4458+msgid "Editor:"
4459+msgstr "المُحرر"
4460+
4461+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:224
4462+msgid "Highlight current line:"
4463+msgstr "إبراز السطر الحالى :"
4464+
4465+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:225
4466+msgid "Highlight matching brackets:"
4467+msgstr "إبراز الاقواس :"
4468+
4469+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:226
4470+msgid "Split long text in many lines:"
4471+msgstr "إقسم النصوص الطويله على عده اسطر :"
4472+
4473+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:227
4474+msgid "Draw spaces:"
4475+msgstr "إرسم المسافات :"
4476+
4477+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:228
4478+msgid "Show line numbers:"
4479+msgstr "إعرض رقم السطر :"
4480+
4481+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:231
4482+msgid "Line width guide:"
4483+msgstr ""
4484+
4485+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:247
4486+msgid "Font and Color Scheme:"
4487+msgstr ""
4488+
4489+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:261
4490+msgid "Select font:"
4491+msgstr "إختر الخط :"
4492+
4493+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:264
4494+msgid "Color scheme:"
4495+msgstr "مخطط الألوان:"
4496+
4497+#: /home/mario/elementary/scratch/po/../src/Dialogs/PreferencesDialog.vala:269
4498+msgid "Custom font:"
4499+msgstr "خط مخصص:"
4500+
4501+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:99
4502+>>>>>>> MERGE-SOURCE
4503 msgid "Zeitgeist Datasource for Scratch"
4504 msgstr ""
4505
4506-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:160
4507+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:181
4508 msgid "Trash"
4509 msgstr "المُهملات"
4510
4511-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:448
4512+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:504
4513 msgid "Open some files"
4514 msgstr ""
4515
4516-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:539
4517+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:599
4518 msgid "Hide search bar"
4519 msgstr "اخفاء شريط البحث"
4520
4521-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:552
4522-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:553
4523+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:654
4524+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:655
4525 msgid "Find…"
4526 msgstr "إبحث..."
4527
4528-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:556
4529-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:557
4530+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:658
4531+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:659
4532 msgid "Go to line…"
4533 msgstr "إذهب الى السطر..."
4534
4535-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:560
4536-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:561
4537+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:662
4538+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:663
4539 msgid "Quit"
4540+<<<<<<< TREE
4541 msgstr "اُخرج"
4542
4543 #: /home/mario/elementary/scratch/po/../src/MainWindow.vala:564
4544@@ -64,82 +180,90 @@
4545
4546 #: /home/mario/elementary/scratch/po/../src/MainWindow.vala:568
4547 #: /home/mario/elementary/scratch/po/../src/MainWindow.vala:569
4548+=======
4549+msgstr "اُخرج"
4550+
4551+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:670
4552+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:671
4553+#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:111
4554+>>>>>>> MERGE-SOURCE
4555 msgid "Replace"
4556 msgstr "إستبدال"
4557
4558-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:572
4559+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:674
4560 msgid "Reopen closed document"
4561 msgstr "أعد فتح المُستند المُغلق"
4562
4563-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:573
4564+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:675
4565 msgid "Open last closed document in a new tab"
4566 msgstr "أعد فتح اخر مُستند مُغلق ولكن فى لسان جديد"
4567
4568-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:576
4569+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:678
4570 msgid "Add New Tab"
4571 msgstr ""
4572
4573-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:577
4574+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:679
4575 msgid "Add a new tab"
4576 msgstr ""
4577
4578-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:580
4579+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:682
4580 msgid "Add New View"
4581 msgstr ""
4582
4583-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:581
4584+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:683
4585 msgid "Add a new view"
4586 msgstr "اضف منطقة عرض جديدة"
4587
4588-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:584
4589+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:686
4590 msgid "Remove Current View"
4591 msgstr "إحذف منطقه العرض الحاليه"
4592
4593-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:585
4594+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:687
4595 msgid "Remove this view"
4596 msgstr "إحذف منطقه العرض هذه"
4597
4598-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:588
4599+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:690
4600 msgid "Undo"
4601 msgstr ""
4602
4603-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:589
4604+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:691
4605 msgid "Undo the last action"
4606 msgstr "تراجع عن آخر إجراء"
4607
4608-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:592
4609+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:694
4610 msgid "Redo"
4611 msgstr "أعد"
4612
4613-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:593
4614+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:695
4615 msgid "Redo the last undone action"
4616 msgstr "أعد اخر إجراء تم التراجع عنه"
4617
4618-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:596
4619+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:698
4620 msgid "Revert"
4621 msgstr "إعكس"
4622
4623-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:597
4624+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:699
4625 msgid "Restore this file"
4626 msgstr "إستعد هذا الملف"
4627
4628-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:600
4629-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:601
4630+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:702
4631+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:703
4632 msgid "Duplicate selected strings"
4633 msgstr "كرر النصوص المحدده"
4634
4635-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:604
4636-#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileView.vala:282
4637+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:706
4638+#: /home/mario/elementary/scratch/po/../plugins/filemanager/FileView.vala:281
4639 msgid "Open"
4640 msgstr "إفتح"
4641
4642-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:605
4643+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:707
4644 msgid "Open a file"
4645 msgstr "إفتح ملفاً"
4646
4647-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:608
4648-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:495
4649+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:710
4650+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:584
4651 msgid "Save"
4652+<<<<<<< TREE
4653 msgstr "إحفظ"
4654
4655 #: /home/mario/elementary/scratch/po/../src/MainWindow.vala:609
4656@@ -147,12 +271,31 @@
4657 msgstr "إحفظ الملف الحالى"
4658
4659 #: /home/mario/elementary/scratch/po/../src/MainWindow.vala:612
4660+=======
4661+msgstr "إحفظ"
4662+
4663+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:711
4664+msgid "Save this file"
4665+msgstr ""
4666+
4667+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:714
4668+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:576
4669+msgid "Save As…"
4670+msgstr ""
4671+
4672+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:715
4673+msgid "Save this file with a different name"
4674+msgstr ""
4675+
4676+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:718
4677+>>>>>>> MERGE-SOURCE
4678 #: /home/mario/elementary/scratch/po/../src/Services/TemplateManager.vala:230
4679 msgid "Templates"
4680 msgstr "القوالب"
4681
4682-#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:613
4683+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:719
4684 msgid "Project templates"
4685+<<<<<<< TREE
4686 msgstr "قوالب المشروع"
4687
4688 #: /home/mario/elementary/scratch/po/../src/MainWindow.vala:616
4689@@ -161,12 +304,35 @@
4690 msgstr "اﻹعدادات"
4691
4692 #: /home/mario/elementary/scratch/po/../src/MainWindow.vala:617
4693+=======
4694+msgstr "قوالب المشروع"
4695+
4696+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:723
4697+>>>>>>> MERGE-SOURCE
4698 msgid "Change Scratch settings"
4699+<<<<<<< TREE
4700 msgstr "تغيير إعدادات خربشات"
4701
4702 #: /home/mario/elementary/scratch/po/../src/MainWindow.vala:623
4703 #: /home/mario/elementary/scratch/po/../src/MainWindow.vala:624
4704+=======
4705+msgstr "تغيير إعدادات خربشات"
4706+
4707+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:726
4708+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:727
4709+msgid "Next Tab"
4710+msgstr ""
4711+
4712+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:730
4713+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:731
4714+msgid "Previous Tab"
4715+msgstr ""
4716+
4717+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:747
4718+#: /home/mario/elementary/scratch/po/../src/MainWindow.vala:748
4719+>>>>>>> MERGE-SOURCE
4720 msgid "Fullscreen"
4721+<<<<<<< TREE
4722 msgstr ""
4723
4724 #: /home/mario/elementary/scratch/po/../src/config.vala:15
4725@@ -345,93 +511,185 @@
4726 msgstr "إغلق الالسنه"
4727
4728 #: /home/mario/elementary/scratch/po/../src/Widgets/ToolBar.vala:59
4729+=======
4730+msgstr ""
4731+
4732+#: /home/mario/elementary/scratch/po/../src/Widgets/ToolBar.vala:57
4733+>>>>>>> MERGE-SOURCE
4734 msgid "Share"
4735 msgstr "المشاركه"
4736
4737-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:42
4738+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:46
4739 msgid "No Files Open"
4740 msgstr ""
4741
4742-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:43
4743+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:47
4744 msgid "Open a file to begin editing."
4745 msgstr "إفتح ملفاً لبدأ التحرير."
4746
4747-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:47
4748+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:51
4749 msgid "New file"
4750 msgstr "ملف جديد"
4751
4752-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:47
4753+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:51
4754 msgid "Create a new empty file."
4755 msgstr "انشئ ملفاً فارغاً جديداً"
4756
4757-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:48
4758+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:52
4759 msgid "Open file"
4760 msgstr "إفتح ملف"
4761
4762-#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:48
4763+#: /home/mario/elementary/scratch/po/../src/Widgets/SplitView.vala:52
4764 msgid "Open a saved file."
4765+<<<<<<< TREE
4766 msgstr "إفتح ملفاً محفوظاً"
4767
4768 #: /home/mario/elementary/scratch/po/../src/Services/Document.vala:165
4769+=======
4770+msgstr "إفتح ملفاً محفوظاً"
4771+
4772+#: /home/mario/elementary/scratch/po/../src/Widgets/SourceView.vala:97
4773+msgid "Syntax Highlighting"
4774+msgstr "إبراز تراكيب الجمله"
4775+
4776+#: /home/mario/elementary/scratch/po/../src/Widgets/SourceView.vala:108
4777+msgid "Normal Text"
4778+msgstr "نص عادى"
4779+
4780+#: /home/mario/elementary/scratch/po/../src/Widgets/LoadingView.vala:36
4781+msgid "Wait while restoring last session..."
4782+msgstr "يُرجى اﻹنتظار ريثما تُستعاد الجلسه السابقه..."
4783+
4784+#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:71
4785+msgid "Find"
4786+msgstr ""
4787+
4788+#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:90
4789+msgid "Replace With"
4790+msgstr "استبدل بـ"
4791+
4792+#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:115
4793+msgid "Replace all"
4794+msgstr ""
4795+
4796+#: /home/mario/elementary/scratch/po/../src/Widgets/SearchManager.vala:123
4797+msgid "Go To Line:"
4798+msgstr "إذهب الى السطر :"
4799+
4800+#: /home/mario/elementary/scratch/po/../src/Scratch.vala:222
4801+msgid "New Tab"
4802+msgstr "لسان جديد"
4803+
4804+#: /home/mario/elementary/scratch/po/../src/Scratch.vala:223
4805+#: /home/mario/elementary/scratch/po/../src/config.vala:18
4806+msgid "New Window"
4807+msgstr "نافذه جديده"
4808+
4809+#: /home/mario/elementary/scratch/po/../src/Scratch.vala:224
4810+msgid "Print version info and exit"
4811+msgstr ""
4812+
4813+#: /home/mario/elementary/scratch/po/../src/Scratch.vala:225
4814+msgid "Set of plugins"
4815+msgstr "مجموعة من الاضافات"
4816+
4817+#: /home/mario/elementary/scratch/po/../src/Scratch.vala:226
4818+msgid "Current working directory"
4819+msgstr ""
4820+
4821+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:248
4822+>>>>>>> MERGE-SOURCE
4823 #, c-format
4824 msgid "Save changes to document %s before closing?"
4825 msgstr "حفظ التغيرات الى المُستند %s قبل اﻹغلاق ؟"
4826
4827-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:168
4828+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:251
4829 msgid ""
4830 "If you don't save, changes from the last 4 seconds will be permanently lost."
4831 msgstr "إن لم تحفظ فستختفى نهائياً جميع التغيرات الحادثه فى اخر 4 ثوانى."
4832
4833-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:170
4834+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:253
4835 msgid "Close without saving"
4836 msgstr "إغلق بدون حفظ"
4837
4838-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:239
4839+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:331
4840 msgid "Save File"
4841 msgstr ""
4842
4843-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:477
4844+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:419
4845+#: /home/mario/elementary/scratch/po/../src/config.vala:17
4846+msgid "New Document"
4847+msgstr "مُستند جديد"
4848+
4849+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:556
4850 #, c-format
4851 msgid ""
4852 "File \"<b>%s</b>\" cannot be read. Maybe it is corrupt\n"
4853 "or you do not have the necessary permissions to read it."
4854 msgstr ""
4855
4856-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:492
4857-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:533
4858-msgid "File "
4859-msgstr ""
4860-
4861-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:493
4862+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:573
4863+msgid "The location containing the file"
4864+msgstr ""
4865+
4866+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:574
4867+msgid "was unmounted. Do you want to save somewhere else?"
4868+msgstr ""
4869+
4870+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:581
4871+msgid "File"
4872+msgstr ""
4873+
4874+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:582
4875 msgid "was deleted. Do you want to save it anyway?"
4876 msgstr ""
4877
4878-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:505
4879+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:595
4880 msgid "You cannot save changes on file"
4881 msgstr ""
4882
4883-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:506
4884+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:596
4885 msgid "Do you want to save the changes to this file in a different location?"
4886 msgstr "هل تريد حفظ التغييرت في هذا الملف الي مسار جديد ؟"
4887
4888-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:508
4889+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:598
4890 msgid "Save changes elsewhere"
4891 msgstr ""
4892
4893-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:534
4894+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:623
4895+msgid "File "
4896+msgstr ""
4897+
4898+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:624
4899 msgid ""
4900 "was modified by an external application. Do you want to load it again or "
4901 "continue your editing?"
4902 msgstr ""
4903
4904-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:536
4905+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:626
4906 msgid "Load"
4907 msgstr ""
4908
4909-#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:539
4910+#: /home/mario/elementary/scratch/po/../src/Services/Document.vala:629
4911 msgid "Continue"
4912 msgstr ""
4913
4914+#: /home/mario/elementary/scratch/po/../src/Utils.vala:42
4915+msgid "All files"
4916+msgstr "كل الملفات"
4917+
4918+#: /home/mario/elementary/scratch/po/../src/Utils.vala:45
4919+msgid "Text files"
4920+msgstr "ملفات نصية"
4921+
4922+#: /home/mario/elementary/scratch/po/../src/config.vala:15
4923+msgid "Edit text files"
4924+msgstr ""
4925+
4926+#: /home/mario/elementary/scratch/po/../src/config.vala:16
4927+msgid "Text Editor"
4928+msgstr "مُحرر النصوص"
4929+
4930 #: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin.vala:23
4931 msgid "Pastebin"
4932 msgstr ""
4933@@ -444,90 +702,90 @@
4934 msgid "Upload to Pastebin"
4935 msgstr ""
4936
4937-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:252
4938+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:254
4939 msgid "Share via PasteBin"
4940 msgstr "مشاركة بواسطة PasteBin"
4941
4942-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:270
4943+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:272
4944 msgid "Name:"
4945 msgstr "الاسم :"
4946
4947-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:276
4948+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:278
4949 msgid "Format: "
4950 msgstr "الصيغة: "
4951
4952-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:278
4953+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:280
4954 msgid "Others..."
4955 msgstr "أخرى..."
4956
4957-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:303
4958+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:305
4959 msgid "Expiry time:"
4960 msgstr "وقت الانتهاء :"
4961
4962-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:308
4963+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:310
4964 msgid "Keep this paste private"
4965 msgstr ""
4966
4967-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:310
4968+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:312
4969 msgid "Upload"
4970 msgstr "رفع"
4971
4972-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:340
4973+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:342
4974 msgid "Other formats"
4975 msgstr "صيغ اخري"
4976
4977-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:509
4978+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:511
4979 msgid "Never"
4980 msgstr "أبداً"
4981
4982-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:510
4983+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:512
4984 msgid "Ten minutes"
4985 msgstr "10 دقائق"
4986
4987-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:511
4988+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:513
4989 msgid "One hour"
4990 msgstr "ساعة واحدة"
4991
4992-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:512
4993+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:514
4994 msgid "One day"
4995 msgstr "يوم واحد"
4996
4997-#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:513
4998+#: /home/mario/elementary/scratch/po/../plugins/pastebin/pastebin_dialog.vala:515
4999 msgid "One month"
5000 msgstr ""
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches