| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
They cut on boilerplate and improve readability.
|
|
|
|
|
|
|
|
|
| |
- 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()
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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()
|
|
|
|
| |
Use modern GLib utilities for memory management.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Use "self" as symbol name for the NautilusPropertiesWindow* instance
in methods and signal handlers.
|
|
|
|
|
|
| |
ROW_PAD was a macro used by code the UI creation
code which has been removed in previous commits.
Now It's not useful.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
| |
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"
|
| |
|
|
|
|
|
| |
now, value_field_update() and value_field_update_internal()
are merged into value_filed_update()
|
|
|
|
| |
This is always the same for all labels, so there is no point.
|
|
|
|
| |
They lost their UI-building role to GtkBuilder.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This commit only creates outer container of the Open With tab.
Inner widgets are ported in the next commit.
|
|
|
|
|
|
|
|
|
|
|
|
| |
"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
|
|
|
|
|
| |
The dialog the "Change Permissions for Enclosed Files…" button opens is
going to be ported in the next commit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Also document the code generating label text containing file names.
|
|
|
|
| |
Internal widgets will be populated from template in the next commits.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Exception: the usage widget continues to be constructed in our own code.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
There are some style issue since the last run. Let's run it again
before enabling style-check CI job.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
The cancel_destroy_handler parameter is not used by remove_pending()
function. Let's remove it to make the code simpler.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
The code was copied to avoid having an external GTK+ 3 dependency, but
at this point it’s more trouble than it’s worth.
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Use sentence capitalization for "Parent folder" label.
|