Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
This commit is contained in:
commit
8a54707dc5
@ -65,6 +65,8 @@
|
||||
#include <nsICommandManager.h>
|
||||
#include <nsIClipboardDragDropHooks.h>
|
||||
|
||||
#define SUGAR_PATH "SUGAR_PATH"
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_PROGRESS,
|
||||
@ -161,9 +163,11 @@ sugar_browser_startup(const char *profile_path, const char *profile_name)
|
||||
NS_ENSURE_TRUE(prefService, FALSE);
|
||||
|
||||
/* Read our predefined default prefs */
|
||||
nsCString pathToPrefs(g_getenv(SUGAR_PATH));
|
||||
pathToPrefs.Append("/data/gecko-prefs.js");
|
||||
|
||||
nsCOMPtr<nsILocalFile> file;
|
||||
NS_NewNativeLocalFile(nsCString(SHARE_DIR"/gecko-prefs.js"),
|
||||
PR_TRUE, getter_AddRefs(file));
|
||||
NS_NewNativeLocalFile(pathToPrefs, PR_TRUE, getter_AddRefs(file));
|
||||
NS_ENSURE_TRUE(file, FALSE);
|
||||
|
||||
rv = prefService->ReadUserPrefs (file);
|
||||
@ -176,7 +180,10 @@ sugar_browser_startup(const char *profile_path, const char *profile_name)
|
||||
prefService->GetBranch ("", getter_AddRefs(pref));
|
||||
NS_ENSURE_TRUE(pref, FALSE);
|
||||
|
||||
pref->SetCharPref ("helpers.private_mime_types_file", SHARE_DIR"/mime.types");
|
||||
nsCString pathToMimeTypes(g_getenv(SUGAR_PATH));
|
||||
pathToMimeTypes.Append("/data/mime.types");
|
||||
|
||||
pref->SetCharPref ("helpers.private_mime_types_file", pathToMimeTypes.get());
|
||||
|
||||
rv = prefService->ReadUserPrefs (nsnull);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -1,2 +1,3 @@
|
||||
application/x-squeak-project pr
|
||||
application/x-abiword abw
|
||||
application/vnd.olpc-x-sugar xo
|
||||
|
@ -237,6 +237,26 @@ class UriListFileType(FileType):
|
||||
return mime_type in cls._types
|
||||
matches_mime_type = classmethod(matches_mime_type)
|
||||
|
||||
class XoFileType(FileType):
|
||||
|
||||
_types = set(['application/vnd.olpc-x-sugar'])
|
||||
|
||||
def get_name(self):
|
||||
return _('Activity package')
|
||||
|
||||
def get_icon(self):
|
||||
return 'theme:stock-missing'
|
||||
|
||||
def get_preview(self):
|
||||
return ''
|
||||
|
||||
def get_activity(self):
|
||||
return ''
|
||||
|
||||
def matches_mime_type(cls, mime_type):
|
||||
return mime_type in cls._types
|
||||
matches_mime_type = classmethod(matches_mime_type)
|
||||
|
||||
class UnknownFileType(FileType):
|
||||
def get_name(self):
|
||||
return _('Object')
|
||||
@ -267,6 +287,7 @@ class TypeRegistry:
|
||||
self._types.append(AbiwordFileType)
|
||||
self._types.append(TextFileType)
|
||||
self._types.append(SqueakProjectFileType)
|
||||
self._types.append(XoFileType)
|
||||
|
||||
def get_type(self, formats):
|
||||
for file_type in self._types:
|
||||
|
Loading…
Reference in New Issue
Block a user