Changeset 4a12852956b8c9d65420066459277f873f6247ee

Show
Ignore:
Timestamp:
09/21/10 21:41:04 (3 years ago)
Author:
Armin Burgmeier <armin@…>
git-author:
Armin Burgmeier <armin@arbur.net> / 2010-09-21T21:27:16Z+0200
Parents:
edf70bfbfed7be742f6fabb0740f88e7a83081d6
Children:
ecfdae11289287fec91513ba406f03d044dc56d9
git-committer:
Armin Burgmeier <armin@arbur.net> / 2010-09-21T21:41:04Z+0200
Message:

Add preferences options for showing remote user info

2010-09-21 Armin Burgmeier <armin@…>

  • code/core/preferences.hpp:
  • code/core/preferences.cpp: Add preferences options for showing remote cursors, selections, current lines and cursor positions in the scrollbar.
  • code/core/textsessionview.hpp:
  • code/core/textsessionview.cpp: Apply the new settings on the underlying objects.
  • code/dialogs/preferences-dialog.hpp:
  • code/dialogs/preferences-dialog.cpp: Add the new options to the preferences dialog.
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r54f0ee1 r4a12852  
     12010-09-21  Armin Burgmeier  <armin@arbur.net> 
     2 
     3        * code/core/preferences.hpp: 
     4        * code/core/preferences.cpp: Add preferences options for showing 
     5        remote cursors, selections, current lines and cursor positions in the 
     6        scrollbar. 
     7 
     8        * code/core/textsessionview.hpp: 
     9        * code/core/textsessionview.cpp: Apply the new settings on the 
     10        underlying objects. 
     11 
     12        * code/dialogs/preferences-dialog.hpp: 
     13        * code/dialogs/preferences-dialog.cpp: Add the new options to the 
     14        preferences dialog. 
     15 
    1162010-06-04  Armin Burgmeier  <armin@arbur.net> 
    217 
  • code/core/preferences.cpp

    r61cce2c r4a12852  
    2626        hue(entry.get_value<double>("hue", Glib::Rand().get_double())), 
    2727        host_directory(entry.get_value<std::string>("host-directory", 
    28                 Glib::build_filename(Glib::get_home_dir(), ".infinote"))) 
     28                Glib::build_filename(Glib::get_home_dir(), ".infinote"))), 
     29        show_remote_cursors(entry.get_value<bool>( 
     30                "show-remote-users", true)), 
     31        show_remote_selections(entry.get_value<bool>( 
     32                "show-remote-selections", true)), 
     33        show_remote_current_lines(entry.get_value<bool>( 
     34                "show-remote-current-lines", true)), 
     35        show_remote_cursor_positions(entry.get_value<bool>( 
     36                "show-remote-cursor-positions", true)) 
    2937{ 
    3038} 
     
    3543        entry.set_value("hue", hue); 
    3644        entry.set_value("host-directory", host_directory); 
     45         
     46        entry.set_value("show-remote-cursors", show_remote_cursors); 
     47        entry.set_value("show-remote-selections", show_remote_selections); 
     48        entry.set_value("show-remote-current-lines", show_remote_current_lines); 
     49        entry.set_value("show-remote-cursor-positions", 
     50                        show_remote_cursor_positions); 
    3751} 
    3852 
  • code/core/preferences.hpp

    r61cce2c r4a12852  
    106106                Option<double> hue; 
    107107                Option<std::string> host_directory; 
     108 
     109                Option<bool> show_remote_cursors; 
     110                Option<bool> show_remote_selections; 
     111                Option<bool> show_remote_current_lines; 
     112                Option<bool> show_remote_cursor_positions; 
    108113        }; 
    109114 
  • code/core/textsessionview.cpp

    r3aa7aa1 r4a12852  
    165165                sigc::mem_fun( 
    166166                        *this, &TextSessionView::on_user_color_changed)); 
     167        m_preferences.user.show_remote_cursors.signal_changed().connect( 
     168                sigc::mem_fun( 
     169                        *this, &TextSessionView::on_show_remote_cursors_changed)); 
     170        m_preferences.user.show_remote_selections.signal_changed().connect( 
     171                sigc::mem_fun( 
     172                        *this, &TextSessionView::on_show_remote_selections_changed)); 
     173        m_preferences.user.show_remote_current_lines.signal_changed().connect( 
     174                sigc::mem_fun( 
     175                        *this, &TextSessionView::on_show_remote_current_lines_changed)); 
     176        m_preferences.user.show_remote_cursor_positions.signal_changed().connect( 
     177                sigc::mem_fun( 
     178                        *this, &TextSessionView::on_show_remote_cursor_positions_changed)); 
    167179        m_preferences.editor.tab_width.signal_changed().connect( 
    168180                sigc::mem_fun( 
     
    206218        m_preferences.appearance.scheme_id.signal_changed().connect( 
    207219                sigc::mem_fun(*this, &TextSessionView::on_scheme_changed)); 
     220 
     221        inf_text_gtk_view_set_show_remote_cursors( 
     222                m_infview, 
     223                m_preferences.user.show_remote_cursors 
     224        ); 
     225        inf_text_gtk_view_set_show_remote_selections( 
     226                m_infview, 
     227                m_preferences.user.show_remote_selections 
     228        ); 
     229        inf_text_gtk_view_set_show_remote_current_lines( 
     230                m_infview, 
     231                m_preferences.user.show_remote_current_lines 
     232        ); 
     233 
    208234        gtk_source_view_set_tab_width(m_view, m_preferences.editor.tab_width); 
    209235        gtk_source_view_set_insert_spaces_instead_of_tabs( 
     
    243269 
    244270        m_infviewport = inf_text_gtk_viewport_new(scroll->gobj(), user_table); 
     271        inf_text_gtk_viewport_set_show_user_markers( 
     272                m_infviewport, 
     273                m_preferences.user.show_remote_cursor_positions 
     274        ); 
    245275 
    246276        pack_start(*scroll, Gtk::PACK_EXPAND_WIDGET); 
     
    392422} 
    393423 
     424 
     425void Gobby::TextSessionView::on_show_remote_cursors_changed() 
     426{ 
     427        inf_text_gtk_view_set_show_remote_cursors( 
     428                m_infview, 
     429                m_preferences.user.show_remote_cursors 
     430        ); 
     431} 
     432 
     433void Gobby::TextSessionView::on_show_remote_selections_changed() 
     434{ 
     435        inf_text_gtk_view_set_show_remote_selections( 
     436                m_infview, 
     437                m_preferences.user.show_remote_selections 
     438        ); 
     439} 
     440 
     441void Gobby::TextSessionView::on_show_remote_current_lines_changed() 
     442{ 
     443        inf_text_gtk_view_set_show_remote_current_lines( 
     444                m_infview, 
     445                m_preferences.user.show_remote_current_lines 
     446        ); 
     447} 
     448 
     449void Gobby::TextSessionView::on_show_remote_cursor_positions_changed() 
     450{ 
     451        inf_text_gtk_viewport_set_show_user_markers( 
     452                m_infviewport, 
     453                m_preferences.user.show_remote_cursor_positions 
     454        ); 
     455} 
     456 
    394457void Gobby::TextSessionView::on_tab_width_changed() 
    395458{ 
  • code/core/textsessionview.hpp

    r3aa7aa1 r4a12852  
    8686        void on_user_color_changed(); 
    8787 
     88        void on_show_remote_cursors_changed(); 
     89        void on_show_remote_selections_changed(); 
     90        void on_show_remote_current_lines_changed(); 
     91        void on_show_remote_cursor_positions_changed(); 
     92 
    8893        void on_tab_width_changed(); 
    8994        void on_tab_spaces_changed(); 
  • code/dialogs/preferences-dialog.cpp

    r61cce2c r4a12852  
    232232        m_group_settings(_("Settings")), 
    233233        m_group_paths(_("Paths")), 
     234        m_group_remote(_("Remote Users")), 
    234235        m_box_user_name(false, 6), 
    235236        m_lbl_user_name(_("User name:"), Gtk::ALIGN_LEFT), 
     
    240241        m_btn_path_host_directory(Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER), 
    241242        m_lbl_path_host_directory(_("Host directory:")), 
     243        m_btn_remote_show_cursors(_("Show cursors of remote users")), 
     244        m_btn_remote_show_selections(_("Show selections of remote users")), 
     245        m_btn_remote_show_current_lines( 
     246                _("Highlight current line of remote users")), 
     247        m_btn_remote_show_cursor_positions( 
     248                _("Indicate remote users' cursor position in the scrollbar")), 
    242249        m_size_group(Gtk::SizeGroup::create(Gtk::SIZE_GROUP_HORIZONTAL)) 
    243250{ 
     
    293300        // m_group_paths.show(); 
    294301 
     302        m_btn_remote_show_cursors.set_active( 
     303                preferences.user.show_remote_cursors); 
     304        m_btn_remote_show_cursors.show(); 
     305        connect_option(m_btn_remote_show_cursors, 
     306                       preferences.user.show_remote_cursors); 
     307 
     308        m_btn_remote_show_selections.set_active( 
     309                preferences.user.show_remote_selections); 
     310        m_btn_remote_show_selections.show(); 
     311        connect_option(m_btn_remote_show_selections, 
     312                       preferences.user.show_remote_selections); 
     313 
     314        m_btn_remote_show_current_lines.set_active( 
     315                preferences.user.show_remote_current_lines); 
     316        m_btn_remote_show_current_lines.show(); 
     317        connect_option(m_btn_remote_show_current_lines, 
     318                       preferences.user.show_remote_current_lines); 
     319 
     320        m_btn_remote_show_cursor_positions.set_active( 
     321                preferences.user.show_remote_cursor_positions); 
     322        m_btn_remote_show_cursor_positions.show(); 
     323        connect_option(m_btn_remote_show_cursor_positions, 
     324                       preferences.user.show_remote_cursor_positions); 
     325 
     326        m_group_remote.add(m_btn_remote_show_cursors); 
     327        m_group_remote.add(m_btn_remote_show_selections); 
     328        m_group_remote.add(m_btn_remote_show_current_lines); 
     329        m_group_remote.add(m_btn_remote_show_cursor_positions); 
     330        m_group_remote.show(); 
     331 
    295332        add(m_group_settings, false); 
    296333        add(m_group_paths, false); 
     334        add(m_group_remote, false); 
    297335} 
    298336 
  • code/dialogs/preferences-dialog.hpp

    r61cce2c r4a12852  
    127127                Group m_group_settings; 
    128128                Group m_group_paths; 
     129                Group m_group_remote; 
    129130 
    130131                Gtk::HBox m_box_user_name; 
     
    139140                Gtk::Label m_lbl_path_host_directory; 
    140141                Gtk::FileChooserButton m_btn_path_host_directory; 
     142 
     143                Gtk::CheckButton m_btn_remote_show_cursors; 
     144                Gtk::CheckButton m_btn_remote_show_selections; 
     145                Gtk::CheckButton m_btn_remote_show_current_lines; 
     146                Gtk::CheckButton m_btn_remote_show_cursor_positions; 
    141147 
    142148                Glib::RefPtr<Gtk::SizeGroup> m_size_group;