Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] [PATCH] Bugfix: Create dynamically growing fields (long filenames are now supported)
@ 2010-02-15 22:13 Michael Stapelberg
  2010-02-27  8:18 ` Rich Lane
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Stapelberg @ 2010-02-15 22:13 UTC (permalink / raw)
  To: sup-devel

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

Hi,

the attached patch modifies textfield.rb to create a dynamically growable field
instead of one with a fixed size. The text field can now hold a dynamic amount
of characters which is often necessary if you have long file names.

How to reproduce the bug:
1) mkdir -p /tmp/very/long-folder-name-foo-bar-baz/longer-than-one-line-foo-bar-bleh-bleh/maw-maw-maw-maw-maw-maw-maw-maw-maw-maw-maw
2) echo foo > /tmp/very/long-folder-name-foo-bar-baz/longer-than-one-line-foo-bar-bleh-bleh/maw-maw-maw-maw-maw-maw-maw-maw-maw-maw-maw/foo.txt
3) create a new message in sup and try to add the new file as an attachment

Please merge this one for the next release.

Best regards,
Michael

[-- Attachment #2: 0001-tf-dynamic-grow.patch --]
[-- Type: application/octet-stream, Size: 1015 bytes --]

From 3e7b378188cc366682503ce0264058e955529ab9 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael@stapelberg.de>
Date: Mon, 15 Feb 2010 23:09:19 +0100
Subject: [PATCH] Bugfix: Create dynamically growing fields (long filenames are now supported)

---
 lib/sup/textfield.rb |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
index 9afeb34..32d34b5 100644
--- a/lib/sup/textfield.rb
+++ b/lib/sup/textfield.rb
@@ -33,7 +33,9 @@ class TextField
     @w, @y, @x, @width = window, y, x, width
     @question = question
     @completion_block = block
-    @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 256, 0
+    @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 0, 0
+    @field.field_opts_off(Ncurses::Form::O_STATIC)
+    @field.max_field = 0
     @form = Ncurses::Form.new_form [@field]
     @value = default || ''
     Ncurses::Form.post_form @form
-- 
1.6.5


[-- Attachment #3: 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] 3+ messages in thread

end of thread, other threads:[~2010-02-27 12:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-15 22:13 [sup-devel] [PATCH] Bugfix: Create dynamically growing fields (long filenames are now supported) Michael Stapelberg
2010-02-27  8:18 ` Rich Lane
2010-02-27 12:45   ` Michael Stapelberg

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