Skip to content

Add go to line dialog. - #62

Merged
j6t merged 2 commits into
j6t:masterfrom
ikolokolnikov:goto-line
Jun 23, 2026
Merged

j6t merged 2 commits into
j6t:masterfrom
ikolokolnikov:goto-line

Conversation

@ikolokolnikov

Copy link
Copy Markdown
Contributor

The user is now able to go to any particular line by entering a line number
into "Go to Line" dialog instead of manually scrolling.

@j6t

j6t commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Thank you for this contribution. In general, I like it.

Regarding behavior:

  • I would prefer that the edit box has the focus and all text selected after pressing Ctrl-G, so that I can start typing a new line number without having to delete an existing line number. This is already the case if the dialog was closed with Enter or Esc before, but is not the case when a button was clicked. But this should be a commit on top.
  • I expanded some assembly lines, then selected to go to one past the last line. This locks up the UI (infinite loop).

Regarding the implementation:

  • There is a KStandardAction::gotoLine that we could use. It is desirable to use the modern slot overload taking a member function pointer rather than the SLOT(...) macro, if possible, despite the surrounding code doing it differently.
  • There is QIntValidator that we could use. If it's not possible, please justify it.
  • Please keep #include files sorted within their category as far as possible.

In your clone of this repository, kindly set your user.name to your full name.

@ikolokolnikov
ikolokolnikov force-pushed the goto-line branch 2 times, most recently from 91e46dc to 01da747 Compare June 16, 2026 01:17
@ikolokolnikov

Copy link
Copy Markdown
Contributor Author

Ok, I think I fixed everything.

@j6t

j6t commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Thanks, this is already looking very good.

One nit, though: I wonder why we need actionCollection()->addAction(...) here, but not in other cases, and I think it is because you want a custom name for the action. However, if you use the standard name, go_goto_line, we can avoid it. It does not matter that this ID is listed in the View menu, I think.

@ikolokolnikov

ikolokolnikov commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

I tried that before, but it seems that it ignores the entry go_goto_line entry in the kdbgui.rc file and still places the action into "Go" menu. I am not sure if I misunderstand something.

Update: After removing a cached .rc file, I managed to put go_goto_line into the View menu, however it still adds the Go menu with a duplicate "Go to Line..." action.

Update 2: I managed to remove the duplicate menu by doing:

  <Menu name="go" deleted="true">
  </Menu>

I am just not sure that this would be an acceptable approach.

@j6t

j6t commented Jun 19, 2026

Copy link
Copy Markdown
Owner

I see. That's too ugly. Let's use the addAction call with the custom name, but add a comment that explains why we do this.

@ikolokolnikov

Copy link
Copy Markdown
Contributor Author

Done.

@j6t
j6t merged commit aeac2de into j6t:master Jun 23, 2026
6 checks passed
@j6t j6t mentioned this pull request Jun 23, 2026
@j6t

j6t commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants