Changeset 1662ea7cb97e74c04650ddda1130c2ea7a4d07ce
- Timestamp:
- 06/01/07 23:58:02 (6 years ago)
- Author:
- Philipp Kern <phil@…>
- Parents:
- 0c6e731fde2f0fa4c225215371d356fed6d6f6f3
- Children:
- c006fa359f7823874cf7a814cb87823276535eae
- git-committer:
- Philipp Kern <phil@0x539.de> / 2007-01-06T22:58:02Z+0000
- Message:
-
[project @ Disable OK button in password dialog when passwords do not match]
Original author: Armin Burgmeier <armin@…>
Date: 2006-03-07 18:03:45+00:00
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r91dd7f0
|
r1662ea7
|
|
| 39 | 39 | Glib::ustring get_password() const; |
| 40 | 40 | protected: |
| 41 | | virtual void on_response(int response_id); |
| | 41 | void on_password_changed(); |
| 42 | 42 | |
| 43 | 43 | bool m_request; |
-
|
r91dd7f0
|
r1662ea7
|
|
| 64 | 64 | m_ent_conf_password.hide(); |
| 65 | 65 | } |
| | 66 | else |
| | 67 | { |
| | 68 | m_ent_password.signal_changed().connect( |
| | 69 | sigc::mem_fun( |
| | 70 | *this, |
| | 71 | &PasswordDialog::on_password_changed |
| | 72 | ) |
| | 73 | ); |
| | 74 | |
| | 75 | m_ent_conf_password.signal_changed().connect( |
| | 76 | sigc::mem_fun( |
| | 77 | *this, |
| | 78 | &PasswordDialog::on_password_changed |
| | 79 | ) |
| | 80 | ); |
| | 81 | } |
| | 82 | |
| | 83 | set_response_sensitive(Gtk::RESPONSE_OK, false); |
| 66 | 84 | |
| 67 | 85 | set_resizable(false); |
| … |
… |
|
| 89 | 107 | } |
| 90 | 108 | |
| 91 | | void Gobby::PasswordDialog::on_response(int response_id) |
| | 109 | void Gobby::PasswordDialog::on_password_changed() |
| 92 | 110 | { |
| 93 | | if(response_id == Gtk::RESPONSE_OK && !m_request) |
| 94 | | { |
| 95 | | if(m_ent_conf_password.get_text() != m_ent_password.get_text() ) |
| 96 | | { |
| 97 | | Gtk::MessageDialog dlg( |
| 98 | | *this, |
| 99 | | _("Passwords do not match"), |
| 100 | | false, |
| 101 | | Gtk::MESSAGE_ERROR, |
| 102 | | Gtk::BUTTONS_OK, |
| 103 | | true |
| 104 | | ); |
| 105 | | |
| 106 | | dlg.run(); |
| 107 | | return; |
| 108 | | } |
| 109 | | } |
| 110 | | |
| 111 | | Gtk::Dialog::on_response(response_id); |
| | 111 | if(m_ent_password.get_text().empty() ) |
| | 112 | set_response_sensitive(Gtk::RESPONSE_OK, false); |
| | 113 | else if(m_ent_password.get_text() != m_ent_conf_password.get_text() ) |
| | 114 | set_response_sensitive(Gtk::RESPONSE_OK, false); |
| | 115 | else |
| | 116 | set_response_sensitive(Gtk::RESPONSE_OK, true); |
| 112 | 117 | } |
| 113 | | |