[gnome-commander] Use selected file/dir name as a hint in mkdir dlg (F7)
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Use selected file/dir name as a hint in mkdir dlg (F7)
- Date: Sun, 12 Dec 2010 21:41:53 +0000 (UTC)
commit fbdd11d24d523e2183b1f4e38189b4af1681793c
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Sun Dec 12 22:39:18 2010 +0100
Use selected file/dir name as a hint in mkdir dlg (F7)
src/dialogs/gnome-cmd-mkdir-dialog.cc | 5 +++--
src/dialogs/gnome-cmd-mkdir-dialog.h | 2 +-
src/gnome-cmd-user-actions.cc | 6 ++++--
3 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-mkdir-dialog.cc b/src/dialogs/gnome-cmd-mkdir-dialog.cc
index c8381a6..2938384 100644
--- a/src/dialogs/gnome-cmd-mkdir-dialog.cc
+++ b/src/dialogs/gnome-cmd-mkdir-dialog.cc
@@ -151,7 +151,7 @@ static void response_callback (GtkDialog *dialog, int response_id, GnomeCmdDir *
}
-gboolean gnome_cmd_mkdir_dialog_new (GnomeCmdDir *dir)
+gboolean gnome_cmd_mkdir_dialog_new (GnomeCmdDir *dir, GnomeCmdFile *selected_file)
{
GtkWidget *dialog = gtk_dialog_new_with_buttons (_("Make Directory"), *main_win,
GtkDialogFlags (GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
@@ -195,7 +195,8 @@ gboolean gnome_cmd_mkdir_dialog_new (GnomeCmdDir *dir)
entry = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
- gtk_entry_set_text (GTK_ENTRY (entry), "PATTERN");
+ if (selected_file)
+ gtk_entry_set_text (GTK_ENTRY (entry), selected_file->get_name());
g_object_set_data (G_OBJECT (dialog), "name", entry);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_table_attach_defaults (GTK_TABLE (table), entry, 1, 2, 0, 1);
diff --git a/src/dialogs/gnome-cmd-mkdir-dialog.h b/src/dialogs/gnome-cmd-mkdir-dialog.h
index d15a2c6..702834f 100644
--- a/src/dialogs/gnome-cmd-mkdir-dialog.h
+++ b/src/dialogs/gnome-cmd-mkdir-dialog.h
@@ -23,6 +23,6 @@
#include "gnome-cmd-dir.h"
-gboolean gnome_cmd_mkdir_dialog_new (GnomeCmdDir *dir);
+gboolean gnome_cmd_mkdir_dialog_new (GnomeCmdDir *dir, GnomeCmdFile *selected_file=NULL);
#endif // __GNOME_CMD_MKDIR_DIALOG_H__
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index a52ddd3..3b3b371 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -792,11 +792,13 @@ void file_chown (GtkMenuItem *menuitem, gpointer not_used)
void file_mkdir (GtkMenuItem *menuitem, gpointer not_used)
{
- GnomeCmdDir *dir = get_fs (ACTIVE)->get_directory();
+ GnomeCmdFileSelector *fs = get_fs (ACTIVE);
+ GnomeCmdDir *dir = fs->get_directory();
+
g_return_if_fail (GNOME_CMD_IS_DIR (dir));
gnome_cmd_dir_ref (dir);
- gnome_cmd_mkdir_dialog_new (dir);
+ gnome_cmd_mkdir_dialog_new (dir, fs->file_list()->get_selected_file());
gnome_cmd_dir_unref (dir);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]