Re-implemented part of the Compose window, adapted to newer icon themes

This commit is contained in:
Pierre Pronchery 2010-10-24 20:27:20 +00:00
parent fcef7fc1d3
commit 4e40d4ec02
35 changed files with 480 additions and 250 deletions

View File

@ -24,6 +24,20 @@ dist:
$(PACKAGE)-$(VERSION)/data/Makefile \ $(PACKAGE)-$(VERSION)/data/Makefile \
$(PACKAGE)-$(VERSION)/data/mailer.desktop \ $(PACKAGE)-$(VERSION)/data/mailer.desktop \
$(PACKAGE)-$(VERSION)/data/project.conf \ $(PACKAGE)-$(VERSION)/data/project.conf \
$(PACKAGE)-$(VERSION)/data/24x24/Makefile \
$(PACKAGE)-$(VERSION)/data/24x24/mailer.png \
$(PACKAGE)-$(VERSION)/data/24x24/mailer-accounts.png \
$(PACKAGE)-$(VERSION)/data/24x24/mailer-drafts.png \
$(PACKAGE)-$(VERSION)/data/24x24/mailer-inbox.png \
$(PACKAGE)-$(VERSION)/data/24x24/mailer-outbox.png \
$(PACKAGE)-$(VERSION)/data/24x24/mailer-sent.png \
$(PACKAGE)-$(VERSION)/data/24x24/project.conf \
$(PACKAGE)-$(VERSION)/data/48x48/Makefile \
$(PACKAGE)-$(VERSION)/data/48x48/mailer.png \
$(PACKAGE)-$(VERSION)/data/48x48/mailer-inbox.png \
$(PACKAGE)-$(VERSION)/data/48x48/mailer-outbox.png \
$(PACKAGE)-$(VERSION)/data/48x48/mailer-sent.png \
$(PACKAGE)-$(VERSION)/data/48x48/project.conf \
$(PACKAGE)-$(VERSION)/include/Mailer.h \ $(PACKAGE)-$(VERSION)/include/Mailer.h \
$(PACKAGE)-$(VERSION)/include/Makefile \ $(PACKAGE)-$(VERSION)/include/Makefile \
$(PACKAGE)-$(VERSION)/include/project.conf \ $(PACKAGE)-$(VERSION)/include/project.conf \

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

BIN
data/16x16/mailer-inbox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

BIN
data/16x16/mailer-sent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

BIN
data/16x16/mailer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

19
data/16x16/project.conf Normal file
View File

@ -0,0 +1,19 @@
dist=Makefile,mailer.png,mailer-accounts.png,mailer-drafts.png,mailer-inbox.png,mailer-outbox.png,mailer-sent.png
[mailer.png]
install=$(PREFIX)/share/icons/hicolor/16x16/apps
[mailer-accounts.png]
install=$(PREFIX)/share/icons/hicolor/16x16/apps
[mailer-drafts.png]
install=$(PREFIX)/share/icons/hicolor/16x16/apps
[mailer-inbox.png]
install=$(PREFIX)/share/icons/hicolor/16x16/apps
[mailer-outbox.png]
install=$(PREFIX)/share/icons/hicolor/16x16/apps
[mailer-sent.png]
install=$(PREFIX)/share/icons/hicolor/16x16/apps

36
data/24x24/Makefile Normal file
View File

@ -0,0 +1,36 @@
PREFIX = /usr/local
DESTDIR =
MKDIR = mkdir -p
INSTALL = install
RM = rm -f
all:
clean:
distclean: clean
install: all
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps
$(INSTALL) -m 0644 -- mailer.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps
$(INSTALL) -m 0644 -- mailer-accounts.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer-accounts.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps
$(INSTALL) -m 0644 -- mailer-drafts.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer-drafts.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps
$(INSTALL) -m 0644 -- mailer-inbox.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer-inbox.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps
$(INSTALL) -m 0644 -- mailer-outbox.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer-outbox.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps
$(INSTALL) -m 0644 -- mailer-sent.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer-sent.png
uninstall:
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer-accounts.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer-drafts.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer-inbox.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer-outbox.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/mailer-sent.png
.PHONY: all clean distclean install uninstall

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

BIN
data/24x24/mailer-inbox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 B

BIN
data/24x24/mailer-sent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
data/24x24/mailer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

19
data/24x24/project.conf Normal file
View File

@ -0,0 +1,19 @@
dist=Makefile,mailer.png,mailer-accounts.png,mailer-drafts.png,mailer-inbox.png,mailer-outbox.png,mailer-sent.png
[mailer.png]
install=$(PREFIX)/share/icons/hicolor/24x24/apps
[mailer-accounts.png]
install=$(PREFIX)/share/icons/hicolor/24x24/apps
[mailer-drafts.png]
install=$(PREFIX)/share/icons/hicolor/24x24/apps
[mailer-inbox.png]
install=$(PREFIX)/share/icons/hicolor/24x24/apps
[mailer-outbox.png]
install=$(PREFIX)/share/icons/hicolor/24x24/apps
[mailer-sent.png]
install=$(PREFIX)/share/icons/hicolor/24x24/apps

30
data/48x48/Makefile Normal file
View File

@ -0,0 +1,30 @@
PREFIX = /usr/local
DESTDIR =
MKDIR = mkdir -p
INSTALL = install
RM = rm -f
all:
clean:
distclean: clean
install: all
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps
$(INSTALL) -m 0644 -- mailer.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/mailer.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps
$(INSTALL) -m 0644 -- mailer-inbox.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/mailer-inbox.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps
$(INSTALL) -m 0644 -- mailer-outbox.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/mailer-outbox.png
$(MKDIR) $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps
$(INSTALL) -m 0644 -- mailer-sent.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/mailer-sent.png
uninstall:
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/mailer.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/mailer-inbox.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/mailer-outbox.png
$(RM) -- $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/mailer-sent.png
.PHONY: all clean distclean install uninstall

BIN
data/48x48/mailer-inbox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
data/48x48/mailer-sent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
data/48x48/mailer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

13
data/48x48/project.conf Normal file
View File

@ -0,0 +1,13 @@
dist=Makefile,mailer.png,mailer-inbox.png,mailer-outbox.png,mailer-sent.png
[mailer.png]
install=$(PREFIX)/share/icons/hicolor/48x48/apps
[mailer-inbox.png]
install=$(PREFIX)/share/icons/hicolor/48x48/apps
[mailer-outbox.png]
install=$(PREFIX)/share/icons/hicolor/48x48/apps
[mailer-sent.png]
install=$(PREFIX)/share/icons/hicolor/48x48/apps

View File

