Changeset ecfdae11289287fec91513ba406f03d044dc56d9
- Timestamp:
- 09/21/10 21:42:01 (3 years ago)
- Author:
- Armin Burgmeier <armin@…>
- Parents:
- 4a12852956b8c9d65420066459277f873f6247ee
- Children:
- 428f3277c6c01ec69d678024f9073fd42c839e46
- git-committer:
- Armin Burgmeier <armin@arbur.net> / 2010-09-21T21:42:01Z+0200
- Message:
-
Add a "Disconnect from Server" option to the context menu (#542)
2010-09-21 Armin Burgmeier <armin@…>
- code/commands/browser-context-commands.hpp:
- code/commands/browser-context-commands.cpp: Add a "Disconnect from
Server" option to the context menu (#542).
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r4a12852
|
recfdae1
|
|
| | 1 | 2010-09-21 Armin Burgmeier <armin@arbur.net> |
| | 2 | |
| | 3 | * code/commands/browser-context-commands.hpp: |
| | 4 | * code/commands/browser-context-commands.cpp: Add a "Disconnect from |
| | 5 | Server" option to the context menu (#542). |
| | 6 | |
| 1 | 7 | 2010-09-21 Armin Burgmeier <armin@arbur.net> |
| 2 | 8 | |
-
|
r61cce2c
|
recfdae1
|
|
| 90 | 90 | *this, &BrowserContextCommands::on_menu_deactivate)); |
| 91 | 91 | |
| | 92 | // Add "Disconnect" menu option if the connection |
| | 93 | // item has been clicked at |
| | 94 | if(is_toplevel) |
| | 95 | { |
| | 96 | Gtk::ImageMenuItem* disconnect_item = Gtk::manage( |
| | 97 | new Gtk::ImageMenuItem(_("_Disconnect from Server"), true)); |
| | 98 | disconnect_item->set_image(*Gtk::manage(new Gtk::Image( |
| | 99 | Gtk::Stock::DISCONNECT, Gtk::ICON_SIZE_MENU))); |
| | 100 | disconnect_item->signal_activate().connect(sigc::bind( |
| | 101 | sigc::mem_fun(*this, |
| | 102 | &BrowserContextCommands::on_disconnect), |
| | 103 | browser)); |
| | 104 | disconnect_item->show(); |
| | 105 | menu->append(*disconnect_item); |
| | 106 | |
| | 107 | // Separator |
| | 108 | Gtk::SeparatorMenuItem* sep_item = |
| | 109 | Gtk::manage(new Gtk::SeparatorMenuItem); |
| | 110 | sep_item->show(); |
| | 111 | menu->append(*sep_item); |
| | 112 | } |
| | 113 | |
| 92 | 114 | // Create Document |
| 93 | 115 | Gtk::ImageMenuItem* new_document_item = Gtk::manage( |
| … |
… |
|
| 127 | 149 | |
| 128 | 150 | Gtk::ImageMenuItem* new_directory_item = Gtk::manage( |
| 129 | | new Gtk::ImageMenuItem(_("Create Directory..."), |
| | 151 | new Gtk::ImageMenuItem(_("Create Di_rectory..."), |
| 130 | 152 | true)); |
| 131 | 153 | new_directory_item->set_image(*new_directory_image); |
| … |
… |
|
| 184 | 206 | } |
| 185 | 207 | |
| | 208 | void Gobby::BrowserContextCommands::on_disconnect(InfcBrowser* browser) |
| | 209 | { |
| | 210 | InfXmlConnection* connection = infc_browser_get_connection(browser); |
| | 211 | InfXmlConnectionStatus status; |
| | 212 | g_object_get(G_OBJECT(connection), "status", &status, NULL); |
| | 213 | |
| | 214 | if(status != INF_XML_CONNECTION_CLOSED && |
| | 215 | status != INF_XML_CONNECTION_CLOSING) |
| | 216 | { |
| | 217 | inf_xml_connection_close(connection); |
| | 218 | } |
| | 219 | } |
| | 220 | |
| 186 | 221 | void Gobby::BrowserContextCommands::on_new(InfcBrowser* browser, |
| 187 | 222 | InfcBrowserIter iter, |
-
|
r61cce2c
|
recfdae1
|
|
| 58 | 58 | |
| 59 | 59 | // Context commands |
| | 60 | void on_disconnect(InfcBrowser* browser); |
| | 61 | |
| 60 | 62 | void on_new(InfcBrowser* browser, InfcBrowserIter iter, |
| 61 | 63 | bool directory); |