Skip to content

Use new style dialog to browse a folder#9378

Closed
mere-human wants to merge 2 commits intonotepad-plus-plus:masterfrom
mere-human:issue-8513
Closed

Use new style dialog to browse a folder#9378
mere-human wants to merge 2 commits intonotepad-plus-plus:masterfrom
mere-human:issue-8513

Conversation

@mere-human
Copy link
Contributor

Add new methods to CustomFileDialog:

  • setTitle() sets the dialog title
  • setFolder() sets an initial directory
  • pickFolder() shows a file open dialog to select a folder

Use CustomFileDialog in folderBrowser().

Affected areas:

  • Search > Find in Files
  • File > Open Folder as Workspace
  • Preferences > Default Directory
  • Preferences > Backup > Custom Backup
  • Preferences > Cloud & Link

Fix #8513

Add new methods to CustomFileDialog:
- setTitle() sets the dialog title
- setFolder() sets an initial directory
- pickFolder() shows a file open dialog to select a folder

Use CustomFileDialog in folderBrowser().

Affected areas:
- Search > Find in Files
- File > Open Folder as Workspace
- Preferences > Default Directory
- Preferences > Backup > Custom Backup
- Preferences > Cloud & Link

Fix notepad-plus-plus#8513
@mere-human
Copy link
Contributor Author

New Browse for File dialog looks like this:
image

@sasumner
Copy link
Contributor

sasumner commented Jan 9, 2021

New Browse for File dialog looks like this

Will it accept paths (or partial paths) with / as directory separator, in the Folder: box? :-)

Also: New Folder button is shown ---> NICE!

@sasumner
Copy link
Contributor

sasumner commented Jan 9, 2021

Affected areas:

With all of these areas, it is getting harder to hold on to the existing regular File-Open and File-SaveAs dialogs (you know, the workhorse ones). :-)

@sasumner
Copy link
Contributor

sasumner commented Jan 9, 2021

BTW, I would have done all of these types of dialog changes myself some time ago, but @donho 's dislike of COM (aka the "dark power" LOL) prevented me from putting the effort in. :-)

@mere-human
Copy link
Contributor Author

Will it accept paths (or partial paths) with / as directory separator, in the Folder: box? :-)

No, not yet. I plan to solve this issue separately, in scope of #9374

@donho donho self-assigned this Jan 10, 2021
Copy link
Member

@donho donho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace or convert getFolderName() with new folderBrowser()

@donho
Copy link
Member

donho commented Jan 10, 2021

@sasumner

BTW, I would have done all of these types of dialog changes myself some time ago, but @donho 's dislike of COM (aka the "dark power" LOL) prevented me from putting the effort in. :-)

I didn't recall that you wanna give it a try. Sorry about that.
But since @mere-human came with an entire solution, and it seems not so "dark" to me, it's easier to accept the solution - especially there's no other remedy for that.

folderBrowser() provides similar functionality to getFolderName().
Use the same code to make things easier.
Now getFolderName() will also show new style folder picker dialog.

Affected areas: Project Panel
1. View > Project Panels > Project Panel 1
2. Workspace > Add New Project, select it
3. Edit > Add Files from Directory
@mere-human
Copy link
Contributor Author

Replace or convert getFolderName() with new folderBrowser()

Done. It was used only in Project Panel to add files from a directory.

@chcg chcg added the enhancement Proposed enhancements of existing features label Jan 10, 2021
@sasumner
Copy link
Contributor

I didn't recall that you wanna give it a try. Sorry about that.

Ha! Well, you don't read minds do you?
It was all in my head about doing such a thing. I never said anything about it.
Thus nothing to be sorry about.

@donho donho closed this in b58a5cc Jan 11, 2021
@mere-human
Copy link
Contributor Author

One thing that bothers me a bit is that the original folder picker functions didn't respect the "Default Directory" preference.
In some cases, the initial directory was provided as an argument (Find in Files) but not always.
For example, if you open File > Open Folder as Workspace it will always start from the top-level directories (This PC, User, etc).
However, for some users, this might be expected behavior.
So I decided to preserve the same behavior for the new folder picker.

@donho
Copy link
Member

donho commented Jan 11, 2021

@mere-human
I don't quite follow you - could you provide me a concrete example?

@mere-human
Copy link
Contributor Author

@mere-human
I don't quite follow you - could you provide me a concrete example?

I mean, when we set the Default Directory preference, then most of the file dialogs will set that as an initial directory.
image
For example, File > Open will show that directory:
image
However, this is not the case for folder picker dialogs. An example is Open Folder as Workspace:
image
This was the behavior of the old dialogs and I preserved the same in this PR.

