Hi AND low pass filter -- fresh from the oven werks.
[ardour.git] / libs / gtkmm2ext / prompter.cc
index 2f7b43e0d551beab130520c2c5b750d449f38fef..51628ab13d5f46137b43e20f6bf0c253bbb93487 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 1999 Paul Barton-Davis 
+    Copyright (C) 1999 Paul Barton-Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
 #include <gtkmm/stock.h>
 #include <gtkmm2ext/prompter.h>
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace Gtkmm2ext;
@@ -52,29 +52,29 @@ Prompter::init ()
        set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
        set_position (Gtk::WIN_POS_MOUSE);
        set_name ("Prompter");
-       
+
        add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
 
-       /* 
+       /*
           Alas a generic 'affirmative' button seems a bit useless sometimes.
           You will have to add your own.
           After adding, use :
           set_response_sensitive (Gtk::RESPONSE_ACCEPT, false)
           to prevent the RESPONSE_ACCEPT button from permitting blank strings.
        */
-       
+
        entryLabel.set_line_wrap (true);
        entryLabel.set_name ("PrompterLabel");
 
        entryBox.set_homogeneous (false);
        entryBox.set_spacing (5);
        entryBox.set_border_width (10);
-       entryBox.pack_start (entryLabel);
-       entryBox.pack_start (entry, false, false);
+       entryBox.pack_start (entryLabel, false, false);
+       entryBox.pack_start (entry, true, true);
 
        get_vbox()->pack_start (entryBox);
        show_all_children();
-}      
+}
 
 void
 Prompter::on_show ()
@@ -86,6 +86,7 @@ Prompter::on_show ()
        if (first_show) {
                entry.signal_changed().connect (mem_fun (*this, &Prompter::on_entry_changed));
                entry.signal_activate().connect (mem_fun (*this, &Prompter::entry_activated));
+               can_accept_from_entry = !entry.get_text().empty();
                first_show = false;
        }
 
@@ -116,15 +117,15 @@ Prompter::entry_activated ()
        } else {
                response (Gtk::RESPONSE_CANCEL);
        }
-}              
+}
 
 void
 Prompter::on_entry_changed ()
 {
-       /* 
-          This is set up so that entering text in the entry 
-          field makes the RESPONSE_ACCEPT button active. 
-          Of course if you haven't added a RESPONSE_ACCEPT 
+       /*
+          This is set up so that entering text in the entry
+          field makes the RESPONSE_ACCEPT button active.
+          Of course if you haven't added a RESPONSE_ACCEPT
           button, nothing will happen at all.
        */