@ -1,3 +1,4 @@
SUBDIRS = 24x24 48x48
PREFIX = /usr/local PREFIX = /usr/local
DESTDIR = DESTDIR =
MKDIR = mkdir -p MKDIR = mkdir -p
@ -5,17 +6,24 @@ INSTALL = install
RM = rm -f RM = rm -f
all: all: subdirs
subdirs:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE)) || exit; done
clean: clean:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done
distclean: clean distclean:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) distclean) || exit; done
install: all install: all
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) install) || exit; done
$(MKDIR) $(DESTDIR)$(PREFIX)/share/applications $(MKDIR) $(DESTDIR)$(PREFIX)/share/applications
$(INSTALL) -m 0644 -- mailer.desktop $(DESTDIR)$(PREFIX)/share/applications/mailer.desktop $(INSTALL) -m 0644 -- mailer.desktop $(DESTDIR)$(PREFIX)/share/applications/mailer.desktop
uninstall: uninstall:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done
$(RM) -- $(DESTDIR)$(PREFIX)/share/applications/mailer.desktop $(RM) -- $(DESTDIR)$(PREFIX)/share/applications/mailer.desktop
.PHONY: all clean distclean install uninstall .PHONY: all subdirs clean distclean install uninstall

View File

@ -1,3 +1,4 @@
subdirs=24x24,48x48
dist=Makefile,mailer.desktop dist=Makefile,mailer.desktop
[mailer.desktop] [mailer.desktop]

246
po/fr.po
View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Mailer 0.0.0\n" "Project-Id-Version: Mailer 0.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-10-22 15:22+0200\n" "POT-Creation-Date: 2010-10-24 22:12+0200\n"
"PO-Revision-Date: 2010-10-02 23:25+0200\n" "PO-Revision-Date: 2010-10-02 23:25+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n" "Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: French\n" "Language-Team: French\n"
@ -16,256 +16,288 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: ../src/compose.c:75 #: ../src/compose.c:73
msgid "_New message" msgid "_New message"
msgstr "_Nouveau message" msgstr "_Nouveau message"
#: ../src/compose.c:78 #: ../src/compose.c:76
msgid "_Save" msgid "_Save"
msgstr "_Enregistrer" msgstr "_Enregistrer"
#: ../src/compose.c:79 #: ../src/compose.c:77
msgid "Save _as..." msgid "Save _as..."
msgstr "Enregistrer _sous..." msgstr "Enregistrer _sous..."
#: ../src/compose.c:81 ../src/mailer.c:97 #: ../src/compose.c:79 ../src/mailer.c:110
msgid "_Print" msgid "_Print"
msgstr "_Imprimer" msgstr "_Imprimer"
#: ../src/compose.c:82 ../src/mailer.c:98 #: ../src/compose.c:80 ../src/mailer.c:111
msgid "Print pre_view" msgid "Print pre_view"
msgstr "_Aperçu avant impression" msgstr "_Aperçu avant impression"
#: ../src/compose.c:85 #: ../src/compose.c:83
msgid "S_end" msgid "S_end"
msgstr "En_voyer" msgstr "En_voyer"
#: ../src/compose.c:88 #: ../src/compose.c:86
msgid "_Close" msgid "_Close"
msgstr "_Fermer" msgstr "_Fermer"
#: ../src/compose.c:95 #: ../src/compose.c:93
msgid "_Undo" msgid "_Undo"
msgstr "_Annuler" msgstr "_Annuler"
#: ../src/compose.c:96 #: ../src/compose.c:94
msgid "_Redo" msgid "_Redo"
msgstr "_Refaire" msgstr "_Refaire"
#: ../src/compose.c:98 ../src/mailer.c:112 #: ../src/compose.c:96 ../src/mailer.c:125
msgid "_Select all" msgid "_Select all"
msgstr "Sélectionner tout" msgstr "Sélectionner tout"
#: ../src/compose.c:105 ../src/mailer.c:119 #: ../src/compose.c:103 ../src/mailer.c:132
msgid "_Unselect all" msgid "_Unselect all"
msgstr "Tout désélectionner" msgstr "Tout désélectionner"
#: ../src/compose.c:107 ../src/mailer.c:108 #: ../src/compose.c:105 ../src/mailer.c:121
msgid "_Cut" msgid "_Cut"
msgstr "Co_uper" msgstr "Co_uper"
#: ../src/compose.c:108 #: ../src/compose.c:106
msgid "_Copy" msgid "_Copy"
msgstr "_Copier" msgstr "_Copier"
#: ../src/compose.c:109 ../src/mailer.c:110 #: ../src/compose.c:107 ../src/mailer.c:123
msgid "_Paste" msgid "_Paste"
msgstr "C_oller" msgstr "C_oller"
#: ../src/compose.c:115 #: ../src/compose.c:113
msgid "_CC field" msgid "Add field"
msgstr "Champ _CC" msgstr "Ajouter un champ"
#: ../src/compose.c:116 #: ../src/compose.c:120 ../src/compose.c:123 ../src/mailer.c:159
msgid "_BCC field" #: ../src/mailer.c:161
msgstr "Champ _BCC"
#: ../src/compose.c:123 ../src/compose.c:126 ../src/mailer.c:146
#: ../src/mailer.c:148
msgid "_About" msgid "_About"
msgstr "_A propos" msgstr "_A propos"
#: ../src/compose.c:133 ../src/mailer.c:155 #: ../src/compose.c:130 ../src/mailer.c:168
msgid "_File" msgid "_File"
msgstr "_Fichier" msgstr "_Fichier"
#: ../src/compose.c:134 ../src/mailer.c:156 #: ../src/compose.c:131 ../src/mailer.c:169
msgid "_Edit" msgid "_Edit"
msgstr "_Edition" msgstr "_Edition"
#: ../src/compose.c:135 #: ../src/compose.c:132
msgid "_View" msgid "_View"
msgstr "_Vue" msgstr "_Vue"
#: ../src/compose.c:136 ../src/mailer.c:158 #: ../src/compose.c:133 ../src/mailer.c:171
msgid "_Help" msgid "_Help"
msgstr "_Aide" msgstr "_Aide"
#: ../src/compose.c:143 #: ../src/compose.c:140
msgid "Send" msgid "Send"
msgstr "Envoyer" msgstr "Envoyer"
#: ../src/compose.c:146 #: ../src/compose.c:143
msgid "Save" msgid "Save"
msgstr "Enregistrer" msgstr "Enregistrer"
#: ../src/compose.c:148 #: ../src/compose.c:145
msgid "Cut"
msgstr "Couper"
#: ../src/compose.c:146
msgid "Copy"
msgstr "Copier"
#: ../src/compose.c:147
msgid "Paste"
msgstr "Coller"
#: ../src/compose.c:149
msgid "Attach" msgid "Attach"
msgstr "Attacher" msgstr "Attacher"
#: ../src/compose.c:177 #: ../src/compose.c:185
msgid " - Compose" msgid " - Compose"
msgstr " - Composer" msgstr " - Composer"
#: ../src/compose.c:194 ../src/mailer.c:570 #: ../src/compose.c:201
msgid " From: " msgid "From: "
msgstr " De: " msgstr "De: "
#: ../src/compose.c:207 ../src/mailer.c:571 #: ../src/compose.c:226
msgid " To: " msgid "To:"
msgstr " À: " msgstr "À:"
#: ../src/compose.c:220 #: ../src/compose.c:229
msgid " CC: " msgid "Cc:"
msgstr "Cc:"
#: ../src/compose.c:232
msgid "Bcc:"
msgstr "Ccc"
#: ../src/compose.c:236
msgid "Reply-To:"
msgstr "Répondre à:"
#: ../src/compose.c:239
msgid "Newsgroup:"
msgstr "" msgstr ""
#: ../src/compose.c:233 #: ../src/compose.c:242
msgid " BCC: " msgid "Followup-To:"
msgstr "" msgstr "Suivre sur:"
#: ../src/compose.c:246 ../src/mailer.c:569 #: ../src/compose.c:268
msgid " Subject: " msgid "Subject: "
msgstr " Sujet: " msgstr "Sujet: "
#: ../src/compose.c:408 #: ../src/compose.c:461
msgid "Sending mail..." msgid "Sending mail..."
msgstr "Envoi du message..." msgstr "Envoi du message..."
#: ../src/compose.c:415 #: ../src/compose.c:468
msgid "Progression: " msgid "Progression: "
msgstr "" msgstr "Progression: "
#: ../src/mailer.c:85 #: ../src/mailer.c:98
msgid "New account" msgid "New account"
msgstr "Nouveau compte" msgstr "Nouveau compte"
#: ../src/mailer.c:85 #: ../src/mailer.c:98
msgid "Account settings" msgid "Account settings"
msgstr "Paramètres du compte" msgstr "Paramètres du compte"
#: ../src/mailer.c:85 #: ../src/mailer.c:98
msgid "Account confirmation" msgid "Account confirmation"
msgstr "Confirmation du compte" msgstr "Confirmation du compte"
#: ../src/mailer.c:91 #: ../src/mailer.c:104
msgid "_New mail" msgid "_New mail"
msgstr "_Nouveau message" msgstr "_Nouveau message"
#: ../src/mailer.c:94 ../src/mailer.c:168 #: ../src/mailer.c:107 ../src/mailer.c:181
msgid "Send / Receive" msgid "Send / Receive"
msgstr "Envoyer / Recevoir" msgstr "Envoyer / Recevoir"
#: ../src/mailer.c:101 #: ../src/mailer.c:114
msgid "_Quit" msgid "_Quit"
msgstr "_Quitter" msgstr "_Quitter"
#: ../src/mailer.c:109 #: ../src/mailer.c:122
msgid "Cop_y" msgid "Cop_y"
msgstr "_Copier" msgstr "_Copier"
#: ../src/mailer.c:121 #: ../src/mailer.c:134
msgid "_Preferences" msgid "_Preferences"
msgstr "_Préférences" msgstr "_Préférences"
#: ../src/mailer.c:128 #: ../src/mailer.c:141
msgid "_Reply" msgid "_Reply"
msgstr "_Répondre" msgstr "_Répondre"
#: ../src/mailer.c:130 #: ../src/mailer.c:143
msgid "Reply to _all" msgid "Reply to _all"
msgstr "Répondre à _tous" msgstr "Répondre à _tous"
#: ../src/mailer.c:132 #: ../src/mailer.c:145
msgid "_Forward" msgid "_Forward"
msgstr "_Transmettre" msgstr "_Transmettre"
#: ../src/mailer.c:135 #: ../src/mailer.c:148
msgid "_Delete" msgid "_Delete"
msgstr "_Supprimer" msgstr "_Supprimer"
#: ../src/mailer.c:138 #: ../src/mailer.c:151
msgid "_View source" msgid "_View source"
msgstr "Afficher la _source" msgstr "Afficher la _source"
#: ../src/mailer.c:157 #: ../src/mailer.c:170
msgid "_Message" msgid "_Message"
msgstr "_Message" msgstr "_Message"
#: ../src/mailer.c:165 #: ../src/mailer.c:178
msgid "New mail" msgid "New mail"
msgstr "Nouveau message" msgstr "Nouveau message"
#: ../src/mailer.c:169 #: ../src/mailer.c:182
msgid "Stop" msgid "Stop"
msgstr "Stop" msgstr "Stop"
#: ../src/mailer.c:171 #: ../src/mailer.c:184
msgid "Reply" msgid "Reply"
msgstr "Répondre" msgstr "Répondre"
#: ../src/mailer.c:172 #: ../src/mailer.c:185
msgid "Reply to all" msgid "Reply to all"
msgstr "Répondre à tous" msgstr "Répondre à tous"
#: ../src/mailer.c:174 #: ../src/mailer.c:187
msgid "Forward" msgid "Forward"
msgstr "Transmettre" msgstr "Transmettre"
#: ../src/mailer.c:176 #: ../src/mailer.c:189
msgid "Delete" msgid "Delete"
msgstr "Supprimer" msgstr "Supprimer"
#: ../src/mailer.c:177 #: ../src/mailer.c:190
msgid "Print" msgid "Print"
msgstr "Imprimer" msgstr "Imprimer"
#: ../src/mailer.c:180 #: ../src/mailer.c:193
msgid "Preferences" msgid "Preferences"
msgstr "Préférences" msgstr "Préférences"
#: ../src/mailer.c:260 #: ../src/mailer.c:273
msgid "Mailer" msgid "Mailer"
msgstr "Mailer" msgstr "Mailer"
#: ../src/mailer.c:395 #: ../src/mailer.c:408
msgid "Folders" msgid "Folders"
msgstr "Dossiers" msgstr "Dossiers"
#: ../src/mailer.c:463 #: ../src/mailer.c:476
msgid "Subject" msgid "Subject"
msgstr "Sujet" msgstr "Sujet"
#: ../src/mailer.c:465 #: ../src/mailer.c:478
msgid "From" msgid "From"
msgstr "De" msgstr "De"
#: ../src/mailer.c:467 #: ../src/mailer.c:480
msgid "To" msgid "To"
msgstr "À" msgstr "À"
#: ../src/mailer.c:469 #: ../src/mailer.c:482
msgid "Date" msgid "Date"
msgstr "Date" msgstr "Date"
#: ../src/mailer.c:572 #: ../src/mailer.c:582
msgid " Subject: "
msgstr " Sujet: "
#: ../src/mailer.c:583
msgid " From: "
msgstr " De: "
#: ../src/mailer.c:584
msgid " To: "
msgstr " À: "
#: ../src/mailer.c:585
msgid " Date: " msgid " Date: "
msgstr " Date: " msgstr " Date: "
#: ../src/mailer.c:706 ../src/mailer.c:711 #: ../src/mailer.c:719 ../src/mailer.c:724
msgid "Error" msgid "Error"
msgstr "Erreur" msgstr "Erreur"
#: ../src/mailer.c:809 #: ../src/mailer.c:823
msgid "" msgid ""
"The messages selected will be deleted.\n" "The messages selected will be deleted.\n"
"Continue?" "Continue?"
@ -273,112 +305,112 @@ msgstr ""
"Les messages sélectionnés vont être effacés.\n" "Les messages sélectionnés vont être effacés.\n"
"Continuer?" "Continuer?"
#: ../src/mailer.c:881 #: ../src/mailer.c:895
msgid "Mailer - View source" msgid "Mailer - View source"
msgstr "Mailer - Source" msgstr "Mailer - Source"
#: ../src/mailer.c:925 #: ../src/mailer.c:941
msgid "Re: " msgid "Re: "
msgstr "Re: " msgstr "Re: "
#: ../src/mailer.c:1064 #: ../src/mailer.c:1080
msgid "Mailer preferences" msgid "Mailer preferences"
msgstr "Préférences de Mailer" msgstr "Préférences de Mailer"
#: ../src/mailer.c:1100 #: ../src/mailer.c:1116
msgid "Enabled" msgid "Enabled"
msgstr "Actif" msgstr "Actif"
#: ../src/mailer.c:1104 #: ../src/mailer.c:1120
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: ../src/mailer.c:1108 #: ../src/mailer.c:1124
msgid "Type" msgid "Type"
msgstr "Type" msgstr "Type"
#: ../src/mailer.c:1132 #: ../src/mailer.c:1148
msgid "Accounts" msgid "Accounts"
msgstr "Comptes" msgstr "Comptes"
#: ../src/mailer.c:1139 #: ../src/mailer.c:1155
msgid "Messages font:" msgid "Messages font:"
msgstr "Police des messages:" msgstr "Police des messages:"
#: ../src/mailer.c:1149 #: ../src/mailer.c:1165
msgid "Display" msgid "Display"
msgstr "Affichage" msgstr "Affichage"
#: ../src/mailer.c:1231 #: ../src/mailer.c:1247
msgid "No account plug-in available" msgid "No account plug-in available"
msgstr "Aucun greffon de compte disponible" msgstr "Aucun greffon de compte disponible"
#: ../src/mailer.c:1386 ../src/mailer.c:1664 #: ../src/mailer.c:1402 ../src/mailer.c:1680
msgid "Account name" msgid "Account name"
msgstr "Nom du compte" msgstr "Nom du compte"
#: ../src/mailer.c:1393 #: ../src/mailer.c:1409
msgid "Your name" msgid "Your name"
msgstr "Votre nom" msgstr "Votre nom"
#: ../src/mailer.c:1400 #: ../src/mailer.c:1416
msgid "e-mail address" msgid "e-mail address"
msgstr "Adresse e-mail" msgstr "Adresse e-mail"
#: ../src/mailer.c:1407 #: ../src/mailer.c:1423
msgid "Type of account" msgid "Type of account"
msgstr "Type de compte" msgstr "Type de compte"
#: ../src/mailer.c:1556 #: ../src/mailer.c:1572
msgid "Choose file" msgid "Choose file"
msgstr "Choisir un fichier" msgstr "Choisir un fichier"
#: ../src/mailer.c:1733 #: ../src/mailer.c:1749
msgid "hidden" msgid "hidden"
msgstr "masqué" msgstr "masqué"
#: ../src/mailer.c:1767 #: ../src/mailer.c:1783
msgid "Yes" msgid "Yes"
msgstr "Oui" msgstr "Oui"
#: ../src/mailer.c:1767 #: ../src/mailer.c:1783
msgid "No" msgid "No"
msgstr "Non" msgstr "Non"
#: ../src/mailer.c:1795 #: ../src/mailer.c:1811
msgid "Account type " msgid "Account type "
msgstr "Type de compte " msgstr "Type de compte "
#: ../src/mailer.c:1796 #: ../src/mailer.c:1812
msgid " active\n" msgid " active\n"
msgstr " actif\n" msgstr " actif\n"
#: ../src/mailer.c:1840 #: ../src/mailer.c:1856
msgid "Edit account: " msgid "Edit account: "
msgstr "Modification du compte: " msgstr "Modification du compte: "
#: ../src/mailer.c:1907 #: ../src/mailer.c:1923
msgid "An error occured while saving preferences" msgid "An error occured while saving preferences"
msgstr "Une erreur est survenue pendant la sauvegarde des préférences" msgstr "Une erreur est survenue pendant la sauvegarde des préférences"
#: ../src/mailer.c:2041 ../src/mailer.c:2046 #: ../src/mailer.c:2057 ../src/mailer.c:2062
msgid "Question" msgid "Question"
msgstr "Question" msgstr "Question"
#: ../src/mailer.c:2115 #: ../src/mailer.c:2131
#, c-format #, c-format
msgid "%s/%s: %d %s" msgid "%s/%s: %d %s"
msgstr "%s/%s: %d %s" msgstr "%s/%s: %d %s"
#: ../src/mailer.c:2118 #: ../src/mailer.c:2134
msgid "messages" msgid "messages"
msgstr "messages" msgstr "messages"
#: ../src/mailer.c:2118 #: ../src/mailer.c:2134
msgid "message" msgid "message"
msgstr "message" msgstr "message"
#: ../src/mailer.c:2121 #: ../src/mailer.c:2137
msgid "Ready" msgid "Ready"
msgstr "Prêt" msgstr "Prêt"

