Changeset 6191

Show
Ignore:
Timestamp:
05/11/08 06:43:50 (5 months ago)
Author:
eugene
Message:

Made automatic list scrolling be optional.

Location:
trunk/qt4-gui/src
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt4-gui/src/config/contactlist.cpp

    r6156 r6191  
    6363  iniFile.ReadBool("ScrollBar", myAllowScrollBar, true); 
    6464  iniFile.ReadBool("SystemBackground", myUseSystemBackground, false); 
     65  iniFile.ReadBool("AutoScrolling", myAutoScroll, true); 
    6566 
    6667  unsigned short flash; 
     
    128129  iniFile.WriteBool("ScrollBar", myAllowScrollBar); 
    129130  iniFile.WriteBool("SystemBackground", myUseSystemBackground); 
     131  iniFile.WriteBool("AutoScrolling", myAutoScroll); 
    130132 
    131133  iniFile.WriteNum("NumColumns", myColumnCount); 
     
    311313} 
    312314 
     315void Config::ContactList::setAutoScroll(bool autoScroll) 
     316{ 
     317  myAutoScroll = autoScroll; 
     318} 
     319 
    313320void Config::ContactList::setShowDividers(bool showDividers) 
    314321{ 
  • trunk/qt4-gui/src/config/contactlist.h

    r6156 r6191  
    110110  bool allowScrollBar() const { return myAllowScrollBar; } 
    111111  bool useSystemBackground() const { return myUseSystemBackground; } 
     112  bool autoScroll() const { return myAutoScroll; } 
    112113 
    113114  bool popupPicture() const { return myPopupPicture; } 
     
    160161  void setAllowScrollBar(bool allowScrollBar); 
    161162  void setUseSystemBackground(bool useSystemBackground); 
     163  void setAutoScroll(bool autoScroll); 
    162164 
    163165  void setPopupPicture(bool popupPicture); 
     
    240242  bool myAllowScrollBar; 
    241243  bool myUseSystemBackground; 
     244  bool myAutoScroll; 
    242245 
    243246  // Contact list sorting 
  • trunk/qt4-gui/src/settings/contactlist.cpp

    r6156 r6191  
    161161  myBehaviourLayout->addWidget(myMainWinStickyCheck, 0, 1); 
    162162 
     163  myAutoScrollCheck = new QCheckBox(tr("Automatic scrolling")); 
     164  myAutoScrollCheck->setToolTip(tr("Automatically scroll to the selected item if it was moved out of the view.")); 
     165  myBehaviourLayout->addWidget(myAutoScrollCheck, 1, 1); 
     166 
    163167  QHBoxLayout* mySortByLayout = new QHBoxLayout(); 
    164168  mySortByLabel = new QLabel(tr("Additional sorting:")); 
     
    176180  mySortByLabel->setBuddy(mySortByCombo); 
    177181  mySortByLayout->addWidget(mySortByCombo); 
    178   myBehaviourLayout->addLayout(mySortByLayout, 1, 1); 
     182  myBehaviourLayout->addLayout(mySortByLayout, 2, 1); 
    179183 
    180184 
     
    347351  myScrollBarCheck->setChecked(contactListConfig->allowScrollBar()); 
    348352  mySysBackCheck->setChecked(contactListConfig->useSystemBackground()); 
     353  myAutoScrollCheck->setChecked(contactListConfig->autoScroll()); 
    349354 
    350355  int numColumns = contactListConfig->columnCount(); 
     
    419424  contactListConfig->setAllowScrollBar(myScrollBarCheck->isChecked()); 
    420425  contactListConfig->setUseSystemBackground(mySysBackCheck->isChecked()); 
     426  contactListConfig->setAutoScroll(myAutoScrollCheck->isChecked()); 
    421427 
    422428  for (unsigned short i = 0; i < MAX_COLUMNCOUNT; ++i) 
  • trunk/qt4-gui/src/settings/contactlist.h

    r6156 r6191  
    9090  QLineEdit* myFrameStyleEdit; 
    9191  QComboBox* mySortByCombo; 
     92  QCheckBox* myAutoScrollCheck; 
    9293  QCheckBox* mySSListCheck; 
    9394  QCheckBox* myGridLinesCheck; 
  • trunk/qt4-gui/src/views/userviewbase.cpp

    r6179 r6191  
    8686} 
    8787 
     88void UserViewBase::scrollTo(const QModelIndex& index, QAbstractItemView::ScrollHint hint) 
     89{ 
     90  if (Config::ContactList::instance()->autoScroll()) 
     91    QTreeView::scrollTo(index, hint); 
     92} 
     93 
    8894void UserViewBase::applySkin() 
    8995{ 
  • trunk/qt4-gui/src/views/userviewbase.h

    r6151 r6191  
    6060   */ 
    6161  virtual void setColors(QColor back); 
     62 
     63  /** 
     64   * Reloaded from base class 
     65   * 
     66   * @param index Index of the item to scroll to 
     67   * @param hint Relative viewport position 
     68   */ 
     69  virtual void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible); 
    6270 
    6371signals: