-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set example file, improved template text, use namefilter for *.xml #917
Conversation
I'll look into them but first should find the best logic for dealing with the example file — have forgotten the code because of wrestling with other codes ;) |
Take your time :) |
dia.setOption(QFileDialog::DontConfirmOverwrite, true); | ||
dia.setFileMode(QFileDialog::AnyFile); | ||
dia.setNameFilter(tr("*.xml files (*.xml)")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above two lines should be:
dia.setFileMode(QFileDialog::ExistingFile);
dia.setNameFilter(tr("XML files (*.xml)"));
But please read my next comment before changing them.
IMO, saving
To do it, I need to make another PR that contains yours and supersedes it. What do you think? |
BTW, the title of the dialog, namely "Open or create bookmarks file", doesn't make sense to me because that dialog only opens a file. It should be "Open bookmarks file" and |
Again, I encountered strange things in QTerminal's GUI ;) What if the user types the path of a nonexistent XML file inside the entry of the "Bookmarks" page of QTerminal's preferences dialog? Where is the confirmation dialog when the user edits a bookmark file from inside it? To say nothing of how the user can create a bookmarks file with it (he can't). |
The existing bookmarks file will be already set in existing .ini file I think. And opening the example file in data directory will be read-only, and saving it in the config location is not intuitive. Maybe a button "use example file"? No clear idea atm.
This is done, but without
|
QTerminal's preferences dialog could save it to the config folder if its Apply or OK button is pressed.
That file dialog only opens an XML file. It isn't responsible for saving. Saving will be done if the Apply or OK button of QTerminal's preferences dialog is pressed and there is a file to save to. Nothing is intuitive in this section of preferences dialog. |
But you yourself proposed that we save it to the config location at first run. What I'm saying is saving it only if the user explicitly selects it and confirms the preferences dialog. |
Yet another method is as follows: We could remove |
I was thinking about this too, but it's ugly to set all those spaces and \ needed.
The actual "ok" button isn't quite clear for this, but this would be the easiest way to do. Having 2 examples files isn't smart. |
If you mean the OK button of QTerminal's dialog, I agree, but, as you said, it's the easiest way. Moreover, as I mentioned above, there should be a confirmation dialog: the app shouldn't overwrite a file without asking the user. |
Maybe this lineedit should be removed or showing location without editing. |
The line-edit will be useful if we enhance the functionality of the Bookmarks page: the user could type a path and expect that it'll be created on clicking the OK/Apply button of QTerminal's dialog. EDIT: I'm so confused by this GUI that I make several typos in my comments ;) |
But it's already clear (if "search..." button opens config directory) where he has saved it, actually the button should simply open the location of the file wherever it is.
same here, but also the ideas... It remembers me my first approach years ago... EDIT: and not "search..." but "open" |
My point is that the user may type a path, instead of searching for an existing file. That'll be good if the dialog does something with that path, i.e., if it creates it. I need to think more about the design. Hopefully, I'll find an acceptable solution and will discuss it with you. |
Path typing can be a source of errors, while clicking through folders in the filedialog is always ok. |
Yes, but it's a good option for those who have already copied a path to the clipboard or want a path to be created. It's usual to have this functionality in an app. |
My sketch:
|
Looks reasonable.
Imho it should still contain much of bookmarks potentials. |
OK, but still as simple as possible. We already have an example file. Please also note that the above sketch is general. There are several details that I haven't included. Their implementation will take time. The goal is having a Bookmarks page that does what any user may expect from it, without adding a widget to it. Later, we could discuss more widgets but I think, if the current ones work as expected, the Bookmarks page will be OK. |
Almost done. Just three things:
It's simple and shows the basic functionality. |
I didn't like much the So, when clicking "ok" this will be used or the example file? |
It just shows the structure; the user could choose the contents. If you have another simple command in mind, please tell me.
If the user clicks If he clicks If he chooses an example file from the app directory (the file name isn't important), it'll be copied to his config directory when he clicks |
If you want the example file(s) to be more visible to the user, I could add an extra button with the label "Example", so that it'll open the app directory regardless of what's in the line-edit. EDIT: In that case, the label "Examples" might be better because you could add more example files. I mean this: |
That is quite nice! But not sure about more examples just for the sake of it, in case we need ideas for them ;) |
Even one file can be considered to show several examples; the plural form "Examples" can be used with one file too. Who knows? You might want to add multiple files later. |
Done in #919 |
At least 2 things missing I've no clue how to achieve:
~/.config/qterminal.org/
instead of$HOME
qterminal_bookmarks_example.xml
in the config location at first runAs it is it will show the small example syntax when
qterminal_bookmarks_example.xml
is not present.With the above it would close #886 IMHO