But now that I think about it, it seems to be a different, not related problem.

@donho
Copy link
Member

donho commented Jan 11, 2021

OK, I see.
The Default Directory preference is only for open or save file dialog.
It's not for applying to the folder browser IMO.

@donho
Copy link
Member

donho commented Jan 11, 2021

@mere-human
FYI (to not have conflict for you):
e26199a

@Uhf7
Copy link
Contributor

Uhf7 commented Jan 15, 2021

I just discovered that using the new style dialogs makes Notepad++ unusable under Windows XP, because these functions are only available since Windows Vista. Under Windows XP, Notepad++ dies now with a message box saying "The procedure entry point SHCreateItemFromParsingName could not be located in the dynamic link library SHELL32.dll".

@sasumner
Copy link
Contributor

sasumner commented Jan 15, 2021

using the new style dialogs makes Notepad++ unusable under Windows XP

Good! Let's not let ancient OSes hold up good new development efforts!

XP support was dropped a bit ago; @chcg recently told us exactly with which commit it was dropped but I can't find it ATM.

@mere-human
Copy link
Contributor Author

mere-human commented Jan 15, 2021

@Uhf7 @donho Any idea how many Windows XP users does Notepad++ have?
Although, Windows XP is not officially supported anymore.
If this is a concern, we can revert my changes for new style dialogs. Or I can implement a workaround specifically for Windows XP users.

@sasumner
Copy link
Contributor

we can revert my changes for new style dialogs.

IMO that doesn't make sense

Or I can implement a workaround specifically for Windows XP users.

IMO: Could be done, but it sounds like complicating the code unnecessarily.

IMO: XP users want to use an ancient OS that is no longer updated by its maker, they can use older versions of N++ (also which are not updated by ITS maker) that DO support their OS.

@Uhf7
Copy link
Contributor

Uhf7 commented Jan 15, 2021

I don't use Windows XP anymore, but obviously some users do. I stumbled over it in Issue #9347.

I brought up the question, because Notepad++ 7.9.2 still works under Windows XP, and the next version will not start anymore. This is the hard end of XP support. If everyone is fine with this, I don't need XP neither.

@sasumner
Copy link
Contributor

7.9.2 still works under Windows XP

When I said earlier that "@chcg recently told us exactly with which commit it was dropped" I meant that there was a feature that was no longer working when invoked, which is obviously a bit different than "won't start anymore".

@Uhf7
Copy link
Contributor

Uhf7 commented Jan 15, 2021

Perhaps it deserves a bigger jump in the version number, like to 8.0.0. And this "completely new" version doesn't run under Windows XP anymore. And the preprocessor definition WIN32_WINNT=0x501 could be upgraded to WIN32_WINNT=0x600. Then, the redefinition of WIN32_WINNT here

#if defined(_WIN32_WINNT) && (!defined(_WIN32_WINNT_VISTA) || (_WIN32_WINNT < _WIN32_WINNT_VISTA))

would become unnecessary, and we would have a software designed to run from Windows Vista on.

It's an administrative decision. I imagine, many XP users didn't realize the end of support until now, but they will realize it, as soon as it doesn't start anymore.

@KOLANICH
Copy link
Contributor

KOLANICH commented Mar 3, 2021

There already was a PR, though I haven't tested it personally (TBH I have never built NPP myself because feel like it is a bit large, though may try) and IDK if it really works.

@Terwilf
Copy link

Terwilf commented Mar 3, 2021

I think they are exaggerating a bit, since if the update is merely cosmetic, it is because this program has already covered practically all the possible functionalities that a text editor can have, I do not understand why instead of thanking that this software maintained the support for a system that was decommissioned 7 years ago, they reproach it for wanting to continue growing.

In addition, the source code is public, that is, its way of proceeding is completely transparent, I mean if it were really a popular demand, practically anyone could create their own compilation of the software.

I say this as a Windows XP user, since I have no other option, that is why I know and see in first person how limiting it is to develop for this system, when my brother helps me develop applications, sometimes he has to do several compilations until he achieves that everything works fine on my OS, it's frustrating, but it is.

python, .net framework and many lesser known libraries no longer support XP, it is sad as I said, for many this operating system is an obligatory reality, but that is not why you can force someone to stay still or look for elaborate solutions just to please Some.

Computers are not what they were and technology always evolves, and although it may start as something cosmetic, later it can give way to much more and if not. In any case, it is not a decision that corresponds to us to make, at least not, sitting from the comfort of our homes...

A cordial greeting to everyone.

@zahra21
Copy link

zahra21 commented Mar 19, 2021

Hello again.
may i ask that notepad 7.9.4 which is released recently, can supports windows xp?
because i wished that notepad uses newer scintilla version and if i understood correctly, from now, it can open large files even with the size of more than one gb!
i really wish that i can use such version in my favorite operating system.

@sasumner
Copy link
Contributor

may i ask that notepad 7.9.4 which is released recently, can supports windows xp?

Sorry, no. Final answer.

@donho
Copy link
Member

donho commented Mar 20, 2021

@Terwilf
Thank you for your words. They are very fair.

@KOLANICH
I do understand your disappointment - as an user I would be upset if I were still under XP.

But my role is not a simple user, so here are some viewpoints from a project maintainer:

Is new-style dialog (or rather "modern" style) an essential functionality? It could be a debate, but the answer clearly for me is YES. It's not only about the look & feel, it's about the ergonomic issues and bunch of functionalities on which @mere-human did a lot of coding effort - the modern style dialog does matter.

My job is not to make everyone happy (whatever we do, there always are people who are not happy anyway), but execute the right tasks (with my vision) for the project - here the right task to me is scarify an old OS which had been abandoned by MS since 2014 (no more security updates or technical support from MS) to make the maintenance of Notepad++ project as easy as possible. It's a technical reason with no doubt.

I apology to the XP users for the fact that Notepad++ continues without XP - you can always use the old versions under XP, and benefit the modern functionality under Windows 10 with the latest versions of Notepad++.

@KOLANICH
Copy link
Contributor

KOLANICH commented Mar 20, 2021

here the right task to me is scarify an old OS which had been abandoned by MS since 2014 (no more security updates or technical support from MS) to make the maintenance of Notepad++ project as easy as possible. It's a technical reason with no doubt.

No, it's not. A technical reason is when it is not technically possible. When it is possible, but someone just doesn't want, it is not a technical reason. Calling quasi-technical excuses doesn't make the reason technical, since the excuses have nothing common with the possibility of implementing this feature:

old OS which had been abandoned by MS since 2014

How it is related to the possibility to detect the presence of the needed API in runtime?

or technical support from MS

Do contributors of NPP really need technical support that is not available to program NPP properly? Under support I don't mean here API docs still available in the Internet, I mean what is usually meant under a support for Windows that was not available. (BTW, I once used such a support, W 7 has stopped to use a NIC, but Linux used it fine. I have phoned MS, but they haven't managed to help me. The issue has strangely resolved itself after a half of year of using Linux as a main OS: I had to run Windows and noticed that NIC icon in the tray had no ❌).

make the maintenance of Notepad++ project as easy as possible.

Is not a technical reason. It is basically an another wording of "we don't want", and "we don't want" is not a technical reason. You have full rights not to do what you don't want to do, like keeping workaround for things noone of you needs personally. You have also a right to call it a technical reason and say any other nonsense - free speech must be an universal right. But calling the reason "we don't want to do that" technical is still disrespect to everyone reading the changelog. Please state clearly in the changelog that <the set of devs who have enough power to make such decisions> (and I guess @sasumner is within this set) just don't want. It is not a very comfortable thing to say, but it is at least the truth.

@sasumner
Copy link
Contributor

sasumner commented Mar 20, 2021

@donho Some people, such as KOLANICH just don't "get it".
Ban him from the project? :-)

@KOLANICH
Don has explained the reasons for the actions several times. To continue the discussion in the manner in which you are doing it is disrespectful.

@KOLANICH
Copy link
Contributor

Yeah, ban me from the project, @donho. Or @sasumner would stop contributing here and the project would stagnate.

@sasumner
Copy link
Contributor

Or @sasumner would stop contributing here and the project would stagnate.

It's true. Thank you for the compliment! :-)

@KOLANICH
Copy link
Contributor

KOLANICH commented Mar 20, 2021

TANSTAAFL, you know. Ones who pay (in any form) for any project decide whom to ban from there and whom not to on their own discretion. And it is completely OK.

@KOLANICH
Copy link
Contributor

KOLANICH commented Mar 20, 2021

Don has explained the reasons for the actions several times.

I absolutely understand the reasons not to support XP and respect your decision to drop it. Anyway, it is you bear the expenses on coding npp, not me. (If someone finds that bringing XP support back overweights the expenses of compiling and maintaining a fork, there would be one. The invisible hand (or game theory, in more scientific wording) in action.) But the reasons are not technical ("it is impossible"), but political ("we don't want") and I think it should clearly stated as such. I don't demand it (it is up to the team to decide, not me, since I have 0% of lines of code in this repo), but I ask you to change the text in the changelog not to create a false impression that it was dropped because it was impossible and the devs had no another choice, rather it was dropped because of the choices made and that there are people who are responsible for the choices made. If one makes such choices, it would be more fair to attribute the choices to himself and say "Because I have decided so. Deal with it." rather than to "circumstances", so other people would have the correct impression "it is not the circumstances and force majeure, it is choices, I can make an own fork and make own choices there".

