summaryrefslogtreecommitdiff
path: root/src/nautilus-new-folder-dialog-controller.h
diff options
context:
space:
mode:
authorRazvan Chitu <razvan.ch95@gmail.com>2016-07-30 18:50:10 +0300
committerRazvan Chitu <razvan.ch95@gmail.com>2016-08-19 15:52:16 +0300
commitfd873c5086e53ee8624a6412c3dd6ff4d263c04b (patch)
tree00cd4b873d1c479010a61c9b01d445304ae35c74 /src/nautilus-new-folder-dialog-controller.h
parent58f62f331889aca434f5f4831c2747eaa89c7756 (diff)
downloadnautilus-fd873c5086e53ee8624a6412c3dd6ff4d263c04b.tar.gz
files-view: move file name widget logic to separate controllers
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
Diffstat (limited to 'src/nautilus-new-folder-dialog-controller.h')
-rw-r--r--src/nautilus-new-folder-dialog-controller.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nautilus-new-folder-dialog-controller.h b/src/nautilus-new-folder-dialog-controller.h
new file mode 100644
index 000000000..a9a8f281e
--- /dev/null
+++ b/src/nautilus-new-folder-dialog-controller.h
@@ -0,0 +1,20 @@
+#ifndef NAUTILUS_NEW_FOLDER_DIALOG_CONTROLLER_H
+#define NAUTILUS_NEW_FOLDER_DIALOG_CONTROLLER_H
+
+#include <glib.h>
+#include <gtk/gtk.h>
+
+#include "nautilus-file-name-widget-controller.h"
+#include "nautilus-directory.h"
+
+#define NAUTILUS_TYPE_NEW_FOLDER_DIALOG_CONTROLLER nautilus_new_folder_dialog_controller_get_type ()
+G_DECLARE_FINAL_TYPE (NautilusNewFolderDialogController, nautilus_new_folder_dialog_controller, NAUTILUS, NEW_FOLDER_DIALOG_CONTROLLER, NautilusFileNameWidgetController)
+
+NautilusNewFolderDialogController * nautilus_new_folder_dialog_controller_new (GtkWindow *parent_window,
+ NautilusDirectory *destination_directory,
+ gboolean with_selection,
+ gchar *initial_name);
+
+gboolean nautilus_new_folder_dialog_controller_get_with_selection (NautilusNewFolderDialogController *controller);
+
+#endif /* NAUTILUS_NEW_FOLDER_DIALOG_CONTROLLER_H */