Changeset 877d3231c6feab2ff51abd8a53b79bf1ea6c7ad6

Show
Ignore:
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:
2 added
7 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r646a4f3 r877d323  
     12009-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 
    1192009-10-25  Armin Burgmeier  <armin@arbur.net> 
    220 
  • code/commands/browser-commands.cpp

    r646a4f3 r877d323  
    291291                     "remote-hostname", &hostname, NULL); 
    292292 
    293         TextSessionView& view = m_folder.add_document( 
     293        TextSessionView& view = m_folder.add_text_session( 
    294294                INF_TEXT_SESSION(session), 
    295295                infc_browser_iter_get_name(browser, iter), 
  • code/core/Makefile.am

    r646a4f3 r877d323  
    33libgobby_core_a_SOURCES = \ 
    44        browser.cpp \ 
     5        chatsessionview.cpp \ 
    56        closableframe.cpp \ 
    67        documentinfostorage.cpp \ 
     
    2324noinst_HEADERS = \ 
    2425        browser.hpp \ 
     26        chatsessionview.hpp \ 
    2527        closableframe.hpp \ 
    2628        documentinfostorage.hpp \ 
  • code/core/folder.cpp

    r646a4f3 r877d323  
    119119 
    120120Gobby::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) 
     121Gobby::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) 
    126126{ 
    127127        TextSessionView* view = Gtk::manage( 
     
    155155} 
    156156 
     157Gobby::ChatSessionView& 
     158Gobby::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 
    157189void Gobby::Folder::remove_document(SessionView& view) 
    158190{ 
  • code/core/folder.hpp

    r646a4f3 r877d323  
    2121 
    2222#include "core/textsessionview.hpp" 
     23#include "core/chatsessionview.hpp" 
    2324#include "core/preferences.hpp" 
    2425#include "util/defaultaccumulator.hpp" 
     
    3536{ 
    3637public: 
     38        // TODO chat: This should be SignalSessionAdded/Removed/Changed 
    3739        typedef sigc::signal<void, SessionView&> SignalDocumentAdded; 
    3840        typedef sigc::signal<void, SessionView&> SignalDocumentRemoved; 
     
    4345                        SignalDocumentCloseRequest; 
    4446 
     47        // TODO chat: Should not require langmgr 
    4548        Folder(Preferences& preferences, 
    4649               GtkSourceLanguageManager* lang_manager); 
    4750        ~Folder(); 
    4851 
    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); 
    5461        void remove_document(SessionView& view); 
    5562 
  • code/window.cpp

    r646a4f3 r877d323  
    4646        m_header(m_preferences, m_lang_manager), 
    4747        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), 
    5051        m_info_storage(INF_GTK_BROWSER_MODEL(m_browser.get_store())), 
    5152        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, 
    5354                            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), 
    5657        m_commands_browser_context(*this, m_browser, m_file_chooser, 
    5758                                   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, 
    6165                        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), 
    6567        m_commands_help(*this, m_header, m_icon_mgr), 
    66         m_title_bar(*this, m_folder) 
     68        m_title_bar(*this, m_text_folder) 
    6769{ 
    6870#ifdef WITH_UNIQUE 
     
    7678        m_header.show(); 
    7779        m_browser.show(); 
    78         m_folder.show(); 
     80        m_text_folder.show(); 
     81        m_chat_folder.show(); 
    7982 
    8083        // Build UI 
     
    9093        Gtk::Frame* frame_text = Gtk::manage(new Gtk::Frame); 
    9194        frame_text->set_shadow_type(Gtk::SHADOW_IN); 
    92         frame_text->add(m_folder); 
     95        frame_text->add(m_text_folder); 
    9396        frame_text->show(); 
    9497 
     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 
    95108        m_paned.pack1(*frame_browser, false, false); 
    96         m_paned.pack2(*frame_text, true, false); 
     109        m_paned.pack2(m_chat_paned, true, false); 
    97110        m_paned.show(); 
    98111 
     
    185198 
    186199        m_paned.set_position(m_paned.get_width() * 2 / 5); 
     200        m_chat_paned.set_position(m_chat_paned.get_height() * 7 / 10); 
    187201} 
    188202 
  • code/window.hpp

    r81f1f55 r877d323  
    7373        ~Window(); 
    7474 
    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; } 
    7777 
    7878        void connect_to_host(const Glib::ustring& hostname) 
     
    133133        Gtk::VBox m_mainbox; 
    134134        Gtk::HPaned m_paned; 
     135        Gtk::VPaned m_chat_paned; 
    135136 
    136137        Header m_header; 
    137138        Browser m_browser; 
    138         Folder m_folder; 
     139        Folder m_text_folder; 
     140        Folder m_chat_folder; 
    139141        StatusBar m_statusbar; 
    140142