Bug 393138 - “Delete session” confirmation dialog lacks session name
Summary: “Delete session” confirmation dialog lacks session name
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: UI: general (show other bugs)
Version: unspecified
Platform: unspecified All
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2018-04-14 17:18 UTC by Vitaliy
Modified: 2019-07-16 16:56 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaliy 2018-04-14 17:18:54 UTC
It only tells “The session and all contained settings will be deleted” but doesn’t mention the session name. That defeats the purpose of the confirmation dialog, as you don’t know what exactly you confirm (it’s easy to push wrong button in the list as they are small and located near each other, but far from names).
Comment 1 Kevin Funk 2018-04-16 06:38:00 UTC
Great task for someone who wants to get started in helping out with KDevelop development.

See here for details for getting started:
  https://www.kdevelop.org/contribute-kdevelop
Comment 2 Sagnik Chaudhuri 2018-05-07 06:52:39 UTC
I want to contribute to this. And I am entirely new to open source development (this is gonna be my first) So can I get some hints? Like which part of the source code should I need to edit?
Comment 3 Sven Brauch 2018-05-07 07:10:19 UTC
The easiest way to find code which belongs to a UI element is to use "git grep" with some part of the (English) text in the UI.
Comment 4 Sagnik Chaudhuri 2018-05-07 09:11:09 UTC
As far as I see, I somehow need to alter the dialogue that appears after clicking the delete button, if that session isn't locked by any PID. Maybe, I may have to change the dialogue box window title from "Delete Session" to "Delete Session (Insert name of session)".
But going through the lines of code, I see that I can't modify the already declared method - i18nc - which accepts only two string arguments.
If I try to modify that method, I will need to modify all those codes where this method call takes place.
So what should be my approach?
Comment 5 Kevin Funk 2018-05-08 04:16:04 UTC
@Sagnik: I'm not sure I understand. 

First of all: I wouldn't change the title of said dialog, it might need to expand too much in size in order to display a long session name.

There's this line of code in sessionchooserdialog.cpp:
      const QString text = i18nc("@info", "The session and all contained settings will be deleted. The projects will stay unaffected. Do you really want to continue?");

Try changing it to:
      const QString text = i18nc("@info", "The session <i>%1</i> and all contained settings will be deleted. The projects will stay unaffected. Do you really want to continue?", sessionName);

(You'll have to figure out how to find out the `sessionName` in that method, though).
Comment 6 Sagnik Chaudhuri 2018-05-08 16:43:27 UTC
I think it's something to do with m_model.(inside https://github.com/KDE/kdevelop/blob/master/kdevplatform/shell/sessionchooserdialog.cpp#L194)
Can i know whether I am right or wrong?
And sorry for any inconveniences caused, I am not at all familiar with Qt.
Comment 7 Sven Brauch 2018-05-10 07:13:26 UTC
Yes, you can retrieve the session name from m_model by calling data() with index 1. See sessioncontroller.cpp, where this model is set up.
Comment 8 Sagnik Chaudhuri 2018-05-10 14:52:11 UTC
I have made some necessary changes. Can I get a review on this?
https://github.com/Sagnik-Chaudhuri/kdevelop/pull/1/commits/ac2a595e3fcb6ec06a49915b1a25656b1671c3cd
Comment 9 Sven Brauch 2018-05-10 17:45:53 UTC
Hi, please submit your review requests on phabricator.kde.org. Thank you!
Comment 10 Sagnik Chaudhuri 2018-06-11 13:09:55 UTC
I submitted it sir:
https://phabricator.kde.org/D13444
Comment 11 Marcin Dłubakowski 2019-07-16 16:56:10 UTC
Fixed in: https://phabricator.kde.org/D22456