-
Notifications
You must be signed in to change notification settings - Fork 39
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
Feature: Save as dialog #133
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for your contribution @Maaxxs. I'm not against it but there are few things to change.
- Can you squash all your commits into 1?
- Make sure
clang-format
is run on all the files you're changing. - Please have a look at my comments and suggestions.
2dc2642
to
cc173c2
Compare
thanks for your suggestions! Other points:
todo:
|
cc173c2
to
07e9e45
Compare
src/application.c
Outdated
filename_suggestion = format_filename(state->config->save_filename_format); | ||
|
||
dialog = gtk_file_chooser_dialog_new(NULL, state->ui->window, action, | ||
("_Cancel"), GTK_RESPONSE_CANCEL, |
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.
Is there a reason why you're putting the "_Cancel"
and "_Save"
between parenthesis?
Regarding translating those, I'm not sure. The gtk doc seems to indicate what you are doing is valid. But I don't know if it means it's properly translated and using the base gtk po
files. I'd need to research.
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.
I've switched to French, and the Close / Save do not seem to be translated. You'll have to use gettext
I guess? I don't know if the ninja target will be smart enough to catch those. (I don't think there any translation done in the .c
files. It's only in the ui
files for now.)
Good luck. :)
1c3eaa2
to
3083bb7
Compare
07e9e45
to
18a899a
Compare
I had some time again, so I continued here. I added some code for the initialization of The initial step to include the translation for the dialog buttons is done. |
Allow to save snapshots with a different name and under a different location than specified in the configuration as default. Signed-off-by: Max Kunzelmann <maxdev@posteo.de>
18a899a
to
e670f72
Compare
// set locales according to environment variables
setlocale(LC_ALL, ""); The default of
I think it would be nice to do this, although it's not necessary as swappy is not using time, number units or similar where the formatting depends on the locale. AFAIU, this would enable an user of swappy to just set $ LC_ALL=de_DE swappy -f ~/Pictures/swappytest.png
$ LANG=de_DE swappy -f ~/Pictures/swappytest.png
$ LC_ALL=en_US LANG=de_DE swappy -f ~/Pictures/swappytest.png
$ LC_ALL=en_US LANG=de_DE LANGUAGE=fr_FR swappy -f ~/Pictures/swappytest.png The first two commands set the language to German. The third one sets it to English because (according to the manpage)
However, if I'm happy to remove this if you don't agree. // set base directory for translated messages
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); This is the most important call that caused me some headache, too. The default prefix on my archlinux system is // explicitly set encoding of message translations to UTF-8
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); this forces the codeset to UTF-8. I think this is ok as the translation files are all UTF-8 as well. For instance, if we don't do this, then I get the following warnings if only $ LC_ALL=de_DE swappy -f ~/Pictures/swappytest.png
(swappy:179132): Pango-WARNING **: 14:07:42.612: Invalid UTF-8 string passed to pango_layout_set_text()
(swappy:179132): Pango-WARNING **: 14:07:42.624: Invalid UTF-8 string passed to pango_layout_set_text() btw, should I continue to force push changes in that one commit or squash the commits in the end? (I always feel kinda bad when doing a force push :) ). |
Thank you @Maaxxs. I'll have a look when I get some time. You can definitely keep "force pushing", it's your branch on your own fork you can do whatever you want with it. |
Sure. Thanks!
Ok. My thinking was that it may be easier for you to review changes. And I think GitHub get confused sometimes when you do a force push and there are open reviews. |
hi @jtheoof have you had time for another look at this? |
nice to see some activity here. Not sure what I can do to push this further. I'm running with these changes since I proposed them and so far (~2 years :) ) it works well. |
Would be really nice to see indeed! |
I am not sure whats causing the delay either, lets wait for the review |
I'd really love to have this feature, too. Would make swappy an even greater replacement for flameshot. |
I'm still hesitating to merge this. I think the part that I'm not a fan of is the fact that it clutters the UI. I want this tool to be simple and we're adding an extra button. I would be down to merge if you remove the UI bits and just use the ctrl+shift+s shortcut + document it properly in the README and the manpage |
are there other functions that are only accessible by keyboard shortcut? |
As mentioned in issue #125 it would be nice to save images to a different location than the default.
I thought so, too and came up with the following solution.
I tried to keep everything clean and simple.
Save
button with the "official" save_as image.Todo:
ctrl+shift+s
for the save_as dialog. I think that'd be useful, too.