After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770160 - file-conflict-dialog: separate file logic from UI management
file-conflict-dialog: separate file logic from UI management
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-19 23:24 UTC by Razvan Chitu
Modified: 2016-08-22 21:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file-conflict-dialog: separate file logic from UI management (47.29 KB, patch)
2016-08-19 23:24 UTC, Razvan Chitu
none Details | Review
file-conflict-dialog: separate file logic from UI management (57.39 KB, patch)
2016-08-21 15:58 UTC, Razvan Chitu
none Details | Review
file-conflict-dialog: separate file logic from UI management (48.20 KB, patch)
2016-08-21 16:08 UTC, Razvan Chitu
none Details | Review
file-conflict-dialog: separate file logic from UI management (48.18 KB, patch)
2016-08-21 22:00 UTC, Razvan Chitu
committed Details | Review

Description Razvan Chitu 2016-08-19 23:24:35 UTC
See patch.
Comment 1 Razvan Chitu 2016-08-19 23:24:40 UTC
Created attachment 333716 [details] [review]
file-conflict-dialog: separate file logic from UI management

In Nautilus, file conflicts are handled by a specific dialog. Previously, the
dialog class managed both the UI and the related nautilus files. This lead to it
being inflexible due to operation specific logic being mixed with the rest of
the functionality. In order to change this, move file logic to a separate module
and add methods for controlling the UI elements in the dialog.

Create an operation-manager module to handle dialog controlling. Move anything
related to Nautilus files from the dialog class to the new module.
Comment 2 Carlos Soriano 2016-08-20 13:08:23 UTC
Review of attachment 333716 [details] [review]:

excellent

::: src/nautilus-file-operations.c
@@ +52,3 @@
 #include <gio/gio.h>
 #include <glib.h>
+#include "nautilus-operations-ui-manager.h"

if I'm not mistaken we could remove the conflict-dialog include right?

::: src/nautilus-operations-ui-manager.c
@@ +40,3 @@
+{
+        ContextInvokeData data;
+        /* Allow only one thread at a time to invoke a main context so we don't

the main context

@@ +59,3 @@
+                               &data);
+
+        while (!data.completed) {

Explain this please. It can be done either in the function header, which is probably the best place to do it, on how we make this thread sync and why

@@ +125,3 @@
+                if (source_is_directory) {
+                        primary_text = g_strdup_printf
+                                (_("Merge folder “%s”?"),

don't multiline the first line

@@ +128,3 @@
+                                 destination_name);
+
+                        message_extra =

don't multiline the first line
Comment 3 Razvan Chitu 2016-08-21 15:58:18 UTC
Created attachment 333823 [details] [review]
file-conflict-dialog: separate file logic from UI management

In Nautilus, file conflicts are handled by a specific dialog. Previously, the
dialog class managed both the UI and the related nautilus files. This lead to it
being inflexible due to operation specific logic being mixed with the rest of
the functionality. In order to change this, move file logic to a separate module
and add methods for controlling the UI elements in the dialog.

Create an operation-manager module to handle dialog controlling. Move anything
related to Nautilus files from the dialog class to the new module.
Comment 4 Razvan Chitu 2016-08-21 16:08:43 UTC
Created attachment 333824 [details] [review]
file-conflict-dialog: separate file logic from UI management

In Nautilus, file conflicts are handled by a specific dialog. Previously, the
dialog class managed both the UI and the related nautilus files. This lead to it
being inflexible due to operation specific logic being mixed with the rest of
the functionality. In order to change this, move file logic to a separate module
and add methods for controlling the UI elements in the dialog.

Create an operation-manager module to handle dialog controlling. Move anything
related to Nautilus files from the dialog class to the new module.
Comment 5 Carlos Soriano 2016-08-21 21:25:01 UTC
Review of attachment 333824 [details] [review]:

::: src/nautilus-operations-ui-manager.c
@@ +77,3 @@
+}
+
+typedef struct FileConflictDialogData {

it's enough with the last one, not need to put here FileConflictDialogData
Comment 6 Razvan Chitu 2016-08-21 22:00:46 UTC
Created attachment 333849 [details] [review]
file-conflict-dialog: separate file logic from UI management

In Nautilus, file conflicts are handled by a specific dialog. Previously, the
dialog class managed both the UI and the related nautilus files. This lead to it
being inflexible due to operation specific logic being mixed with the rest of
the functionality. In order to change this, move file logic to a separate module
and add methods for controlling the UI elements in the dialog.

Create an operation-manager module to handle dialog controlling. Move anything
related to Nautilus files from the dialog class to the new module.
Comment 7 Carlos Soriano 2016-08-21 22:01:51 UTC
Review of attachment 333849 [details] [review]:

yep!
Comment 8 Razvan Chitu 2016-08-22 21:42:17 UTC
Attachment 333849 [details] pushed as fd01842 - file-conflict-dialog: separate file logic from UI management