diff --git a/Makefile b/Makefile index 8b17e48..54c721e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PACKAGE = Mailer VERSION = 0.0.0 -SUBDIRS = src +SUBDIRS = data src RM = rm -f LN = ln -f TAR = tar -czvf @@ -21,6 +21,9 @@ dist: $(RM) -r $(PACKAGE)-$(VERSION) $(LN) -s . $(PACKAGE)-$(VERSION) @$(TAR) $(PACKAGE)-$(VERSION).tar.gz \ + $(PACKAGE)-$(VERSION)/data/Makefile \ + $(PACKAGE)-$(VERSION)/data/mailer.desktop \ + $(PACKAGE)-$(VERSION)/data/project.conf \ $(PACKAGE)-$(VERSION)/src/account.c \ $(PACKAGE)-$(VERSION)/src/callbacks.c \ $(PACKAGE)-$(VERSION)/src/common.c \ diff --git a/data/Makefile b/data/Makefile new file mode 100644 index 0000000..14ec345 --- /dev/null +++ b/data/Makefile @@ -0,0 +1,21 @@ +PREFIX = /usr/local +DESTDIR = +MKDIR = mkdir -p +INSTALL = install +RM = rm -f + + +all: + +clean: + +distclean: clean + +install: all + $(MKDIR) $(DESTDIR)$(PREFIX)/share/applications + $(INSTALL) -m 0644 mailer.desktop $(DESTDIR)$(PREFIX)/share/applications/mailer.desktop + +uninstall: + $(RM) $(DESTDIR)$(PREFIX)/share/applications/mailer.desktop + +.PHONY: all clean distclean install uninstall diff --git a/data/mailer.desktop b/data/mailer.desktop new file mode 100644 index 0000000..f14497d --- /dev/null +++ b/data/mailer.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Mail client +Comment=Read and send e-mails and more +Exec=mailer +Icon=stock_mail +Type=Application +Categories=GTK; diff --git a/data/project.conf b/data/project.conf new file mode 100644 index 0000000..a562919 --- /dev/null +++ b/data/project.conf @@ -0,0 +1,4 @@ +dist=Makefile,mailer.desktop + +[mailer.desktop] +install=$(PREFIX)/share/applications diff --git a/project.conf b/project.conf index faf620d..cb09810 100644 --- a/project.conf +++ b/project.conf @@ -2,5 +2,5 @@ package=Mailer version=0.0.0 config=h -subdirs=src +subdirs=data,src dist=Makefile,COPYING,config.h diff --git a/src/mailer.c b/src/mailer.c index c96d0b4..716d1de 100644 --- a/src/mailer.c +++ b/src/mailer.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2008 Pierre Pronchery */ +/* Copyright (c) 2009 Pierre Pronchery */ /* This file is part of DeforaOS Desktop Mailer */ /* Mailer is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License version 2 as published by the Free @@ -156,6 +156,9 @@ Mailer * mailer_new(void) /* widgets */ mailer->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(GTK_WINDOW(mailer->window), 800, 600); +#if GTK_CHECK_VERSION(2, 6, 0) + gtk_window_set_icon_name(GTK_WINDOW(mailer->window), "stock_mail"); +#endif gtk_window_set_title(GTK_WINDOW(mailer->window), "Mailer"); g_signal_connect(G_OBJECT(mailer->window), "delete-event", G_CALLBACK( on_closex), NULL); @@ -362,11 +365,11 @@ static GtkWidget * _new_headers(Mailer * mailer) GtkWidget ** widget; } widgets[] = { - { " Subject: ", &mailer->hdr_subject }, - { " From: ", &mailer->hdr_from }, - { " To: ", &mailer->hdr_to }, - { " Date: ", &mailer->hdr_date }, - { NULL, NULL } + { " Subject: ", NULL }, + { " From: ", NULL }, + { " To: ", NULL }, + { " Date: ", NULL }, + { NULL, NULL } }; int i; GtkWidget * vbox; @@ -375,6 +378,10 @@ static GtkWidget * _new_headers(Mailer * mailer) GtkSizeGroup * group; PangoFontDescription * bold; + widgets[0].widget = &mailer->hdr_subject; + widgets[1].widget = &mailer->hdr_from; + widgets[2].widget = &mailer->hdr_to; + widgets[3].widget = &mailer->hdr_date; vbox = gtk_vbox_new(FALSE, 0); mailer->hdr_vbox = gtk_vbox_new(FALSE, 0); group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);