Merge lp:~elementary-apps/pantheon-files/granite into lp:~elementary-apps/pantheon-files/trunk

Proposed by Mario Guerriero
Status: Merged
Merged at revision: 807
Proposed branch: lp:~elementary-apps/pantheon-files/granite
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 2294 lines (+979/-856)
30 files modified
CMakeLists.txt (+1/-1)
data/marlin.desktop.in (+5/-56)
libcore/CMakeLists.txt (+2/-1)
libcore/marlincore.deps (+1/-0)
libwidgets/CMakeLists.txt (+1/-0)
marlin-daemon/CMakeLists.txt (+0/-49)
marlin-daemon/client.vala (+0/-29)
marlin-daemon/marlind-tagging.vala (+0/-380)
marlin-daemon/miner.vala (+0/-124)
pantheon-files-daemon/CMakeLists.txt (+49/-0)
pantheon-files-daemon/client.vala (+29/-0)
pantheon-files-daemon/marlind-tagging.vala (+380/-0)
pantheon-files-daemon/miner.vala (+124/-0)
po/CMakeLists.txt (+2/-2)
src/CMakeLists.txt (+16/-12)
src/View/Chrome/IconFactory.vala (+53/-0)
src/View/Chrome/ImgEventBox.vala (+68/-0)
src/View/Chrome/TopMenu.vala (+4/-4)
src/View/Chrome/ViewSwicher.vala (+4/-2)
src/View/Chrome/XsEntry.vala (+40/-0)
src/View/ContextView.vala (+2/-1)
src/View/LocationBar.vala (+2/-2)
src/View/PropertiesWindow.vala (+8/-8)
src/View/Resources.vala (+5/-5)
src/View/SettingsDialog.vala (+2/-2)
src/View/Window.vala (+10/-10)
src/marlin-application.c (+8/-6)
src/marlin-application.h (+3/-2)
src/marlin-ui.xml (+0/-160)
src/pantheon-files-ui.xml (+160/-0)
To merge this branch: bzr merge lp:~elementary-apps/pantheon-files/granite
Reviewer Review Type Date Requested Status
Victor Martinez (community) Approve
Review via email: mp+105328@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Victor Martinez (victored) wrote :

Mario, thank you for your work :)

I found a couple of trivial issues:

1) Configuring the project fails. Line 126 in src/CMakeList.txt should be:
   > target_link_libraries (pantheon-files marlincore marlinwidgets ${UNITY_LIBRARIES})
   instead of:
   > target_link_libraries (marlin marlincore marlinwidgets ${UNITY_LIBRARIES})

2) I would have preferred not to do any kind of re-branding in this branch, but you've kept it minimal, so I don't see any problem with it :)

3) Why is it still using VarkaWidgetsCollapsiblePaned? We have the same widget in Granite. If Varka's version has some kind of improvement, we should merge it in Granite first.

4) Let's ditch the Varka.Widgets namespace. The fact that a widget is not actually in Granite shouldn't prevent us from using its namespace. If we use Granite.Widgets there would be no complications if the file is ever moved from pantheon-files to granite.

review: Needs Fixing
805. By Victor Martinez

Merge Mario's work, resolve conflict in data/desktop.in, and fix minor cmake issue.

806. By Victor Martinez

Use Granite.Widgets.CollapsiblePaned

807. By Victor Martinez

Use Granite.Widgets instead of Varka.Widgets

Revision history for this message
Victor Martinez (victored) wrote :

Just fixed the remaining issues. Let's do the re-branding on a separate branch :)

