Changeset be1b56bbd438ae97c8e3d71f1bdfb610749fbf9f
- Timestamp:
- 07/09/07 22:54:30 (6 years ago)
- Author:
- Philipp Kern <phil@…>
- Parents:
- 0b2867fe24ca70a931a026e7f628fd391b42c557
- Children:
- 2270de3b6315c289b39835cf98ecb546946dce43
- git-committer:
- Philipp Kern <phil@0x539.de> / 2007-07-09T20:54:30Z+0000
- Message:
-
2007-07-09 Philipp Kern <phil@…>
- inc/joindialog.hpp:
- src/joindialog.cpp: add support for IPv6 autodiscovery
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r0b2867f
|
rbe1b56b
|
|
| | 1 | 2007-07-09 Philipp Kern <phil@0x539.de> |
| | 2 | |
| | 3 | * inc/joindialog.hpp: |
| | 4 | * src/joindialog.cpp: add support for IPv6 autodiscovery |
| | 5 | |
| 1 | 6 | 2007-07-09 Armin Burgmeier <armin@0x539.de> |
| 2 | 7 | |
-
|
r73098a3
|
rbe1b56b
|
|
| 82 | 82 | Gtk::TreeModel::iterator find_entry(const std::string& name) const; |
| 83 | 83 | #ifndef WITH_AVAHI |
| 84 | | virtual bool on_timer(); |
| | 84 | bool on_timer(); |
| 85 | 85 | #endif |
| 86 | | virtual void on_discover(const std::string& name, |
| 87 | | const net6::ipv4_address& addr); |
| 88 | | virtual void on_leave(const std::string& name); |
| 89 | | virtual void on_change(); |
| | 86 | // The template function is implemented in the source file, thus it's private. |
| | 87 | private: |
| | 88 | template <typename addr_type> |
| | 89 | void on_discover(const std::string& name, |
| | 90 | const addr_type& addr); |
| | 91 | |
| | 92 | protected: |
| | 93 | void on_leave(const std::string& name); |
| | 94 | void on_change(); |
| 90 | 95 | |
| 91 | 96 | virtual void on_show(); |
-
|
r500d2c5
|
rbe1b56b
|
|
| 125 | 125 | m_ep_discover.add(m_session_view); |
| 126 | 126 | |
| 127 | | m_zeroconf->discover_event().connect( |
| 128 | | sigc::mem_fun(*this, &JoinDialog::on_discover)); |
| | 127 | m_zeroconf->discover_event().connect(sigc::mem_fun( |
| | 128 | *this, |
| | 129 | &JoinDialog::on_discover<net6::ipv4_address>)); |
| | 130 | m_zeroconf->discover6_event().connect(sigc::mem_fun( |
| | 131 | *this, |
| | 132 | &JoinDialog::on_discover<net6::ipv6_address>)); |
| 129 | 133 | m_zeroconf->leave_event().connect( |
| 130 | 134 | sigc::mem_fun(*this, &JoinDialog::on_leave) ); |
| … |
… |
|
| 223 | 227 | #endif |
| 224 | 228 | |
| | 229 | template <typename addr_type> |
| 225 | 230 | void Gobby::JoinDialog::on_discover(const std::string& name, |
| 226 | | const net6::ipv4_address& addr) |
| | 231 | const addr_type& addr) |
| 227 | 232 | { |
| 228 | 233 | // Ignore entries which introduce user names which are already in |
| … |
… |
|
| 230 | 235 | if(find_entry(name) != m_session_list->children().end() ) |
| 231 | 236 | return; |
| | 237 | |
| 232 | 238 | Gtk::TreeModel::Row row = *(m_session_list->append() ); |
| 233 | 239 | row[m_session_cols.name] = name; |
| 234 | 240 | row[m_session_cols.host] = addr.get_name(); |
| | 241 | // Generic addresses do not bear ports, thus the passed addr_type |
| | 242 | // must implement get_port(). |
| 235 | 243 | row[m_session_cols.port] = addr.get_port(); |
| | 244 | |
| 236 | 245 | m_ep_discover.set_expanded(true); |
| 237 | 246 | } |