summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-04-06 19:10:43 (GMT)
committer Simon <simon@hardwired.org.uk>2011-04-08 10:11:30 (GMT)
commit40c4dde34a525ea1a4911c011cabf73f5d93dcc6 (patch)
treeeff651438ad6a2cc7ff08b1795d94b5cc6e67e25 /src
parent6ac508a5de77ad8ec7cdba374ad4731d1ee2665a (diff)
downloadpowder-40c4dde34a525ea1a4911c011cabf73f5d93dcc6.zip
powder-40c4dde34a525ea1a4911c011cabf73f5d93dcc6.tar.gz
Document icons for linux
Diffstat (limited to 'src')
-rw-r--r--src/Resources/icon-document-16.pngbin0 -> 533 bytes
-rw-r--r--src/Resources/icon-document-32.pngbin0 -> 1253 bytes
-rw-r--r--src/misc.c18
3 files changed, 17 insertions, 1 deletions
diff --git a/src/Resources/icon-document-16.png b/src/Resources/icon-document-16.png
new file mode 100644
index 0000000..5e43e8e
--- /dev/null
+++ b/src/Resources/icon-document-16.png
Binary files differ
diff --git a/src/Resources/icon-document-32.png b/src/Resources/icon-document-32.png
new file mode 100644
index 0000000..6b93bda
--- /dev/null
+++ b/src/Resources/icon-document-32.png
Binary files differ
diff --git a/src/misc.c b/src/misc.c
index 78f7ffd..86e3834 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -8,6 +8,7 @@
#include "interface.h"
#include "graphics.h"
#include "powder.h"
+#include <icondoc.h>
#if defined WIN32
#include <windows.h>
#else
@@ -526,7 +527,22 @@ int register_extension()
fclose(f);
system("xdg-mime install powdertoy-save.xml");
system("xdg-desktop-menu install powdertoy-tpt.desktop");
- // TODO: icons
+ f = fopen("powdertoy-save-32.png", "wb");
+ if (!f)
+ return 0;
+ fwrite(icon_doc_32_png, 1, sizeof(icon_doc_32_png), f);
+ fclose(f);
+ f = fopen("powdertoy-save-16.png", "wb");
+ if (!f)
+ return 0;
+ fwrite(icon_doc_16_png, 1, sizeof(icon_doc_16_png), f);
+ fclose(f);
+ system("xdg-icon-resource install --noupdate --context mimetypes --size 32 powdertoy-save-32.png application-vnd.powdertoy.save");
+ system("xdg-icon-resource install --noupdate --context mimetypes --size 16 powdertoy-save-16.png application-vnd.powdertoy.save");
+ system("xdg-icon-resource forceupdate");
+ system("xdg-mime default powdertoy-tpt.desktop application/vnd.powdertoy.save");
+ unlink("powdertoy-save-32.png");
+ unlink("powdertoy-save-16.png");
unlink("powdertoy-save.xml");
unlink("powdertoy-tpt.desktop");
return 1;