/** * Set the sort tye to @p sort. */ void KTinyTabBar::setTabSortType( SortType sort ) { if( m_sortType == sort ) return; m_sortType = sort; updateSort(); }
/** * Set the button @p button_id's url to @p docurl. */ void KTinyTabBar::setTabURL( int button_id, const QString& docurl ) { if( !m_IDToTabButton.contains( button_id ) ) return; m_IDToTabButton[button_id]->setURL( docurl); if( tabSortType() == URL ) updateSort(); }
void gTree::setSortColumn(int v) { if (_sort_column < 0) setSorted(false); else { _sort_column = v; _ascending = true; updateSort(); } }
DECLARE_EXPORT void CalendarBucket::setStart(const Date d) { // Check if (d > enddate) throw DataException("Calendar bucket start must be earlier than its end"); // Update the field startdate = d; // Keep the list in sorted order updateSort(); }
void gTree::setSorted(bool v) { if (v == _sorted) return; _sorted = v; _sort_column = v ? 0 : -1; if (!_sorted) { gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store), GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, GTK_SORT_ASCENDING); gtk_tree_sortable_set_default_sort_func(GTK_TREE_SORTABLE(store), NULL, NULL, NULL); } updateSort(); }
void KateFileList::slotNameChanged (Kate::Document *doc) { if (!doc) return; // ### using nextSibling to *only* look at toplevel items. // child items could be marks for example QListViewItem * item = firstChild(); while( item ) { if ( ((KateFileListItem*)item)->document() == doc ) { item->setText( 0, doc->docName() ); repaintItem( item ); break; } item = item->nextSibling(); } updateSort(); }
DECLARE_EXPORT void CalendarBucket::setCalendar(Calendar* c) { if (cal == c) return; if (cal) throw DataException("Can't reassign a calendar bucket to a new calendar"); // Generate a unique id cal = c; setId(id); // Link in the list of buckets if (cal->firstBucket) { cal->firstBucket->prevBucket = this; nextBucket = cal->firstBucket; } cal->firstBucket = this; updateSort(); }
/** * Sets the text of the tab with ID \a button_id to \a text. * \see tabText() */ void KTinyTabBar::setTabText( int button_id, const QString& text ) { if( !m_IDToTabButton.contains( button_id ) ) return; // change highlight key, if entry exists if( m_highlightedTabs.contains( m_IDToTabButton[button_id]->text() ) ) { QString value = m_highlightedTabs[m_IDToTabButton[button_id]->text()]; m_highlightedTabs.remove( m_IDToTabButton[button_id]->text() ); m_highlightedTabs[text] = value; // do not emit highlightMarksChanged(), because every tabbar gets this // change (usually) // emit highlightMarksChanged( this ); } m_IDToTabButton[button_id]->setText( text ); if( tabSortType() == Name || tabSortType() == URL || tabSortType() == Extension ) updateSort(); }
/** * This is an overloaded member function, provided for convenience. * It behaves essentially like the above function. * * Adds a new tab with \a icon and \a text. Returns the new tab's index. */ int KTinyTabBar::addTab( const QString& docurl, const QIcon& icon, const QString& text ) { KTinyTabButton* tabButton = new KTinyTabButton( docurl, text, m_nextID, false, this ); tabButton->setIcon( icon ); if( m_highlightedTabs.contains( text ) ) tabButton->setHighlightColor( QColor( m_highlightedTabs[text] ) ); // set all properties! be sure nothing is missing :) tabButton->setHighlightOpacity( highlightOpacity() ); tabButton->setTabButtonStyle( tabButtonStyle() ); tabButton->setHighlightModifiedTabs( highlightModifiedTabs() ); tabButton->setHighlightActiveTab( highlightActiveTab() ); tabButton->setHighlightPreviousTab( highlightPreviousTab() ); tabButton->setModifiedTabsColor( modifiedTabsColor() ); tabButton->setActiveTabColor( activeTabColor() ); tabButton->setPreviousTabColor( previousTabColor() ); m_tabButtons.append( tabButton ); m_IDToTabButton[m_nextID] = tabButton; connect( tabButton, SIGNAL(activated(KTinyTabButton*)), this, SLOT(tabButtonActivated(KTinyTabButton*)) ); connect( tabButton, SIGNAL(highlightChanged(KTinyTabButton*)), this, SLOT(tabButtonHighlightChanged(KTinyTabButton*)) ); connect( tabButton, SIGNAL(closeRequest(KTinyTabButton*)), this, SLOT(tabButtonCloseRequest(KTinyTabButton*)) ); connect( tabButton, SIGNAL(closeOtherTabsRequest(KTinyTabButton*)), this, SLOT(tabButtonCloseOtherRequest(KTinyTabButton*)) ); connect( tabButton, SIGNAL(closeAllTabsRequest()), this, SLOT(tabButtonCloseAllRequest()) ); if( !isVisible() ) show(); updateSort(); return m_nextID++; }
void KateFileList::setSortType (int s) { m_sort = s; updateSort (); }
void gTree::setSortAscending(bool v) { _ascending = v; updateSort(); }