Changeset 877d3231c6feab2ff51abd8a53b79bf1ea6c7ad6
- Timestamp:
- 11/09/09 10:57:08 (4 years ago)
- Author:
- Armin Burgmeier <armin@…>
- git-author:
- Armin Burgmeier <armin@arbur.net> / 2009-11-08T00:37:07Z+0100
- Parents:
- 646a4f3c01880913367395f619aea3fe17d0cca5
- Children:
- f8809f6ead608ebf57654a28ca9e0bc748cb3ee6
- git-committer:
- Armin Burgmeier <armin@arbur.net> / 2009-11-09T10:57:08Z+0100
- Message:
-
Added ChatSessionView? and a paned for the chat area
2009-11-08 Armin Burgmeier <armin@…>
- code/core/chatsessionview.hpp:
- code/core/chatsessionview.cpp: Added a SessionView?-deriving class to
show a chat session.
- code/core/Makefile.am: Added the new files to the build.
- code/core/folder.hpp:
- code/core/folder.cpp: Added add_chat_session, renamed add_document
to add_text_session.
- code/commands/browser-commands.cpp: Use add_text_session instead of
add_document.
- code/window.hpp:
- code/window.cpp: Added a bottom pane for the chat.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r646a4f3
|
r877d323
|
|
| | 1 | 2009-11-08 Armin Burgmeier <armin@arbur.net> |
| | 2 | |
| | 3 | * code/core/chatsessionview.hpp: |
| | 4 | * code/core/chatsessionview.cpp: Added a SessionView-deriving class to |
| | 5 | show a chat session. |
| | 6 | |
| | 7 | * code/core/Makefile.am: Added the new files to the build. |
| | 8 | |
| | 9 | * code/core/folder.hpp: |
| | 10 | * code/core/folder.cpp: Added add_chat_session, renamed add_document |
| | 11 | to add_text_session. |
| | 12 | |
| | 13 | * code/commands/browser-commands.cpp: Use add_text_session instead of |
| | 14 | add_document. |
| | 15 | |
| | 16 | * code/window.hpp: |
| | 17 | * code/window.cpp: Added a bottom pane for the chat. |
| | 18 | |
| 1 | 19 | 2009-10-25 Armin Burgmeier <armin@arbur.net> |
| 2 | 20 | |
-
|
r646a4f3
|
r877d323
|
|
| 291 | 291 | "remote-hostname", &hostname, NULL); |
| 292 | 292 | |
| 293 | | TextSessionView& view = m_folder.add_document( |
| | 293 | TextSessionView& view = m_folder.add_text_session( |
| 294 | 294 | INF_TEXT_SESSION(session), |
| 295 | 295 | infc_browser_iter_get_name(browser, iter), |
-
|
r646a4f3
|
r877d323
|
|
| 3 | 3 | libgobby_core_a_SOURCES = \ |
| 4 | 4 | browser.cpp \ |
| | 5 | chatsessionview.cpp \ |
| 5 | 6 | closableframe.cpp \ |
| 6 | 7 | documentinfostorage.cpp \ |
| … |
… |
|
| 23 | 24 | noinst_HEADERS = \ |
| 24 | 25 | browser.hpp \ |
| | 26 | chatsessionview.hpp \ |
| 25 | 27 | closableframe.hpp \ |
| 26 | 28 | documentinfostorage.hpp \ |
-
|
r646a4f3
|
r877d323
|
|
| 119 | 119 | |
| 120 | 120 | Gobby::TextSessionView& |
| 121 | | Gobby::Folder::add_document(InfTextSession* session, |
| 122 | | const Glib::ustring& title, |
| 123 | | const Glib::ustring& path, |
| 124 | | const Glib::ustring& hostname, |
| 125 | | const std::string& info_storage_key) |
| | 121 | Gobby::Folder::add_text_session(InfTextSession* session, |
| | 122 | const Glib::ustring& title, |
| | 123 | const Glib::ustring& path, |
| | 124 | const Glib::ustring& hostname, |
| | 125 | const std::string& info_storage_key) |
| 126 | 126 | { |
| 127 | 127 | TextSessionView* view = Gtk::manage( |
| … |
… |
|
| 155 | 155 | } |
| 156 | 156 | |
| | 157 | Gobby::ChatSessionView& |
| | 158 | Gobby::Folder::add_chat_session(InfChatSession* session, |
| | 159 | const Glib::ustring& title, |
| | 160 | const Glib::ustring& path, |
| | 161 | const Glib::ustring& hostname) |
| | 162 | { |
| | 163 | ChatSessionView* view = Gtk::manage( |
| | 164 | new ChatSessionView(session, title, path, hostname, |
| | 165 | m_preferences)); |
| | 166 | view->show(); |
| | 167 | m_signal_document_added.emit(*view); |
| | 168 | |
| | 169 | SessionUserView* userview = Gtk::manage( |
| | 170 | new SessionUserView( |
| | 171 | *view, |
| | 172 | m_preferences.appearance.show_userlist, |
| | 173 | m_preferences.appearance.userlist_width)); |
| | 174 | userview->show(); |
| | 175 | |
| | 176 | // TODO chat: Use a ChatTabLabel |
| | 177 | Gtk::Label* tablabel = Gtk::manage(new Gtk::Label(hostname)); |
| | 178 | /* tablabel->signal_close_request().connect( |
| | 179 | sigc::bind( |
| | 180 | sigc::mem_fun(*this, &Folder::on_tab_close_request), |
| | 181 | sigc::ref(*view)));*/ |
| | 182 | tablabel->show(); |
| | 183 | append_page(*userview, *tablabel); |
| | 184 | |
| | 185 | set_tab_reorderable(*userview, true); |
| | 186 | return *view; |
| | 187 | } |
| | 188 | |
| 157 | 189 | void Gobby::Folder::remove_document(SessionView& view) |
| 158 | 190 | { |
-
|
r646a4f3
|
r877d323
|
|
| 21 | 21 | |
| 22 | 22 | #include "core/textsessionview.hpp" |
| | 23 | #include "core/chatsessionview.hpp" |
| 23 | 24 | #include "core/preferences.hpp" |
| 24 | 25 | #include "util/defaultaccumulator.hpp" |
| … |
… |
|
| 35 | 36 | { |
| 36 | 37 | public: |
| | 38 | // TODO chat: This should be SignalSessionAdded/Removed/Changed |
| 37 | 39 | typedef sigc::signal<void, SessionView&> SignalDocumentAdded; |
| 38 | 40 | typedef sigc::signal<void, SessionView&> SignalDocumentRemoved; |
| … |
… |
|
| 43 | 45 | SignalDocumentCloseRequest; |
| 44 | 46 | |
| | 47 | // TODO chat: Should not require langmgr |
| 45 | 48 | Folder(Preferences& preferences, |
| 46 | 49 | GtkSourceLanguageManager* lang_manager); |
| 47 | 50 | ~Folder(); |
| 48 | 51 | |
| 49 | | TextSessionView& add_document(InfTextSession* session, |
| 50 | | const Glib::ustring& title, |
| 51 | | const Glib::ustring& path, |
| 52 | | const Glib::ustring& hostname, |
| 53 | | const std::string& info_storage_key); |
| | 52 | TextSessionView& add_text_session(InfTextSession* session, |
| | 53 | const Glib::ustring& title, |
| | 54 | const Glib::ustring& path, |
| | 55 | const Glib::ustring& hostname, |
| | 56 | const std::string& info_storage_key); |
| | 57 | ChatSessionView& add_chat_session(InfChatSession* session, |
| | 58 | const Glib::ustring& title, |
| | 59 | const Glib::ustring& path, |
| | 60 | const Glib::ustring& hostname); |
| 54 | 61 | void remove_document(SessionView& view); |
| 55 | 62 | |
-
|
r646a4f3
|
r877d323
|
|
| 46 | 46 | m_header(m_preferences, m_lang_manager), |
| 47 | 47 | m_browser(*this, Plugins::TEXT, m_statusbar, m_preferences), |
| 48 | | m_folder(m_preferences, m_lang_manager), |
| 49 | | m_statusbar(m_folder, m_preferences), |
| | 48 | m_text_folder(m_preferences, m_lang_manager), |
| | 49 | m_chat_folder(m_preferences, m_lang_manager), |
| | 50 | m_statusbar(m_text_folder, m_preferences), |
| 50 | 51 | m_info_storage(INF_GTK_BROWSER_MODEL(m_browser.get_store())), |
| 51 | 52 | m_operations(m_info_storage, m_statusbar), |
| 52 | | m_commands_autosave(m_folder, m_operations, m_info_storage, |
| | 53 | m_commands_autosave(m_text_folder, m_operations, m_info_storage, |
| 53 | 54 | m_preferences), |
| 54 | | m_commands_browser(m_browser, m_folder, m_info_storage, m_statusbar, |
| 55 | | m_preferences), |
| | 55 | m_commands_browser(m_browser, m_text_folder, m_info_storage, |
| | 56 | m_statusbar, m_preferences), |
| 56 | 57 | m_commands_browser_context(*this, m_browser, m_file_chooser, |
| 57 | 58 | m_operations, m_preferences), |
| 58 | | m_commands_folder(m_folder), |
| 59 | | m_commands_file(*this, m_header, m_browser, m_folder, m_statusbar, |
| 60 | | m_file_chooser, m_operations, m_info_storage, |
| | 59 | m_commands_folder(m_text_folder), |
| | 60 | // TODO: chat_folder commands |
| | 61 | m_commands_file(*this, m_header, m_browser, m_text_folder, |
| | 62 | m_statusbar, m_file_chooser, m_operations, |
| | 63 | m_info_storage, m_preferences), |
| | 64 | m_commands_edit(*this, m_header, m_text_folder, m_statusbar, |
| 61 | 65 | m_preferences), |
| 62 | | m_commands_edit(*this, m_header, m_folder, m_statusbar, |
| 63 | | m_preferences), |
| 64 | | m_commands_view(m_header, m_folder, m_preferences), |
| | 66 | m_commands_view(m_header, m_text_folder, m_preferences), |
| 65 | 67 | m_commands_help(*this, m_header, m_icon_mgr), |
| 66 | | m_title_bar(*this, m_folder) |
| | 68 | m_title_bar(*this, m_text_folder) |
| 67 | 69 | { |
| 68 | 70 | #ifdef WITH_UNIQUE |
| … |
… |
|
| 76 | 78 | m_header.show(); |
| 77 | 79 | m_browser.show(); |
| 78 | | m_folder.show(); |
| | 80 | m_text_folder.show(); |
| | 81 | m_chat_folder.show(); |
| 79 | 82 | |
| 80 | 83 | // Build UI |
| … |
… |
|
| 90 | 93 | Gtk::Frame* frame_text = Gtk::manage(new Gtk::Frame); |
| 91 | 94 | frame_text->set_shadow_type(Gtk::SHADOW_IN); |
| 92 | | frame_text->add(m_folder); |
| | 95 | frame_text->add(m_text_folder); |
| 93 | 96 | frame_text->show(); |
| 94 | 97 | |
| | 98 | // TODO: Use ClosableFrame here |
| | 99 | Gtk::Frame* frame_chat = Gtk::manage(new Gtk::Frame); |
| | 100 | frame_chat->set_shadow_type(Gtk::SHADOW_IN); |
| | 101 | frame_chat->add(m_chat_folder); |
| | 102 | frame_chat->show(); |
| | 103 | |
| | 104 | m_chat_paned.pack1(*frame_text, true, false); |
| | 105 | m_chat_paned.pack2(*frame_chat, false, false); |
| | 106 | m_chat_paned.show(); |
| | 107 | |
| 95 | 108 | m_paned.pack1(*frame_browser, false, false); |
| 96 | | m_paned.pack2(*frame_text, true, false); |
| | 109 | m_paned.pack2(m_chat_paned, true, false); |
| 97 | 110 | m_paned.show(); |
| 98 | 111 | |
| … |
… |
|
| 185 | 198 | |
| 186 | 199 | m_paned.set_position(m_paned.get_width() * 2 / 5); |
| | 200 | m_chat_paned.set_position(m_chat_paned.get_height() * 7 / 10); |
| 187 | 201 | } |
| 188 | 202 | |
-
|
r81f1f55
|
r877d323
|
|
| 73 | 73 | ~Window(); |
| 74 | 74 | |
| 75 | | const Folder& get_folder() const { return m_folder; } |
| 76 | | Folder& get_folder() { return m_folder; } |
| | 75 | const Folder& get_text_folder() const { return m_text_folder; } |
| | 76 | Folder& get_text_folder() { return m_text_folder; } |
| 77 | 77 | |
| 78 | 78 | void connect_to_host(const Glib::ustring& hostname) |
| … |
… |
|
| 133 | 133 | Gtk::VBox m_mainbox; |
| 134 | 134 | Gtk::HPaned m_paned; |
| | 135 | Gtk::VPaned m_chat_paned; |
| 135 | 136 | |
| 136 | 137 | Header m_header; |
| 137 | 138 | Browser m_browser; |
| 138 | | Folder m_folder; |
| | 139 | Folder m_text_folder; |
| | 140 | Folder m_chat_folder; |
| 139 | 141 | StatusBar m_statusbar; |
| 140 | 142 | |