Skip to content
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

[backup-this-file@h3nr1ke] Feature Request: Add configurable extension #392

Open
sphh opened this issue May 31, 2024 · 10 comments
Open

[backup-this-file@h3nr1ke] Feature Request: Add configurable extension #392

sphh opened this issue May 31, 2024 · 10 comments
Labels
feature request New feature or request

Comments

@sphh
Copy link

sphh commented May 31, 2024

Action name and maintainer

backup-this-file@h3nr1ke @h3nr1ke

What would you like to see?

backup-this-file@h3nr1ke

Preamble: Unfortunately I cannot find the proper UUID in the drop-down list for the ‘Action name and maintainer’ …

It would be great, if it were possible to configure the extension used when creating a back-up file. Thanks.

@sphh sphh added the feature request New feature or request label May 31, 2024
@rcalixte rcalixte changed the title Add configurable extension [backup-this-file@h3nr1ke] Feature Request: Add configurable extension Jun 1, 2024
@rcalixte
Copy link
Member

rcalixte commented Jun 1, 2024

cc @h3nr1ke

@h3nr1ke
Copy link
Contributor

h3nr1ke commented Jun 3, 2024

Hey @sphh , thanks for using the action =)

I will think on how to add the visual part to ask for the user the desired extension as store it

I did this action using only shell scripts, so no interface in the end...

Soon I get the chance to change I will let you know =)

@sphh
Copy link
Author

sphh commented Jun 3, 2024

To be honest, I don't know, if this possible at at this moment. I had a look through my installed actions and none of those offer the possibility to configure them – as applets can be configured.

If there is no way to configure an action, I only see two approaches:

  1. Ask the cinnamon maintainers to add the possibility to configure actions, or
  2. Pop up a dialog, where it's possible to specify the desired extensions. But this is then very similar to the (already existing) batch rename feature …

@h3nr1ke
Copy link
Contributor

h3nr1ke commented Jun 4, 2024

To be honest, I don't know, if this possible at at this moment. I had a look through my installed actions and none of those offer the possibility to configure them – as applets can be configured.

If there is no way to configure an action, I only see two approaches:

  1. Ask the cinnamon maintainers to add the possibility to configure actions, or
  2. Pop up a dialog, where it's possible to specify the desired extensions. But this is then very similar to the (already existing) batch rename feature …

Yes, I think the best idea is to pop up the option during the first usage asking to keep the standard extension or use a new one.

May be we can add an extra option in the menu, like "Backup this file custom extension" to popup the modal, the other option will remain there for quick usage

or even a simple solution, just add a config file to define the extension to be used, if the user want to change we can open it when the setting button is pressed.

(not sure about any of those options are possible... but I will study)

@h3nr1ke
Copy link
Contributor

h3nr1ke commented Jun 5, 2024

@rcalixte do you know if there is anyway to identify a shift key when the action is called?

I was wondering to display a prompt asking for the custom extension, like this (inspired on your plugin, thanks for that)

image

image

image

@sphh I think to add the custom modal solves the problem, if the modal is canceled, the .bkp extension will be used, what do you think?

This works if the user wants to apply a date as an extension for instance. To change .bkp to anything else, I that is the new standard, maybe a config file is better

I havent found how to create a setting page for an action, is it possible @rcalixte ?

Thanks for the feedbacks =)

@sphh
Copy link
Author

sphh commented Jun 5, 2024

I like the idea of a modification key (Shift or Ctrl). Here comes the approach I would like:

  • Selecting the action (without modification key) will make a copy adding the standard extension.
  • Selecting the action with the modification key pressed opens a dialog as shown above. This dialog has the following widgets:
    • A text input with the standard/saved extension as default as text
    • A checkbox (initially unchecked) with Save the extension as default; if this is checked, the given extension is saved as default, when the Backup button is pressed
    • A Cancel button, which cancels the action (do not copy)
    • A Backup (or OK) button, which copies the selected files; only active, if the text input field is not empty
    • A Reset button, which resets the extension to .bkp (optional)

@rcalixte
Copy link
Member

rcalixte commented Jun 6, 2024

@rcalixte do you know if there is anyway to identify a shift key when the action is called?

There might be something with GDK but the issue I think would be how the content menu for the Action itself is clicked. If a user right-clicks like normal, and then Shift+Click on the menu, it might register differently but I don't know if the event would be available for the action itself to receive. I've not done anything like this here yet. 😅

I havent found how to create a setting page for an action, is it possible @rcalixte ?

Maybe you could have some json settings file in the directory for the action? That is a rough idea and I don't know how to implement it cleanly. Maybe additional properties to manage the appearance of a dialog and related options too. I would need to play with it a little bit more.

@h3nr1ke
Copy link
Contributor

h3nr1ke commented Jun 6, 2024

Hey @rcalixte thanks for the comments

I have played around here using only shell script and seems not be possible...

I will need to see if something happen using python

A json file would be great, so if the json file is there the system will display the gear button in the action so the user can change it... =) would be super... with some standard data types and widgets to display the options.

should we create a feature suggestion to the cinnamon team?

@h3nr1ke
Copy link
Contributor

h3nr1ke commented Jun 9, 2024

Hey @sphh and @rcalixte I was researching how to do the "Shift + Action" thing and got no lucky there... :(

what do you guys think to create a second action for the custom, so both will be available when the user click it.

@sphh
Copy link
Author

sphh commented Jun 10, 2024

That would be my favourite (as described in #392 (comment))!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants