* [sup-devel] [PATCHES] Add an account selector in edit-mode
@ 2011-03-13 16:13 Damien Leone
2011-03-13 20:21 ` Sascha Silbe
2011-05-30 17:23 ` Hamish
0 siblings, 2 replies; 7+ messages in thread
From: Damien Leone @ 2011-03-13 16:13 UTC (permalink / raw)
To: sup-devel
[-- Attachment #1: Type: text/plain, Size: 159 bytes --]
Sup guys,
Please see commit messages for detailed informations.
--
Damien Leone <damien.leone@fensalir.fr>
Web: http://dleone.fensalir.fr/
GPG: 0x82EB4DDF
[-- Attachment #2: 0001-reply-mode-improve-the-way-headers-are-handled.patch --]
[-- Type: application/octet-stream, Size: 5389 bytes --]
From d30d6136ebe14657a9b4530d80eb9e24ce9555ab Mon Sep 17 00:00:00 2001
From: Damien Leone <damien.leone@fensalir.fr>
Date: Wed, 9 Jun 2010 12:38:52 +0200
Subject: [PATCH 1/3] reply-mode: improve the way headers are handled
I noticed that changing the Reply-to selector was also changing the
other headers such as From even if you edited it. I guess it is an
unwanted behaviour since this selector should only behave on the To
and Cc fields.
This commit splits the headers in two "types", those handled by
Reply-To selector and those that are only merged with the first ones
at initialization of the edit-mode.
It also gives a better support of the Customized choice by saving back
the fields for later use.
---
lib/sup/modes/reply-mode.rb | 60 ++++++++++++++++++++++--------------------
1 files changed, 31 insertions(+), 29 deletions(-)
diff --git a/lib/sup/modes/reply-mode.rb b/lib/sup/modes/reply-mode.rb
index ccdf371..d7d914f 100644
--- a/lib/sup/modes/reply-mode.rb
+++ b/lib/sup/modes/reply-mode.rb
@@ -48,6 +48,7 @@ EOS
## the full headers (most importantly the list-post header, if
## any)
body = reply_body_lines message
+ @body_orig = body
## first, determine the address at which we received this email. this will
## become our From: address in the reply.
@@ -97,14 +98,21 @@ EOS
@headers = {}
@headers[:recipient] = {
"To" => cc.map { |p| p.full_address },
+ "Cc" => [],
} if useful_recipient
## typically we don't want to have a reply-to-sender option if the sender
## is a user account. however, if the cc is empty, it's a message to
## ourselves, so for the lack of any other options, we'll add it.
- @headers[:sender] = { "To" => [to.full_address], } if !AccountManager.is_account?(to) || !useful_recipient
+ @headers[:sender] = {
+ "To" => [to.full_address],
+ "Cc" => [],
+ } if !AccountManager.is_account?(to) || !useful_recipient
- @headers[:user] = {}
+ @headers[:user] = {
+ "To" => [],
+ "Cc" => [],
+ }
not_me_ccs = cc.select { |p| !AccountManager.is_account?(p) }
@headers[:all] = {
@@ -114,22 +122,11 @@ EOS
@headers[:list] = {
"To" => [@m.list_address.full_address],
+ "Cc" => [],
} if @m.is_list_message?
refs = gen_references
- @headers.each do |k, v|
- @headers[k] = {
- "From" => from.full_address,
- "To" => [],
- "Cc" => [],
- "Bcc" => [],
- "In-reply-to" => "<#{@m.id}>",
- "Subject" => Message.reify_subj(@m.subj),
- "References" => refs,
- }.merge v
- end
-
types = REPLY_TYPES.select { |t| @headers.member?(t) }
@type_selector = HorizontalSelector.new "Reply to:", types, types.map { |x| TYPE_DESCRIPTIONS[x] }
@@ -148,13 +145,17 @@ EOS
:recipient
end)
- @bodies = {}
- @headers.each do |k, v|
- @bodies[k] = body
- HookManager.run "before-edit", :header => v, :body => @bodies[k]
- end
+ headers_full = {
+ "From" => from.full_address,
+ "Bcc" => [],
+ "In-reply-to" => "<#{@m.id}>",
+ "Subject" => Message.reify_subj(@m.subj),
+ "References" => refs,
+ }.merge @headers[@type_selector.val]
+
+ HookManager.run "before-edit", :header => headers_full, :body => body
- super :header => @headers[@type_selector.val], :body => @bodies[@type_selector.val], :twiddles => false
+ super :header => headers_full, :body => body, :twiddles => false
add_selector @type_selector
end
@@ -163,8 +164,7 @@ protected
def move_cursor_right
super
if @headers[@type_selector.val] != self.header
- self.header = @headers[@type_selector.val]
- self.body = @bodies[@type_selector.val] unless @edited
+ self.header = self.header.merge @headers[@type_selector.val]
rerun_crypto_selector_hook
update
end
@@ -173,8 +173,7 @@ protected
def move_cursor_left
super
if @headers[@type_selector.val] != self.header
- self.header = @headers[@type_selector.val]
- self.body = @bodies[@type_selector.val] unless @edited
+ self.header = self.header.merge @headers[@type_selector.val]
rerun_crypto_selector_hook
update
end
@@ -192,14 +191,15 @@ protected
end
def handle_new_text new_header, new_body
- if new_body != @bodies[@type_selector.val]
- @bodies[@type_selector.val] = new_body
+ if new_body != @body_orig
+ @body_orig = new_body
@edited = true
end
old_header = @headers[@type_selector.val]
- if new_header.size != old_header.size || old_header.any? { |k, v| new_header[k] != v }
+ if old_header.any? { |k, v| new_header[k] != v }
@type_selector.set_to :user
- self.header = @headers[:user] = new_header
+ self.header["To"] = @headers[:user]["To"] = new_header["To"]
+ self.header["Cc"] = @headers[:user]["Cc"] = new_header["Cc"]
update
end
end
@@ -210,8 +210,10 @@ protected
def edit_field field
edited_field = super
- if edited_field && edited_field != "Subject"
+ if edited_field and (field == "To" or field == "Cc")
@type_selector.set_to :user
+ @headers[:user]["To"] = self.header["To"]
+ @headers[:user]["Cc"] = self.header["Cc"]
update
end
end
--
1.7.2.3
[-- Attachment #3: 0002-edit-message-mode-Add-an-optional-account-selector.patch --]
[-- Type: application/octet-stream, Size: 4018 bytes --]
From 401b9e43b049e9d8c54b6ebbd73305fa7a9d99c5 Mon Sep 17 00:00:00 2001
From: Damien Leone <damien.leone@fensalir.fr>
Date: Sun, 27 Feb 2011 19:05:35 +0100
Subject: [PATCH 2/3] edit-message-mode: Add an optional account selector
Set to true by default, it allows you to change your account in
edit-mode using a horizontal selector. It doesn't change any of the
previous behaviour since the proper account is selected by default, it
also handles customized choice in case the user edited the From field
manually.
---
lib/sup.rb | 1 +
lib/sup/modes/edit-message-mode.rb | 42 ++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/lib/sup.rb b/lib/sup.rb
index 67e834e..41709f1 100644
--- a/lib/sup.rb
+++ b/lib/sup.rb
@@ -297,6 +297,7 @@ EOS
:ask_for_cc => true,
:ask_for_bcc => false,
:ask_for_subject => true,
+ :account_selector => true,
:confirm_no_attachments => true,
:confirm_top_posting => true,
:jump_to_open_message => true,
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
index a374197..8e0e9c3 100644
--- a/lib/sup/modes/edit-message-mode.rb
+++ b/lib/sup/modes/edit-message-mode.rb
@@ -116,6 +116,27 @@ EOS
@selector_label_width = 0
@async_mode = nil
+ if $config[:account_selector]
+ ## Duplicate e-mail strings to prevent a "can't modify frozen
+ ## object" crash triggered by the String::display_length()
+ ## method in util.rb
+ user_emails_copy = []
+ AccountManager.user_emails.each { |e| user_emails_copy.push e.dup }
+
+ @account_selector =
+ HorizontalSelector.new "Account:", AccountManager.user_accounts + [nil], user_emails_copy + ["Customized"]
+
+ if @header["From"] =~ /<?(\S+@(\S+?))>?$/
+ @account_selector.set_to AccountManager.account_for($1)
+ @account_user = ""
+ else
+ @account_selector.set_to nil
+ @account_user = @header["From"]
+ end
+
+ add_selector @account_selector
+ end
+
@crypto_selector =
if CryptoManager.have_crypto?
HorizontalSelector.new "Crypto:", [:none] + CryptoManager::OUTGOING_MESSAGE_OPERATIONS.keys, ["None"] + CryptoManager::OUTGOING_MESSAGE_OPERATIONS.values
@@ -164,6 +185,8 @@ EOS
def edit_subject; edit_field "Subject" end
def edit_message
+ old_from = @header["From"] if @account_selector
+
@file = Tempfile.new "sup.#{self.class.name.gsub(/.*::/, '').camel_to_hyphy}"
@file.puts format_headers(@header - NON_EDITABLE_HEADERS).first
@file.puts
@@ -180,6 +203,12 @@ EOS
header, @body = parse_file @file.path
@header = header - NON_EDITABLE_HEADERS
+
+ if @account_selector and @header["From"] != old_from
+ @account_user = @header["From"]
+ @account_selector.set_to nil
+ end
+
handle_new_text @header, @body
rerun_crypto_selector_hook
update
@@ -295,6 +324,7 @@ protected
if curpos < @selectors.length
@selectors[curpos].roll_left
buffer.mark_dirty
+ update if @account_selector
else
col_left
end
@@ -304,6 +334,7 @@ protected
if curpos < @selectors.length
@selectors[curpos].roll_right
buffer.mark_dirty
+ update if @account_selector
else
col_right
end
@@ -315,6 +346,11 @@ protected
end
def update
+ if @account_selector
+ account = @account_selector.val
+ @header["From"] = account && account.full_address || @account_user
+ end
+
regen_text
buffer.mark_dirty if buffer
end
@@ -532,6 +568,12 @@ protected
if contacts
text = contacts.map { |s| s.full_address }.join(", ")
@header[field] = parse_header field, text
+
+ if @account_selector and field == "From"
+ @account_user = @header["From"]
+ @account_selector.set_to nil
+ end
+
rerun_crypto_selector_hook
update
end
--
1.7.2.3
[-- Attachment #4: 0003-edit-message-mode-Fix-the-way-signatures-are-handled.patch --]
[-- Type: application/octet-stream, Size: 3266 bytes --]
From fa0af2b2f2792a535d46b608ebef6beb009bb1ca Mon Sep 17 00:00:00 2001
From: Damien Leone <damien.leone@fensalir.fr>
Date: Sun, 27 Feb 2011 19:07:53 +0100
Subject: [PATCH 3/3] edit-message-mode: Fix the way signatures are handled
The current signatures handling is not suitable for account changing
in edit-message-mode. It is working fine when the edit_signature
option is false, but it could have a better behavior when this option
is enabled.
This commit tries to do this by appending the signature to the body
text if the edit_signature is true, then after editing the message it
checks if the signature has been modified by comparing the end of the
file to the current account's signature. If it has been edited then we
stick to it by setting @sig_edited to true, otherwise the signature
will still be automatically changed if another account is selected.
---
lib/sup/modes/edit-message-mode.rb | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
index 8e0e9c3..9341d82 100644
--- a/lib/sup/modes/edit-message-mode.rb
+++ b/lib/sup/modes/edit-message-mode.rb
@@ -93,7 +93,7 @@ EOS
@header_lines = []
@body = opts.delete(:body) || []
- @body += sig_lines if $config[:edit_signature] && !opts.delete(:have_signature)
+ @sig_edited = false
if opts[:attachments]
@attachments = opts[:attachments].values
@@ -185,12 +185,14 @@ EOS
def edit_subject; edit_field "Subject" end
def edit_message
+ sig = sig_lines.join("\n")
old_from = @header["From"] if @account_selector
@file = Tempfile.new "sup.#{self.class.name.gsub(/.*::/, '').camel_to_hyphy}"
@file.puts format_headers(@header - NON_EDITABLE_HEADERS).first
@file.puts
@file.puts @body.join("\n")
+ @file.puts sig if ($config[:edit_signature] and !@sig_edited)
@file.close
editor = $config[:editor] || ENV['EDITOR'] || "/usr/bin/vi"
@@ -204,6 +206,19 @@ EOS
header, @body = parse_file @file.path
@header = header - NON_EDITABLE_HEADERS
+ if $config[:edit_signature]
+ pbody = @body.join("\n")
+ blen = pbody.length
+ slen = sig.length
+
+ if blen > slen and pbody[blen-slen..blen] == sig
+ @sig_edited = false
+ @body = pbody[0..blen-slen].split("\n")
+ else
+ @sig_edited = true
+ end
+ end
+
if @account_selector and @header["From"] != old_from
@account_user = @header["From"]
@account_selector.set_to nil
@@ -358,7 +373,7 @@ protected
def regen_text
header, @header_lines = format_headers(@header - NON_EDITABLE_HEADERS) + [""]
@text = header + [""] + @body
- @text += sig_lines unless $config[:edit_signature]
+ @text += sig_lines unless @sig_edited
@attachment_lines_offset = 0
@@ -473,7 +488,7 @@ protected
m = RMail::Message.new
m.header["Content-Type"] = "text/plain; charset=#{$encoding}"
m.body = @body.join("\n")
- m.body += sig_lines.join("\n") unless $config[:edit_signature]
+ m.body += "\n" + sig_lines.join("\n") unless @sig_edited
## body must end in a newline or GPG signatures will be WRONG!
m.body += "\n" unless m.body =~ /\n\Z/
--
1.7.2.3
[-- Attachment #5: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [sup-devel] [PATCHES] Add an account selector in edit-mode
2011-03-13 16:13 [sup-devel] [PATCHES] Add an account selector in edit-mode Damien Leone
@ 2011-03-13 20:21 ` Sascha Silbe
2011-05-30 17:23 ` Hamish
1 sibling, 0 replies; 7+ messages in thread
From: Sascha Silbe @ 2011-03-13 20:21 UTC (permalink / raw)
To: Damien Leone; +Cc: sup-devel
[-- Attachment #1.1: Type: text/plain, Size: 1307 bytes --]
Excerpts from Damien Leone's message of Sun Mar 13 17:13:05 +0100 2011:
> Sup guys,
>
> Please see commit messages for detailed informations.
> Attachment: 0001-reply-mode-improve-the-way-headers-are-handled.patch
This one would possibly break my workflow. My From address is chosen in
the before-edit hook based on the set of recipients. Since you only
call before-edit once with headers_full as headers, whatever From
address gets chosen for the initial reply mode will "stick".
It also seems that something I wanted to do for some time was already
possible with the old code, but isn't anymore with yours: Changing the
contents of the To and CC fields for the selector. Even arbitrary headers
(Mail-Followup-To in my case) could be keyed on the selector. I now
understand why before-edit was invoked multiple times. :)
And the part where I need to avoid modifying the body on subsequent
invocations looks like a bug in the original code: @bodies[k] should
contain a _copy_ of body (currently all @bodies[k] contain a reference
to the same instance, rendering the Hash useless).
BTW, do you know about Hash.merge! ? Some parts of your code could have
been simplified by using merge! instead of merge.
Sascha
--
http://sascha.silbe.org/
http://www.infra-silbe.de/
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 500 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [sup-devel] [PATCHES] Add an account selector in edit-mode
2011-03-13 16:13 [sup-devel] [PATCHES] Add an account selector in edit-mode Damien Leone
2011-03-13 20:21 ` Sascha Silbe
@ 2011-05-30 17:23 ` Hamish
2011-06-19 21:48 ` Hamish
1 sibling, 1 reply; 7+ messages in thread
From: Hamish @ 2011-05-30 17:23 UTC (permalink / raw)
To: sup-devel
Excerpts from Damien Leone's message of Sun Mar 13 16:13:05 +0000 2011:
> 0002-edit-message-mode-Add-an-optional-account-selector.patch
I've finally got around to reviewing some of these. The patch above
seems to confuse possible email addresses, and user accounts. These do
not line up as it is possible for each account to have multiple email
addresses associated with it (using the alternates value in an account).
I have only one account, and have alternates, so the account selector
appears, but doesn't work due to the confusion. I've had a look through,
but not found an easy way to fix that behaviour, so I'll leave it up to
you as to how you want to do it.
I imagine though that you would want to handle all the possible email
addresses, so I've written an extra patch to do that, and pushed your
patch and mine onto the (new) account_selector branch on gitorious.
Please have a look and see if what I've done still works for you, and is
what you meant.
I also wondered whether to change the behaviour so that the account
selector will only appear if there is more than one possible email
address to choose from, but I thought it would be handy to be able to
reset the From: header to your usual From: using the selector, rather
than having to hand edit whatever was in the To: header that you are
replying to. What do you think?
I'll wait for you to review my changes before I merge this into next.
(My changes are in commit bf56b543cc664c40c3695e287ee8e7e924f2d0d1)
Hamish Downer
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [sup-devel] [PATCHES] Add an account selector in edit-mode
2011-05-30 17:23 ` Hamish
@ 2011-06-19 21:48 ` Hamish
2011-06-20 8:08 ` Damien Leone
2011-06-20 13:47 ` Sascha Silbe
0 siblings, 2 replies; 7+ messages in thread
From: Hamish @ 2011-06-19 21:48 UTC (permalink / raw)
To: sup-devel
Excerpts from Hamish's message of Mon May 30 18:23:10 +0100 2011:
> Excerpts from Damien Leone's message of Sun Mar 13 16:13:05 +0000 2011:
> > 0002-edit-message-mode-Add-an-optional-account-selector.patch
>
> I imagine though that you would want to handle all the possible email
> addresses, so I've written an extra patch to do that, and pushed your
> patch and mine onto the (new) account_selector branch on gitorious.
> Please have a look and see if what I've done still works for you, and is
> what you meant.
>
> I also wondered whether to change the behaviour so that the account
> selector will only appear if there is more than one possible email
> address to choose from, but I thought it would be handy to be able to
> reset the From: header to your usual From: using the selector, rather
> than having to hand edit whatever was in the To: header that you are
> replying to. What do you think?
>
> I'll wait for you to review my changes before I merge this into next.
> (My changes are in commit bf56b543cc664c40c3695e287ee8e7e924f2d0d1)
I've not heard anything for a bit, so I've pushed this into next for
wider testing, with the guard so that the account selector will only
appear if you have more than one email address. Shout out if it causes
any problems.
Hamish
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [sup-devel] [PATCHES] Add an account selector in edit-mode
2011-06-19 21:48 ` Hamish
@ 2011-06-20 8:08 ` Damien Leone
2011-06-20 13:47 ` Sascha Silbe
1 sibling, 0 replies; 7+ messages in thread
From: Damien Leone @ 2011-06-20 8:08 UTC (permalink / raw)
To: sup-devel
Hello,
Sorry I have been quite busy finishing my degree last weeks. I planned
to review and answer but it got delayed and delayed.
Thanks for pushing and fixing the issue with alternate addresses. I
will fetch it and let you know.
Excerpts from Hamish's message of dim. juin 19 23:48:40 +0200 2011:
> Excerpts from Hamish's message of Mon May 30 18:23:10 +0100 2011:
> > Excerpts from Damien Leone's message of Sun Mar 13 16:13:05 +0000 2011:
> > > 0002-edit-message-mode-Add-an-optional-account-selector.patch
> >
> > I imagine though that you would want to handle all the possible email
> > addresses, so I've written an extra patch to do that, and pushed your
> > patch and mine onto the (new) account_selector branch on gitorious.
> > Please have a look and see if what I've done still works for you, and is
> > what you meant.
> >
> > I also wondered whether to change the behaviour so that the account
> > selector will only appear if there is more than one possible email
> > address to choose from, but I thought it would be handy to be able to
> > reset the From: header to your usual From: using the selector, rather
> > than having to hand edit whatever was in the To: header that you are
> > replying to. What do you think?
> >
> > I'll wait for you to review my changes before I merge this into next.
> > (My changes are in commit bf56b543cc664c40c3695e287ee8e7e924f2d0d1)
>
> I've not heard anything for a bit, so I've pushed this into next for
> wider testing, with the guard so that the account selector will only
> appear if you have more than one email address. Shout out if it causes
> any problems.
>
> Hamish
--
Damien Leone <damien.leone@fensalir.fr>
GPG: 0x82EB4DDF
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [sup-devel] [PATCHES] Add an account selector in edit-mode
2011-06-19 21:48 ` Hamish
2011-06-20 8:08 ` Damien Leone
@ 2011-06-20 13:47 ` Sascha Silbe
2011-06-20 21:38 ` Hamish Downer
1 sibling, 1 reply; 7+ messages in thread
From: Sascha Silbe @ 2011-06-20 13:47 UTC (permalink / raw)
To: Hamish; +Cc: sup-devel
[-- Attachment #1.1: Type: text/plain, Size: 1674 bytes --]
Excerpts from Hamish's message of Sun Jun 19 23:48:40 +0200 2011:
> I've not heard anything for a bit, so I've pushed this into next for
> wider testing, with the guard so that the account selector will only
> appear if you have more than one email address. Shout out if it causes
> any problems.
This breaks the "Reply to" selector for me. Any attempt to change the
value results in an exception:
--- TypeError from thread: main
no implicit conversion from nil to integer
./lib/sup/horizontal-selector.rb:18:in `[]'
./lib/sup/horizontal-selector.rb:18:in `val'
./lib/sup/modes/edit-message-mode.rb:374:in `update'
./lib/sup/modes/edit-message-mode.rb:351:in `move_cursor_left'
./lib/sup/modes/reply-mode.rb:174:in `move_cursor_left'
./lib/sup/mode.rb:59:in `send'
./lib/sup/mode.rb:59:in `handle_input'
./lib/sup/buffer.rb:278:in `handle_input'
bin/sup:271
Reverting the account selector patches makes it work again.
This is the code in edit-message-mode.rb:
372 def update
373 if @account_selector
374 if @account_selector.val.nil?
375 @header["From"] = @account_user
376 else
377 @header["From"] = AccountManager.full_address_for @account_selector.val
378 end
379 end
And horizontal-selector.rb:
18 def val; @vals[@selection] end
So account_selector.selection is nil. The only way for that to happen is
by calling account_selector.set_to() with a value that's not in
account_selector.vals (IMO HorizontalSelector should throw an exception
in that case, BTW). Any idea where and why that would have happened?
Sascha
--
http://sascha.silbe.org/
http://www.infra-silbe.de/
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [sup-devel] [PATCHES] Add an account selector in edit-mode
2011-06-20 13:47 ` Sascha Silbe
@ 2011-06-20 21:38 ` Hamish Downer
0 siblings, 0 replies; 7+ messages in thread
From: Hamish Downer @ 2011-06-20 21:38 UTC (permalink / raw)
To: sup-devel
Excerpts from Sascha Silbe's message of Mon Jun 20 14:47:57 +0100 2011:
> This breaks the "Reply to" selector for me. Any attempt to change the
> value results in an exception:
>
> So account_selector.selection is nil. The only way for that to happen is
> by calling account_selector.set_to() with a value that's not in
> account_selector.vals (IMO HorizontalSelector should throw an exception
> in that case, BTW). Any idea where and why that would have happened?
I'm afraid I couldn't reproduce your exception - do you have several
accounts? Multiple email addresses per account?
Anyway I've pushed an update to the account_selector branch (commit
5bb55890) that you could try out. The basic change is that in the
original patch, there was:
@account_selector =
HorizontalSelector.new "Account:", AccountManager.user_accounts + [nil], user_emails_copy + ["Customized"]
Note the [nil] added to the end of the first array. I've changed that to
[:user] (in line with the replyto selector) and made the other changes
in the file to stay in line with that. As I say I can't reproduce your
problem, so I'm not 100% sure I've solved it, so let me know how you get
on. If it fixes it for you I'll put the patch onto next aswell.
Hamish Downer
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-06-20 21:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-13 16:13 [sup-devel] [PATCHES] Add an account selector in edit-mode Damien Leone
2011-03-13 20:21 ` Sascha Silbe
2011-05-30 17:23 ` Hamish
2011-06-19 21:48 ` Hamish
2011-06-20 8:08 ` Damien Leone
2011-06-20 13:47 ` Sascha Silbe
2011-06-20 21:38 ` Hamish Downer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox