Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
From: Michael Stapelberg <michael+sup@stapelberg.de>
To: sup-devel <sup-devel@rubyforge.org>
Subject: [sup-devel] [PATCH] Bugfix: Create dynamically growing fields (long filenames are now supported)
Date: Mon, 15 Feb 2010 23:13:00 +0100	[thread overview]
Message-ID: <1266271874-sup-6404@midna.zekjur.net> (raw)

[-- 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

             reply	other threads:[~2010-02-15 22:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-15 22:13 Michael Stapelberg [this message]
2010-02-27  8:18 ` Rich Lane
2010-02-27 12:45   ` Michael Stapelberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1266271874-sup-6404@midna.zekjur.net \
    --to=michael+sup@stapelberg.de \
    --cc=sup-devel@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox