Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] Display a default save path for attachments
@ 2008-11-23 18:53 Steve Goldman
  2008-11-27  0:15 ` William Morgan
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Goldman @ 2008-11-23 18:53 UTC (permalink / raw)


Let the user specify a default path for saving attachments with
:default_attachment_save_dir: in config.yaml, and display this path in
front of the filename when saving an attachment in thread view mode.
---
 lib/sup.rb                        |    1 +
 lib/sup/modes/thread-view-mode.rb |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/sup.rb b/lib/sup.rb
index 93369a5..92ace7d 100644
--- a/lib/sup.rb
+++ b/lib/sup.rb
@@ -221,6 +221,7 @@ else
     :confirm_no_attachments => true,
     :confirm_top_posting => true,
     :discard_snippets_from_encrypted_messages => false,
+    :default_attachment_save_dir => "",
   }
   begin
     FileUtils.mkdir_p Redwood::BASE_DIR
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index 5f578d3..011eccd 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -259,7 +259,7 @@ EOS
     chunk = @chunk_lines[curpos] or return
     case chunk
     when Chunk::Attachment
-      fn = BufferManager.ask_for_filename :filename, "Save attachment to file: ", chunk.filename
+      fn = BufferManager.ask_for_filename :filename, "Save attachment to file: ", ($config[:default_attachment_save_dir] + chunk.filename)
       save_to_file(fn) { |f| f.print chunk.raw_content } if fn
     else
       m = @message_lines[curpos]
-- 
1.5.6.4
-- 

Steve Goldman
sgoldman at tower-research.com

T: 212.219.6014
F: 212.219.6007

Tower Research Capital, LLC
377 Broadway, 11th Fl.
New York, NY 10013


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [sup-talk] [PATCH] Display a default save path for attachments
  2008-11-23 18:53 [sup-talk] [PATCH] Display a default save path for attachments Steve Goldman
@ 2008-11-27  0:15 ` William Morgan
  0 siblings, 0 replies; 2+ messages in thread
From: William Morgan @ 2008-11-27  0:15 UTC (permalink / raw)


Reformatted excerpts from Steve Goldman's message of 2008-11-23:
> Let the user specify a default path for saving attachments with
> :default_attachment_save_dir: in config.yaml, and display this path in
> front of the filename when saving an attachment in thread view mode.

Applied, thanks!
-- 
William <wmorgan-sup at masanjin.net>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-27  0:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-23 18:53 [sup-talk] [PATCH] Display a default save path for attachments Steve Goldman
2008-11-27  0:15 ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox