@@ -46,7 +46,7 @@ std::vector<std::string> OSTreeTUI::parseVisibleCommitMap(cpplibostree::OSTreeRe
46
46
return visibleCommitViewMap;
47
47
}
48
48
49
- int OSTreeTUI::main (const std::string& repo, const std::vector<std::string>& startupBranches, bool showTooltips ) {
49
+ int OSTreeTUI::main (const std::string& repo, const std::vector<std::string>& startupBranches) {
50
50
using namespace ftxui ;
51
51
52
52
// - STATES ---------- ----------
@@ -86,25 +86,19 @@ int OSTreeTUI::main(const std::string& repo, const std::vector<std::string>& sta
86
86
visibleCommitViewMap = parseVisibleCommitMap (ostreeRepo, visibleBranches); // TODO This update shouldn't be made here...
87
87
88
88
// COMMIT TREE
89
- /* TODO The commit-tree is currentrly under a heavy rebuild, see implementation To-Dos below.
90
- * For a general list of To-Dos refer to https://github.com/AP-Sensing/ostree-tui/pull/21
89
+ /* The commit-tree is currentrly under a heavy rebuild, see implementation To-Dos below.
90
+ * For a general list of To-Dos refer to https://github.com/AP-Sensing/ostree-tui/pull/21
91
91
*
92
92
* TODO extend with keyboard functionality:
93
93
* normal scrolling through commits (should also highlight selected commit)
94
94
* if 'p' is pressed: start promotion
95
95
* if 'd' is pressed: open deletion window
96
96
* TODO add commit deletion
97
97
* add deletion button & ask for confirmation (also add keyboard functionality)
98
- * TODO maybe re-arrange the manager window to remove the tabs again
99
- * now that promotion and deletion is gone / changed, we have enough rooom to fit both the info and the filter
100
- * TODO update the ostree-tui
101
- * after promotion & after filtering branches
102
- * TOOD code cleanup:
103
- * snake_case to camelCase (consistent)
104
- * make const& where applicable
105
98
*/
106
99
// commit promotion state
107
- // TODO store shared information about which commit is in which state
100
+ // TODO especially needed for keyboard shortcuts
101
+ // store shared information about which commit is in which state
108
102
// each commit can then display itself the way it should
109
103
// * is promotion action active?
110
104
// * keyboard or mouse?
@@ -121,15 +115,15 @@ int OSTreeTUI::main(const std::string& repo, const std::vector<std::string>& sta
121
115
Component commitList;
122
116
Component tree;
123
117
124
- int scroll_offset {0 };
118
+ int scrollOffset {0 };
125
119
126
120
auto refresh_commitComponents = [&] {
127
121
commitComponents.clear ();
128
122
int i{0 };
129
123
visibleCommitViewMap = parseVisibleCommitMap (ostreeRepo, visibleBranches);
130
124
for (auto & hash : visibleCommitViewMap) {
131
125
commitComponents.push_back (
132
- CommitComponent (i, scroll_offset , inPromotionSelection, promotionHash, promotionBranch, visibleBranches, columnToBranchMap, hash, ostreeRepo, refresh)
126
+ CommitComponent (i, scrollOffset , inPromotionSelection, promotionHash, promotionBranch, visibleBranches, columnToBranchMap, hash, ostreeRepo, refresh)
133
127
);
134
128
i++;
135
129
}
@@ -154,18 +148,16 @@ int OSTreeTUI::main(const std::string& repo, const std::vector<std::string>& sta
154
148
promotionBranchColorMap.insert ({str,Color::GrayDark});
155
149
}
156
150
}
157
- return CommitRender::commitRender (ostreeRepo, visibleCommitViewMap, visibleBranches, columnToBranchMap, promotionBranchColorMap, scroll_offset , selectedCommit);
151
+ return CommitRender::commitRender (ostreeRepo, visibleCommitViewMap, visibleBranches, columnToBranchMap, promotionBranchColorMap, scrollOffset , selectedCommit);
158
152
}
159
- return CommitRender::commitRender (ostreeRepo, visibleCommitViewMap, visibleBranches, columnToBranchMap, branchColorMap, scroll_offset , selectedCommit);
153
+ return CommitRender::commitRender (ostreeRepo, visibleCommitViewMap, visibleBranches, columnToBranchMap, branchColorMap, scrollOffset , selectedCommit);
160
154
});
161
155
162
156
Component commitListComponent = Container::Horizontal ({
163
157
tree,
164
158
commitList
165
159
});
166
160
167
- // - UPDATES ---------- ----------
168
-
169
161
// / refresh all graphical components in the commit-tree
170
162
auto refresh_commitListComoponent = [&] {
171
163
commitListComponent->DetachAllChildren ();
@@ -187,36 +179,31 @@ int OSTreeTUI::main(const std::string& repo, const std::vector<std::string>& sta
187
179
commitListComponent = CatchEvent (commitListComponent, [&](Event event) {
188
180
// scroll
189
181
if (event.is_mouse () && event.mouse ().button == Mouse::WheelUp) {
190
- if (scroll_offset < 0 ) {
191
- ++scroll_offset ;
182
+ if (scrollOffset < 0 ) {
183
+ ++scrollOffset ;
192
184
}
193
- selectedCommit = -scroll_offset / 4 ;
185
+ selectedCommit = -scrollOffset / 4 ;
194
186
return true ;
195
187
}
196
188
if (event.is_mouse () && event.mouse ().button == Mouse::WheelDown) {
197
- --scroll_offset ;
198
- selectedCommit = -scroll_offset / 4 ;
189
+ --scrollOffset ;
190
+ selectedCommit = -scrollOffset / 4 ;
199
191
return true ;
200
192
}
201
193
// switch through commits
202
194
if (event == Event::ArrowUp || event == Event::Character (' k' )) {
203
- scroll_offset = std::min (0 , scroll_offset + 4 );
204
- selectedCommit = -scroll_offset / 4 ;
195
+ scrollOffset = std::min (0 , scrollOffset + 4 );
196
+ selectedCommit = -scrollOffset / 4 ;
205
197
return true ;
206
198
}
207
199
if (event == Event::ArrowDown || event == Event::Character (' j' )) {
208
- scroll_offset -= 4 ;
209
- selectedCommit = -scroll_offset / 4 ;
200
+ scrollOffset -= 4 ;
201
+ selectedCommit = -scrollOffset / 4 ;
210
202
return true ;
211
203
}
212
204
return false ;
213
205
});
214
206
215
- /*
216
- * END of commit-tree TODO
217
- * Probably shouldn't have to change anything outside of this.
218
- */
219
-
220
207
// INTERCHANGEABLE VIEW
221
208
// info
222
209
Component infoView = Renderer ([&] {
@@ -319,7 +306,6 @@ int OSTreeTUI::showHelp(const std::string& caller, const std::string& errorMessa
319
306
// option, arguments, meaning
320
307
{" -h, --help" , " " , " Show help options. The REPOSITORY_PATH can be omitted" },
321
308
{" -r, --refs" , " REF [REF...]" , " Specify a list of visible refs at startup if not specified, show all refs" },
322
- {" -n, --no-tooltips" , " " , " Hide Tooltips in promotion view." }
323
309
};
324
310
325
311
Elements options {text (" Options:" )};
0 commit comments