Changeset cfeaba1cd10e7c3fa4201bfe898f2b6b17386cc0

Show
Ignore:
Timestamp:
08/24/08 18:46:20 (5 years ago)
Author:
Armin Burgmeier <armin@…>
Parents:
3bb782a97a760f078c127f35d7bbb94f7ebd6655
Children:
3bb736dc8aaca0b06ecd8cd17b594c34c828759e
git-committer:
Armin Burgmeier <armin@arbur.net> / 2008-08-24T18:46:20Z+0200
Message:

Focus opened DocWindow? on subscription

2008-08-24 Armin Burgmeier <armin@…>

  • inc/core/browser.hpp:
  • src/core/browser.cpp: Added the get_selected() and set_selected() methods, using the new inf_gtk_browser_view_set_selected().
  • src/commands/browser-commands.cpp: When subscribing to a session, then change the BrowserView? selection to the corresponding note, and give focus to the DocWindow?, so the user can start typing immediately.
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r3bb782a9 rcfeaba1  
     12008-08-24  Armin Burgmeier  <armin@arbur.net> 
     2 
     3        * inc/core/browser.hpp: 
     4        * src/core/browser.cpp: Added the get_selected() and set_selected() 
     5        methods, using the new inf_gtk_browser_view_set_selected(). 
     6 
     7        * src/commands/browser-commands.cpp: When subscribing to a session, 
     8        then change the BrowserView selection to the corresponding note, and 
     9        give focus to the DocWindow, so the user can start typing immediately. 
     10 
    1112008-08-14  Armin Burgmeier  <armin@arbur.net> 
    212 
  • TODO

    r5fae4ad rcfeaba1  
    44 - Subscribing to a for the first time document and clicking into it scrolls 
    55   the view all way down. Perhaps it is enough to keep the cursor initially at 
    6    the beginning of the document. 
     6   the beginning of the document, which we should do anyway (in infinote) 
    77 - ^W should close the window 
    88 - Remove references to doclist, userlist and chat in the icon manager 
     
    1616 - Add close buttons to browser in left pane, user lists and docwindow infos, 
    1717   and a way to re-show the former two. 
     18 
     19These things need to be implemented in infinote, but again would be nice 
     20to have: 
     21 
     22 - Show other user's cursors 
     23 - Show other user's selections 
     24 - Show other user's viewport position (perhaps in a separate widget) 
  • inc/core/browser.hpp

    rdddf956 rcfeaba1  
    6666        } 
    6767 
     68        bool get_selected(InfcBrowser** browser, InfcBrowserIter* iter); 
     69        void set_selected(InfcBrowser* browser, InfcBrowserIter* iter); 
     70 
    6871        SignalActivate signal_activate() const { return m_signal_activate; } 
    6972 
  • src/commands/browser-commands.cpp

    r3bb782a9 rcfeaba1  
    289289                infc_browser_iter_get_name(browser, iter), 
    290290                m_info_storage.get_key(browser, iter)); 
     291 
     292        // For now we always highlight the newly created session... 
     293        // TODO: If the user issued other browserview events in the meanwhile, 
     294        // then don't select the item, and if the user did issue other folder 
     295        // events, then don't switch to the document in the folder. 
    291296        m_folder.switch_to_document(window); 
     297        gtk_widget_grab_focus(GTK_WIDGET(window.get_text_view())); 
     298        m_browser.set_selected(browser, iter); 
    292299 
    293300        SessionNode& node = m_session_map[session]; 
  • src/core/browser.cpp

    r77f22cf rcfeaba1  
    269269        m_status_bar.add_message(StatusBar::ERROR, error.what(), 5); 
    270270} 
     271 
     272bool Gobby::Browser::get_selected(InfcBrowser** browser, 
     273                                  InfcBrowserIter* iter) 
     274{ 
     275        GtkTreeIter tree_iter; 
     276        if(!inf_gtk_browser_view_get_selected(m_browser_view, &tree_iter)) 
     277                return false; 
     278 
     279        InfcBrowser* tmp_browser; 
     280        InfcBrowserIter* tmp_iter; 
     281 
     282        gtk_tree_model_get( 
     283                GTK_TREE_MODEL(m_browser_store), &tree_iter, 
     284                INF_GTK_BROWSER_MODEL_COL_BROWSER, &tmp_browser, 
     285                INF_GTK_BROWSER_MODEL_COL_NODE, &tmp_iter, -1); 
     286 
     287        *browser = tmp_browser; 
     288        *iter = *tmp_iter; 
     289 
     290        infc_browser_iter_free(tmp_iter); 
     291        g_object_unref(tmp_browser); 
     292 
     293        return true; 
     294} 
     295 
     296void Gobby::Browser::set_selected(InfcBrowser* browser, InfcBrowserIter* iter) 
     297{ 
     298        GtkTreeIter tree_iter; 
     299 
     300        gboolean has_iter = inf_gtk_browser_model_browser_iter_to_tree_iter( 
     301                INF_GTK_BROWSER_MODEL(m_browser_store), 
     302                browser, iter, &tree_iter); 
     303        g_assert(has_iter == TRUE); 
     304 
     305        inf_gtk_browser_view_set_selected(m_browser_view, &tree_iter); 
     306}