review: Approve

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 2011-11-06 17:28:37 +0000
3+++ CMakeLists.txt 2012-05-12 02:06:17 +0000
4@@ -14,7 +14,7 @@
5 configure_file (${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
6 add_subdirectory (src)
7 add_subdirectory (data)
8-add_subdirectory (marlin-daemon)
9+add_subdirectory (pantheon-files-daemon)
10 add_subdirectory (icons)
11 add_subdirectory (libcore)
12 add_subdirectory (libwidgets)
13
14=== modified file 'data/marlin.desktop.in'
15--- data/marlin.desktop.in 2012-05-07 19:06:49 +0000
16+++ data/marlin.desktop.in 2012-05-12 02:06:17 +0000
17@@ -1,56 +1,5 @@
18 [Desktop Entry]
19-Name=Marlin File Manager
20-Name[ar]=مدير الملفات سونار
21-Name[ast]=Alministrador de ficheros Marlin
22-Name[be]=Кіраўнік файлаў Marlin
23-Name[bn]=Marlin ফাইল ম্যানেজার
24-Name[ca]=Gestor de fitxers Marlin
25-Name[cs]=Správce souborů Marlin
26-Name[da]=Marlin-filhåndtering
27-Name[de]=Dateimanager Marlin
28-Name[dz]=ཐུ་ནར་ཡིག་སྣོད་འཛིན་སྐྱོང་པ།
29-Name[el]=Διαχειριστής αρχείων Marlin
30-Name[en_GB]=Marlin
31-Name[eo]=Marlin dosier-administrilo
32-Name[es]=Administrador de archivos Marlin
33-Name[et]=Failihaldur Marlin
34-Name[eu]=Marlin fitxategi kudeatzailea
35-Name[fi]=Marlin-tiedostonhallinta
36-Name[fr]=Gestionnaire de Fichiers Marlin
37-Name[gl]=Xestor de ficheiros Marlin
38-Name[he]=מנהל הקבצים ‎Marlin
39-Name[hr]=Marlin Upravitelj Datoteka
40-Name[hu]=Marlin fájlkezelő
41-Name[id]=Manajer Berkas Marlin
42-Name[it]=Il gestore di file Marlin
43-Name[ja]=Marlin ファイルマネージャ
44-Name[kk]=Marlin файлдар басқарушысы
45-Name[ko]=Marlin 화일 관리자
46-Name[ku]=Marlin, Gerinendeyê Pelan
47-Name[lt]=Marlin failų tvarkyklė
48-Name[lv]=Marlin failu pārvaldnieks
49-Name[mk]=Marlin менаџер на датотеки
50-Name[nb]=Marlin Filbehandler
51-Name[nl]=Marlin bestandsbeheerder
52-Name[nn]=Marlin filhandsaming
53-Name[pa]=ਥੰਨਰ ਫਾਇਲ ਮੈਨੇਜਰ
54-Name[pl]=Menedżer plików Marlin
55-Name[pt]=Gestor de Ficheiros Marlin
56-Name[pt_BR]=Gerenciador de arquivos Marlin
57-Name[ro]=Managerul de fișiere Marlin
58-Name[ru]=Файловый менеджер Marlin
59-Name[si]=Marlin ගොනු කළමණාකරු
60-Name[sk]=Správca súborov Marlin
61-Name[sq]=Përgjegjësi i Kartelave Marlin
62-Name[sv]=Filhanteraren Marlin
63-Name[tr]=Marlin Dosya Yöneticisi
64-Name[ug]=Marlin ھۆججەت باشقۇرغۇ
65-Name[uk]=Файловий менеджер Marlin
66-Name[ur]=تھنر فائل منیجر
67-Name[ur_PK]=تھنر فائل منیجر
68-Name[vi]=Trình quản lý tập tin Marlin
69-Name[zh_CN]=Marlin 文件管理器
70-Name[zh_TW]=Marlin 檔案管理員
71+Name=Files
72 Comment=Browse your files
73 Comment[ar]=تصفح ملفات النظام بمدير الملفات
74 Comment[ast]=Restolar el sistema de ficheros col alministrador de ficheros
75@@ -151,8 +100,8 @@
76 GenericName[ur_PK]=فائل منیجر
77 GenericName[zh_CN]=文件管理器
78 GenericName[zh_TW]=檔案管理員
79-Exec=marlin %U
80-Icon=marlin
81+Exec=pantheon-files %U
82+Icon=system-file-manager
83 Terminal=false
84 StartupNotify=true
85 Type=Application
86@@ -163,12 +112,12 @@
87
88 [TabNew Shortcut Group]
89 Name=New _Tab
90-Exec=marlin -t
91+Exec=pantheon-files -t
92 TargetEnvironment=Unity
93
94 [WindowNew Shortcut Group]
95 Name=New _Window
96-Exec=marlin
97+Exec=pantheon-files
98 TargetEnvironment=Unity
99
100 [Root Shortcut Group]
101
102=== modified file 'libcore/CMakeLists.txt'
103--- libcore/CMakeLists.txt 2012-02-07 19:56:47 +0000
104+++ libcore/CMakeLists.txt 2012-05-12 02:06:17 +0000
105@@ -23,6 +23,7 @@
106 Plugin.vala
107 marlincore-C.vapi
108 PACKAGES
109+ granite
110 gtk+-3.0
111 gio-2.0
112 gee-1.0
113@@ -184,4 +185,4 @@
114 )
115 add_test(core marlincore_tests)
116 target_link_libraries(marlincore_tests marlincore ${DEPS_LIBRARIES})
117-#target_link_libraries(marlincore ${DEPS_LIBRARIES})
118+target_link_libraries(marlincore ${DEPS_LIBRARIES})
119
120=== modified file 'libcore/marlincore.deps'
121--- libcore/marlincore.deps 2011-11-16 18:52:37 +0000
122+++ libcore/marlincore.deps 2012-05-12 02:06:17 +0000
123@@ -1,1 +1,2 @@
124 marlincore-C
125+gee-1.0
126\ No newline at end of file
127
128=== modified file 'libwidgets/CMakeLists.txt'
129--- libwidgets/CMakeLists.txt 2011-12-26 10:39:24 +0000
130+++ libwidgets/CMakeLists.txt 2012-05-12 02:06:17 +0000
131@@ -66,3 +66,4 @@
132 )
133 install (TARGETS ${PKGNAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/)
134 add_subdirectory(tests)
135+target_link_libraries(marlinwidgets ${DEPS_LIBRARIES})
136\ No newline at end of file
137
138=== removed directory 'marlin-daemon'
139=== removed file 'marlin-daemon/CMakeLists.txt'
140--- marlin-daemon/CMakeLists.txt 2011-08-08 16:57:40 +0000
141+++ marlin-daemon/CMakeLists.txt 1970-01-01 00:00:00 +0000
142@@ -1,49 +0,0 @@
143-# Vala stuff
144-
145-find_package(Vala REQUIRED)
146-include(ValaVersion)
147-ensure_vala_version("0.11.3" MINIMUM)
148-include(ValaPrecompile)
149-# pkgconfig, real C code
150-
151-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
152-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
153-include_directories(${CMAKE_CURRENT_BINARY_DIR})
154-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../libcore/)
155-include_directories(${CMAKE_CURRENT_BINARY_DIR}/../libwidgets/)
156-find_package(PkgConfig)
157-pkg_check_modules(DEPS REQUIRED
158- glib-2.0>=2.29.0
159- gthread-2.0
160- gio-2.0
161- pango>=1.1.2
162- gtk+-3.0>=3.0.3
163- gail-3.0
164- gee-1.0
165- sqlite3
166- dbus-glib-1
167- libnotify>=0.7.2)
168-set(CFLAGS
169- ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER}
170-)
171-set(LIB_PATHS
172- ${DEPS_LIBRARY_DIRS}
173-)
174-link_directories(${LIB_PATHS})
175-add_definitions(${CFLAGS}
176- "-DGETTEXT_PACKAGE=\"marlin\""
177- -O2
178- )
179-vala_precompile(VALA_C
180- marlind-tagging.vala
181-PACKAGES
182- gtk+-3.0
183- gio-2.0
184- gee-1.0
185- sqlite3
186-OPTIONS
187- --thread)
188-add_executable(marlin-daemon
189- ${VALA_C} )
190-target_link_libraries(marlin-daemon ${DEPS_LIBRARIES})
191-install(TARGETS marlin-daemon RUNTIME DESTINATION bin)
192
193=== removed file 'marlin-daemon/client.vala'
194--- marlin-daemon/client.vala 2010-11-24 18:15:11 +0000
195+++ marlin-daemon/client.vala 1970-01-01 00:00:00 +0000
196@@ -1,29 +0,0 @@
197-
198-[DBus (name = "org.elementary.marlin.db")]
199-interface Demo : Object {
200- public abstract bool showTable (string table) throws IOError;
201- public abstract int getColor (string uri) throws IOError;
202- public abstract bool setColor (string uri, int color) throws IOError;
203- public abstract bool deleteEntry (string uri) throws IOError;
204- public abstract bool clearDB () throws IOError;
205-}
206-
207-void main () {
208- try {
209- Demo demo = Bus.get_proxy_sync (BusType.SESSION, "org.elementary.marlin.db",
210- "/org/elementary/marlin/db");
211-
212- //demo.setColor("file:///home/jordi", 3);
213- //demo.isFileInDB("file:///home/jordi");
214- //print("\n\nColor for file is %i\n", demo.getColor("file:///home/jordi"));
215- //demo.deleteEntry("file:///home/jordi");
216- //demo.clearDB();
217- demo.showTable ("tags");
218-
219- //demo.clearDB();
220-
221- } catch (IOError e) {
222- stderr.printf ("%s\n", e.message);
223- }
224-}
225-
226
227=== removed file 'marlin-daemon/marlind-tagging.vala'
228--- marlin-daemon/marlind-tagging.vala 2012-01-02 15:55:50 +0000
229+++ marlin-daemon/marlind-tagging.vala 1970-01-01 00:00:00 +0000
230@@ -1,380 +0,0 @@
231-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
232-/*
233- * Copyright (C) 2010 Jordi Puigdellívol <jordi@gloobus.net>
234- *
235- * This library is free software; you can redistribute it and/or modify
236- * it under the terms of the GNU Lesser General Public License
237- * version 3.0 as published by the Free Software Foundation.
238- *
239- * This library is distributed in the hope that it will be useful,
240- * but WITHOUT ANY WARRANTY; without even the implied warranty of
241- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
242- * GNU Lesser General Public License version 3.0 for more details.
243- *
244- * You should have received a copy of the GNU Lesser General Public
245- * License along with this library. If not, see
246- * <http://www.gnu.org/licenses/>.
247- *
248- * Authors: Jordi Puigdellívol <jordi@gloobus.net>
249- * ammonkey <am.monkeyd@gmail.com>
250- *
251-
252- Marlin Tagging system
253-
254-//Dependences
255-libsqlite3-dev
256-
257-//To create de table
258-create table tags (uri TEXT, color INT, tags TEXT);
259-
260-//To compile this sample
261-valac --pkg sqlite3 -o sqlitesample SqliteSample.vala
262-valac --pkg sqlite3 --pkg gio-2.0 -o sqlitesample marlin_tagging.vala && ./sqlitesample
263-
264-*/
265-
266-using GLib;
267-using Sqlite;
268-
269-[DBus (name = "org.elementary.marlin.db")]
270-public class MarlinTags : Object {
271-
272- protected static Sqlite.Database db;
273-
274- public MarlinTags(){
275- openMarlinDB();
276- }
277-
278- protected static void fatal(string op, int res) {
279- error("%s: [%d] %s", op, res, db.errmsg());
280- }
281-
282- private static int show_table_callback (int n_columns, string[] values, string[] column_names)
283- {
284- for (int i = 0; i < n_columns; i++) {
285- stdout.printf ("%s = %s\n", column_names[i], values[i]);
286- }
287- stdout.printf ("\n");
288-
289- return 0;
290- }
291-
292- public bool openMarlinDB()
293- {
294- File home_dir = File.new_for_path (Environment.get_home_dir ());
295- File data_dir = home_dir.get_child(".config").get_child("marlin");
296-
297- try {
298- if (!data_dir.query_exists(null))
299- data_dir.make_directory_with_parents(null);
300- } catch (Error err) {
301- stderr.printf("Unable to create data directory %s: %s", data_dir.get_path(), err.message);
302- }
303-
304- string marlin_db_path = data_dir.get_child("marlin.db").get_path();
305- //The database must exists, add here the full path
306- print("Database path: %s \n", marlin_db_path);
307- openDB(marlin_db_path);
308-
309- return true;
310- }
311-
312- private bool openDB(string dbpath){
313- int rc = Sqlite.Database.open_v2(dbpath, out db, Sqlite.OPEN_READWRITE | Sqlite.OPEN_CREATE, null);
314-
315- if (rc != Sqlite.OK) {
316- stderr.printf ("Can't open database: %d, %s\n", rc, db.errmsg ());
317- return false;
318- }
319-
320- // disable synchronized commits for performance reasons ... this is not vital
321- rc = db.exec("PRAGMA synchronous=OFF");
322- if (rc != Sqlite.OK)
323- stdout.printf("Unable to disable synchronous mode %d, %s\n", rc, db.errmsg ());
324-
325- Sqlite.Statement stmt;
326- int res = db.prepare_v2("CREATE TABLE IF NOT EXISTS tags ("
327- + "id INTEGER PRIMARY KEY, "
328- + "uri TEXT UNIQUE NOT NULL, "
329- + "color INTEGER DEFAULT 0, "
330- + "tags TEXT NULL, "
331- + "content_type TEXT, "
332- + "modified_time INTEGER DEFAULT 0, "
333- + "dir TEXT "
334- + ")", -1, out stmt);
335- assert(res == Sqlite.OK);
336- res = stmt.step();
337- if (res != Sqlite.DONE)
338- fatal("create tags table", res);
339-
340- /* TODO check result of the last sql command */
341- upgrade_database ();
342-
343- return true;
344- }
345-
346-#if 0
347- public async bool record_uri (string raw_uri, string content_type, int modified_time) {
348- var uri = escape(raw_uri);
349-
350- var sql = "INSERT OR REPLACE INTO tags (uri,content_type,modified_time) VALUES ('"+uri+"','"+content_type+"',"+modified_time.to_string()+");\n";
351- //var c = "INSERT OR IGNORE INTO tags (uri,content_type,modified_time) VALUES ('"+uri+"','"+content_type+"',"+modified_time.to_string()+");\n";
352-
353- int rc = db.exec (sql, null, null);
354- if (rc != Sqlite.OK) {
355- stderr.printf ("[record_uri: SQL error] %d, %s\n", rc, db.errmsg ());
356- return false;
357- }
358- //stdout.printf("[Consult]: %s\n",c);
359-
360- return true;
361- }
362-#endif
363-
364- public async bool record_uris (Variant[] locations, string directory) {
365- string sql = "";
366- foreach (var location_variant in locations) {
367- VariantIter iter = location_variant.iterator();
368-
369- var uri = iter.next_value ().get_string ();
370- var content_type = iter.next_value ().get_string ();
371- var modified_time = iter.next_value ().get_string ();
372- var color = iter.next_value ().get_string ();
373- sql += "INSERT OR REPLACE INTO tags (uri, content_type, color, modified_time, dir) VALUES ('%s', '%s', %s, %s, '%s');\n".printf (uri, content_type, color, modified_time, directory);
374- }
375-
376- int rc = db.exec (sql, null, null);
377- if (rc != Sqlite.OK) {
378- stderr.printf ("[record_uri: SQL error] %d, %s\n", rc, db.errmsg ());
379- return false;
380- }
381- //stdout.printf("[Consult]: %s\n",sql);
382-
383- return true;
384- }
385-
386- private string escape(string input){
387- return input.replace("'", "''");
388- }
389-
390- public async Variant get_uri_infos (string raw_uri)
391- {
392- Idle.add (get_uri_infos.callback);
393- yield;
394- var uri = escape (raw_uri);
395- Statement stmt;
396-
397- var vb = new VariantBuilder (new VariantType ("(as)"));
398- int rc = db.prepare_v2 ("select modified_time, content_type, color from tags where uri='%s'".printf (uri),
399- -1, out stmt);
400- assert (rc == Sqlite.OK);
401- rc = stmt.step();
402-
403- vb.open (new VariantType ("as"));
404-
405- switch (rc) {
406- case Sqlite.DONE:
407- break;
408- case Sqlite.ROW:
409- vb.add ("s", stmt.column_text (0));
410- var content_type = stmt.column_text (1);
411- vb.add ("s", (content_type != null) ? content_type : "");
412- vb.add ("s", stmt.column_text (2));
413- break;
414- default:
415- printerr ("[get_uri_infos]: Error: %d, %s\n", rc, db.errmsg ());
416- break;
417- }
418-
419- vb.close ();
420- return vb.end ();
421- }
422-
423-#if 0
424- public async int getColor(string raw_uri)
425- {
426- Idle.add (getColor.callback);
427- yield;
428- var uri = escape(raw_uri);
429- string c = "select color from tags where uri='" + uri + "'";
430- Statement stmt;
431- int rc = 0;
432- int col, cols;
433- string txt = "0";
434-
435- if ((rc = db.prepare_v2 (c, -1, out stmt, null)) == 1) {
436- printerr ("[getColor]: SQL error: %d, %s\n", rc, db.errmsg ());
437- return -1;
438- }
439- cols = stmt.column_count();
440- do {
441- rc = stmt.step();
442- switch (rc) {
443- case Sqlite.DONE:
444- break;
445- case Sqlite.ROW:
446- for (col = 0; col < cols; col++) {
447- txt = stmt.column_text(col);
448- //print ("%s = %s\n", stmt.column_name (col), txt);
449- }
450- break;
451- default:
452- printerr ("[getColor]: Error: %d, %s\n", rc, db.errmsg ());
453- break;
454- }
455- } while (rc == Sqlite.ROW);
456- //stdout.printf("[getColor]: %s\n", txt);
457-
458- int ret = int.parse(txt);
459- /* It appears that a db error return -1, we got to check the value just in case */
460- if(ret == -1){
461- ret = 0;
462- }
463-
464- return ret;
465- }
466-#endif
467-
468- public async bool deleteEntry(string uri)
469- {
470- Idle.add (deleteEntry.callback);
471- yield;
472- string c = "delete from tags where uri='" + uri + "'";
473- int rc = db.exec (c, null, null);
474-
475- if (rc != Sqlite.OK) {
476- stderr.printf ("[deleteEntry: SQL error] %d, %s\n", rc, db.errmsg ());
477- return false;
478- }
479-
480- return true;
481- }
482-
483- public bool showTable(string table){
484- stdout.printf("showTable\n");
485- string consult = "select * from " + table;
486- int rc = db.exec (consult, show_table_callback, null);
487-
488- if (rc != Sqlite.OK) {
489- stderr.printf ("[showTable: SQL error]: %d, %s\n", rc, db.errmsg ());
490- return false;
491- }
492-
493- return true;
494- }
495-
496- public bool clearDB(){
497- string c = "delete from tags";
498- int rc = db.exec (c, null, null);
499-
500- if (rc != Sqlite.OK) {
501- stderr.printf ("[clearDB: SQL error] %d, %s\n", rc, db.errmsg ());
502- return false;
503- }
504-
505- return true;
506- }
507-
508- private bool has_column(string table_name, string column_name) {
509- Sqlite.Statement stmt;
510- int res = db.prepare_v2("PRAGMA table_info(%s)".printf(table_name), -1, out stmt);
511- assert(res == Sqlite.OK);
512-
513- for (;;) {
514- res = stmt.step();
515- if (res == Sqlite.DONE) {
516- break;
517- } else if (res != Sqlite.ROW) {
518- fatal("has_column %s".printf(table_name), res);
519-
520- break;
521- } else {
522- string column = stmt.column_text(1);
523- if (column != null && column == column_name)
524- return true;
525- }
526- }
527-
528- return false;
529- }
530-
531- private bool add_column(string table_name, string column_name, string column_constraints) {
532- Sqlite.Statement stmt;
533- int res = db.prepare_v2("ALTER TABLE %s ADD COLUMN %s %s".printf(table_name, column_name,
534- column_constraints), -1, out stmt);
535- assert(res == Sqlite.OK);
536-
537- res = stmt.step();
538- if (res != Sqlite.DONE) {
539- critical("Unable to add column %s %s %s: (%d) %s", table_name, column_name, column_constraints,
540- res, db.errmsg());
541-
542- return false;
543- }
544-
545- return true;
546- }
547-
548- private void upgrade_database () {
549-
550- // version 2
551-
552- if (!has_column("tags", "content_type")) {
553- message("upgrade_database: adding content_type column to tags");
554- if (!add_column("tags", "content_type", "TEXT"))
555- warning ("UPGRADE_ERROR");
556- }
557- if (!has_column("tags", "modified_time")) {
558- message("upgrade_database: adding modified_time column to tags");
559- if (!add_column("tags", "modified_time", "INTEGER DEFAULT 0"))
560- warning ("UPGRADE_ERROR");
561- }
562- if (!has_column("tags", "dir")) {
563- message("upgrade_database: adding dir column to tags");
564- if (!add_column("tags", "dir", "TEXT"))
565- warning ("UPGRADE_ERROR");
566- }
567- }
568-
569-}
570-
571-/* =============== Main ==================== */
572-/*void main (string[] args) {
573-
574- MarlinTags t = new MarlinTags();
575-
576- t.openMarlinDB();
577-
578- t.setColor("file:///home/jordi" ,MARLIN_RED);
579- t.setColor("file:///home/dev" ,MARLIN_YELLOW);
580-
581-//t.deleteEntry(File.new_for_path ("/home/dev")); //When deleting files
582-//t.deleteEntry("/home/documents");
583-
584-//t.clearDB();
585-t.showTable("tags");
586-
587-
588-// DBUS Things
589-print("\n\nColor for file is %i\n",
590-t.getColor("file:///home/jordi"));
591-}*/
592-
593-
594-void on_bus_aquired (DBusConnection conn) {
595- try {
596- conn.register_object ("/org/elementary/marlin/db", new MarlinTags ());
597- } catch (IOError e) {
598- error ("Could not register service");
599- }
600-}
601-
602-void main () {
603- Bus.own_name (BusType.SESSION, "org.elementary.marlin.db", BusNameOwnerFlags.NONE,
604- on_bus_aquired,
605- () => {},
606- () => error ("Could not aquire name"));
607-
608- new MainLoop ().run ();
609-}
610-
611
612=== removed file 'marlin-daemon/miner.vala'
613--- marlin-daemon/miner.vala 2012-01-02 15:55:50 +0000
614+++ marlin-daemon/miner.vala 1970-01-01 00:00:00 +0000
615@@ -1,124 +0,0 @@
616-[DBus (name = "org.elementary.marlin.db")]
617-interface Tags : Object {
618- public abstract bool showTable (string table) throws IOError;
619- public abstract bool record_uris (Variant[] entries, string directory) throws IOError;
620- /*public abstract bool deleteEntry (string uri) throws IOError;
621- public abstract bool clearDB () throws IOError;*/
622-}
623-
624-public class Miner : Object {
625-
626- public signal void done_loading ();
627-
628- public File location;
629- public Cancellable cancellable;
630-
631- private Tags tags;
632- private List<File> ufiles = null;
633- private List<File> ufiles_hidden = null;
634-
635- public class Miner (File directory)
636- {
637- location = directory;
638- cancellable = new Cancellable ();
639-
640- try {
641- tags = Bus.get_proxy_sync (BusType.SESSION, "org.elementary.marlin.db",
642- "/org/elementary/marlin/db");
643- } catch (IOError e) {
644- stderr.printf ("%s\n", e.message);
645- }
646- done_loading.connect (process_unknown_files);
647- }
648-
649- private Variant add_entry (string uri, string content_type, int modified_time)
650- {
651- //var vb = new VariantBuilder (new VariantType ("as"));
652-
653- char* ptr_arr[4];
654- ptr_arr[0] = uri;
655- ptr_arr[1] = content_type;
656- ptr_arr[2] = modified_time.to_string ();
657- ptr_arr[3] = "0"; /* color */
658- return new Variant.strv ((string[]) ptr_arr);
659-
660- /*vb.add ("s", uri);
661- vb.add ("s", content_type);
662- vb.add ("s", modified_time.to_string ());
663-
664- return vb.end ();*/
665- }
666-
667- private void process_unknown_files ()
668- {
669- warning ("process_unknown_files");
670- //HashTable<string,string>[] entries = null;
671- Variant[] entries = null;
672-
673- try {
674- foreach (var file in ufiles) {
675- var info = file.query_info (gio_full_attrs, 0, cancellable);
676- //message ("%s : %s", info.get_name (), info.get_content_type ());
677- /*tags.record_uri (file.get_uri (),
678- info.get_content_type (),
679- (int) info.get_attribute_uint64 (FILE_ATTRIBUTE_TIME_MODIFIED));*/
680- entries += add_entry (file.get_uri (),
681- info.get_content_type (),
682- (int) info.get_attribute_uint64 (FILE_ATTRIBUTE_TIME_MODIFIED));
683- }
684-
685- tags.record_uris (entries, location.get_uri ());
686- } catch (Error err) {
687- warning ("%s", err.message);
688- }
689- loop.quit ();
690- }
691-
692- private string gio_attrs = "standard::name,standard::type,standard::is-hidden,standard::is-backup,standard::fast-content-type,time::modified";
693- private string gio_full_attrs = "standard::name,standard::type,standard::is-hidden,standard::is-backup,standard::content-type,time::modified";
694-
695- public async void process_directory ()
696- {
697- try {
698- var enumerator = yield location.enumerate_children_async (gio_attrs, 0, 0, cancellable);
699- while (true) {
700- var files = yield enumerator.next_files_async (1024, 0, cancellable);
701- if (files == null)
702- break;
703-
704- foreach (var f in files)
705- {
706- //unowned string name = f.get_name ();
707- /*if (f.get_file_type () == FileType.REGULAR && name.has_suffix (".desktop")
708- && !filenames_cache.contains (name))*/
709- //yield load_eaction_file (directory.get_child (name));
710- var ftype = f.get_attribute_string (FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE);
711- if (ftype == "application/octet-stream") {
712- //message ("%s", name);
713- if (f.get_is_hidden () || f.get_is_backup ())
714- ufiles_hidden.prepend (location.get_child (f.get_name()));
715- else
716- ufiles.prepend (location.get_child (f.get_name()));
717- }
718- }
719- }
720- } catch (Error err) {
721- warning ("%s", err.message);
722- }
723- done_loading ();
724- }
725-}
726-
727-MainLoop loop;
728-
729-public static int main () {
730- //Miner miner = new Miner (File.new_for_path ("/home/kitkat"));
731- Miner miner = new Miner (File.new_for_path ("/usr/bin"));
732- miner.process_directory ();
733-
734- loop = new MainLoop ();
735- loop.run ();
736-
737- return 0;
738-}
739-
740
741=== added directory 'pantheon-files-daemon'
742=== added file 'pantheon-files-daemon/CMakeLists.txt'
743--- pantheon-files-daemon/CMakeLists.txt 1970-01-01 00:00:00 +0000
744+++ pantheon-files-daemon/CMakeLists.txt 2012-05-12 02:06:17 +0000
745@@ -0,0 +1,49 @@
746+# Vala stuff
747+
748+find_package(Vala REQUIRED)
749+include(ValaVersion)
750+ensure_vala_version("0.11.3" MINIMUM)
751+include(ValaPrecompile)
752+# pkgconfig, real C code
753+
754+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
755+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
756+include_directories(${CMAKE_CURRENT_BINARY_DIR})
757+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../libcore/)
758+include_directories(${CMAKE_CURRENT_BINARY_DIR}/../libwidgets/)
759+find_package(PkgConfig)
760+pkg_check_modules(DEPS REQUIRED
761+ glib-2.0>=2.29.0
762+ gthread-2.0
763+ gio-2.0
764+ pango>=1.1.2
765+ gtk+-3.0>=3.0.3
766+ gail-3.0
767+ gee-1.0
768+ sqlite3
769+ dbus-glib-1
770+ libnotify>=0.7.2)
771+set(CFLAGS
772+ ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER}
773+)
774+set(LIB_PATHS
775+ ${DEPS_LIBRARY_DIRS}
776+)
777+link_directories(${LIB_PATHS})
778+add_definitions(${CFLAGS}
779+ "-DGETTEXT_PACKAGE=\"pantheon-files\""
780+ -O2
781+ )
782+vala_precompile(VALA_C
783+ marlind-tagging.vala
784+PACKAGES
785+ gtk+-3.0
786+ gio-2.0
787+ gee-1.0
788+ sqlite3
789+OPTIONS
790+ --thread)
791+add_executable(pantheon-files-daemon
792+ ${VALA_C} )
793+target_link_libraries(pantheon-files-daemon ${DEPS_LIBRARIES})
794+install(TARGETS pantheon-files-daemon RUNTIME DESTINATION bin)
795
796=== added file 'pantheon-files-daemon/client.vala'
797--- pantheon-files-daemon/client.vala 1970-01-01 00:00:00 +0000
798+++ pantheon-files-daemon/client.vala 2012-05-12 02:06:17 +0000
799@@ -0,0 +1,29 @@
800+
801+[DBus (name = "org.elementary.marlin.db")]
802+interface Demo : Object {
803+ public abstract bool showTable (string table) throws IOError;
804+ public abstract int getColor (string uri) throws IOError;
805+ public abstract bool setColor (string uri, int color) throws IOError;
806+ public abstract bool deleteEntry (string uri) throws IOError;
807+ public abstract bool clearDB () throws IOError;
808+}
809+
810+void main () {
811+ try {
812+ Demo demo = Bus.get_proxy_sync (BusType.SESSION, "org.elementary.marlin.db",
813+ "/org/elementary/marlin/db");
814+
815+ //demo.setColor("file:///home/jordi", 3);
816+ //demo.isFileInDB("file:///home/jordi");
817+ //print("\n\nColor for file is %i\n", demo.getColor("file:///home/jordi"));
818+ //demo.deleteEntry("file:///home/jordi");
819+ //demo.clearDB();
820+ demo.showTable ("tags");
821+
822+ //demo.clearDB();
823+
824+ } catch (IOError e) {
825+ stderr.printf ("%s\n", e.message);
826+ }
827+}
828+
829
830=== added file 'pantheon-files-daemon/marlind-tagging.vala'
831--- pantheon-files-daemon/marlind-tagging.vala 1970-01-01 00:00:00 +0000
832+++ pantheon-files-daemon/marlind-tagging.vala 2012-05-12 02:06:17 +0000
833@@ -0,0 +1,380 @@
834+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
835+/*
836+ * Copyright (C) 2010 Jordi Puigdellívol <jordi@gloobus.net>
837+ *
838+ * This library is free software; you can redistribute it and/or modify
839+ * it under the terms of the GNU Lesser General Public License
840+ * version 3.0 as published by the Free Software Foundation.
841+ *
842+ * This library is distributed in the hope that it will be useful,
843+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
844+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
845+ * GNU Lesser General Public License version 3.0 for more details.
846+ *
847+ * You should have received a copy of the GNU Lesser General Public
848+ * License along with this library. If not, see
849+ * <http://www.gnu.org/licenses/>.
850+ *
851+ * Authors: Jordi Puigdellívol <jordi@gloobus.net>
852+ * ammonkey <am.monkeyd@gmail.com>
853+ *
854+
855+ Marlin Tagging system
856+
857+//Dependences
858+libsqlite3-dev
859+
860+//To create de table
861+create table tags (uri TEXT, color INT, tags TEXT);
862+
863+//To compile this sample
864+valac --pkg sqlite3 -o sqlitesample SqliteSample.vala
865+valac --pkg sqlite3 --pkg gio-2.0 -o sqlitesample marlin_tagging.vala && ./sqlitesample
866+
867+*/
868+
869+using GLib;
870+using Sqlite;
871+
872+[DBus (name = "org.elementary.marlin.db")]
873+public class MarlinTags : Object {
874+
875+ protected static Sqlite.Database db;
876+
877+ public MarlinTags(){
878+ openMarlinDB();
879+ }
880+
881+ protected static void fatal(string op, int res) {
882+ error("%s: [%d] %s", op, res, db.errmsg());
883+ }
884+
885+ private static int show_table_callback (int n_columns, string[] values, string[] column_names)
886+ {
887+ for (int i = 0; i < n_columns; i++) {
888+ stdout.printf ("%s = %s\n", column_names[i], values[i]);
889+ }
890+ stdout.printf ("\n");
891+
892+ return 0;
893+ }
894+
895+ public bool openMarlinDB()
896+ {
897+ File home_dir = File.new_for_path (Environment.get_home_dir ());
898+ File data_dir = home_dir.get_child(".config").get_child("marlin");
899+
900+ try {
901+ if (!data_dir.query_exists(null))
902+ data_dir.make_directory_with_parents(null);
903+ } catch (Error err) {
904+ stderr.printf("Unable to create data directory %s: %s", data_dir.get_path(), err.message);
905+ }
906+
907+ string marlin_db_path = data_dir.get_child("marlin.db").get_path();
908+ //The database must exists, add here the full path
909+ print("Database path: %s \n", marlin_db_path);
910+ openDB(marlin_db_path);
911+
912+ return true;
913+ }
914+
915+ private bool openDB(string dbpath){
916+ int rc = Sqlite.Database.open_v2(dbpath, out db, Sqlite.OPEN_READWRITE | Sqlite.OPEN_CREATE, null);
917+
918+ if (rc != Sqlite.OK) {
919+ stderr.printf ("Can't open database: %d, %s\n", rc, db.errmsg ());
920+ return false;
921+ }
922+
923+ // disable synchronized commits for performance reasons ... this is not vital
924+ rc = db.exec("PRAGMA synchronous=OFF");
925+ if (rc != Sqlite.OK)
926+ stdout.printf("Unable to disable synchronous mode %d, %s\n", rc, db.errmsg ());
927+
928+ Sqlite.Statement stmt;
929+ int res = db.prepare_v2("CREATE TABLE IF NOT EXISTS tags ("
930+ + "id INTEGER PRIMARY KEY, "
931+ + "uri TEXT UNIQUE NOT NULL, "
932+ + "color INTEGER DEFAULT 0, "
933+ + "tags TEXT NULL, "
934+ + "content_type TEXT, "
935+ + "modified_time INTEGER DEFAULT 0, "
936+ + "dir TEXT "
937+ + ")", -1, out stmt);
938+ assert(res == Sqlite.OK);
939+ res = stmt.step();
940+ if (res != Sqlite.DONE)
941+ fatal("create tags table", res);
942+
943+ /* TODO check result of the last sql command */
944+ upgrade_database ();
945+
946+ return true;
947+ }
948+
949+#if 0
950+ public async bool record_uri (string raw_uri, string content_type, int modified_time) {
951+ var uri = escape(raw_uri);
952+
953+ var sql = "INSERT OR REPLACE INTO tags (uri,content_type,modified_time) VALUES ('"+uri+"','"+content_type+"',"+modified_time.to_string()+");\n";
954+ //var c = "INSERT OR IGNORE INTO tags (uri,content_type,modified_time) VALUES ('"+uri+"','"+content_type+"',"+modified_time.to_string()+");\n";
955+
956+ int rc = db.exec (sql, null, null);
957+ if (rc != Sqlite.OK) {
958+ stderr.printf ("[record_uri: SQL error] %d, %s\n", rc, db.errmsg ());
959+ return false;
960+ }
961+ //stdout.printf("[Consult]: %s\n",c);
962+
963+ return true;
964+ }
965+#endif
966+
967+ public async bool record_uris (Variant[] locations, string directory) {
968+ string sql = "";
969+ foreach (var location_variant in locations) {
970+ VariantIter iter = location_variant.iterator();
971+
972+ var uri = iter.next_value ().get_string ();
973+ var content_type = iter.next_value ().get_string ();
974+ var modified_time = iter.next_value ().get_string ();
975+ var color = iter.next_value ().get_string ();
976+ sql += "INSERT OR REPLACE INTO tags (uri, content_type, color, modified_time, dir) VALUES ('%s', '%s', %s, %s, '%s');\n".printf (uri, content_type, color, modified_time, directory);
977+ }
978+
979+ int rc = db.exec (sql, null, null);
980+ if (rc != Sqlite.OK) {
981+ stderr.printf ("[record_uri: SQL error] %d, %s\n", rc, db.errmsg ());
982+ return false;
983+ }
984+ //stdout.printf("[Consult]: %s\n",sql);
985+
986+ return true;
987+ }
988+
989+ private string escape(string input){
990+ return input.replace("'", "''");
991+ }
992+
993+ public async Variant get_uri_infos (string raw_uri)
994+ {
995+ Idle.add (get_uri_infos.callback);
996+ yield;
997+ var uri = escape (raw_uri);
998+ Statement stmt;
999+
1000+ var vb = new VariantBuilder (new VariantType ("(as)"));
1001+ int rc = db.prepare_v2 ("select modified_time, content_type, color from tags where uri='%s'".printf (uri),
1002+ -1, out stmt);
1003+ assert (rc == Sqlite.OK);
1004+ rc = stmt.step();
1005+
1006+ vb.open (new VariantType ("as"));
1007+
1008+ switch (rc) {
1009+ case Sqlite.DONE:
1010+ break;
1011+ case Sqlite.ROW:
1012+ vb.add ("s", stmt.column_text (0));
1013+ var content_type = stmt.column_text (1);
1014+ vb.add ("s", (content_type != null) ? content_type : "");
1015+ vb.add ("s", stmt.column_text (2));
1016+ break;
1017+ default:
1018+ printerr ("[get_uri_infos]: Error: %d, %s\n", rc, db.errmsg ());
1019+ break;
1020+ }
1021+
1022+ vb.close ();
1023+ return vb.end ();
1024+ }
1025+
1026+#if 0
1027+ public async int getColor(string raw_uri)
1028+ {
1029+ Idle.add (getColor.callback);
1030+ yield;
1031+ var uri = escape(raw_uri);
1032+ string c = "select color from tags where uri='" + uri + "'";
1033+ Statement stmt;
1034+ int rc = 0;
1035+ int col, cols;
1036+ string txt = "0";
1037+
1038+ if ((rc = db.prepare_v2 (c, -1, out stmt, null)) == 1) {
1039+ printerr ("[getColor]: SQL error: %d, %s\n", rc, db.errmsg ());
1040+ return -1;
1041+ }
1042+ cols = stmt.column_count();
1043+ do {
1044+ rc = stmt.step();
1045+ switch (rc) {
1046+ case Sqlite.DONE:
1047+ break;
1048+ case Sqlite.ROW:
1049+ for (col = 0; col < cols; col++) {
1050+ txt = stmt.column_text(col);
1051+ //print ("%s = %s\n", stmt.column_name (col), txt);
1052+ }
1053+ break;
1054+ default:
1055+ printerr ("[getColor]: Error: %d, %s\n", rc, db.errmsg ());
1056+ break;
1057+ }
1058+ } while (rc == Sqlite.ROW);
1059+ //stdout.printf("[getColor]: %s\n", txt);
1060+
1061+ int ret = int.parse(txt);
1062+ /* It appears that a db error return -1, we got to check the value just in case */
1063+ if(ret == -1){
1064+ ret = 0;
1065+ }
1066+
1067+ return ret;
1068+ }
1069+#endif
1070+
1071+ public async bool deleteEntry(string uri)
1072+ {
1073+ Idle.add (deleteEntry.callback);
1074+ yield;
1075+ string c = "delete from tags where uri='" + uri + "'";
1076+ int rc = db.exec (c, null, null);
1077+
1078+ if (rc != Sqlite.OK) {
1079+ stderr.printf ("[deleteEntry: SQL error] %d, %s\n", rc, db.errmsg ());
1080+ return false;
1081+ }
1082+
1083+ return true;
1084+ }
1085+
1086+ public bool showTable(string table){
1087+ stdout.printf("showTable\n");
1088+ string consult = "select * from " + table;
1089+ int rc = db.exec (consult, show_table_callback, null);
1090+
1091+ if (rc != Sqlite.OK) {
1092+ stderr.printf ("[showTable: SQL error]: %d, %s\n", rc, db.errmsg ());
1093+ return false;
1094+ }
1095+
1096+ return true;
1097+ }
1098+
1099+ public bool clearDB(){
1100+ string c = "delete from tags";
1101+ int rc = db.exec (c, null, null);
1102+
1103+ if (rc != Sqlite.OK) {
1104+ stderr.printf ("[clearDB: SQL error] %d, %s\n", rc, db.errmsg ());
1105+ return false;
1106+ }
1107+
1108+ return true;
1109+ }
1110+
1111+ private bool has_column(string table_name, string column_name) {
1112+ Sqlite.Statement stmt;
1113+ int res = db.prepare_v2("PRAGMA table_info(%s)".printf(table_name), -1, out stmt);
1114+ assert(res == Sqlite.OK);
1115+
1116+ for (;;) {
1117+ res = stmt.step();
1118+ if (res == Sqlite.DONE) {
1119+ break;
1120+ } else if (res != Sqlite.ROW) {
1121+ fatal("has_column %s".printf(table_name), res);
1122+
1123+ break;
1124+ } else {
1125+ string column = stmt.column_text(1);
1126+ if (column != null && column == column_name)
1127+ return true;
1128+ }
1129+ }
1130+
1131+ return false;
1132+ }
1133+
1134+ private bool add_column(string table_name, string column_name, string column_constraints) {
1135+ Sqlite.Statement stmt;
1136+ int res = db.prepare_v2("ALTER TABLE %s ADD COLUMN %s %s".printf(table_name, column_name,
1137+ column_constraints), -1, out stmt);
1138+ assert(res == Sqlite.OK);
1139+
1140+ res = stmt.step();
1141+ if (res != Sqlite.DONE) {
1142+ critical("Unable to add column %s %s %s: (%d) %s", table_name, column_name, column_constraints,
1143+ res, db.errmsg());
1144+
1145+ return false;
1146+ }
1147+
1148+ return true;
1149+ }
1150+
1151+ private void upgrade_database () {
1152+
1153+ // version 2
1154+
1155+ if (!has_column("tags", "content_type")) {
1156+ message("upgrade_database: adding content_type column to tags");
1157+ if (!add_column("tags", "content_type", "TEXT"))
1158+ warning ("UPGRADE_ERROR");
1159+ }
1160+ if (!has_column("tags", "modified_time")) {
1161+ message("upgrade_database: adding modified_time column to tags");
1162+ if (!add_column("tags", "modified_time", "INTEGER DEFAULT 0"))
1163+ warning ("UPGRADE_ERROR");
1164+ }
1165+ if (!has_column("tags", "dir")) {
1166+ message("upgrade_database: adding dir column to tags");
1167+ if (!add_column("tags", "dir", "TEXT"))
1168+ warning ("UPGRADE_ERROR");
1169+ }
1170+ }
1171+
1172+}
1173+
1174+/* =============== Main ==================== */
1175+/*void main (string[] args) {
1176+
1177+ MarlinTags t = new MarlinTags();
1178+
1179+ t.openMarlinDB();
1180+
1181+ t.setColor("file:///home/jordi" ,MARLIN_RED);
1182+ t.setColor("file:///home/dev" ,MARLIN_YELLOW);
1183+
1184+//t.deleteEntry(File.new_for_path ("/home/dev")); //When deleting files
1185+//t.deleteEntry("/home/documents");
1186+
1187+//t.clearDB();
1188+t.showTable("tags");
1189+
1190+
1191+// DBUS Things
1192+print("\n\nColor for file is %i\n",
1193+t.getColor("file:///home/jordi"));
1194+}*/
1195+
1196+
1197+void on_bus_aquired (DBusConnection conn) {
1198+ try {
1199+ conn.register_object ("/org/elementary/marlin/db", new MarlinTags ());
1200+ } catch (IOError e) {
1201+ error ("Could not register service");
1202+ }
1203+}
1204+
1205+void main () {
1206+ Bus.own_name (BusType.SESSION, "org.elementary.marlin.db", BusNameOwnerFlags.NONE,
1207+ on_bus_aquired,
1208+ () => {},
1209+ () => error ("Could not aquire name"));
1210+
1211+ new MainLoop ().run ();
1212+}
1213+
1214
1215=== added file 'pantheon-files-daemon/miner.vala'
1216--- pantheon-files-daemon/miner.vala 1970-01-01 00:00:00 +0000
1217+++ pantheon-files-daemon/miner.vala 2012-05-12 02:06:17 +0000
1218@@ -0,0 +1,124 @@
1219+[DBus (name = "org.elementary.marlin.db")]
1220+interface Tags : Object {
1221+ public abstract bool showTable (string table) throws IOError;
1222+ public abstract bool record_uris (Variant[] entries, string directory) throws IOError;
1223+ /*public abstract bool deleteEntry (string uri) throws IOError;
1224+ public abstract bool clearDB () throws IOError;*/
1225+}
1226+
1227+public class Miner : Object {
1228+
1229+ public signal void done_loading ();
1230+
1231+ public File location;
1232+ public Cancellable cancellable;
1233+
1234+ private Tags tags;
1235+ private List<File> ufiles = null;
1236+ private List<File> ufiles_hidden = null;
1237+
1238+ public class Miner (File directory)
1239+ {
1240+ location = directory;
1241+ cancellable = new Cancellable ();
1242+
1243+ try {
1244+ tags = Bus.get_proxy_sync (BusType.SESSION, "org.elementary.marlin.db",
1245+ "/org/elementary/marlin/db");
1246+ } catch (IOError e) {
1247+ stderr.printf ("%s\n", e.message);
1248+ }
1249+ done_loading.connect (process_unknown_files);
1250+ }
1251+
1252+ private Variant add_entry (string uri, string content_type, int modified_time)
1253+ {
1254+ //var vb = new VariantBuilder (new VariantType ("as"));
1255+
1256+ char* ptr_arr[4];
1257+ ptr_arr[0] = uri;
1258+ ptr_arr[1] = content_type;
1259+ ptr_arr[2] = modified_time.to_string ();
1260+ ptr_arr[3] = "0"; /* color */
1261+ return new Variant.strv ((string[]) ptr_arr);
1262+
1263+ /*vb.add ("s", uri);
1264+ vb.add ("s", content_type);
1265+ vb.add ("s", modified_time.to_string ());
1266+
1267+ return vb.end ();*/
1268+ }
1269+
1270+ private void process_unknown_files ()
1271+ {
1272+ warning ("process_unknown_files");
1273+ //HashTable<string,string>[] entries = null;
1274+ Variant[] entries = null;
1275+
1276+ try {
1277+ foreach (var file in ufiles) {
1278+ var info = file.query_info (gio_full_attrs, 0, cancellable);
1279+ //message ("%s : %s", info.get_name (), info.get_content_type ());
1280+ /*tags.record_uri (file.get_uri (),
1281+ info.get_content_type (),
1282+ (int) info.get_attribute_uint64 (FILE_ATTRIBUTE_TIME_MODIFIED));*/
1283+ entries += add_entry (file.get_uri (),
1284+ info.get_content_type (),
1285+ (int) info.get_attribute_uint64 (FILE_ATTRIBUTE_TIME_MODIFIED));
1286+ }
1287+
1288+ tags.record_uris (entries, location.get_uri ());
1289+ } catch (Error err) {
1290+ warning ("%s", err.message);
1291+ }
1292+ loop.quit ();
1293+ }
1294+
1295+ private string gio_attrs = "standard::name,standard::type,standard::is-hidden,standard::is-backup,standard::fast-content-type,time::modified";
1296+ private string gio_full_attrs = "standard::name,standard::type,standard::is-hidden,standard::is-backup,standard::content-type,time::modified";
1297+
1298+ public async void process_directory ()
1299+ {
1300+ try {
1301+ var enumerator = yield location.enumerate_children_async (gio_attrs, 0, 0, cancellable);
1302+ while (true) {
1303+ var files = yield enumerator.next_files_async (1024, 0, cancellable);
1304+ if (files == null)
1305+ break;
1306+
1307+ foreach (var f in files)
1308+ {
1309+ //unowned string name = f.get_name ();
1310+ /*if (f.get_file_type () == FileType.REGULAR && name.has_suffix (".desktop")
1311+ && !filenames_cache.contains (name))*/
1312+ //yield load_eaction_file (directory.get_child (name));
1313+ var ftype = f.get_attribute_string (FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE);
1314+ if (ftype == "application/octet-stream") {
1315+ //message ("%s", name);
1316+ if (f.get_is_hidden () || f.get_is_backup ())
1317+ ufiles_hidden.prepend (location.get_child (f.get_name()));
1318+ else
1319+ ufiles.prepend (location.get_child (f.get_name()));
1320+ }
1321+ }
1322+ }
1323+ } catch (Error err) {
1324+ warning ("%s", err.message);
1325+ }
1326+ done_loading ();
1327+ }
1328+}
1329+
1330+MainLoop loop;
1331+
1332+public static int main () {
1333+ //Miner miner = new Miner (File.new_for_path ("/home/kitkat"));
1334+ Miner miner = new Miner (File.new_for_path ("/usr/bin"));
1335+ miner.process_directory ();
1336+
1337+ loop = new MainLoop ();
1338+ loop.run ();
1339+
1340+ return 0;
1341+}
1342+
1343
1344=== modified file 'po/CMakeLists.txt'
1345--- po/CMakeLists.txt 2011-08-11 10:22:14 +0000
1346+++ po/CMakeLists.txt 2012-05-12 02:06:17 +0000
1347@@ -1,6 +1,6 @@
1348 include(Translations)
1349-add_translations_directory("marlin")
1350-add_translations_catalog("marlin"
1351+add_translations_directory("pantheon-files")
1352+add_translations_catalog("pantheon-files"
1353 ../src/View
1354 ../src
1355 ../libcore
1356
1357=== modified file 'src/CMakeLists.txt'
1358--- src/CMakeLists.txt 2012-01-10 15:11:58 +0000
1359+++ src/CMakeLists.txt 2012-05-12 02:06:17 +0000
1360@@ -15,7 +15,8 @@
1361 include_directories(${CMAKE_CURRENT_BINARY_DIR}/../libwidgets/)
1362 find_package(PkgConfig)
1363 pkg_check_modules(DEPS REQUIRED
1364- varka>=0.1
1365+ varka
1366+ granite
1367 glib-2.0>=2.29.0
1368 gthread-2.0
1369 gio-2.0
1370@@ -36,9 +37,9 @@
1371
1372 link_directories(${LIB_PATHS})
1373 add_definitions(${CFLAGS}
1374- "-DGETTEXT_PACKAGE=\"marlin\""
1375- "-DPIXMAP_DIR=\"${CMAKE_INSTALL_PREFIX}/share/pixmaps/marlin/\""
1376- "-DUI_DIR=\"${CMAKE_INSTALL_PREFIX}/share/marlin/ui/\""
1377+ "-DGETTEXT_PACKAGE=\"pantheon-files\""
1378+ "-DPIXMAP_DIR=\"${CMAKE_INSTALL_PREFIX}/share/pixmaps/pantheon-files/\""
1379+ "-DUI_DIR=\"${CMAKE_INSTALL_PREFIX}/share/pantheon-files/ui/\""
1380 -O2
1381 )
1382 vala_precompile(VALA_C
1383@@ -60,6 +61,9 @@
1384 View/Chrome/TopMenu.vala
1385 View/Chrome/ViewSwicher.vala
1386 View/Chrome/ColorWidget.vala
1387+ View/Chrome/XsEntry.vala
1388+ View/Chrome/IconFactory.vala
1389+ View/Chrome/ImgEventBox.vala
1390 CUSTOM_VAPIS
1391 ${CMAKE_CURRENT_BINARY_DIR}/../libwidgets/marlinwidgets.vapi
1392 marlin.vapi
1393@@ -68,7 +72,7 @@
1394 gio-2.0
1395 posix
1396 gee-1.0
1397- varka
1398+ granite
1399 marlincore
1400 marlincore-C
1401 GENERATE_HEADER
1402@@ -77,7 +81,7 @@
1403 --vapidir=${CMAKE_SOURCE_DIR}/libcore/
1404 --vapidir=${CMAKE_BINARY_DIR}/libcore/
1405 --thread)
1406-add_executable(marlin
1407+add_executable(pantheon-files
1408 eel-editable-label.c
1409 marlin-application.c
1410 gossip-cell-renderer-expander.c
1411@@ -110,19 +114,19 @@
1412 marlin-progress-info-widget.c
1413 ${VALA_C} )
1414
1415-add_definitions("-DPLUGIN_DIR=\"${CMAKE_INSTALL_PREFIX}/lib/marlin/plugins/\"")
1416-target_link_libraries(marlin marlincore marlinwidgets ${DEPS_LIBRARIES})
1417+add_definitions("-DPLUGIN_DIR=\"${CMAKE_INSTALL_PREFIX}/lib/pantheon-files/plugins/\"")
1418+target_link_libraries(pantheon-files marlincore marlinwidgets ${DEPS_LIBRARIES})
1419
1420 OPTION(WITH_UNITY "Add Unity launcher support" ON)
1421 pkg_check_modules(UNITY unity>=4.0.0)
1422
1423 IF(WITH_UNITY AND UNITY_FOUND)
1424 include_directories(${UNITY_INCLUDE_DIRS})
1425- target_link_libraries (marlin marlincore marlinwidgets ${UNITY_LIBRARIES})
1426+ target_link_libraries (pantheon-files marlincore marlinwidgets ${UNITY_LIBRARIES})
1427 add_definitions("-DHAVE_UNITY=1")
1428 ENDIF(WITH_UNITY AND UNITY_FOUND)
1429
1430-install(TARGETS marlin RUNTIME DESTINATION bin)
1431-install(FILES marlin-ui.xml DESTINATION share/marlin/ui/)
1432-install(FILES fm-directory-view-ui.xml fm-icon-view-ui.xml DESTINATION share/marlin/ui/)
1433+install(TARGETS pantheon-files RUNTIME DESTINATION bin)
1434+install(FILES pantheon-files-ui.xml DESTINATION share/pantheon-files/ui/)
1435+install(FILES fm-directory-view-ui.xml fm-icon-view-ui.xml DESTINATION share/pantheon-files/ui/)
1436 include(Tests)
1437
1438=== added file 'src/View/Chrome/IconFactory.vala'
1439--- src/View/Chrome/IconFactory.vala 1970-01-01 00:00:00 +0000
1440+++ src/View/Chrome/IconFactory.vala 2012-05-12 02:06:17 +0000
1441@@ -0,0 +1,53 @@
1442+/*
1443+ * Copyright (C) 2011 ammonkey <am.monkeyd@gmail.com>
1444+ *
1445+ * This program is free software: you can redistribute it and/or modify
1446+ * it under the terms of the GNU General Public License as published by
1447+ * the Free Software Foundation, either version 3 of the License, or
1448+ * (at your option) any later version.
1449+ *
1450+ * This program is distributed in the hope that it will be useful,
1451+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1452+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1453+ * GNU General Public License for more details.
1454+ *
1455+ * You should have received a copy of the GNU General Public License
1456+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1457+ */
1458+
1459+namespace Varka {
1460+
1461+ public static IconFactory? icon_factory = null;
1462+
1463+ public class IconFactory : GLib.Object {
1464+
1465+ private Gtk.IconTheme icon_theme;
1466+
1467+ public class IconFactory () {
1468+ icon_theme = Gtk.IconTheme.get_default ();
1469+ }
1470+
1471+ public static IconFactory get_default () {
1472+ if (icon_factory != null)
1473+ return icon_factory;
1474+
1475+ icon_factory = new IconFactory ();
1476+ return icon_factory;
1477+ }
1478+
1479+ public Gdk.Pixbuf? load_symbolic_icon (Gtk.StyleContext style, string iconname, int size) {
1480+ Gdk.Pixbuf px = null;
1481+
1482+ ThemedIcon themed_icon = new ThemedIcon.with_default_fallbacks (iconname);
1483+ Gtk.IconInfo icon_info = icon_theme.lookup_by_gicon ((GLib.Icon) themed_icon, size, Gtk.IconLookupFlags.GENERIC_FALLBACK);
1484+ try {
1485+ px = icon_info.load_symbolic_for_context (style);
1486+ } catch (Error err) {
1487+ stderr.printf ("Unable to load symbolic icon: %s", err.message);
1488+ }
1489+
1490+ return px;
1491+ }
1492+
1493+ }
1494+}
1495
1496=== added file 'src/View/Chrome/ImgEventBox.vala'
1497--- src/View/Chrome/ImgEventBox.vala 1970-01-01 00:00:00 +0000
1498+++ src/View/Chrome/ImgEventBox.vala 2012-05-12 02:06:17 +0000
1499@@ -0,0 +1,68 @@
1500+/*
1501+ * Copyright (C) 2011 Elementary Developers
1502+ *
1503+ * This program is free software: you can redistribute it and/or modify
1504+ * it under the terms of the GNU General Public License as published by
1505+ * the Free Software Foundation, either version 3 of the License, or
1506+ * (at your option) any later version.
1507+ *
1508+ * This program is distributed in the hope that it will be useful,
1509+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1510+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1511+ * GNU General Public License for more details.
1512+ *
1513+ * You should have received a copy of the GNU General Public License
1514+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515+ *
1516+ * Author: ammonkey <am.monkeyd@gmail.com>
1517+ */
1518+
1519+using Gtk;
1520+using Gdk;
1521+using Cairo;
1522+
1523+namespace Granite.Widgets {
1524+
1525+ public class ImgEventBox : EventBox
1526+ {
1527+ private Pixbuf? pix = null;
1528+ private int wpix;
1529+ private int hpix;
1530+
1531+ public Orientation orientation { get; set; }
1532+
1533+ public ImgEventBox (Orientation o)
1534+ {
1535+ visible_window = false;
1536+ orientation = o;
1537+ }
1538+
1539+ protected override bool draw (Context cr) {
1540+ Allocation vba;
1541+ get_allocation (out vba);
1542+
1543+ if (pix != null) {
1544+ //cairo_set_source_pixbuf (cr, pix, 0, 0);
1545+ if (orientation == Orientation.HORIZONTAL)
1546+ cairo_set_source_pixbuf (cr, pix, vba.width/2 - wpix/2, 0);
1547+ else
1548+ cairo_set_source_pixbuf (cr, pix, 3, vba.height/2 - hpix/2);
1549+ cr.paint();
1550+ }
1551+
1552+ return true;
1553+ }
1554+
1555+ public void set_from_pixbuf (Pixbuf _pix) {
1556+ pix = _pix;
1557+ wpix = pix.get_width();
1558+ hpix = pix.get_height();
1559+ //message ("evbox set_from_pix %d %d", wpix, hpix);
1560+ if (orientation == Orientation.HORIZONTAL)
1561+ set_size_request (-1, hpix);
1562+ else
1563+ set_size_request (wpix+6, -1);
1564+ queue_draw ();
1565+ }
1566+ }
1567+}
1568
1569=== modified file 'src/View/Chrome/TopMenu.vala'
1570--- src/View/Chrome/TopMenu.vala 2012-02-14 01:37:01 +0000
1571+++ src/View/Chrome/TopMenu.vala 2012-05-12 02:06:17 +0000
1572@@ -28,7 +28,7 @@
1573 public ViewSwitcher? view_switcher;
1574 public Gtk.Menu compact_menu;
1575 public Gtk.Menu toolbar_menu;
1576- public Varka.Widgets.AppMenu app_menu;
1577+ public Granite.Widgets.AppMenu app_menu;
1578 public LocationBar? location_bar;
1579 public Window win;
1580
1581@@ -42,7 +42,7 @@
1582 compact_menu = (Gtk.Menu) win.ui.get_widget("/CompactMenu");
1583 toolbar_menu = (Gtk.Menu) win.ui.get_widget("/ToolbarMenu");
1584
1585- app_menu = new Varka.Widgets.AppMenu (compact_menu);
1586+ app_menu = new Granite.Widgets.AppMenu (compact_menu);
1587 setup_items();
1588 show();
1589
1590@@ -119,12 +119,12 @@
1591 if (main_action != null)
1592 {
1593 if (name == "Forward"){
1594- win.button_forward = new Varka.Widgets.ToolButtonWithMenu.from_action(main_action);
1595+ win.button_forward = new Granite.Widgets.ToolButtonWithMenu.from_action(main_action);
1596 win.button_forward.show_all();
1597 insert(win.button_forward, -1);
1598 }
1599 else if ( name == "Back"){
1600- win.button_back = new Varka.Widgets.ToolButtonWithMenu.from_action(main_action);
1601+ win.button_back = new Granite.Widgets.ToolButtonWithMenu.from_action(main_action);
1602 win.button_back.show_all();
1603 insert(win.button_back, -1);
1604 }else{
1605
1606=== modified file 'src/View/Chrome/ViewSwicher.vala'
1607--- src/View/Chrome/ViewSwicher.vala 2012-02-07 20:55:31 +0000
1608+++ src/View/Chrome/ViewSwicher.vala 2012-05-12 02:06:17 +0000
1609@@ -21,7 +21,7 @@
1610 // along with this program. If not, see <http://www.gnu.org/licenses/>.
1611
1612 using Gtk;
1613-using Varka.Widgets;
1614+using Granite.Widgets;
1615 using Config;
1616
1617 namespace Marlin.View.Chrome
1618@@ -53,7 +53,7 @@
1619
1620 Preferences.settings.set_enum ("default-viewmode", value);
1621 //switcher.focus(target);
1622- switcher.set_active_widget (target);
1623+ //switcher.set_active_widget (target);
1624 _mode = mode;
1625 }
1626 private get{
1627@@ -75,6 +75,8 @@
1628 margin = 3;
1629
1630 switcher = new ModeButton ();
1631+ switcher.set_margin_top (5);
1632+ switcher.set_margin_bottom (5);
1633 Varka.IconFactory icon_factory = Varka.IconFactory.get_default ();
1634 Gtk.StyleContext style = get_style_context ();
1635
1636
1637=== added file 'src/View/Chrome/XsEntry.vala'
1638--- src/View/Chrome/XsEntry.vala 1970-01-01 00:00:00 +0000
1639+++ src/View/Chrome/XsEntry.vala 2012-05-12 02:06:17 +0000
1640@@ -0,0 +1,40 @@
1641+/*
1642+ * Copyright (C) 2011 Elementary Developers
1643+ *
1644+ * This program is free software: you can redistribute it and/or modify
1645+ * it under the terms of the GNU General Public License as published by
1646+ * the Free Software Foundation, either version 3 of the License, or
1647+ * (at your option) any later version.
1648+ *
1649+ * This program is distributed in the hope that it will be useful,
1650+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1651+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1652+ * GNU General Public License for more details.
1653+ *
1654+ * You should have received a copy of the GNU General Public License
1655+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1656+ *
1657+ * Author: ammonkey <am.monkeyd@gmail.com>
1658+ */
1659+
1660+using Gtk;
1661+
1662+/* Just a workarround Gtk.Entry which got a minimum fixed prefered width
1663+With XsEntry we can set the exact width we want */
1664+public class Granite.Widgets.XsEntry : Entry
1665+{
1666+ public int m_default_with = 25;
1667+
1668+ public XsEntry ()
1669+ {
1670+ width_request = m_default_with;
1671+ }
1672+
1673+ public override void get_preferred_width (out int minimum_width, out int natural_width)
1674+ {
1675+ if (width_request >= m_default_with)
1676+ minimum_width = natural_width = width_request;
1677+ else
1678+ minimum_width = natural_width = m_default_with;
1679+ }
1680+}
1681
1682=== modified file 'src/View/ContextView.vala'
1683--- src/View/ContextView.vala 2012-01-09 03:13:39 +0000
1684+++ src/View/ContextView.vala 2012-05-12 02:06:17 +0000
1685@@ -24,7 +24,8 @@
1686 using Gdk;
1687 using Cairo;
1688 using Gee;
1689-using Varka.Widgets;
1690+using Granite.Widgets;
1691+using Granite.Widgets;
1692
1693 namespace Marlin.View {
1694
1695
1696=== modified file 'src/View/LocationBar.vala'
1697--- src/View/LocationBar.vala 2012-05-07 19:02:04 +0000
1698+++ src/View/LocationBar.vala 2012-05-12 02:06:17 +0000
1699@@ -53,8 +53,8 @@
1700 set_expand(true);
1701
1702 //border_width = 0;
1703- margin_top = 3;
1704- margin_bottom = 3;
1705+ margin_top = 5;
1706+ margin_bottom = 5;
1707
1708 add(bread);
1709 }
1710
1711=== modified file 'src/View/PropertiesWindow.vala'
1712--- src/View/PropertiesWindow.vala 2012-05-07 19:16:24 +0000
1713+++ src/View/PropertiesWindow.vala 2012-05-12 02:06:17 +0000
1714@@ -20,13 +20,13 @@
1715 using Gtk;
1716 using Posix;
1717 using GLib;
1718-using Varka.Widgets;
1719+using Granite.Widgets;
1720
1721 public class Marlin.View.PropertiesWindow : Gtk.Dialog
1722 {
1723 private Gee.LinkedList<Pair<string, string>> info;
1724- private ImgEventBox evbox;
1725- private XsEntry perm_code;
1726+ private Granite.Widgets.ImgEventBox evbox;
1727+ private Granite.Widgets.XsEntry perm_code;
1728 private bool perm_code_should_update = true;
1729 private Gtk.Label l_perm;
1730
1731@@ -41,7 +41,7 @@
1732
1733 private Gee.Set<string>? mimes;
1734
1735- private Varka.Widgets.WrapLabel header_title;
1736+ private Granite.Widgets.WrapLabel header_title;
1737 private Gtk.Label header_desc;
1738 private string ftype; /* common type */
1739
1740@@ -235,7 +235,7 @@
1741 var vvbox = new Box (Gtk.Orientation.VERTICAL, 0);
1742 content.pack_start(vvbox);
1743
1744- header_title = new Varka.Widgets.WrapLabel ();
1745+ header_title = new Granite.Widgets.WrapLabel ();
1746 if (count > 1)
1747 header_title.set_markup ("<span weight='semibold' size='large'>" + "%u selected items".printf(count) + "</span>");
1748 else
1749@@ -388,7 +388,7 @@
1750
1751 int n = 0;
1752 foreach(var pair in item_info){
1753- var value_label = new Varka.Widgets.WrapLabel(pair.value);
1754+ var value_label = new Granite.Widgets.WrapLabel(pair.value);
1755 var key_label = create_label_key (pair.key);
1756 value_label.set_selectable (true);
1757 //value_label.set_size_request (150, -1);
1758@@ -855,7 +855,7 @@
1759 perm_grid.attach(key_label, 0, 5, 1, 1);
1760 perm_grid.attach(value_hlabel, 1, 5, 1, 1);
1761
1762- perm_code = new XsEntry();
1763+ perm_code = new Granite.Widgets.XsEntry();
1764 //var perm_code = new Label("705");
1765 //perm_code.margin_right = 2;
1766 perm_code.set_text("000");
1767@@ -1063,7 +1063,7 @@
1768 }
1769
1770 private void construct_preview_panel (Box box) {
1771- evbox = new ImgEventBox(Orientation.HORIZONTAL);
1772+ evbox = new Granite.Widgets.ImgEventBox(Orientation.HORIZONTAL);
1773 var pix = goffile.get_icon_pixbuf (256, false, GOF.FileIconFlags.USE_THUMBNAILS);
1774 evbox.set_from_pixbuf (pix);
1775
1776
1777=== modified file 'src/View/Resources.vala'
1778--- src/View/Resources.vala 2012-02-18 15:11:11 +0000
1779+++ src/View/Resources.vala 2012-05-12 02:06:17 +0000
1780@@ -1,11 +1,11 @@
1781 namespace Marlin {
1782- public const string APP_TITLE = "Marlin";
1783+ public const string APP_TITLE = "Pantheon Files";
1784 public const string COPYRIGHT = "2010-2012 Marlin Developers";
1785 public const string LAUNCHPAD_LABEL = "Website";
1786- public const string LAUNCHPAD_URL = "http://launchpad.net/marlin";
1787- public const string HELP_URL = "https://answers.launchpad.net/marlin";
1788- public const string BUG_URL = "https://bugs.launchpad.net/marlin/+filebug";
1789- public const string TRANSLATE_URL = "https://translations.launchpad.net/marlin";
1790+ public const string LAUNCHPAD_URL = "http://launchpad.net/pantheon-files";
1791+ public const string HELP_URL = "https://answers.launchpad.net/pantheon-files";
1792+ public const string BUG_URL = "https://bugs.launchpad.net/pantheon-files/+filebug";
1793+ public const string TRANSLATE_URL = "https://translations.launchpad.net/pantheon-files";
1794 public const string COMMENTS = "File Manager";
1795
1796 public const string[] AUTHORS = {
1797
1798=== modified file 'src/View/SettingsDialog.vala'
1799--- src/View/SettingsDialog.vala 2012-05-07 19:03:43 +0000
1800+++ src/View/SettingsDialog.vala 2012-05-12 02:06:17 +0000
1801@@ -20,7 +20,7 @@
1802 *
1803 */
1804
1805-using Varka.Widgets;
1806+using Granite.Widgets;
1807
1808 namespace Marlin.View
1809 {
1810@@ -33,7 +33,7 @@
1811 //width_request = 500;
1812 set_resizable(false);
1813
1814- var mai_notebook = new Varka.Widgets.StaticNotebook();
1815+ var mai_notebook = new Granite.Widgets.StaticNotebook();
1816
1817 var first_vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 3);
1818 first_vbox.border_width = 5;
1819
1820=== modified file 'src/View/Window.vala'
1821--- src/View/Window.vala 2012-02-17 19:31:44 +0000
1822+++ src/View/Window.vala 2012-05-12 02:06:17 +0000
1823@@ -24,7 +24,6 @@
1824 using Gdk;
1825 using Cairo;
1826 using Marlin.View.Chrome;
1827-using Varka.Widgets;
1828 using EelGtk.Window;
1829
1830 namespace Marlin.View {
1831@@ -38,14 +37,14 @@
1832 public Marlin.Places.Sidebar sidebar;
1833
1834 public ViewContainer? current_tab;
1835- public CollapsiblePaned main_box;
1836+ public Granite.Widgets.CollapsiblePaned main_box;
1837 public ContextView? contextview = null;
1838
1839 public Gtk.ActionGroup main_actions;
1840 public Gtk.AccelGroup accel_group;
1841
1842- public Varka.Widgets.ToolButtonWithMenu button_forward;
1843- public Varka.Widgets.ToolButtonWithMenu button_back;
1844+ public Granite.Widgets.ToolButtonWithMenu button_forward;
1845+ public Granite.Widgets.ToolButtonWithMenu button_back;
1846
1847 private const int horizontal_contextplane_max_width = 910;
1848 private const int horizontal_contextplane_max_height = 380; // after which we will go vertical
1849@@ -138,21 +137,22 @@
1850 Preferences.settings.bind("sidebar-icon-size", sidebar, "icon-size", SettingsBindFlags.DEFAULT);
1851
1852 /* Devide main views into sidebars */
1853- main_box = new CollapsiblePaned(Orientation.VERTICAL);
1854+ main_box = new Granite.Widgets.CollapsiblePaned (Orientation.VERTICAL);
1855 main_box.show();
1856
1857- var lside_pane = new HCollapsiblePaned();
1858+ var lside_pane = new Granite.Widgets.CollapsiblePaned (Gtk.Orientation.HORIZONTAL);
1859+ lside_pane.get_style_context ().add_class ("sidebar-pane-separator");
1860 lside_pane.show();
1861
1862 lside_pane.pack1(sidebar, false, false);
1863 lside_pane.pack2(main_box, true, true);
1864- lside_pane.collapse_mode = CollapseMode.LEFT;
1865+ lside_pane.collapse_mode = Granite.CollapseMode.LEFT;
1866
1867 main_box.pack1(tabs, true, true);
1868
1869 ((Gtk.ToggleAction) main_actions.get_action("Show Hide Context Pane")).set_active(Preferences.settings.get_boolean("start-with-contextview"));
1870
1871- main_box.collapse_mode = CollapseMode.RIGHT;
1872+ main_box.collapse_mode = Granite.CollapseMode.BOTTOM;
1873
1874 /*/
1875 /* Pack up all the view
1876@@ -584,7 +584,7 @@
1877 }
1878
1879 protected void show_about() {
1880- Varka.Widgets.show_about_dialog ((Gtk.Window) this,
1881+ Granite.Widgets.show_about_dialog ((Gtk.Window) this,
1882 "program-name", Marlin.APP_TITLE,
1883 "version", Config.VERSION,
1884 "comments", Marlin.COMMENTS,
1885@@ -594,7 +594,7 @@
1886 "website-label", Marlin.LAUNCHPAD_LABEL,
1887 "authors", Marlin.AUTHORS,
1888 "artists", Marlin.ARTISTS,
1889- "logo-icon-name", "marlin",
1890+ "logo-icon-name", Marlin.ICON_ABOUT_LOGO,
1891 "translator-credits", Marlin.TRANSLATORS,
1892 "help", Marlin.HELP_URL,
1893 "translate", Marlin.TRANSLATE_URL,
1894
1895=== modified file 'src/marlin-application.c'
1896--- src/marlin-application.c 2012-02-07 19:56:47 +0000
1897+++ src/marlin-application.c 2012-05-12 02:06:17 +0000
1898@@ -344,6 +344,8 @@
1899 application->priv =
1900 G_TYPE_INSTANCE_GET_PRIVATE (application, MARLIN_TYPE_APPLICATION,
1901 MarlinApplicationPriv);
1902+ /* Some app settings */
1903+ ((GraniteApplication*) application)->program_name = "Files";
1904 }
1905
1906 static void
1907@@ -382,7 +384,7 @@
1908 //g_debug ("%s %d files", G_STRFUNC, n_files);
1909
1910 if (self->priv->debug)
1911- varka_logger_set_DisplayLevel (VARKA_LOG_LEVEL_DEBUG);
1912+ granite_services_logger_set_DisplayLevel (GRANITE_SERVICES_LOG_LEVEL_DEBUG);
1913
1914 /* Create windows. */
1915 if (self->priv->open_intab)
1916@@ -604,15 +606,15 @@
1917 */
1918 G_APPLICATION_CLASS (marlin_application_parent_class)->startup (app);
1919
1920- varka_logger_initialize ("marlin");
1921- varka_logger_set_DisplayLevel (VARKA_LOG_LEVEL_INFO);
1922+ granite_services_logger_initialize ("pantheon-files");
1923+ granite_services_logger_set_DisplayLevel (GRANITE_SERVICES_LOG_LEVEL_INFO);
1924
1925- g_message ("Welcome to Marlin");
1926+ g_message ("Welcome to Pantheon Files");
1927 g_message ("Version: %s", PACKAGE_VERSION);
1928- g_message ("Report any issues/bugs you might find to http://bugs.launchpad.net/marlin");
1929+ g_message ("Report any issues/bugs you might find to http://bugs.launchpad.net/pantheon-files");
1930
1931 if (self->priv->debug)
1932- varka_logger_set_DisplayLevel (VARKA_LOG_LEVEL_DEBUG);
1933+ granite_services_logger_set_DisplayLevel (GRANITE_SERVICES_LOG_LEVEL_DEBUG);
1934
1935 init_schemas ();
1936 init_gtk_accels ();
1937
1938=== modified file 'src/marlin-application.h'
1939--- src/marlin-application.h 2011-11-25 09:21:06 +0000
1940+++ src/marlin-application.h 2012-05-12 02:06:17 +0000
1941@@ -20,6 +20,7 @@
1942 #ifndef __MARLIN_APPLICATION_H__
1943 #define __MARLIN_APPLICATION_H__
1944
1945+#include <granite/granite.h>
1946 #include <gdk/gdk.h>
1947 #include <gio/gio.h>
1948 #include <gtk/gtk.h>
1949@@ -39,13 +40,13 @@
1950 typedef struct _MarlinApplicationPriv MarlinApplicationPriv;
1951
1952 typedef struct {
1953- GtkApplication parent;
1954+ GraniteApplication parent;
1955
1956 MarlinApplicationPriv *priv;
1957 } MarlinApplication;
1958
1959 typedef struct {
1960- GtkApplicationClass parent_class;
1961+ GraniteApplicationClass parent_class;
1962 } MarlinApplicationClass;
1963
1964 GType marlin_application_get_type (void);
1965
1966=== removed file 'src/marlin-ui.xml'
1967--- src/marlin-ui.xml 2012-02-17 19:38:21 +0000
1968+++ src/marlin-ui.xml 1970-01-01 00:00:00 +0000
1969@@ -1,160 +0,0 @@
1970-<ui>
1971-<accelerator action="ZoomInAccel"/>
1972-<accelerator action="ZoomInAccel2"/>
1973-<accelerator action="ZoomOutAccel"/>
1974-<accelerator action="Next Tab" />
1975-<accelerator action="Previous Tab" />
1976-<menubar name="MenuBar">
1977- <menu action="File">
1978- <placeholder name="New Items Placeholder">
1979- <menuitem name="New Tab" action="New Tab"/>
1980- <menuitem name="New Window" action="New Window"/>
1981- </placeholder>
1982- <separator/>
1983- <placeholder name="Open Placeholder"/>
1984- <separator/>
1985- <separator/>
1986- <menuitem name="Connect to Server" action="Connect to Server"/>
1987- <separator/>
1988- <!--<placeholder name="Close Items Placeholder"/>-->
1989- <menuitem name="Close" action="Close"/>
1990- </menu>
1991- <menu name="Edit" action="Edit">
1992- <!--<placeholder name="Undostack Actions"/>
1993- <separator/>-->
1994- <placeholder name="Undostack Actions">
1995- <menuitem name="Undo" action="Undo"/>
1996- <menuitem name="Redo" action="Redo"/>
1997- </placeholder>
1998- <separator/>
1999- <placeholder name="Clipboard Actions"/>
2000- <separator/>
2001- <!--<placeholder name="Select Items"/>-->
2002- <placeholder name="File Items Placeholder"/>
2003- <separator/>
2004- <placeholder name="Dangerous File Actions"/>
2005- <separator/>
2006- <menuitem name="ToolbarEditor" action="ToolbarEditor"/>
2007- <menuitem name="MarlinSettings" action="MarlinSettings"/>
2008- <!--<menu action="ColorMenu">-->
2009- <!-- <menuitem action="set-color-clear" />
2010- <menuitem action="set-color-butter" />
2011- <menuitem action="set-color-orange" />
2012- <menuitem action="set-color-chocolate" />
2013- <menuitem action="set-color-chameleon" />
2014- <menuitem action="set-color-skyblue" />
2015- <menuitem action="set-color-plum" />
2016- <menuitem action="set-color-red" />
2017- <menuitem action="set-color-lightgray" />
2018- <menuitem action="set-color-darkgray" />-->
2019- <!--</menu>-->
2020-
2021- <!--<menuitem name="Preferences" action="Preferences"/>-->
2022- </menu>
2023- <menu action="View">
2024- <!--<menuitem name="Stop" action="Stop"/>-->
2025- <menuitem name="Reload" action="Reload"/>
2026- <separator/>
2027- <!--<menuitem name="Show Hide Toolbar" action="Show Hide Toolbar"/>-->
2028- <menuitem name="Show Hide Context Pane" action="Show Hide Context Pane"/>
2029- <menuitem name="Show Hide Menubar" action="Show Hide Menubar"/>
2030- <menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/>
2031- <separator/>
2032- <menuitem name="Show Hidden Files" action="Show Hidden Files"/>
2033- <menuitem name="Show Desktop Files" action="Show Desktop Files"/>
2034- <placeholder name="View Preferences Placeholder"/>
2035- <separator/>
2036- <placeholder name="View Items Placeholder"/>
2037- <separator/>
2038- <placeholder name="Zoom Items Placeholder">
2039- <menuitem name="Zoom In" action="Zoom In"/>
2040- <menuitem name="Zoom Out" action="Zoom Out"/>
2041- <menuitem name="Zoom Normal" action="Zoom Normal"/>
2042- </placeholder>
2043- <!--<separator/>
2044- <placeholder name="Show Hide Clutter">
2045- <menuitem name="Clutterflow" action="Show Hide Clutter"/>
2046- </placeholder>
2047- <menuitem name="Embed Terminal" action="Show Hide Embed Terminal"/>
2048- <placeholder name="View Choices">
2049- <separator/>
2050- <placeholder name="Extra Viewer"/>
2051- <separator name="Before Short List"/>
2052- <placeholder name="Short List"/>
2053- </placeholder>-->
2054- <separator/>
2055- <menuitem action="view-as-icons" />
2056- <menuitem action="view-as-detailed-list" />
2057- <menuitem action="view-as-compact" />
2058- <menuitem action="view-as-columns" />
2059- </menu>
2060- <menu action="Go">
2061- <menuitem name="Up" action="Up"/>
2062- <menuitem name="Back" action="Back"/>
2063- <menuitem name="Forward" action="Forward"/>
2064- <separator/>
2065- <menuitem name="Home" action="Home"/>
2066- <!--<menuitem name="Computer" action="Go to Computer"/>-->
2067- <menuitem name="Go to Trash" action="Go to Trash"/>
2068- <menuitem name="Go to Network" action="Go to Network"/>
2069- <!-- <menuitem name="Go to Location" action="Go to Location"/>
2070- <menuitem name="Search" action="Search"/>
2071- <separator/>
2072- <placeholder name="History Placeholder"/>-->
2073- </menu>
2074- <!--<menu action="Bookmarks">
2075- <menuitem name="Add Bookmark" action="Add Bookmark"/>
2076- <menuitem name="Edit Bookmark" action="Edit Bookmarks"/>
2077- <separator/>
2078- <placeholder name="Bookmarks Placeholder"/>
2079- </menu>-->
2080- <menu action="Help">
2081- <menuitem name="GetHelp" action="GetHelp"/>
2082- <menuitem name="Translate" action="Translate"/>
2083- <menuitem name="ReportProblem" action="ReportProblem"/>
2084- <separator />
2085- <menuitem name="About" action="About"/>
2086- </menu>
2087-</menubar>
2088-<!--<popup name="background">
2089- <placeholder name="Before Zoom Items">
2090- <placeholder name="New Window Items"/>
2091- <placeholder name="New Object Items"/>
2092- <separator/>
2093- <placeholder name="Extension Actions"/>
2094- </placeholder>
2095- <separator/>
2096- <placeholder name="Zoom Items">
2097- <menuitem name="Zoom Normal" action="Zoom Normal"/>
2098- </placeholder>
2099- <separator/>
2100- <placeholder name="After Zoom Items"/>
2101-</popup>-->
2102-
2103-<popup name="ToolbarMenu" accelerators="false">
2104- <menuitem name="Show Hide Context Pane" action="Show Hide Context Pane"/>
2105- <menuitem name="Show Hide Menubar" action="Show Hide Menubar"/>
2106- <menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/>
2107- <separator/>
2108- <menuitem name="ToolbarEditor" action="ToolbarEditor"/>
2109-</popup>
2110-
2111-<popup name="CompactMenu" accelerators="false">
2112- <menuitem name="New Tab" action="New Tab"/>
2113- <menuitem name="New Window" action="New Window"/>
2114- <separator/>
2115- <menuitem name="Connect to Server" action="Connect to Server"/>
2116- <separator/>
2117- <!--
2118- <menuitem name="Undo" action="Undo"/>
2119- <menuitem name="Redo" action="Redo"/>
2120- <separator/>
2121- <menuitem name="Connect to Server" action="Connect to Server"/>
2122- <separator/>
2123- <menuitem name="Reset to Defaults" action="Reset to Defaults"/>-->
2124- <menuitem name="Show Hidden Files" action="Show Hidden Files"/>
2125- <separator/>
2126- <menuitem name="About" action="About"/>
2127- <menuitem name="MarlinSettings" action="MarlinSettings"/>
2128-</popup>
2129-</ui>
2130
2131=== added file 'src/pantheon-files-ui.xml'
2132--- src/pantheon-files-ui.xml 1970-01-01 00:00:00 +0000
2133+++ src/pantheon-files-ui.xml 2012-05-12 02:06:17 +0000
2134@@ -0,0 +1,160 @@
2135+<ui>
2136+<accelerator action="ZoomInAccel"/>
2137+<accelerator action="ZoomInAccel2"/>
2138+<accelerator action="ZoomOutAccel"/>
2139+<accelerator action="Next Tab" />
2140+<accelerator action="Previous Tab" />
2141+<menubar name="MenuBar">
2142+ <menu action="File">
2143+ <placeholder name="New Items Placeholder">
2144+ <menuitem name="New Tab" action="New Tab"/>
2145+ <menuitem name="New Window" action="New Window"/>
2146+ </placeholder>
2147+ <separator/>
2148+ <placeholder name="Open Placeholder"/>
2149+ <separator/>
2150+ <separator/>
2151+ <menuitem name="Connect to Server" action="Connect to Server"/>
2152+ <separator/>
2153+ <!--<placeholder name="Close Items Placeholder"/>-->
2154+ <menuitem name="Close" action="Close"/>
2155+ </menu>
2156+ <menu name="Edit" action="Edit">
2157+ <!--<placeholder name="Undostack Actions"/>
2158+ <separator/>-->
2159+ <placeholder name="Undostack Actions">
2160+ <menuitem name="Undo" action="Undo"/>
2161+ <menuitem name="Redo" action="Redo"/>
2162+ </placeholder>
2163+ <separator/>
2164+ <placeholder name="Clipboard Actions"/>
2165+ <separator/>
2166+ <!--<placeholder name="Select Items"/>-->
2167+ <placeholder name="File Items Placeholder"/>
2168+ <separator/>
2169+ <placeholder name="Dangerous File Actions"/>
2170+ <separator/>
2171+ <menuitem name="ToolbarEditor" action="ToolbarEditor"/>
2172+ <menuitem name="MarlinSettings" action="MarlinSettings"/>
2173+ <!--<menu action="ColorMenu">-->
2174+ <!-- <menuitem action="set-color-clear" />
2175+ <menuitem action="set-color-butter" />
2176+ <menuitem action="set-color-orange" />
2177+ <menuitem action="set-color-chocolate" />
2178+ <menuitem action="set-color-chameleon" />
2179+ <menuitem action="set-color-skyblue" />
2180+ <menuitem action="set-color-plum" />
2181+ <menuitem action="set-color-red" />
2182+ <menuitem action="set-color-lightgray" />
2183+ <menuitem action="set-color-darkgray" />-->
2184+ <!--</menu>-->
2185+
2186+ <!--<menuitem name="Preferences" action="Preferences"/>-->
2187+ </menu>
2188+ <menu action="View">
2189+ <!--<menuitem name="Stop" action="Stop"/>-->
2190+ <menuitem name="Reload" action="Reload"/>
2191+ <separator/>
2192+ <!--<menuitem name="Show Hide Toolbar" action="Show Hide Toolbar"/>-->
2193+ <menuitem name="Show Hide Context Pane" action="Show Hide Context Pane"/>
2194+ <menuitem name="Show Hide Menubar" action="Show Hide Menubar"/>
2195+ <menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/>
2196+ <separator/>
2197+ <menuitem name="Show Hidden Files" action="Show Hidden Files"/>
2198+ <menuitem name="Show Desktop Files" action="Show Desktop Files"/>
2199+ <placeholder name="View Preferences Placeholder"/>
2200+ <separator/>
2201+ <placeholder name="View Items Placeholder"/>
2202+ <separator/>
2203+ <placeholder name="Zoom Items Placeholder">
2204+ <menuitem name="Zoom In" action="Zoom In"/>
2205+ <menuitem name="Zoom Out" action="Zoom Out"/>
2206+ <menuitem name="Zoom Normal" action="Zoom Normal"/>
2207+ </placeholder>
2208+ <!--<separator/>
2209+ <placeholder name="Show Hide Clutter">
2210+ <menuitem name="Clutterflow" action="Show Hide Clutter"/>
2211+ </placeholder>
2212+ <menuitem name="Embed Terminal" action="Show Hide Embed Terminal"/>
2213+ <placeholder name="View Choices">
2214+ <separator/>
2215+ <placeholder name="Extra Viewer"/>
2216+ <separator name="Before Short List"/>
2217+ <placeholder name="Short List"/>
2218+ </placeholder>-->
2219+ <separator/>
2220+ <menuitem action="view-as-icons" />
2221+ <menuitem action="view-as-detailed-list" />
2222+ <menuitem action="view-as-compact" />
2223+ <menuitem action="view-as-columns" />
2224+ </menu>
2225+ <menu action="Go">
2226+ <menuitem name="Up" action="Up"/>
2227+ <menuitem name="Back" action="Back"/>
2228+ <menuitem name="Forward" action="Forward"/>
2229+ <separator/>
2230+ <menuitem name="Home" action="Home"/>
2231+ <!--<menuitem name="Computer" action="Go to Computer"/>-->
2232+ <menuitem name="Go to Trash" action="Go to Trash"/>
2233+ <menuitem name="Go to Network" action="Go to Network"/>
2234+ <!-- <menuitem name="Go to Location" action="Go to Location"/>
2235+ <menuitem name="Search" action="Search"/>
2236+ <separator/>
2237+ <placeholder name="History Placeholder"/>-->
2238+ </menu>
2239+ <!--<menu action="Bookmarks">
2240+ <menuitem name="Add Bookmark" action="Add Bookmark"/>
2241+ <menuitem name="Edit Bookmark" action="Edit Bookmarks"/>
2242+ <separator/>
2243+ <placeholder name="Bookmarks Placeholder"/>
2244+ </menu>-->
2245+ <menu action="Help">
2246+ <menuitem name="GetHelp" action="GetHelp"/>
2247+ <menuitem name="Translate" action="Translate"/>
2248+ <menuitem name="ReportProblem" action="ReportProblem"/>
2249+ <separator />
2250+ <menuitem name="About" action="About"/>
2251+ </menu>
2252+</menubar>
2253+<!--<popup name="background">
2254+ <placeholder name="Before Zoom Items">
2255+ <placeholder name="New Window Items"/>
2256+ <placeholder name="New Object Items"/>
2257+ <separator/>
2258+ <placeholder name="Extension Actions"/>
2259+ </placeholder>
2260+ <separator/>
2261+ <placeholder name="Zoom Items">
2262+ <menuitem name="Zoom Normal" action="Zoom Normal"/>
2263+ </placeholder>
2264+ <separator/>
2265+ <placeholder name="After Zoom Items"/>
2266+</popup>-->
2267+
2268+<popup name="ToolbarMenu" accelerators="false">
2269+ <menuitem name="Show Hide Context Pane" action="Show Hide Context Pane"/>
2270+ <menuitem name="Show Hide Menubar" action="Show Hide Menubar"/>
2271+ <menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/>
2272+ <separator/>
2273+ <menuitem name="ToolbarEditor" action="ToolbarEditor"/>
2274+</popup>
2275+
2276+<popup name="CompactMenu" accelerators="false">
2277+ <menuitem name="New Tab" action="New Tab"/>
2278+ <menuitem name="New Window" action="New Window"/>
2279+ <separator/>
2280+ <menuitem name="Connect to Server" action="Connect to Server"/>
2281+ <separator/>
2282+ <!--
2283+ <menuitem name="Undo" action="Undo"/>
2284+ <menuitem name="Redo" action="Redo"/>
2285+ <separator/>
2286+ <menuitem name="Connect to Server" action="Connect to Server"/>
2287+ <separator/>
2288+ <menuitem name="Reset to Defaults" action="Reset to Defaults"/>-->
2289+ <menuitem name="Show Hidden Files" action="Show Hidden Files"/>
2290+ <separator/>
2291+ <menuitem name="About" action="About"/>
2292+ <menuitem name="MarlinSettings" action="MarlinSettings"/>
2293+</popup>
2294+</ui>

Subscribers

People subscribed via source and target branches