mirror of
https://github.com/MidnightCommander/mc
synced 2025-02-24 19:24:48 +03:00
1999-01-13 Jonathan Blandford <jrb@redhat.com>
* glayout.c (create_container): beginnings of the New-> menu. It doesn't have much yet, hopefully we'll have a good way to let apps register themselves with it. 1999-01-12 Jonathan Blandford <jrb@redhat.com> * cmd.c (mkdir_cmd): now mkdir_cmd will accept relative, and absolute directories.
This commit is contained in:
parent
d677adf527
commit
218790bdbe
@ -1,3 +1,9 @@
|
||||
1999-01-13 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* glayout.c (create_container): beginnings of the New-> menu. It
|
||||
doesn't have much yet, hopefully we'll have a good way to let apps
|
||||
register themselves with it.
|
||||
|
||||
1999-01-13 bertrand <Bertrand.Guiheneuf@inria.fr>
|
||||
|
||||
* gdialogs.c
|
||||
|
@ -275,9 +275,15 @@ run_cmd (void)
|
||||
void configure_box (void);
|
||||
|
||||
GtkCheckMenuItem *gnome_toggle_snap (void);
|
||||
GnomeUIInfo gnome_panel_new_menu [] = {
|
||||
{ GNOME_APP_UI_ITEM, N_("_Terminal"), N_("Launch a new terminal in the current directory"), NULL},
|
||||
{ GNOME_APP_UI_ITEM, N_("_Directory..."), N_("Creates a new directory"), mkdir_cmd },
|
||||
{ GNOME_APP_UI_ENDOFINFO, 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
GnomeUIInfo gnome_panel_file_menu [] = {
|
||||
GNOMEUIINFO_MENU_NEW_ITEM(N_("_New window"), N_("Opens a new window"), gnome_open_panel, NULL),
|
||||
GNOMEUIINFO_MENU_NEW_ITEM(N_("New _Window"), N_("Opens a new window"), gnome_open_panel, NULL),
|
||||
|
||||
/* We want to make a new menu entry here... */
|
||||
/* For example: */
|
||||
@ -287,14 +293,13 @@ GnomeUIInfo gnome_panel_file_menu [] = {
|
||||
/* Gnumeric Spreadsheet */
|
||||
/* Text Document */
|
||||
/* etc... */
|
||||
|
||||
{ GNOME_APP_UI_SUBTREE, N_("_New"), NULL, gnome_panel_new_menu},
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
{ GNOME_APP_UI_ITEM, N_("_Open"), N_("Opens the selected files"), gnome_open_files },
|
||||
/* { GNOME_APP_UI_ITEM, N_("Open _FTP site"), N_("Opens an FTP site"), ftplink_cmd },*/
|
||||
{ GNOME_APP_UI_ITEM, N_("_Copy..."), N_("Copy files"), copy_cmd, NULL},
|
||||
{ GNOME_APP_UI_ITEM, N_("_Delete..."), N_("Delete files from disk"), delete_cmd },
|
||||
{ GNOME_APP_UI_ITEM, N_("_Move..."), N_("Rename or move files"), ren_cmd },
|
||||
/* { GNOME_APP_UI_ITEM, N_("_Make directory..."), N_("Creates a new directory"), mkdir_cmd },*/
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
{ GNOME_APP_UI_ITEM, N_("C_lose"), N_("Close this panel"), gnome_close_panel, NULL,
|
||||
NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CLOSE,
|
||||
@ -445,7 +450,14 @@ static GtkWidget *create_toolbar (GtkWidget * window, GtkWidget *widget)
|
||||
}
|
||||
return toolbar;
|
||||
}
|
||||
|
||||
static void
|
||||
create_new_menu (GnomeApp *app, WPanel *panel)
|
||||
{
|
||||
gint pos;
|
||||
GtkWidget *shell = NULL;
|
||||
shell = gnome_app_find_menu_pos (app->menubar, _("File/New/Directory..."), &pos);
|
||||
/*gtk_menu_shell_insert*/
|
||||
}
|
||||
WPanel *
|
||||
create_container (Dlg_head *h, char *name, char *geometry)
|
||||
{
|
||||
@ -475,7 +487,7 @@ create_container (Dlg_head *h, char *name, char *geometry)
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
|
||||
gnome_app_set_contents (GNOME_APP (app), vbox);
|
||||
gnome_app_create_menus_with_data (GNOME_APP (app), gnome_panel_menu, panel);
|
||||
|
||||
create_new_menu (app, panel);
|
||||
/*
|
||||
* I am trying to unclutter the screen, so this toolbar is gone now
|
||||
*/
|
||||
|
@ -1,3 +1,8 @@
|
||||
1999-01-12 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* cmd.c (mkdir_cmd): now mkdir_cmd will accept relative, and
|
||||
absolute directories.
|
||||
|
||||
Tue Jan 12 13:40:46 1999 Timur Bakeyev <mc@bat.ru>
|
||||
|
||||
* gtkedit(syntax.c): Fixed a typo in Pascal syntax.
|
||||
|
20
src/cmd.c
20
src/cmd.c
@ -385,23 +385,31 @@ void copymove_cmd_with_default (int copy, char *thedefault)
|
||||
|
||||
void mkdir_cmd (WPanel *panel)
|
||||
{
|
||||
char tempdir[MC_MAXPATHLEN];
|
||||
char *dir;
|
||||
|
||||
panel = get_a_panel (panel);
|
||||
dir = input_expand_dialog (_(" Mkdir "), _(" Enter directory name:") , "");
|
||||
dir = input_expand_dialog (_("Create a new Directory"), _(" Enter directory name:") , "");
|
||||
|
||||
if (!dir)
|
||||
return;
|
||||
|
||||
if (dir[0] && (dir[0] == '/' || dir[0] == '~'))
|
||||
strncat (tempdir, dir, MC_MAXPATHLEN);
|
||||
else {
|
||||
strncat (tempdir, panel->cwd, MC_MAXPATHLEN - strlen (dir) - 1);
|
||||
strcat (tempdir, "/");
|
||||
strcat (tempdir, dir);
|
||||
}
|
||||
printf ("%s\n", tempdir);
|
||||
save_cwds_stat ();
|
||||
if (my_mkdir (dir, 0777) == 0){
|
||||
update_panels (UP_OPTIMIZE, dir);
|
||||
if (my_mkdir (tempdir, 0777) == 0){
|
||||
update_panels (UP_OPTIMIZE, tempdir);
|
||||
repaint_screen ();
|
||||
select_item (cpanel);
|
||||
free (dir);
|
||||
free (tempdir);
|
||||
return;
|
||||
}
|
||||
free (dir);
|
||||
free (tempdir);
|
||||
message (1, MSG_ERROR, " %s ", unix_error_string (errno));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user