summaryrefslogtreecommitdiff
path: root/src/nautilus-rename-file-popover-controller.c
Commit message (Collapse)AuthorAgeFilesLines
* general: Fix indentation nitpicksAntónio Fernandes2023-04-231-1/+1
| | | | Pass new uncrustify criteria. No logic changes.
* rename-file-popover-controller: Set parent only on creationCorey Berla2022-08-011-4/+4
| | | | | | | | | We are attempting to reset the parent to the view every time the rename popover shows. This triggers warnings because the popover already has a parent. There's no reason to do this because we are setting the parent to the view over and over again. Since the popover and view have the same lifecycle, set the parent on creation.
* general: Switch to GTK4António Fernandes2022-01-091-18/+13
| | | | | | | | | | | | | | | | The new major version of the toolkit is a requirement to fix old issues and enable future enhancements. Update symbols and adapt logic to API changes. Update and simplify UI definitions. Update local copy of places sidebar and places view. Replace dependencies with their GTK4-compatible successors. Make a minimum changes required to build and run, with known regressions to be fixed in future commits. For a detailed breakup of the changes, see the 36 commits-deep log leading to d5763facb1e5045251171ed1273dca0859f3542f. This is the main part of https://gitlab.gnome.org/GNOME/nautilus/-/issues/276
* rename-file-popover-controller: Use controller for key eventsErnestas Kulik2021-12-221-23/+16
| | | | Rebased and ammended by António Fernandes <antoniof@gnome.org>
* rename-file-popover: implement redesignPeter Eisenmann2021-11-031-9/+9
| | | | | | | | | Implements Alan's proposed redesign for the rename dialog, that also allows displaying longer file names. Implements GNOME/nautilus#1986 Relates GNOME/nautilus#46
* replace display_name attribute with edit_name for renamingAnubhav Tyagi2021-07-151-8/+8
| | | | | | | | The edit_name attribute corresponds to G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME attribute. It is almost identical to display_name, except if there is invalid encoding, and is preferred when implementing renaming functionality. Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1540
* general: Clean up signal handler disconnectionJoshua Lee2020-07-081-20/+6
| | | | | | | Make use of GLib's new g_clear_signal_handler() function to simplify nautilus' signal handler disconnection and reduce unneccessary code. Fixes: #1522
* file-name-widget: Warn when name exceeds size limitAntónio Fernandes2018-08-021-8/+2
| | | | | | | | | An warning for names exceeding the size limit has been introduced in 122f201dcf356460a30a7b260730bcfc7246a614 for the rename popover. This would be useful for the compress and new folder dialogs as well. So, make all file name widget derivatives share this feature.
* file-name-widget: Clarify logic in name_is_valid()António Fernandes2018-08-021-6/+12
| | | | | | | | | | | We rely on the presence of an error_message to decide whether the name is valid. However, this is misleading, because we can have an invalid name with no error_message (the empty name case), and we can have a valid name with an error_message (the dotfile case), requiring 2 early returns. Instead, use an explicit return variable.
* file-name-widget : Warn if the name will hide the fileYash Jain2018-07-251-0/+12
| | | | | | | | | The user should be informed that using a file/folder name starting with "." will mark it a hidden. Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/529 Signed-off-by: Yash Jain <ydjainopensource@gmail.com>
* rename-file-popover-controller: Stop using key-press-eventErnestas Kulik2018-05-281-10/+23
|
* rename-file-popover: Remove redundant calculationHarish Nair2018-05-211-1/+1
| | | | | Removes a calculation that has already been done before. Instead uses the variable that contains the result of the calculation.
* rename-file-popover: Warn when name exceeds size limitHarish Nair2018-05-181-0/+17
| | | | | | | | | | | | | | | When a file is renamed if the name entered by user has a length that exceeds maximum limit then it shows a window with a warning. The problem is that once the user has acknowledged the warning, the file name goes back to its original name. The user is not given a chance to make slight modifications in the name that was entered. To fix this problem, a warning will be given in the popup itself where the new filename is entered. That way the user will be able to make slight changes so that the file name is within the size limit. https://gitlab.gnome.org/GNOME/nautilus/issues/148
* rename-file-popover-controller: Make popover recyclableErnestas Kulik2018-03-291-73/+118
| | | | | | | | | | | | Creating and destroying the controller each time we want to rename something results in not being able to pop down the popover, which leads to an inconsistent look. The “containing-directory” in the file name widget controller parent class needed to be made non-construct-only, as otherwise it would be impossible to reuse the same controller. Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/260
* rename-file-popover-controller: Don't destroy the popover in 'unmap'Jan Alexander Steffens (heftig)2018-01-191-7/+1
| | | | | | | | Doing that when transitions are deactivated destroys the popover in the middle of gtk_popover_popdown, causing gtk_popover_hide_internal to operate on a finalized popover. Fixes #216.
* rename-file-popover: fix key event state checkingErnestas Kulik2017-12-081-1/+1
| | | | | | | | | | | Currently, when checking if the user pressed ctrl-z, an equality check is used on the state to determine whether the ctrl key is pressed. That does not work, however, as there may be other modifier masks applied, be it internal GDK values or mapping of num lock to mod2. That is fixed by using binary AND on the state with the relevant mask. Closes #149.
* rename-file-popover-controller: consume ctrl-zErnestas Kulik2017-08-081-22/+43
| | | | | | | | | Pressing ctrl-z while renaming a file results in undoing the last completed operation, which breaks expectations. This commit makes the key combination revert the text in the name entry to the display name of the target file. https://bugzilla.gnome.org/show_bug.cgi?id=686023
* rename-file-popover-controller: close on file deletionErnestas Kulik2017-03-041-0/+31
| | | | | | | | | Currently, the popover remains open if the file is deleted (can be triggered by creating a file, opening the rename popover and undoing). This commit makes the controller connect to the “changed” signal of the target file and emits the “cancelled” signal if the file is gone. https://bugzilla.gnome.org/show_bug.cgi?id=779568
* rename-file-popover-controller: make F2 toggle between selection modesErnestas Kulik2017-03-021-0/+61
| | | | | | | | | In previous versions of Nautilus, F2 used to switch between selecting the whole filename and selecting the filename up to the extension. This functionality has been lost in some version. This commit brings the functionality back. https://bugzilla.gnome.org/show_bug.cgi?id=774361
* rename-file-popover-controller: set entry width for all filesErnestas Kulik2017-03-021-10/+13
| | | | | | | | | The width for the rename popover entry is set if the file is a regular file, which does not include folders, resulting in a narrow entry, despite the name being long. This commit makes the code set the width regardless of the file type. https://bugzilla.gnome.org/show_bug.cgi?id=774361
* rename-file-popover-controller: select entire name for foldersRazvan Chitu2016-11-081-7/+13
| | | | | | | | When renaming a file, the extension is not selected for editing, even if the file is a directory. In order to fix this, deselect the extension only if the renamed file is of regular type. https://bugzilla.gnome.org/show_bug.cgi?id=759718
* rename-file-popover-controller: Fix popover animationAlexandru Pandelea2016-11-041-2/+2
| | | | | | | | | The transitions for the rename popover are disabled. To fix this, use gtk_popover_popdown and gtk_popover_popup instead of gtk_widget_show and gtk_widget_hide. https://bugzilla.gnome.org/show_bug.cgi?id=771614
* rename-file-popover-controller: add headerCarlos Soriano2016-09-061-0/+19
|
* general: initialize smart pointers to NULLRazvan Chitu2016-08-301-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=770609
* general: run uncrustifyCarlos Soriano2016-08-291-144/+161
| | | | | | | | And make the style of Nautilus the same for all files. Hopefully we can fix all the style issues we can find in the next days, so expect a little of movement on this. https://bugzilla.gnome.org/show_bug.cgi?id=770564
* file-name-widgets: use a revealer to display errorsRazvan Chitu2016-08-231-0/+3
| | | | | | | | Each file name widget has an error label for displaying error messages. However, when there is no error, the label just takes up space for no reason. In order to fix this, use a revealer to display error messages. https://bugzilla.gnome.org/show_bug.cgi?id=770199
* files-view: move file name widget logic to separate controllersRazvan Chitu2016-08-191-0/+223
The rename file popover and the new folder dialog share common logic for validating file names entered by the user. The control logic was implemented with a simple structure in files-view. Besides common logic, the structure also held parameters specific to only one of the operations. Another problem is that the current implementation does not allow flexibility in obtaining the file name from the widgets and displaying error messages. In order to fix this, reimplement the structure as an abstract class and create two subclasses for the "Rename" and "New Folder" widgets. https://bugzilla.gnome.org/show_bug.cgi?id=769336