Permalink
Browse files

Added EmailAccount to Reminder so a different email account can be as…

…sociated with each reminder.
  • Loading branch information...
1 parent 06a48fe commit a1e0bc9b612d139125030240abc1ac6a13038dda @dalezak committed Jan 27, 2011
View
111 src/main/java/net/frontlinesms/plugins/reminders/RemindersDialogHandler.java
@@ -32,6 +32,7 @@
import net.frontlinesms.FrontlineSMS;
import net.frontlinesms.FrontlineUtils;
import net.frontlinesms.data.domain.Contact;
+import net.frontlinesms.data.domain.EmailAccount;
import net.frontlinesms.data.events.DatabaseEntityNotification;
import net.frontlinesms.data.repository.ContactDao;
import net.frontlinesms.data.repository.EmailAccountDao;
@@ -43,6 +44,7 @@
import net.frontlinesms.plugins.reminders.data.repository.ReminderDao;
import net.frontlinesms.ui.ThinletUiEventHandler;
import net.frontlinesms.ui.UiGeneratorController;
+import net.frontlinesms.ui.events.TabChangedNotification;
import net.frontlinesms.ui.handler.ComponentPagingHandler;
import net.frontlinesms.ui.handler.PagedComponentItemProvider;
import net.frontlinesms.ui.handler.PagedListDetails;
@@ -86,6 +88,8 @@
private Reminder selectedReminder;
private RemindersCallback remindersCallback;
+ private Object comboEmailAccount;
+
private Object panelRecipients;
private Object comboOccurrence;
@@ -122,14 +126,7 @@ public RemindersDialogHandler(UiGeneratorController ui, ApplicationContext appli
this.reminderDao = (ReminderDao) this.applicationContext.getBean("reminderDao");
this.contactDao = this.ui.getFrontlineController().getContactDao();
this.emailAccountDao = this.ui.getFrontlineController().getEmailAccountFactory();
- }
-
- /**
- * Initialize dialog
- * @param reminder Reminder
- */
- public void init(Reminder reminder) {
- this.selectedReminder = reminder;
+
this.dialogReminders = this.ui.loadComponentFromFile(DIALOG_XML, this);
this.panelRecipients = this.ui.find(this.dialogReminders, "panelRecipients");
@@ -142,32 +139,17 @@ public void init(Reminder reminder) {
this.pagerRecipients.setCurrentPage(0);
this.pagerRecipients.refresh();
+ this.comboEmailAccount = this.ui.find(this.dialogReminders, "comboEmailAccount");
this.comboOccurrence = this.ui.find(this.dialogReminders, "comboOccurrence");
- for (Reminder reminderClass : RemindersFactory.getReminderClasses()) {
- Object comboBoxChoice = this.ui.createComboboxChoice(reminderClass.getOccurrenceLabel(), reminderClass.getOccurrence());
- this.ui.add(this.comboOccurrence, comboBoxChoice);
- }
this.comboHourStart = this.ui.find(this.dialogReminders, "comboHourStart");
this.comboHourEnd = this.ui.find(this.dialogReminders, "comboHourEnd");
- for (int hour = 1; hour <= 12 ; hour ++) {
- this.ui.add(this.comboHourStart, this.ui.createComboboxChoice(Integer.toString(hour), hour));
- this.ui.add(this.comboHourEnd, this.ui.createComboboxChoice(Integer.toString(hour), hour));
- }
this.comboMinuteStart = this.ui.find(this.dialogReminders, "comboMinuteStart");
this.comboMinuteEnd = this.ui.find(this.dialogReminders, "comboMinuteEnd");
- for (int minute = 0; minute < 60; minute ++) {
- this.ui.add(this.comboMinuteStart, this.ui.createComboboxChoice(String.format("%02d", minute), minute));
- this.ui.add(this.comboMinuteEnd, this.ui.createComboboxChoice(String.format("%02d", minute), minute));
- }
this.comboAmPmStart = this.ui.find(this.dialogReminders, "comboAmPmStart");
this.comboAmPmEnd = this.ui.find(this.dialogReminders, "comboAmPmEnd");
- for (String amPm : new String [] {"AM", "PM"}) {
- this.ui.add(this.comboAmPmStart, this.ui.createComboboxChoice(amPm, amPm));
- this.ui.add(this.comboAmPmEnd, this.ui.createComboboxChoice(amPm, amPm));
- }
this.textDateStart = this.ui.find(this.dialogReminders, "textDateStart");
this.textDateEnd = this.ui.find(this.dialogReminders, "textDateEnd");
@@ -178,7 +160,38 @@ public void init(Reminder reminder) {
this.textSubject = this.ui.find(this.dialogReminders, "textSubject");
this.textMessage = this.ui.find(this.dialogReminders, "textMessage");
-
+ }
+
+ /**
+ * Initialize dialog
+ * @param reminder Reminder
+ */
+ public void init(Reminder reminder) {
+ this.selectedReminder = reminder;
+ loadEmailAccounts();
+ this.ui.removeAll(this.comboOccurrence);
+ for (Reminder reminderClass : RemindersFactory.getReminderClasses()) {
+ Object comboBoxChoice = this.ui.createComboboxChoice(reminderClass.getOccurrenceLabel(), reminderClass.getOccurrence());
+ this.ui.add(this.comboOccurrence, comboBoxChoice);
+ }
+ this.ui.removeAll(this.comboHourStart);
+ this.ui.removeAll(this.comboHourEnd);
+ for (int hour = 1; hour <= 12 ; hour ++) {
+ this.ui.add(this.comboHourStart, this.ui.createComboboxChoice(Integer.toString(hour), hour));
+ this.ui.add(this.comboHourEnd, this.ui.createComboboxChoice(Integer.toString(hour), hour));
+ }
+ this.ui.removeAll(this.comboMinuteStart);
+ this.ui.removeAll(this.comboMinuteEnd);
+ for (int minute = 0; minute < 60; minute ++) {
+ this.ui.add(this.comboMinuteStart, this.ui.createComboboxChoice(String.format("%02d", minute), minute));
+ this.ui.add(this.comboMinuteEnd, this.ui.createComboboxChoice(String.format("%02d", minute), minute));
+ }
+ this.ui.removeAll(this.comboAmPmStart);
+ this.ui.removeAll(this.comboAmPmEnd);
+ for (String amPm : new String [] {"AM", "PM"}) {
+ this.ui.add(this.comboAmPmStart, this.ui.createComboboxChoice(amPm, amPm));
+ this.ui.add(this.comboAmPmEnd, this.ui.createComboboxChoice(amPm, amPm));
+ }
if (reminder != null) {
this.ui.setAttachedObject(this.dialogReminders, reminder);
this.ui.setEnabled(this.comboOccurrence, false);
@@ -242,6 +255,15 @@ public void notify(FrontlineEventNotification notification) {
this.pagerRecipients.refresh();
}
}
+ else if (notification instanceof TabChangedNotification) {
+ loadEmailAccounts();
+ }
+ else if (notification instanceof DatabaseEntityNotification<?>) {
+ Object entity = ((DatabaseEntityNotification<?>) notification).getDatabaseEntity();
+ if (entity instanceof EmailAccount && !((EmailAccount) entity).isForReceiving()) {
+ loadEmailAccounts();
+ }
+ }
}
/**
@@ -271,6 +293,7 @@ public void saveReminder(Object dialog, Object table) {
}
String subject = (type == Reminder.Type.EMAIL) ? this.ui.getText(this.textSubject) : "";
String message = this.ui.getText(this.textMessage);
+ EmailAccount emailAccount = getEmailAccount();
if (type == Type.EMAIL && this.emailAccountDao.getAllEmailAccounts().size() == 0) {
this.ui.alert(InternationalisationUtils.getI18NString(RemindersConstants.MISSING_EMAIL_ACCOUNT));
}
@@ -292,6 +315,9 @@ else if (type == Type.EMAIL && subject.isEmpty()) {
else if (message.isEmpty()) {
this.ui.alert(InternationalisationUtils.getI18NString(RemindersConstants.MISSING_MESSAGE));
}
+ else if (type == Type.EMAIL && emailAccount == null) {
+ this.ui.alert(InternationalisationUtils.getI18NString(RemindersConstants.MISSING_EMAIL_ACCOUNT));
+ }
else {
Reminder reminder = this.ui.getAttachedObject(dialog, Reminder.class);
if (reminder != null) {
@@ -305,6 +331,7 @@ else if (message.isEmpty()) {
reminder.setSubject(subject);
reminder.setContent(message);
reminder.setStatus(Reminder.Status.PENDING);
+ reminder.setEmailAccount(type == Type.EMAIL ? emailAccount : null);
this.reminderDao.updateReminder(reminder);
if (type == Reminder.Type.EMAIL) {
this.ui.setStatus(InternationalisationUtils.getI18NString(RemindersConstants.EMAIL_REMINDER_UPDATED));
@@ -316,6 +343,7 @@ else if (message.isEmpty()) {
else {
reminder = RemindersFactory.createReminder(startDate, endDate, type, recipients.toString(), subject, message, occurrence);
reminder.setStatus(Reminder.Status.PENDING);
+ reminder.setEmailAccount(type == Type.EMAIL ? emailAccount : null);
this.reminderDao.saveReminder(reminder);
if (type == Reminder.Type.EMAIL) {
this.ui.setStatus(InternationalisationUtils.getI18NString(RemindersConstants.EMAIL_REMINDER_CREATED));
@@ -351,16 +379,18 @@ public void removeDialog(Object dialog) {
* @param textSubject
* @param textMessage
*/
- public void typeChanged(Object checkbox, Object textSubject, Object textMessage) {
+ public void typeChanged(Object checkbox, Object textSubject, Object textMessage, Object comboboxAccount) {
LOG.debug("typeChanged");
if (checkbox == this.checkboxEmail) {
this.ui.setEnabled(textSubject, true);
this.ui.setEditable(textSubject, true);
+ this.ui.setEnabled(comboboxAccount, true);
}
else if (checkbox == this.checkboxMessage) {
this.ui.setEnabled(textSubject, false);
this.ui.setEditable(textSubject, false);
this.ui.setText(textSubject, "");
+ this.ui.setEnabled(comboboxAccount, false);
}
}
@@ -410,6 +440,35 @@ public PagedListDetails getListDetails(Object list, int startIndex, int limit) {
}
/**
+ * Load email accounts
+ */
+ private void loadEmailAccounts() {
+ int index = 0;
+ EmailAccount selectedEmailAccount = selectedReminder != null ? selectedReminder.getEmailAccount() : null;
+ this.ui.removeAll(this.comboEmailAccount);
+ for (EmailAccount emailAccount : this.emailAccountDao.getSendingEmailAccounts()) {
+ String comboBoxText = String.format("%s : %s : %s : %s", emailAccount.getAccountName(), emailAccount.getAccountServer(), emailAccount.getProtocol(), emailAccount.getAccountServerPort());
+ Object comboBoxItem = this.ui.createComboboxChoice(comboBoxText, emailAccount);
+ this.ui.add(this.comboEmailAccount, comboBoxItem);
+ if (selectedEmailAccount != null && emailAccount.equals(selectedEmailAccount)) {
+ this.ui.setSelectedIndex(this.comboEmailAccount, index);
+ }
+ index++;
+ }
+ }
+
+ /**
+ * Get email account
+ */
+ private EmailAccount getEmailAccount() {
+ Object selectedItem = this.ui.getSelectedItem(this.comboEmailAccount);
+ if (selectedItem != null) {
+ return (EmailAccount)this.ui.getAttachedObject(selectedItem);
+ }
+ return null;
+ }
+
+ /**
* Convert contacts to table rows
* @param contacts collection of Contacts
* @param reminder Reminder
View
26 src/main/java/net/frontlinesms/plugins/reminders/RemindersPluginProperties.java
@@ -28,41 +28,17 @@
*/
public class RemindersPluginProperties extends UserHomeFilePropertySet {
- private static final String EMAIL_ACCOUNT = "email.account";
-
private static RemindersPluginProperties instance;
public RemindersPluginProperties() {
super("reminders");
}
- private static synchronized RemindersPluginProperties getInstance() {
+ protected static synchronized RemindersPluginProperties getInstance() {
if (instance == null) {
instance = new RemindersPluginProperties();
}
return instance;
}
- /**
- * Get EmailAccount
- * @return EmailAccount
- */
- public static String getEmailAccount() {
- return getInstance().getProperty(EMAIL_ACCOUNT);
- }
-
- /**
- * Set EmailAccount
- * @param emailAccount EmailAccount
- */
- public static void setEmailAccount(String emailAccount) {
- if (emailAccount != null) {
- getInstance().setProperty(EMAIL_ACCOUNT, emailAccount);
- }
- else {
- getInstance().setProperty(EMAIL_ACCOUNT, null);
- }
- getInstance().saveToDisk();
- }
-
}
View
112 src/main/java/net/frontlinesms/plugins/reminders/RemindersThinletTabController.java
@@ -33,13 +33,11 @@
import net.frontlinesms.FrontlineSMS;
import net.frontlinesms.FrontlineUtils;
import net.frontlinesms.data.repository.ContactDao;
-import net.frontlinesms.data.repository.EmailAccountDao;
import net.frontlinesms.data.repository.EmailDao;
import net.frontlinesms.plugins.BasePluginThinletTabController;
import net.frontlinesms.ui.Icon;
import net.frontlinesms.ui.ThinletUiEventHandler;
import net.frontlinesms.ui.UiGeneratorController;
-import net.frontlinesms.ui.events.TabChangedNotification;
import net.frontlinesms.ui.handler.ComponentPagingHandler;
import net.frontlinesms.ui.handler.PagedComponentItemProvider;
import net.frontlinesms.ui.handler.PagedListDetails;
@@ -59,7 +57,7 @@
import net.frontlinesms.data.domain.Contact;
import net.frontlinesms.data.domain.Email;
import net.frontlinesms.data.domain.EmailAccount;
-import net.frontlinesms.data.events.DatabaseEntityNotification;
+import net.frontlinesms.data.events.EntityDeleteWarning;
import net.frontlinesms.events.EventObserver;
import net.frontlinesms.events.FrontlineEventNotification;
@@ -70,7 +68,7 @@
* see {@link "http://www.frontlinesms.net"} for more details.
* copyright owned by Kiwanja.net
*/
-public class RemindersThinletTabController extends BasePluginThinletTabController<RemindersPluginController> implements ThinletUiEventHandler, PagedComponentItemProvider, EventObserver, RemindersCallback {
+public class RemindersThinletTabController extends BasePluginThinletTabController<RemindersPluginController> implements ThinletUiEventHandler, EventObserver, PagedComponentItemProvider, RemindersCallback {
private static Logger LOG = FrontlineUtils.getLogger(RemindersThinletTabController.class);
@@ -102,11 +100,6 @@
private final EmailDao emailDao;
/**
- * EmailAccountDao
- */
- private final EmailAccountDao emailAccountDao;
-
- /**
* EmailServerHandler
*/
private final EmailServerHandler emailManager;
@@ -118,7 +111,6 @@
private Object tabComponent;
private Object tableReminders;
- private Object comboEmailAccount;
private Object panelTableReminders;
private Object menuReminders;
private Object toolbarReminders;
@@ -149,37 +141,19 @@ public RemindersThinletTabController(RemindersPluginController pluginController,
this.reminderDao = (ReminderDao) applicationContext.getBean("reminderDao");
this.contactDao = this.ui.getFrontlineController().getContactDao();
this.emailDao = this.ui.getFrontlineController().getEmailDao();
- this.emailAccountDao = this.ui.getFrontlineController().getEmailAccountFactory();
this.emailManager = this.ui.getFrontlineController().getEmailServerHandler();
this.menuReminders = this.ui.find(this.tabComponent, "menuReminders");
this.toolbarReminders = this.ui.find(this.tabComponent, "toolbarReminders");
this.tableReminders = this.ui.find(this.tabComponent, "tableReminders");
this.pagerReminders = new ComponentPagingHandler(this.ui, this, tableReminders);
- this.comboEmailAccount = this.ui.find(this.tabComponent, "comboEmailAccount");
this.panelTableReminders = this.ui.find(this.tabComponent, "panelTableReminders");
this.ui.add(this.panelTableReminders, this.pagerReminders.getPanel());
this.pagerReminders.setCurrentPage(0);
this.pagerReminders.refresh();
-
- loadEmailAccounts();
- }
-
- /**
- * Handle Frontline notifications
- */
- public void notify(FrontlineEventNotification notification) {
- if (notification instanceof TabChangedNotification) {
- loadEmailAccounts();
- } else if (notification instanceof DatabaseEntityNotification<?>) {
- Object entity = ((DatabaseEntityNotification<?>) notification).getDatabaseEntity();
- if (entity instanceof EmailAccount && !((EmailAccount) entity).isForReceiving()) {
- loadEmailAccounts();
- }
- }
}
/**
@@ -197,6 +171,28 @@ public void notify(FrontlineEventNotification notification) {
*/
private final HashMap<Reminder, ScheduledFuture<?>> expired = new HashMap<Reminder, ScheduledFuture<?>>();
+ public void notify(FrontlineEventNotification notification) {
+ if (notification instanceof EntityDeleteWarning<?>) {
+ Object entity = ((EntityDeleteWarning<?>) notification).getDatabaseEntity();
+ if (entity instanceof EmailAccount) {
+ EmailAccount deletedEmailAccount = (EmailAccount)entity;
+ for(Reminder reminder : reminderDao.getAllReminders()) {
+ EmailAccount reminderEmailAccount = reminder.getEmailAccount();
+ if (reminderEmailAccount != null && reminderEmailAccount.equals(deletedEmailAccount)) {
+ LOG.debug("WARNING, email account " + deletedEmailAccount.getAccountName() + " will be deleted!!");
+ try{
+ reminder.setEmailAccount(null);
+ reminderDao.updateReminder(reminder);
+ }
+ catch (Exception ex) {
+ LOG.error("Error removing email account from Reminder", ex);
+ }
+ }
+ }
+ }
+ }
+ }
+
/**
* Schedule a Reminder
*/
@@ -278,12 +274,11 @@ public void sendReminder(Reminder reminder) {
LOG.debug("sendReminder: " + reminder);
if (reminder != null) {
if (reminder.getType() == Reminder.Type.EMAIL) {
- EmailAccount emailAccount = this.getEmailAccount();
- if (emailAccount != null) {
+ if (reminder.getEmailAccount() != null) {
for (String contactName : reminder.getRecipientsArray()) {
LOG.debug("Sending EMAIL");
Contact contact = this.contactDao.getContactByName(contactName);
- Email email = new Email(emailAccount, contact.getEmailAddress(), reminder.getSubject(), reminder.getContent());
+ Email email = new Email(reminder.getEmailAccount(), contact.getEmailAddress(), reminder.getSubject(), reminder.getContent());
this.emailDao.saveEmail(email);
this.emailManager.sendEmail(email);
}
@@ -345,61 +340,6 @@ public Object getTab(){
}
/**
- * Load email accounts
- */
- private void loadEmailAccounts() {
- int index = 0;
- String selectedEmailAccount = RemindersPluginProperties.getEmailAccount();
- this.ui.removeAll(this.comboEmailAccount);
- for (EmailAccount emailAccount : this.emailAccountDao.getSendingEmailAccounts()) {
- String comboBoxText = String.format("%s : %s : %s : %s", emailAccount.getAccountName(), emailAccount.getAccountServer(), emailAccount.getProtocol(), emailAccount.getAccountServerPort());
- Object comboBoxItem = this.ui.createComboboxChoice(comboBoxText, emailAccount);
- this.ui.add(this.comboEmailAccount, comboBoxItem);
- if (emailAccount.getAccountName().equalsIgnoreCase(selectedEmailAccount)) {
- this.ui.setSelectedIndex(this.comboEmailAccount, index);
- }
- index++;
- }
- if (this.ui.getSelectedItem(this.comboEmailAccount) == null) {
- this.ui.setSelectedIndex(this.comboEmailAccount, 0);
- for (EmailAccount emailAccount : this.emailAccountDao.getSendingEmailAccounts()) {
- RemindersPluginProperties.setEmailAccount(emailAccount.getAccountName());
- break;
- }
- }
- }
-
- /**
- * Get email account
- */
- private EmailAccount getEmailAccount() {
- Object selectedItem = this.ui.getSelectedItem(this.comboEmailAccount);
- if (selectedItem != null) {
- return (EmailAccount)this.ui.getAttachedObject(selectedItem);
- }
- return null;
- }
-
- /**
- * Email account changed
- */
- public void emailAccountChanged(Object comboEmailAccount) {
- Object selectedItem = this.ui.getSelectedItem(comboEmailAccount);
- if (selectedItem != null) {
- EmailAccount emailAccount = (EmailAccount)this.ui.getAttachedObject(selectedItem);
- if (emailAccount != null) {
- RemindersPluginProperties.setEmailAccount(emailAccount.getAccountName());
- }
- else {
- RemindersPluginProperties.setEmailAccount(null);
- }
- }
- else {
- RemindersPluginProperties.setEmailAccount(null);
- }
- }
-
- /**
* Remove reminders
*/
public void removeSelectedFromReminderList() {
View
19 src/main/java/net/frontlinesms/plugins/reminders/data/domain/Reminder.java
@@ -25,6 +25,7 @@
import java.util.List;
import java.util.StringTokenizer;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorValue;
@@ -35,12 +36,15 @@
import javax.persistence.InheritanceType;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
+import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.apache.log4j.Logger;
+import org.hibernate.annotations.Cascade;
import net.frontlinesms.FrontlineUtils;
import net.frontlinesms.data.EntityField;
+import net.frontlinesms.data.domain.EmailAccount;
import net.frontlinesms.plugins.reminders.RemindersCallback;
/*
@@ -143,6 +147,11 @@
/** Recipient of the reminder */
@Column(name=COLUMN_RECIPIENTS)
private String recipients;
+
+ /** Recipient of the reminder */
+ @ManyToOne(cascade=CascadeType.ALL)
+ @Cascade(value = { org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
+ private EmailAccount emailAccount;
//> CONSTRUCTORS
/** Empty constructor required for hibernate. */
@@ -378,7 +387,15 @@ public Calendar getEndCalendar() {
return calendar;
}
-//> GENERATED CODE
+ public void setEmailAccount(EmailAccount emailAccount) {
+ this.emailAccount = emailAccount;
+ }
+
+ public EmailAccount getEmailAccount() {
+ return emailAccount;
+ }
+
+ //> GENERATED CODE
/** @see java.lang.Object#hashCode() */
@Override
public int hashCode() {
View
1 ...ain/resources/net/frontlinesms/plugins/reminders/RemindersPluginControllerText.properties
@@ -5,6 +5,7 @@ plugins.reminders.edit=Edit Reminder
plugins.reminders.delete=Delete Reminder
plugins.reminders.save=Save Reminder
plugins.reminders.occurrence=Occurrence
+plugins.reminders.account=Account
plugins.reminders.once=Once
plugins.reminders.hourly=Hourly
plugins.reminders.daily=Daily
View
3 src/main/resources/net/frontlinesms/plugins/reminders/reminders-spring-hibernate.xml
@@ -10,6 +10,9 @@
<bean id="reminderDao" class="net.frontlinesms.plugins.reminders.data.repository.hibernate.HibernateReminderDao" parent="baseHibernateDao">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
+ <bean id="emailAccountDao" class="net.frontlinesms.data.repository.hibernate.HibernateEmailAccountDao" parent="baseHibernateDao">
+ <property name="sessionFactory" ref="sessionFactory" />
+ </bean>
<bean id="baseHibernateDao" abstract="true" class="net.frontlinesms.data.repository.hibernate">
<property name="sessionFactory" ref="sessionFactory"/>
<property name="eventBus" ref="eventBus"/>
View
3 src/main/resources/net/frontlinesms/plugins/reminders/reminders.hibernate.cfg.xml
@@ -16,6 +16,7 @@
<mapping class="net.frontlinesms.plugins.reminders.data.domain.ThursdaysReminder" />
<mapping class="net.frontlinesms.plugins.reminders.data.domain.FridaysReminder" />
<mapping class="net.frontlinesms.plugins.reminders.data.domain.SaturdaysReminder" />
- <mapping class="net.frontlinesms.plugins.reminders.data.domain.SundaysReminder" />
+ <mapping class="net.frontlinesms.plugins.reminders.data.domain.SundaysReminder" />
+ <mapping class="net.frontlinesms.data.domain.EmailAccount" />
</session-factory>
</hibernate-configuration>
View
7 src/main/resources/ui/plugins/reminders/remindersForm.xml
@@ -33,9 +33,12 @@
</panel>
<label name="labelType" icon="/icons/reminder_type.png" text="i18n.common.type" valign="top"/>
- <checkbox name="checkboxEmail" action="typeChanged(this, textSubject, textMessage)" group="groupType" halign="center" selected="true" text="i18n.common.email" icon="/icons/email.png"/>
- <checkbox name="checkboxMessage" action="typeChanged(this, textSubject, textMessage)" group="groupType" text="i18n.common.message" icon="/icons/sms.png"/>
+ <checkbox name="checkboxEmail" action="typeChanged(this, textSubject, textMessage, comboEmailAccount)" group="groupType" halign="center" selected="true" text="i18n.common.email" icon="/icons/email.png"/>
+ <checkbox name="checkboxMessage" action="typeChanged(this, textSubject, textMessage, comboEmailAccount)" group="groupType" text="i18n.common.message" icon="/icons/sms.png"/>
+ <label text="i18n.plugins.reminders.account" icon="/icons/email.png" />
+ <combobox name="comboEmailAccount" editable="false" colspan="2" weightx="1"/>
+
<label name="labelSubject" icon="/icons/email_subject.png" text="i18n.common.subject" valign="top"/>
<textarea name="textSubject" colspan="2" rows="1" columns="75"/>
View
4 src/main/resources/ui/plugins/reminders/remindersTab.xml
@@ -3,10 +3,6 @@
<panel name="panelReminders" bottom="9" columns="2" gap="9" left="9" right="9" top="9">
<label name="labelHeading" icon="/icons/header/reminders.png" valign="top"/>
<panel name="panelTableReminders" border="false" weightx="1" weighty="1" columns="1" gap="10">
- <panel gap="10">
- <label text="i18n.common.email.account" icon="/icons/email.png" />
- <combobox name="comboEmailAccount" action="emailAccountChanged(this)" editable="false" weightx="1"/>
- </panel>
<table name="tableReminders" selection="multiple" weightx="1" weighty="1" action="enableOptions(this, menuReminders, toolbarReminders)" perform="showReminderDialog(tableReminders)">
<header>
<column icon="/icons/status.png" text="i18n.common.status" width="65"/>

0 comments on commit a1e0bc9

Please sign in to comment.