View File

@ -40,7 +40,7 @@ mailer.o: mailer.c account.h callbacks.h compose.h mailer.h ../config.h
$(CC) -D PREFIX=\"$(PREFIX)\" $(mailer_CFLAGS) -c mailer.c $(CC) -D PREFIX=\"$(PREFIX)\" $(mailer_CFLAGS) -c mailer.c
main.o: main.c mailer.h ../config.h main.o: main.c mailer.h ../config.h
$(CC) $(mailer_CFLAGS) -c main.c $(CC) -D PREFIX=\"$(PREFIX)\" $(mailer_CFLAGS) -c main.c
clean: clean:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done @for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean) || exit; done

View File

@ -23,9 +23,20 @@
#include <dlfcn.h> #include <dlfcn.h>
#include "mailer.h" #include "mailer.h"
#include "account.h" #include "account.h"
#include "../config.h"
/* constants */ /* constants */
#ifndef PREFIX
# define PREFIX "/usr/local"
#endif
#ifndef LIBDIR
# define LIBDIR PREFIX "/lib"
#endif
#ifndef PLUGINDIR
# define PLUGINDIR LIBDIR "/Mailer"
#endif
#define ACCOUNT "account" #define ACCOUNT "account"

View File

@ -88,7 +88,7 @@ static MboxFolder _mbox_inbox =
&_mbox_config[0], NULL, 0, NULL, &_mbox_config[0], NULL, 0, NULL,
0, NULL, -1, 0, NULL, -1,
0, PC_FROM, NULL, 0, NULL, 0, PC_FROM, NULL, 0, NULL,
"stock_inbox" "mailer-inbox"
}; };
static MboxFolder _mbox_spool = static MboxFolder _mbox_spool =
@ -96,7 +96,7 @@ static MboxFolder _mbox_spool =
&_mbox_config[1], NULL, 0, NULL, &_mbox_config[1], NULL, 0, NULL,
0, NULL, -1, 0, NULL, -1,
0, PC_FROM, NULL, 0, NULL, 0, PC_FROM, NULL, 0, NULL,
"stock_inbox" "mailer-inbox"
}; };
static MboxFolder _mbox_drafts = static MboxFolder _mbox_drafts =
@ -112,7 +112,7 @@ static MboxFolder _mbox_sent =
&_mbox_config[3], NULL, 0, NULL, &_mbox_config[3], NULL, 0, NULL,
0, NULL, -1, 0, NULL, -1,
0, PC_FROM, NULL, 0, NULL, 0, PC_FROM, NULL, 0, NULL,
"stock_sent-mail" "mailer-sent"
}; };
static MboxFolder _mbox_trash = static MboxFolder _mbox_trash =

View File

@ -238,21 +238,12 @@ void on_compose_file_close(gpointer data)
/* compose view menu */ /* compose view menu */
/* on_compose_view_cc */ /* on_compose_view_add_field */
void on_compose_view_cc(gpointer data) void on_compose_view_add_field(gpointer data)
{ {
Compose * compose = data; Compose * compose = data;
compose_toggle_show_cc(compose); compose_add_field(compose, NULL, NULL);
}
/* on_compose_view_bcc */
void on_compose_view_bcc(gpointer data)
{
Compose * compose = data;
compose_toggle_show_bcc(compose);
} }

View File

@ -79,8 +79,7 @@ void on_compose_edit_copy(gpointer data);
void on_compose_edit_paste(gpointer data); void on_compose_edit_paste(gpointer data);
/* view menu */ /* view menu */
void on_compose_view_cc(gpointer data); void on_compose_view_add_field(gpointer data);
void on_compose_view_bcc(gpointer data);
/* help menu */ /* help menu */
void on_compose_help_about(gpointer data); void on_compose_help_about(gpointer data);

View File

@ -53,11 +53,9 @@ struct _Compose
/* widgets */ /* widgets */
GtkWidget * window; GtkWidget * window;
GtkWidget * from; GtkWidget * from;
GtkWidget * to; GtkListStore * h_store;
GtkWidget * tb_cc; GtkListStore * h_headers;
GtkWidget * cc; GtkWidget * h_view;
GtkWidget * tb_bcc;
GtkWidget * bcc;
GtkWidget * subject; GtkWidget * subject;
GtkWidget * view; GtkWidget * view;
GtkWidget * statusbar; GtkWidget * statusbar;
@ -112,8 +110,7 @@ static DesktopMenu _menu_edit[] =
static DesktopMenu _menu_view[] = static DesktopMenu _menu_view[] =
{ {
{ N_("_CC field"), G_CALLBACK(on_compose_view_cc), NULL, 0, 0 }, { N_("Add field"), G_CALLBACK(on_compose_view_add_field), NULL, 0, 0 },
{ N_("_BCC field"), G_CALLBACK(on_compose_view_bcc), NULL, 0, 0 },
{ NULL, NULL, NULL, 0, 0 } { NULL, NULL, NULL, 0, 0 }
}; };
@ -145,6 +142,10 @@ static DesktopToolbar _compose_toolbar[] =
{ "", NULL, NULL, 0, 0, NULL }, { "", NULL, NULL, 0, 0, NULL },
{ N_("Save"), G_CALLBACK(on_compose_save), GTK_STOCK_SAVE, 0, 0, NULL }, { N_("Save"), G_CALLBACK(on_compose_save), GTK_STOCK_SAVE, 0, 0, NULL },
{ "", NULL, NULL, 0, 0, NULL }, { "", NULL, NULL, 0, 0, NULL },
{ N_("Cut"), NULL, GTK_STOCK_CUT, 0, 0, NULL },
{ N_("Copy"), NULL, GTK_STOCK_COPY, 0, 0, NULL },
{ N_("Paste"), NULL, GTK_STOCK_PASTE, 0, 0, NULL },
{ "", NULL, NULL, 0, 0, NULL },
{ N_("Attach"), NULL, "stock_attach", 0, 0, NULL }, { N_("Attach"), NULL, "stock_attach", 0, 0, NULL },
{ NULL, NULL, NULL, 0, 0, NULL } { NULL, NULL, NULL, 0, 0, NULL }
}; };
@ -153,6 +154,10 @@ static DesktopToolbar _compose_toolbar[] =
/* public */ /* public */
/* compose_new */ /* compose_new */
static GtkWidget * _new_text_view(Mailer * mailer); static GtkWidget * _new_text_view(Mailer * mailer);
static void _on_header_field_edited(GtkCellRendererText * renderer,
gchar * path, gchar * text, gpointer data);
static void _on_header_edited(GtkCellRendererText * renderer, gchar * path,
gchar * text, gpointer data);
Compose * compose_new(Mailer * mailer) Compose * compose_new(Mailer * mailer)
{ {
@ -163,6 +168,9 @@ Compose * compose_new(Mailer * mailer)
GtkToolItem * toolitem; GtkToolItem * toolitem;
GtkSizeGroup * sizegroup; GtkSizeGroup * sizegroup;
GtkWidget * widget; GtkWidget * widget;
GtkCellRenderer * renderer;
GtkTreeViewColumn * column;
GtkTreeIter iter;
if((compose = malloc(sizeof(*compose))) == NULL) if((compose = malloc(sizeof(*compose))) == NULL)
{ {
@ -187,11 +195,12 @@ Compose * compose_new(Mailer * mailer)
/* toolbar */ /* toolbar */
toolbar = desktop_toolbar_create(_compose_toolbar, compose, group); toolbar = desktop_toolbar_create(_compose_toolbar, compose, group);
gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, TRUE, 0);
/* FIXME make these fields a GtkTreeView */
/* from */ /* from */
sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
toolbar = gtk_toolbar_new(); toolbar = gtk_toolbar_new();
widget = gtk_label_new(_(" From: ")); widget = gtk_label_new(_("From: "));
gtk_misc_set_alignment(GTK_MISC(widget), 0.1, 0.5);
gtk_widget_set_size_request(widget, 80, -1);
gtk_size_group_add_widget(sizegroup, widget); gtk_size_group_add_widget(sizegroup, widget);
toolitem = gtk_tool_item_new(); toolitem = gtk_tool_item_new();
gtk_container_add(GTK_CONTAINER(toolitem), widget); gtk_container_add(GTK_CONTAINER(toolitem), widget);
@ -202,48 +211,63 @@ Compose * compose_new(Mailer * mailer)
gtk_container_add(GTK_CONTAINER(toolitem), compose->from); gtk_container_add(GTK_CONTAINER(toolitem), compose->from);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolitem, -1); gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolitem, -1);
gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
/* to */ /* headers */
toolbar = gtk_toolbar_new(); widget = gtk_scrolled_window_new(NULL, NULL);
widget = gtk_label_new(_(" To: ")); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(widget),
gtk_size_group_add_widget(sizegroup, widget); GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
toolitem = gtk_tool_item_new(); compose->h_store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
gtk_container_add(GTK_CONTAINER(toolitem), widget); compose->h_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolitem, -1); compose->h_store));
compose->to = gtk_entry_new(); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(compose->h_view),
toolitem = gtk_tool_item_new(); FALSE);
gtk_tool_item_set_expand(toolitem, TRUE); gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(compose->h_view), TRUE);
gtk_container_add(GTK_CONTAINER(toolitem), compose->to); compose->h_headers = gtk_list_store_new(2, G_TYPE_STRING,
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolitem, -1); G_TYPE_STRING);
gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0); gtk_list_store_append(compose->h_headers, &iter);
/* cc */ gtk_list_store_set(compose->h_headers, &iter, 0, "To:", 1, _("To:"),
compose->tb_cc = gtk_toolbar_new(); -1);
widget = gtk_label_new(_(" CC: ")); gtk_list_store_append(compose->h_headers, &iter);
gtk_size_group_add_widget(sizegroup, widget); gtk_list_store_set(compose->h_headers, &iter, 0, "Cc:", 1, _("Cc:"),
toolitem = gtk_tool_item_new(); -1);
gtk_container_add(GTK_CONTAINER(toolitem), widget); gtk_list_store_append(compose->h_headers, &iter);
gtk_toolbar_insert(GTK_TOOLBAR(compose->tb_cc), toolitem, -1); gtk_list_store_set(compose->h_headers, &iter, 0, "Bcc:", 1, _("Bcc:"),
compose->cc = gtk_entry_new(); -1);
toolitem = gtk_tool_item_new(); gtk_list_store_append(compose->h_headers, &iter);
gtk_tool_item_set_expand(toolitem, TRUE); gtk_list_store_set(compose->h_headers, &iter, 0, "Reply-To:", 1,
gtk_container_add(GTK_CONTAINER(toolitem), compose->cc); _("Reply-To:"), -1);
gtk_toolbar_insert(GTK_TOOLBAR(compose->tb_cc), toolitem, -1); gtk_list_store_append(compose->h_headers, &iter);
gtk_box_pack_start(GTK_BOX(vbox), compose->tb_cc, FALSE, FALSE, 0); gtk_list_store_set(compose->h_headers, &iter, 0, "Newsgroup:", 1,
/* bcc */ _("Newsgroup:"), -1);
compose->tb_bcc = gtk_toolbar_new(); gtk_list_store_append(compose->h_headers, &iter);
widget = gtk_label_new(_(" BCC: ")); gtk_list_store_set(compose->h_headers, &iter, 0, "Followup-To:", 1,
gtk_size_group_add_widget(sizegroup, widget); _("Followup-To:"), -1);
toolitem = gtk_tool_item_new(); renderer = gtk_cell_renderer_combo_new();
gtk_container_add(GTK_CONTAINER(toolitem), widget); g_object_set(renderer, "editable", TRUE, "model", compose->h_headers,
gtk_toolbar_insert(GTK_TOOLBAR(compose->tb_bcc), toolitem, -1); "text-column", 1, NULL);
compose->bcc = gtk_entry_new(); g_signal_connect(G_OBJECT(renderer), "edited", G_CALLBACK(
toolitem = gtk_tool_item_new(); _on_header_field_edited), compose);
gtk_tool_item_set_expand(toolitem, TRUE); column = gtk_tree_view_column_new_with_attributes("", renderer, "text",
gtk_container_add(GTK_CONTAINER(toolitem), compose->bcc); 0, NULL);
gtk_toolbar_insert(GTK_TOOLBAR(compose->tb_bcc), toolitem, -1); gtk_tree_view_column_set_min_width(column, 80);
gtk_box_pack_start(GTK_BOX(vbox), compose->tb_bcc, FALSE, FALSE, 0); gtk_tree_view_append_column(GTK_TREE_VIEW(compose->h_view), column);
renderer = gtk_cell_renderer_text_new();
g_object_set(G_OBJECT(renderer), "editable", TRUE, NULL);
g_signal_connect(G_OBJECT(renderer), "edited", G_CALLBACK(
_on_header_edited), compose);
column = gtk_tree_view_column_new_with_attributes("", renderer, "text",
1, NULL);
#if GTK_CHECK_VERSION(2, 4, 0)
gtk_tree_view_column_set_expand(column, TRUE);
#endif
gtk_tree_view_append_column(GTK_TREE_VIEW(compose->h_view), column);
gtk_list_store_append(compose->h_store, &iter);
gtk_list_store_set(compose->h_store, &iter, 0, "To:", -1);
gtk_container_add(GTK_CONTAINER(widget), compose->h_view);
gtk_box_pack_start(GTK_BOX(vbox), widget, FALSE, TRUE, 0);
/* subject */ /* subject */
toolbar = gtk_toolbar_new(); toolbar = gtk_toolbar_new();
widget = gtk_label_new(_(" Subject: ")); widget = gtk_label_new(_("Subject: "));
gtk_misc_set_alignment(GTK_MISC(widget), 0.1, 0.5);
gtk_size_group_add_widget(sizegroup, widget); gtk_size_group_add_widget(sizegroup, widget);
toolitem = gtk_tool_item_new(); toolitem = gtk_tool_item_new();
gtk_container_add(GTK_CONTAINER(toolitem), widget); gtk_container_add(GTK_CONTAINER(toolitem), widget);
@ -269,8 +293,6 @@ Compose * compose_new(Mailer * mailer)
gtk_container_add(GTK_CONTAINER(compose->window), vbox); gtk_container_add(GTK_CONTAINER(compose->window), vbox);
compose->ab_window = NULL; compose->ab_window = NULL;
gtk_widget_show_all(vbox); gtk_widget_show_all(vbox);
gtk_widget_hide(compose->tb_cc);
gtk_widget_hide(compose->tb_bcc);
gtk_widget_show(compose->window); gtk_widget_show(compose->window);
return compose; return compose;
} }
@ -314,6 +336,30 @@ static GtkWidget * _new_text_view(Mailer * mailer)
return textview; return textview;
} }
static void _on_header_field_edited(GtkCellRendererText * renderer,
gchar * path, gchar * text, gpointer data)
{
Compose * compose = data;
GtkTreeModel * model = GTK_TREE_MODEL(compose->h_store);
GtkTreeIter iter;
if(gtk_tree_model_get_iter_from_string(model, &iter, path) != TRUE)
return;
gtk_list_store_set(compose->h_store, &iter, 0, text, -1);
}
static void _on_header_edited(GtkCellRendererText * renderer, gchar * path,
gchar * text, gpointer data)
{
Compose * compose = data;
GtkTreeModel * model = GTK_TREE_MODEL(compose->h_store);
GtkTreeIter iter;
if(gtk_tree_model_get_iter_from_string(model, &iter, path) != TRUE)
return;
gtk_list_store_set(compose->h_store, &iter, 1, text, -1);
}
/* compose_delete */ /* compose_delete */
void compose_delete(Compose * compose) void compose_delete(Compose * compose)
@ -338,14 +384,21 @@ void compose_set_subject(Compose * compose, char const * subject)
} }
/* compose_set_to */ /* useful */
void compose_set_to(Compose * compose, char const * to) /* compose_add_field */
void compose_add_field(Compose * compose, char const * field,
char const * value)
{ {
gtk_entry_set_text(GTK_ENTRY(compose->to), to); GtkTreeIter iter;
gtk_list_store_append(compose->h_store, &iter);
if(field != NULL)
gtk_list_store_set(compose->h_store, &iter, 0, field, -1);
if(value != NULL)
gtk_list_store_set(compose->h_store, &iter, 1, value, -1);
} }
/* useful */
/* compose_save */ /* compose_save */
int compose_save(Compose * compose) int compose_save(Compose * compose)
{ {
@ -364,6 +417,7 @@ static gboolean _on_send_write(GIOChannel * source, GIOCondition condition,
void compose_send(Compose * compose) void compose_send(Compose * compose)
{ {
/* FIXME rewrite more efficiently (and tracking process) */
char * msg; char * msg;
size_t msg_len; size_t msg_len;
char * body; char * body;
@ -449,55 +503,63 @@ static int _mail_child(int fd[2])
static char * _send_headers(Compose * compose) static char * _send_headers(Compose * compose)
{ {
struct { /* FIXME rewrite this function */
char * hdr;
GtkWidget * wgt;
} widgets[] =
{
{ "To: ", NULL },
{ "Cc: ", NULL },
{ "Bcc: ", NULL },
{ "Subject: ", NULL },
{ NULL, NULL }
};
int i;
char * msg = NULL; char * msg = NULL;
size_t msg_len = 0; size_t msg_len = 0;
char const * p; char * p;
size_t len; GtkTreeModel * model = GTK_TREE_MODEL(compose->h_store);
size_t hdr_len; GtkTreeIter iter;
char * q; gboolean valid;
char * field;
size_t field_len;
char * value;
char const * q;
widgets[0].wgt = compose->to; p = gtk_combo_box_get_active_text(GTK_COMBO_BOX(compose->from));
widgets[1].wgt = compose->cc; if(*p != '\0')
widgets[2].wgt = compose->bcc;
widgets[3].wgt = compose->subject;
q = gtk_combo_box_get_active_text(GTK_COMBO_BOX(compose->from));
if(*q != '\0')
{ {
msg_len = strlen(q) + 8; msg_len = strlen(p) + 8;
if((msg = malloc(msg_len + 1)) == NULL) if((msg = malloc(msg_len + 1)) == NULL)
return NULL; return NULL;
snprintf(msg, msg_len + 1, "%s%s\r\n", "From: ", q); snprintf(msg, msg_len + 1, "%s%s\r\n", "From: ", p);
} }
g_free(q); g_free(p);
for(i = 0; widgets[i].hdr != NULL; i++) valid = gtk_tree_model_get_iter_first(model, &iter);
for(; valid == TRUE; valid = gtk_tree_model_iter_next(model, &iter))
{ {
p = gtk_entry_get_text(GTK_ENTRY(widgets[i].wgt)); gtk_tree_model_get(model, &iter, 0, &field, 1, &value, -1);
if((len = strlen(p)) == 0) if((field_len = strlen(field)) == 0
continue; || field[field_len - 1] != ':'
hdr_len = strlen(widgets[i].hdr); || index(field, ':') != field + field_len - 1)
if((q = realloc(msg, msg_len + hdr_len + len + 3)) == NULL)
{ {
free(msg); g_free(field);
mailer_error(compose->mailer, strerror(errno), 0); g_free(value);
return NULL; continue; /* XXX report error */
} }
msg = q; if((p = realloc(msg, msg_len + strlen(field) + strlen(value)
snprintf(&msg[msg_len], hdr_len + len + 3, "%s%s\r\n", + 4)) == NULL)
widgets[i].hdr, p); {
msg_len += hdr_len + len + 2; g_free(field);
g_free(value);
continue; /* XXX report error */
}
msg = p;
strcat(msg, field);
strcat(msg, " ");
strcat(msg, value);
strcat(msg, "\r\n");
msg_len = strlen(msg); /* XXX ugly */
g_free(field);
g_free(value);
} }
q = gtk_entry_get_text(GTK_ENTRY(compose->subject));
msg_len += strlen(q) + 11;
if((p = realloc(msg, msg_len + 1)) == NULL)
return NULL;
msg = p;
strcat(msg, "Subject: ");
strcat(msg, q);
strcat(msg, "\r\n");
if(msg != NULL) if(msg != NULL)
return msg; return msg;
if((msg = strdup("")) == NULL) if((msg = strdup("")) == NULL)
@ -580,23 +642,7 @@ void compose_show_about(Compose * compose, gboolean show)
desktop_about_dialog_set_version(dialog, VERSION); desktop_about_dialog_set_version(dialog, VERSION);
desktop_about_dialog_set_authors(dialog, _authors); desktop_about_dialog_set_authors(dialog, _authors);
desktop_about_dialog_set_copyright(dialog, _copyright); desktop_about_dialog_set_copyright(dialog, _copyright);
desktop_about_dialog_set_logo_icon_name(dialog, "stock_mail"); desktop_about_dialog_set_logo_icon_name(dialog, "mailer");
desktop_about_dialog_set_license(dialog, _license); desktop_about_dialog_set_license(dialog, _license);
gtk_widget_show(dialog); gtk_widget_show(dialog);
} }
/* compose_toggle_show_bcc */
void compose_toggle_show_bcc(Compose * compose)
{
/* FIXME implement correctly */
gtk_widget_show(compose->tb_bcc);
}
/* compose_toggle_show_cc */
void compose_toggle_show_cc(Compose * compose)
{
/* FIXME implement correctly */
gtk_widget_show(compose->tb_cc);
}

View File

@ -32,16 +32,15 @@ void compose_delete(Compose * compose);
/* accessors */ /* accessors */
Mailer * compose_get_mailer(Compose * compose); Mailer * compose_get_mailer(Compose * compose);
void compose_set_subject(Compose * compose, char const * subject); void compose_set_subject(Compose * compose, char const * subject);
void compose_set_to(Compose * compose, char const * to);
/* useful */ /* useful */
void compose_add_field(Compose * compose, char const * field,
char const * value);
int compose_save(Compose * compose); int compose_save(Compose * compose);
void compose_send(Compose * compose); void compose_send(Compose * compose);
void compose_send_cancel(Compose * compose); void compose_send_cancel(Compose * compose);
void compose_show_about(Compose * compose, gboolean show); void compose_show_about(Compose * compose, gboolean show);
void compose_toggle_show_bcc(Compose * compose);
void compose_toggle_show_cc(Compose * compose);
#endif /* !MAILER_COMPOSE_H */ #endif /* !MAILER_COMPOSE_H */

View File

@ -27,11 +27,24 @@
#include "compose.h" #include "compose.h"
#include "callbacks.h" #include "callbacks.h"
#include "mailer.h" #include "mailer.h"
#include "../config.h"
#include "common.c" #include "common.c"
#define _(string) gettext(string) #define _(string) gettext(string)
#define N_(string) (string) #define N_(string) (string)
/* constants */
#ifndef PREFIX
# define PREFIX "/usr/local"
#endif
#ifndef LIBDIR
# define LIBDIR PREFIX "/lib"
#endif
#ifndef PLUGINDIR
# define PLUGINDIR LIBDIR "/Mailer"
#endif
/* Mailer */ /* Mailer */
/* private */ /* private */
/* types */ /* types */
@ -255,7 +268,7 @@ Mailer * mailer_new(void)
gtk_window_add_accel_group(GTK_WINDOW(mailer->window), group); gtk_window_add_accel_group(GTK_WINDOW(mailer->window), group);
gtk_window_set_default_size(GTK_WINDOW(mailer->window), 800, 600); gtk_window_set_default_size(GTK_WINDOW(mailer->window), 800, 600);
#if GTK_CHECK_VERSION(2, 6, 0) #if GTK_CHECK_VERSION(2, 6, 0)
gtk_window_set_icon_name(GTK_WINDOW(mailer->window), "stock_mail"); gtk_window_set_icon_name(GTK_WINDOW(mailer->window), "mailer");
#endif #endif
gtk_window_set_title(GTK_WINDOW(mailer->window), _("Mailer")); gtk_window_set_title(GTK_WINDOW(mailer->window), _("Mailer"));
g_signal_connect_swapped(G_OBJECT(mailer->window), "delete-event", g_signal_connect_swapped(G_OBJECT(mailer->window), "delete-event",
@ -739,7 +752,7 @@ int mailer_account_add(Mailer * mailer, Account * account)
model = gtk_tree_view_get_model(GTK_TREE_VIEW(mailer->view_folders)); model = gtk_tree_view_get_model(GTK_TREE_VIEW(mailer->view_folders));
gtk_tree_store_append(GTK_TREE_STORE(model), &iter, NULL); gtk_tree_store_append(GTK_TREE_STORE(model), &iter, NULL);
theme = gtk_icon_theme_get_default(); theme = gtk_icon_theme_get_default();
pixbuf = gtk_icon_theme_load_icon(theme, "stock_mail-accounts", 16, 0, pixbuf = gtk_icon_theme_load_icon(theme, "mailer-accounts", 16, 0,
NULL); NULL);
gtk_tree_store_set(GTK_TREE_STORE(model), &iter, MF_COL_ACCOUNT, gtk_tree_store_set(GTK_TREE_STORE(model), &iter, MF_COL_ACCOUNT,
account, MF_COL_ENABLED, account_get_enabled(account), account, MF_COL_ENABLED, account_get_enabled(account),
@ -789,6 +802,7 @@ static void _mailer_delete_selected_foreach(GtkTreeRowReference * reference,
void mailer_delete_selected(Mailer * mailer) void mailer_delete_selected(Mailer * mailer)
{ {
/* FIXME figure which area is focused first (deleting folders) */
GtkTreeModel * model; GtkTreeModel * model;
GtkTreeSelection * treesel; GtkTreeSelection * treesel;
GList * selected; GList * selected;
@ -920,8 +934,10 @@ static void _reply_selected(Mailer * mailer, GtkTreeModel * model,
return; /* XXX error message? */ return; /* XXX error message? */
gtk_tree_model_get(model, iter, MH_COL_FROM, &from, MH_COL_SUBJECT, gtk_tree_model_get(model, iter, MH_COL_FROM, &from, MH_COL_SUBJECT,
&subject, -1); &subject, -1);
#if 0 /* FIXME adapt */
if(from != NULL) if(from != NULL)
compose_set_to(compose, from); compose_set_to(compose, from);
#endif
q = N_("Re: "); q = N_("Re: ");
if(subject != NULL if(subject != NULL
&& strncasecmp(subject, q, strlen(q)) != 0 && strncasecmp(subject, q, strlen(q)) != 0
@ -1004,7 +1020,7 @@ void mailer_show_about(Mailer * mailer, gboolean show)
desktop_about_dialog_set_version(dialog, VERSION); desktop_about_dialog_set_version(dialog, VERSION);
desktop_about_dialog_set_authors(dialog, _authors); desktop_about_dialog_set_authors(dialog, _authors);
desktop_about_dialog_set_copyright(dialog, _copyright); desktop_about_dialog_set_copyright(dialog, _copyright);
desktop_about_dialog_set_logo_icon_name(dialog, "stock_mail"); desktop_about_dialog_set_logo_icon_name(dialog, "mailer");
desktop_about_dialog_set_license(dialog, _license); desktop_about_dialog_set_license(dialog, _license);
gtk_widget_show(dialog); gtk_widget_show(dialog);
} }

View File

@ -22,15 +22,10 @@
# include <gtk/gtk.h> # include <gtk/gtk.h>
# include "Mailer.h" # include "Mailer.h"
# include "account.h" # include "account.h"
# include "../config.h"
/* Mailer */ /* Mailer */
/* constants */ /* constants */
# ifndef PLUGINDIR
# define PLUGINDIR LIBDIR "/Mailer"
# endif
# define MAILER_CONFIG_FILE ".mailer" # define MAILER_CONFIG_FILE ".mailer"
# define MAILER_MESSAGES_FONT "Monospace 8" # define MAILER_MESSAGES_FONT "Monospace 8"

View File

@ -29,4 +29,5 @@ cppflags=-D PREFIX=\"$(PREFIX)\"
depends=account.h,callbacks.h,compose.h,mailer.h,../config.h depends=account.h,callbacks.h,compose.h,mailer.h,../config.h
[main.c] [main.c]
cppflags=-D PREFIX=\"$(PREFIX)\"
depends=mailer.h,../config.h depends=mailer.h,../config.h