Changeset View
Changeset View
Standalone View
Standalone View
ui/side_reviews.cpp
Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Line(s) | 89 | { | |||
---|---|---|---|---|---|
140 | // - add separator | 140 | // - add separator | ||
141 | toolBar->addSeparator(); | 141 | toolBar->addSeparator(); | ||
142 | // - add Current Page Only button | 142 | // - add Current Page Only button | ||
143 | QAction * curPageOnlyAction = toolBar->addAction( QIcon::fromTheme( QStringLiteral("arrow-down") ), i18n( "Show reviews for current page only" ) ); | 143 | QAction * curPageOnlyAction = toolBar->addAction( QIcon::fromTheme( QStringLiteral("arrow-down") ), i18n( "Show reviews for current page only" ) ); | ||
144 | curPageOnlyAction->setCheckable( true ); | 144 | curPageOnlyAction->setCheckable( true ); | ||
145 | connect(curPageOnlyAction, &QAction::toggled, this, &Reviews::slotCurrentPageOnly); | 145 | connect(curPageOnlyAction, &QAction::toggled, this, &Reviews::slotCurrentPageOnly); | ||
146 | curPageOnlyAction->setChecked( Okular::Settings::currentPageOnly() ); | 146 | curPageOnlyAction->setChecked( Okular::Settings::currentPageOnly() ); | ||
147 | 147 | | |||
148 | // Adds space between left actions, so that the next two buttons are aligned to the right | ||||
149 | QWidget * spacer = new QWidget(); | ||||
150 | spacer->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); | ||||
151 | toolBar->addWidget( spacer ); | ||||
152 | | ||||
153 | QAction * expandAll = toolBar->addAction( QIcon::fromTheme( QStringLiteral("expand-all") ), i18n( "Expand all elements" ) ); | ||||
154 | connect(expandAll, &QAction::triggered, this, &Reviews::slotExpandAll); | ||||
155 | QAction * collapseAll = toolBar->addAction( QIcon::fromTheme( QStringLiteral("collapse-all") ), i18n( "Collapse all elements" ) ); | ||||
aacid: This should probably be Collapse instead of Collapses. Not sure that's very english-y. @ngraham… | |||||
ngraham: Right, that should definitely be "Collapse all elements". | |||||
davidhurka: Something is wrong with this icon, it does not change to a light foreground color at a dark… | |||||
156 | connect(collapseAll, &QAction::triggered, this, &Reviews::slotCollapseAll); | ||||
157 | | ||||
148 | connect(m_view, &TreeView::activated, this, &Reviews::activated); | 158 | connect(m_view, &TreeView::activated, this, &Reviews::activated); | ||
149 | 159 | | |||
150 | m_view->setContextMenuPolicy( Qt::CustomContextMenu ); | 160 | m_view->setContextMenuPolicy( Qt::CustomContextMenu ); | ||
151 | connect(m_view, &TreeView::customContextMenuRequested, this, &Reviews::contextMenuRequested); | 161 | connect(m_view, &TreeView::customContextMenuRequested, this, &Reviews::contextMenuRequested); | ||
152 | 162 | | |||
153 | } | 163 | } | ||
154 | 164 | | |||
155 | Reviews::~Reviews() | 165 | Reviews::~Reviews() | ||
Show All 39 Lines | |||||
195 | void Reviews::slotCurrentPageOnly( bool on ) | 205 | void Reviews::slotCurrentPageOnly( bool on ) | ||
196 | { | 206 | { | ||
197 | // store toggle state in Settings and update the listview | 207 | // store toggle state in Settings and update the listview | ||
198 | Okular::Settings::setCurrentPageOnly( on ); | 208 | Okular::Settings::setCurrentPageOnly( on ); | ||
199 | m_filterProxy->groupByCurrentPage( on ); | 209 | m_filterProxy->groupByCurrentPage( on ); | ||
200 | 210 | | |||
201 | m_view->expandAll(); | 211 | m_view->expandAll(); | ||
202 | } | 212 | } | ||
213 | | ||||
214 | void Reviews::slotExpandAll() | ||||
215 | { | ||||
216 | m_view->expandAll(); | ||||
217 | } | ||||
218 | | ||||
219 | void Reviews::slotCollapseAll() | ||||
220 | { | ||||
221 | m_view->collapseAll(); | ||||
222 | } | ||||
203 | //END GUI Slots | 223 | //END GUI Slots | ||
204 | 224 | | |||
205 | 225 | | |||
206 | void Reviews::activated( const QModelIndex &index ) | 226 | void Reviews::activated( const QModelIndex &index ) | ||
207 | { | 227 | { | ||
208 | const QModelIndex authorIndex = m_authorProxy->mapToSource( index ); | 228 | const QModelIndex authorIndex = m_authorProxy->mapToSource( index ); | ||
209 | const QModelIndex filterIndex = m_groupProxy->mapToSource( authorIndex ); | 229 | const QModelIndex filterIndex = m_groupProxy->mapToSource( authorIndex ); | ||
210 | const QModelIndex annotIndex = m_filterProxy->mapToSource( filterIndex ); | 230 | const QModelIndex annotIndex = m_filterProxy->mapToSource( filterIndex ); | ||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |
This should probably be Collapse instead of Collapses. Not sure that's very english-y. @ngraham does it sound right to you?