To continue the discussion in the manner in which you are doing it is disrespectful.

I don't think that just saying truth in a polite way is disrespectful.

@sasumner
Copy link
Contributor

@KOLANICH

Where you started by saying:

I absolutely understand the reasons not to support XP and respect your decision to drop it...

Thank you for a nice statement. It clarifies your position.
My previous interpretation of your position was that you were campaigning to "bring XP support back" after a very-final decision. I see now that you merely want a disavowal of a technical barrier to continuing support.

Since the reason has already been published in the change log, I don't know that a retraction and restatement of it is reasonable/possible. If you have a suggestion for how this might be done, perhaps @donho would consider doing it.

@donho
Copy link
Member

donho commented Mar 20, 2021

Ban him from the project? :-)

No. It's not reasonable. I know you're kidding but I want to still make one point clear:
People would be banned if they insult, spam, off-topic or do things to prevent the forum from working. Otherwise they can do any complain here freely.

BTW, thanks to @KOLANICH (and other security people) the release has been signed by GPG. Yet another reason to not ban him :)

Regarding "political reason" that @KOLANICH mentioned, as the BDFL in this project, every feature I decided to integrate is "political", according to such viewpoint. Though I don't agree with such point, I will say no more about it - it'll lead meaningless & endless arguing.

@zahra21
Copy link

zahra21 commented Mar 24, 2021

while i wish that notepad++ continues supporting xp for more versions or forever at best!
but i am glad that notepad++ has a good and friendly community that dont insult, blame and attack lovers, users and supporters of windows xp.
i believe that you did not want to stop supporting xp. am i right?
the new feature for project panel caused notepad++ stop running under xp
and i am very glad that you did not remove supporting xp by intention!
thanks again for your great program and God bless you!

@zahra21
Copy link

zahra21 commented Mar 24, 2021

mere-human,
can you please send me email?
i have a request that is not related to supporting windows xp, and i decided to send it for you directly and i wish you accept it!

@sasumner
Copy link
Contributor

mere-human,
can you please send me email?
i have a request that is not related to supporting windows xp, and i decided to send it for you directly and i wish you accept it!

This seems like an unusual request.
Of course mere-human is free to do as he likes, but...

If you have an idea for a Notepad++ feature, the proper procedure is to create an issue so that it can be discussed properly, not in some one-on-one email basis.

@zahra21
Copy link

zahra21 commented Mar 24, 2021

i forgot to ask,
do developers can read my email address?
unfortunately copy link address is not available in github anymore, or at least, i could not find this item.
my email address:
nasrinkhaksar3@gmail.com
i need just one small change in notepad installer especially in 7.9.2 that i should use forever because i love xp,
and also i have some questions
and i wish to be in contact with notepad++ developers directly!

@sasumner
Copy link
Contributor

i need just one small change in notepad installer especially in 7.9.2 that i should use forever because i love xp

So that would be a feature request to be made via the issue system, but it would be declined because it is for XP.
So...don't bother.

and also i have some questions

Questions go HERE

and i wish to be in contact with notepad++ developers directly!

It is good to want things! :-)

@zahra21
Copy link

zahra21 commented Mar 24, 2021

i make issues on github for my request.
because my request is very simple to fulfill.
i want just small change in notepad++ installer, i wish the old layout of notepad websites which includes informations about all versions of notepad++ and i have some questions about using notepad++ with my screen reader.
since i think that members of notepad++ community dont use screen reader, in that case, how can they help me and answer my questions?
in the last years, i tried to subscribe in notepad++ community, but i could not and dont remember its reason now.

@mere-human
Copy link
Contributor Author

@zahra21

  1. You can create a new issue for your request in this repository on GitHub.
    The request will be considered.
    But it is not guaranteed that the feature will be accepted by the maintainer.

  2. My email is publicly visible on my GitHub page.
    Everyone can write a message.
    But I'm just a developer who contributes like any other.
    The final decision is still on Don HO who is the maintainer of this project.

  3. I'd recommend to take a look at the Community Forum.
    It has a lot of active and friendly users.
    They can provide some useful tips. Or perhaps they had a similar problem and already found a solution.

@zahra21
Copy link

zahra21 commented Mar 24, 2021

in the previous time, i could not find informations about you and your profile. i could only read my profile by my nvda screen reader.
i sign out and loggin again and this time i found your address.
thanks so much.
about my questions,
how can i ask in the community when people dont use screen reader and they maybe even dont know what is the screen reader?!
i wished to ask you and other developers. thanks again for your help.
and, is it possible that my requested change be included in 7.9.2 which is the last version that supports my favorite windows version?
i explain for you in my email.
thanks and God bless!

@nikunjbhatt
Copy link

nikunjbhatt commented Apr 7, 2021

Most probably because of this change of using new style file/folder browser dialog, some features are missing in this dialog in Linux/Wine. (See the attached first screenshot.) It has no button to go to parent folder (or there is no item like ".." (double dots) in file/folder list to go to parent folder). (User needs to type double dots in "File Name" textbox and press enter key to go to the parent folder.)

One more problem is, it is always adding file extension of the file type selected in the drop down box of the "File Types" (located besides "File Name" textbox), even if the file name is enclosed in double quotes, except when "All types" is selected in the "File Types" dropdown. So, if user enters file name "abc.txt" (with or without double quotes) in Save dialog box, and "PHP Hypertext Preprocessor file" file type is selected in the dropdown then the file is being saved with name "abc.txt.php".

Are these problem directly related to Notepad++ or problem in Wine?

Here is my computer configuration:
Operating System: Fedora 33
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.10.21-200.fc33.x86_64
OS Type: 64-bit

Notepad++ v7.9.5 (64-bit)
Build time : Mar 21 2021 - 02:13:17
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : ON
Local Conf mode : OFF
OS Name : Microsoft Windows 7 (64-bit)
OS Build : 7601.0
Current ANSI codepage : 1252
WINE : 6.3
Plugins : BetterMultiSelection.dll ComparePlugin.dll DSpellCheck.dll Explorer.dll mimeTools.dll NppConverter.dll NppExport.dll zoomdisabler_x64.dll

(Second screenshot is showing Open dialog from Wine's Notepad application.)
Open_017
Open -2-‎_020

@sasumner
Copy link
Contributor

sasumner commented Apr 7, 2021

I'm not seeing Linux/WINE here: https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/SUPPORTED_SYSTEM.md
Should it be added?

@mere-human
Copy link
Contributor Author

mere-human commented Apr 7, 2021

It has no button to go to parent folder (or there is no item like ".." (double dots) in file/folder list to go to parent folder). (User needs to type double dots in "File Name" textbox and press enter key to go to the parent folder.)

I have the button to go to the parent folder (to the right of ← → buttons):
image

So, if user enters file name "abc.txt" (with or without double quotes) in Save dialog box, and "PHP Hypertext Preprocessor file" file type is selected in the dropdown then the file is being saved with name "abc.txt.php".

I can't reproduce this problem. When I enter a name with some extension e.g. new.txt then select a different type in the dropdown, the extension is substituted to the selected one.

Are these problem directly related to Notepad++ or problem in Wine?

It is likely that the problems you described are specific to Wine.

Also, please refrain from describing not related problems in the existing PR (especially, closed one).
It is better to create a separate GitHub issue, describe the problem, provide all info and keep the discussion there.
1 problem = 1 issue.
It would be easier to address the issue in a related PR and then close the related issue once the PR is submitted.

@mere-human
Copy link
Contributor Author

Probably, a bug should be reported into Wine repository.

@nikunjbhatt
Copy link

I have the button to go to the parent folder (to the right of ← → buttons):

This button is also appearing in the second screenshot I attached.

Also, please refrain from describing not related problems in the existing PR (especially, closed one).

This does seems related, at least to me.

It is better to create a separate GitHub issue, describe the problem, provide all info and keep the discussion there.
It would be easier to address the issue in a related PR and then close the related issue once the PR is submitted.

First I wanted to confirm that whether these problems are because of Wine or Notepad++. If these are not fault of Notepad++ then creating a new issue is of no use; sasumner and donho would scold me. ;-)

@mere-human
Copy link
Contributor Author

It has no button to go to parent folder (or there is no item like ".." (double dots) in file/folder list to go to parent folder)

I have the button to go to the parent folder (to the right of ← → buttons):

This button is also appearing in the second screenshot I attached.

The button ↑ allows you to navigate to the parent folder.
It was present in 7.9.1 (both in new style dialog and old style dialog):
image
The same button is present in 7.9.5 dialog:
image

What you have on the 1st screenshot is probably the poorly implemented feature in Wine.
I think, their implementation of Common Item Dialog is incomplete.

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

Labels

enhancement Proposed enhancements of existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please extend the "Browse for Folder" to match path opened