summaryrefslogtreecommitdiff
path: root/src/nautilus-properties-window.c
Commit message (Collapse)AuthorAgeFilesLines
* properties-window: Add created row to the basic pageApoorv Sachan2021-01-051-1/+25
| | | | | | | | The NautilusFile backend now supports birth-time parameter. It is now leveraged to display the date-created for a file in properties dialogue. Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/1566
* properties-window: Use g_clear_*()António Fernandes2020-12-221-43/+13
| | | | They cut on boilerplate and improve readability.
* properties-window: Use modern GList code patternsAntónio Fernandes2020-12-221-102/+47
| | | | | | | | | - Use GList API instead of reimplementing it: - g_list_copy_deep() - g_list_foreach() - g_list_delete_link() - NULL-initialize fully-owned lists. - Don't reimplement nautilus_mime_get_default_application_for_file()
* properties-window: Stop multi-file GAppInfo leakAntónio Fernandes2020-12-221-2/+4
| | | | | | | | | | | | When showing the properties for multiple files with the same MIME type, The app_info variable is reassigned multiple times in a for loop to the return value of nautilus_mime_get_default_application_for_file(), which returns a caller-owned refference. So, we leak a reference on each reassignment. To fix this, declare the variable inside the loop block, to ensure autocleanup after each loop iteration.
* properties-window: Use autocleanup variables moreAntónio Fernandes2020-12-221-123/+68
| | | | | | | Also fixes a few leaks: *uri in setup_volume_usage_widget() *error in set_as_default_clicked_cb() *message in set_as_default_clicked_cb()
* properties-window: Use autocleanup variablesApoorv Sachan2020-12-221-139/+62
| | | | Use modern GLib utilities for memory management.
* properties-window: Set boolean object data correctlyAntónio Fernandes2020-12-221-2/+2
| | | | | | | | | | It's wrong to set a pointer to an object as data without incrementing its refcount. But there is actually no need to pass a real pointer as data here, as we actually want a boolean. Use a pointer conversion macros instead.
* properties-window: Instance symbol renamingApoorv Sachan2020-12-221-716/+716
| | | | | Use "self" as symbol name for the NautilusPropertiesWindow* instance in methods and signal handlers.
* properties-window: Removed unused macrosApoorv Sachan2020-12-221-2/+0
| | | | | | ROW_PAD was a macro used by code the UI creation code which has been removed in previous commits. Now It's not useful.
* properties-window: Follow HIG layout adviceApoorv Sachan2020-08-051-14/+1
| | | | | | | | | | | | | | The GNOME Human Interface Guidelines include spacing rules for widgets laid out in a grid, and spacing from window edges: https://developer.gnome.org/hig/stable/visual-layout.html.en For vertical spacing between groups of controls, we have been using empty label widgets. This doesn't give us the control over the heigh that we need, so shall use margins instead. In case of the Basic page, due to the conditionality of the first widget in a group, instead of propper margins we use an empty box with a set heigh as a spacer. Also, prefer the GtkBox:spacing property over the padding child prop.
* properties-window: Reposition icon above basic gridApoorv Sachan2020-08-051-3/+3
| | | | | | | | With the title labels aligned to the right, the icon widget is isolated at the left side, pushed to the edge and disconnected. Center the icon horizontally, at the top of the page, for better visual balance. Also, make it slightly larger, using standard icon size.
* properties-window: HIG Complaince stylingApoorv Sachan2020-08-051-1/+1
| | | | | | * All the title labels are right Aligned * All labels appear in a lighter shade - dim-label styling * ':' symbol has been removed which succeeds the title labels
* properties-window: Align Contents title lable propperlyApoorv Sachan2020-08-051-20/+0
| | | | | | | | | When the Contents field displays a multi line message the Contents label needs to be aligned to the first line. Traditional implementation achieved this by conditionally appending a newline character, however now that valign property could be used to achieve the same, by setting it to "Start"
* properties-window: Remove unused struct membersApoorv Sachan2020-08-051-3/+0
|
* properties-window: Stop setting "use_original" dataApoorv Sachan2020-08-051-53/+26
| | | | | now, value_field_update() and value_field_update_internal() are merged into value_filed_update()
* properties-window: Stop setting "inconsistent_string" dataApoorv Sachan2020-08-051-43/+4
| | | | This is always the same for all labels, so there is no point.
* properties-window: Removing dead functionsApoorv Sachan2020-08-051-363/+0
| | | | They lost their UI-building role to GtkBuilder.
* properties-window: Clear list of dangling pointersAntónio Fernandes2020-08-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | The window->change_permission_combos list is populated each time the "Change Permissions of Enclosed Files" button is clicked. This list is cleared when the Properties window is destroyed, but not when the "Change Permissions of Enclosed Files" dialog is. As a result, if the button is clicked again, new combos are prepended to the list but the previous (now-dangling) pointers are still there. If GLib is built without -DG_DISABLE_CAST_CHECKS, then trying to use this dialog a second time to change permissions of enclosed files will result in a crash due to the dangling pointers failing a cast check. But even though production code will not crash this way, leaving dangling pointers in the list is a bad idea. Before this dialog was ported to a GtkBuilder UI definition, this bug was masked by a leak of floating references. To properly manage the lifecycle of this list, let's clear it whenever the dialog is destroyed.
* properties-window: Stop using NautilusMimeApplicationChooser classApoorv Sachan2020-08-051-10/+299
| | | | | | | | | | | | | | | | The template UI definition has the Open With tab empty. This is because its contents come from the NautilusMimeApplicationChooser widget. But a separate abstraction for choosing appications based on MIME types isn't required as GTK provides GtkAppChooser. The other widgets can be neatly tucked away in the UI built using XML templates to achieve the same results, and at the same time allowing the open-with page to be customizable in Glade. Some functions are adapted from mime-application-chooser.c, but modified to remove any dependency on that class.
* properties-window: Add "Open With" tab to templateApoorv Sachan2020-08-051-10/+9
| | | | | | This commit only creates outer container of the Open With tab. Inner widgets are ported in the next commit.
* properties-window: Port "Change Permissions..." dialog to GtkBuilderApoorv Sachan2020-08-051-41/+26
| | | | | | | | | | | | "Change Permissions of Enclosed Files" dialog is now built using XML UI definition. This is present as a seperate .ui file apart from nautilus-properties-window.ui because a .ui file file containing a widget declared as a template cannot have other external widgets to be built independently from the template. This .ui file is not produced or editable usingg Glade as it doesn't recognize "action" type children as found in GtkDialog. This issue is already reported in https://gitlab.gnome.org/GNOME/glade/-/issues/392
* properties-window: Populate remaining grid rows from templateApoorv Sachan2020-08-051-56/+70
| | | | | The dialog the "Change Permissions for Enclosed Files…" button opens is going to be ported in the next commit.
* properties-window: Populate Owner, Group and Others rows from templateApoorv Sachan2020-08-051-78/+192
| | | | | | | | | | | | | | | | | | Combo boxes are empty in the template. Their models and renderers are still handled programatically, because porting them posed many issues: - User lists and groups lists are not staic. - Permissions list stores have a column for permissions enum. While we can use the enum value symbol in C, we would have to use a numeric value in Glade, which is going to be quite obscure and hard to document. - Porting the models to GtkBuilder UI definition isn’t really improving hackability / design-ability much because of how Glade handles it. - The comboBox itself is already defined in the .ui file, so it’s possible to tweak the design even if the comboBoxes look empty It would make things more complicated, so it’s more reasonable to let the code handle this.
* properties-window: Add conditional prompt labels to the templateApoorv Sachan2020-08-051-9/+19
| | | | Also document the code generating label text containing file names.
* properties-window: Add Permissions tab outer containers to templateApoorv Sachan2020-08-051-23/+19
| | | | Internal widgets will be populated from template in the next commits.
* properties-window: Add volume usage grid to templateApoorv Sachan2020-08-051-122/+30
| | | | | | The skeleton, layouting of grid cells, and styling of widgets inside the volume usage widget is done in the template. Only the GtkDrawing areas are drawn using code, in callbacks for ::draw.
* properties-window: Populate all rows in templateApoorv Sachan2020-08-051-141/+210
| | | | Exception: the usage widget continues to be constructed in our own code.
* properties-window: Populate Name row from templateApoorv Sachan2020-08-051-63/+29
| | | | | | | | | | | We have been creating either an entry or a label for the name field, depending on whether we were able to edit the name or not. In GtkBuilder UI definitions we cannot do this anymore, as we have to define and build both the entry and the label. So, in order to only show the one we want on each situation, we are introducing a GtkStack to contain both.
* properties-window: Define icon widget in templateApoorv Sachan2020-08-051-33/+22
| | | | | | | | | | | The GtkImage that displays the window icon may or may not be contained by a GtkButton, depending on whether we were able to set a custom icon. In GtkBuilder UI definitions we cannot do this anymore, as we have to set a parent for the image widget from the start. So, define both a simple image and a button with an image, and pack them in a GtkStack to only show the button when appropriate.
* properties-window: Add Basic tab containers to templateApoorv Sachan2020-08-051-16/+9
| | | | | | | | | This commit obtains the outer containers of the Basic page from the widget template UI definition. A new GtkBox to pack the icon widget is included. The inner widgets are ported to the UI definition in the next commits.
* properties-window: Add composite widget templateApoorv Sachan2020-08-051-19/+14
| | | | | | | | | For now, only the outermost containers, GtkWindow down to GtkNotebook, have been defined in the GtkBuilder UI file. The Basic, Permissions, and Open With tabs, along with their content, are still built and inserted programaically. They are going to be ported accross the next series commits.
* properties-window: Restore close on press 'Esc' functionalityApoorv Sachan2020-08-051-0/+7
| | | | | | | | | | NautilusPropertiesWindow usec to be a GtkDialog subclass, inheriting the "close" signal, which was leveraged to implement close on Esc. However as GtkWindow doesn't feature a "close" signal natively, and NautilusPropertiesWindow now subclasses GtkWindow, it needs to be seperately defined and attached to a signal handler to restore the functionality.
* properties-window: Inherit from GtkWindow instead of GtkDialogApoorv Sachan2020-08-051-28/+7
| | | | | | | | | | | | | | The properties window has been subclassing GtkDialog since long ago. GtkDialog features an action area where, historically, the properties window added Help and Close action buttons. These action were dropped when a headerbar was adopted.[1] Moreover, we want to port the Properties window to a GtkBuilder UI definition, which GtkDialog makes harder to achive. Subclassing GtkWindow fits this use case much better. [1] d8a8ab3b66a0a4849e2f9cd17e96f86f85541dee
* general: Run uncrustify scriptOndrej Holy2020-04-051-29/+29
| | | | | There are some style issue since the last run. Let's run it again before enabling style-check CI job.
* properties-window: Fix endless content size calculationsOndrej Holy2020-03-061-4/+0
| | | | | | | | | | | | | | | | | | | | | | The total number of items and their size are shown in Properties dialog. However, the deep count calculations are currently restarted with each "changed" event of `NautilusFile` object(s). This is not usually a problem if only one file is selected, but it is a pretty big issue when more files are selected. It is common that the calculation never ends. This is because the "changed" events are emitted in many irrelevant cases (e.g. free space change) and it totally doesn't make sense to restart the calculation in most of the cases. The initial idea was to react on ongoing file operations, however, the calculation currently doesn't react on file changes deeper in the tree anyway, or on changes, which happened after the calculation is done. Thus the current result can be outdated anyway. Let's ignore `NautilusFile` changes at all when calculating the content size as it is pretty impossible to implement this properly to dynamically react on all size changes in the tree. Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/363
* properties-window: Remove unused parameterOndrej Holy2019-10-031-6/+4
| | | | | The cancel_destroy_handler parameter is not used by remove_pending() function. Let's remove it to make the code simpler.
* properties-window: Fix crashes when opened multiple timesOndrej Holy2019-10-031-1/+4
| | | | | | | | Nautilus crashes with segmentation fault when closing the properties dialog after it has been opened mutliple times for the same file. This can't be reproduced over Nautilus as it uses modal dialogs, however, it can be simply reproduced over the Desktop Icons extension. Let's check the pending_key variable before used to be sure it is not NULL to fix this crashes.
* properties-window: Fix crashes when cancelledOndrej Holy2019-10-031-2/+12
| | | | | | | | Nautilus crashes on the "timed_wait_free: assertion failed: (g_hash_table_lookup (timed_wait_hash_table, wait) != NULL)" assertion when the creating of the properties window is cancelled. This is because the timed wait has been already removed. Let's don't remove the wait when cancelled in order to prevent the crashes.
* properties-window: Fix criticals when closingOndrej Holy2019-10-031-1/+1
| | | | | | | | | | The "eel_timed_wait_stop: assertion 'wait != NULL' failed" critical is printed when closing the properties window since commit c8c2fab2. This is because the timed wait has been already removed. Let's remove the wait when closing only if it has not been yet removed in order to prevent this criticals. Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/1075
* general: Drop in-tree copy of gnome-desktopErnestas Kulik2019-06-281-1/+1
| | | | | The code was copied to avoid having an external GTK+ 3 dependency, but at this point it’s more trouble than it’s worth.
* properties-window: Logic for displaying Modified and Accessed timesTimothy OBrien2019-02-111-2/+17
| | | | | | | Modified times were not displaying when viewing directory properties. Added logic to show the Accessed and Modified fields at appropriate times when either files or folders are selected. Fixes #723
* properties-window: Remove never set variablesBastien Nocera2019-02-111-5/+2
| | | | | | The total_count and total_size struct members were read but never set. This has been the case since the original "multi-file" support was added for the size reporting in commit 70f0260
* general: Fix the error dialog not showingGeorge Mocanu2018-10-271-1/+1
| | | | | | | | | | | | | Since commit c1bb594d, a dialog error wouldn't be shown if there was an error when renaming a file or setting permissions to a file. The user should be informed through a error dialog if something went wrong in the above-mentioned use-cases. This patch solves the issue by using the parent, instead of NULL. Closes #705
* properties-window: Keep alive properties window if called through DBusCarlos Soriano2018-08-071-29/+77
| | | | | | | | | | | | | | The properties window can be used from within Nautilus, and therefore a dialog window makes sense, or from outside Nautilus, such as the FileManager dbus free desktop standard. In the later, used for integration with things like desktop icons extensions, we need to keep the application alive since GApplication would close the application if no application window is alive after a timeout. To fix this, this work makes the window hint a regular window if used from those cases.
* general: Stop setting WM classErnestas Kulik2018-05-281-2/+0
| | | | | | | According to GTK+ docs, this should be the same for all windows of an application, and GTK+ defaults to doing that itself. However, there is a slight issue in that the properties window sets a custom window icon that isn’t reset instantaneously after closing the dialog.
* properties-window: Use “notify” signal instead of focus eventsErnestas Kulik2018-05-281-13/+15
|
* properties-window: Drop deprecated GtkStyleContext APIErnestas Kulik2018-05-221-3/+5
| | | | | | | This is kind of a hack, but we can still use gtk_style_context_get_color() to get the color of the pie slice. Two hacks, in fact, as this adds a separate style class to hold the color of the border.
* eel: Remove a11y utilitiesErnestas Kulik2018-05-221-3/+11
| | | | | | In theory, it would be possible to just drop the GAIL code and keep the header, but, given that NautilusCanvasItem is the only remaining consumer, the needed bits can be moved over.
* general: Copy gnome-desktop thumbnailing codeErnestas Kulik2018-05-221-1/+1
| | | | | | | This is one of prerequisite steps to take before fully switching to GTK+ 4, as gnome-desktop has code, depending on GTK+ 3. Since the thumbnailing machinery is self-contained, it can easily be just copied over.
* properties-window: Fix typoGeorge Mocanu2018-05-211-1/+1
| | | | Use sentence capitalization for "Parent folder" label.