New menu view. Not everything works yet, but that's tomorrow's job.

also, spiffy new policy dialog for copying many files.
This commit is contained in:
Jonathan Blandford 1998-12-29 04:15:30 +00:00
parent d2b1a29c91
commit 66558b5f73
4 changed files with 63 additions and 62 deletions

View File

@ -1,3 +1,7 @@
1998-12-28 Jonathan Blandford <jrb@redhat.com>
* glayout.c: Initial rehash of the menu code.
1998-12-27 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gprop.c (perm_mode_new), gcliplabel.c: Uset gtk_label_set_text.
@ -9,10 +13,7 @@ Thu Dec 24 18:38:45 1998 Norbert Warmuth <nwarmuth@privat.circular.de>
1998-12-22 Jonathan Blandford <jrb@redhat.com>
* gdialogs.c (file_progress_query_replace_policy): new function.
Currently called every time multiple files are called -- should
only be called if needed.
(file_progress_real_query_replace): Cleaned up some. Still has a
* gdialogs.c (file_progress_real_query_replace): Cleaned up some. Still has a
bit of work to do, but in general, much better.
Mon Dec 21 22:33:07 1998 Norbert Warmuth <nwarmuth@privat.circular.de>

View File

@ -37,7 +37,6 @@ static gint minor_copy_status;
/* Callbacks go here... */
static void
fmd_check_box_callback (GtkWidget *widget, gpointer data)
@ -177,11 +176,11 @@ file_progress_show_bytes (double done, double total)
static void
option_menu_policy_callback (GtkWidget *menu, gpointer data)
{
g_print ("ork ork:%d\n", (gint) data);
minor_copy_status = (gint) data;
copy_status = (gint) data;
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (op_radio), TRUE);
}
static void
policy_callback (GtkWidget *button, gpointer data)
{
@ -194,7 +193,7 @@ policy_callback (GtkWidget *button, gpointer data)
}
}
FileProgressStatus
file_progress_query_replace_policy ()
file_progress_query_replace_policy (gboolean dialog_needed)
{
GtkWidget *qrp_dlg;
GtkWidget *radio;
@ -209,6 +208,8 @@ file_progress_query_replace_policy ()
GtkWidget *menu_item;
copy_status = REPLACE_PROMPT;
if (dialog_needed == FALSE)
return FILE_CONT;
minor_copy_status = REPLACE_ALWAYS;
g_print ("in file_progress_query_replace_policy\n");
qrp_dlg = gnome_dialog_new (_("Files Exist"),

View File

@ -266,63 +266,60 @@ GtkCheckMenuItem *gnome_toggle_snap (void);
GnomeUIInfo gnome_panel_file_menu [] = {
{ GNOME_APP_UI_ITEM, N_("_New window"), N_("Opens a new window"), gnome_open_panel },
{ GNOME_APP_UI_ITEM, N_("New _Terminal"), N_("Opens a terminal"), gnome_open_terminal },
#if 0
/* We want to make a new menu entry here... */
#endif
{ GNOME_APP_UI_SEPARATOR },
{ GNOME_APP_UI_ITEM, N_("_Open"), N_("Open selected files"), NULL },
{ GNOME_APP_UI_ITEM, N_("_Copy..."), N_("Copy files"), copy_cmd },
{ GNOME_APP_UI_ITEM, N_("Rename/_Move..."), N_("Rename or move files"), ren_cmd },
{ GNOME_APP_UI_ITEM, N_("New di_rectory..."), N_("Creates a new folder"), mkdir_cmd },
{ GNOME_APP_UI_ITEM, N_("_Move..."), N_("Rename or move files"), ren_cmd },
{ GNOME_APP_UI_ITEM, N_("_Delete..."), N_("Delete files from disk"), delete_cmd },
{ GNOME_APP_UI_SEPARATOR },
{ GNOME_APP_UI_ITEM, N_("_View"), N_("View file"), view_cmd },
{ GNOME_APP_UI_ITEM, N_("View r_aw"), N_("View the file without further processing"), view_simple_cmd },
{ GNOME_APP_UI_SEPARATOR },
{ GNOME_APP_UI_ITEM, N_("_Select group by pattern..."), N_("Select a group of files"), select_cmd },
{ GNOME_APP_UI_ITEM, N_("_Unselect group by pattern..."), N_("Un-selects a group of marked files"), unselect_cmd },
{ GNOME_APP_UI_ITEM, N_("R_everse selection"), N_("Reverses the list of tagged files"), reverse_selection_cmd },
{ GNOME_APP_UI_SEPARATOR },
{ GNOME_APP_UI_ITEM, N_("C_lose"), N_("Close this panel"), gnome_close_panel },
#if 0
{ GNOME_APP_UI_ITEM, N_("E_xit"), N_("Exit program"), gnome_quit_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT },
#endif
{ GNOME_APP_UI_ENDOFINFO, 0, 0 }
};
GnomeUIInfo gnome_panel_panel_menu [] = {
{ GNOME_APP_UI_ITEM, N_("_Display mode..."), N_("Set the display mode for the panel"), gnome_listing_cmd },
{ GNOME_APP_UI_ITEM, N_("_Sort order..."), N_("Changes the sort order of the files"), sort_cmd },
{ GNOME_APP_UI_ITEM, N_("_Filter..."), N_("Set a filter for the files"), filter_cmd },
{ GNOME_APP_UI_ITEM, N_("_Rescan"), N_("Rescan the directory contents"), reread_cmd },
GnomeUIInfo gnome_panel_edit_menu [] = {
{ GNOME_APP_UI_ITEM, N_("_Cut"), N_("Cuts the selected files into the cut buffer."), NULL },
{ GNOME_APP_UI_ITEM, N_("C_opy"), N_("Copies the selected files into the cut buffer."), NULL },
{ GNOME_APP_UI_ITEM, N_("_Paste"), N_("Pastes files from the cut buffer into the current directory"), NULL },
{ GNOME_APP_UI_SEPARATOR },
#ifdef USE_NETCODE
{ GNOME_APP_UI_ITEM, N_("_Network link..."), N_("Connect to a remote machine"), netlink_cmd },
{ GNOME_APP_UI_ITEM, N_("FT_P link..."), N_("Connect to a remote machine with FTP"), ftplink_cmd },
#endif
{ GNOME_APP_UI_ITEM, N_("_Select Files..."), N_("Select a group of files"), select_cmd },
{ GNOME_APP_UI_ITEM, N_("_Invert Selection"), N_("Reverses the list of tagged files"), reverse_selection_cmd },
{ GNOME_APP_UI_ITEM, N_("_Rescan Directory"), N_("Rescan the directory contents"), reread_cmd },
{ GNOME_APP_UI_SEPARATOR },
{ GNOME_APP_UI_ITEM, N_("Preferences..."), N_("Configure the GNOME Midnight Commander"), configure_box, NULL,
NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PROP},
{ GNOME_APP_UI_ENDOFINFO, 0, 0 }
};
GnomeUIInfo gnome_panel_options_menu [] = {
{ GNOME_APP_UI_ITEM, N_("_Confirmation..."), N_("Confirmation settings"), confirm_box },
{ GNOME_APP_UI_ITEM, N_("_Options..."), N_("Global option settings"), configure_box, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PROP },
#ifdef USE_VFS
{ GNOME_APP_UI_ITEM, N_("_Virtual FS..."), N_("Virtual File System settings"), configure_vfs },
#endif
GnomeUIInfo gnome_panel_view_menu [] = {
{ GNOME_APP_UI_ITEM, N_("Icon View"), NULL, NULL},
{ GNOME_APP_UI_ITEM, N_("Partial View"), NULL, NULL},
{ GNOME_APP_UI_ITEM, N_("Full View"), NULL, NULL},
{ GNOME_APP_UI_ITEM, N_("Custom View"), NULL, NULL},
{GNOME_APP_UI_ENDOFINFO, NULL, NULL, NULL, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL, 0, 0, NULL}
};
GnomeUIInfo gnome_panel_layout_menu [] = {
{ GNOME_APP_UI_ITEM, N_("_Sort Order..."), N_("Confirmation settings"), sort_cmd },
{ GNOME_APP_UI_ITEM, N_("_Filter View..."), N_("Global option settings"), NULL },
{ GNOME_APP_UI_SEPARATOR },
{ GNOME_APP_UI_ITEM, N_("_Save setup"), NULL, save_setup_cmd },
{ GNOME_APP_UI_RADIOITEMS, NULL , NULL, gnome_panel_view_menu},
{ GNOME_APP_UI_ENDOFINFO, 0, 0 }
};
GnomeUIInfo gnome_panel_commands_menu [] = {
{ GNOME_APP_UI_ITEM, N_("_Find..."), N_("Locate files on disk"), find_cmd },
{ GNOME_APP_UI_ITEM, N_("_Hotlist..."), N_("List of favorite sites"), quick_chdir_cmd },
{ GNOME_APP_UI_ITEM, N_("_Compare panels..."), N_("Compare panel contents"), gnome_compare_panels },
{ GNOME_APP_UI_ITEM, N_("_External panelize..."), NULL, external_panelize },
{ GNOME_APP_UI_ITEM, N_("_Find File..."), N_("Locate files on disk"), find_cmd },
{ GNOME_APP_UI_ITEM, N_("_Compare panels..."), N_("Compare two panel contents"), gnome_compare_panels },
{ GNOME_APP_UI_ITEM, N_("_Run Command..."), N_("Run a command and put the results in a panel"), external_panelize },
#ifdef USE_VFS
{ GNOME_APP_UI_ITEM, N_("_Active VFS list..."), N_("List of active virtual file systems"), reselect_vfs },
#endif
{ GNOME_APP_UI_ITEM, N_("_Active VFS list..."),N_("List of active virtual file systems"), reselect_vfs },
#endif
#ifdef USE_EXT2FSLIB
{ GNOME_APP_UI_ITEM, N_("_Undelete files (ext2fs only)..."), N_("Recover deleted files"), undelete_cmd },
/*does this do anything?*/
/* { GNOME_APP_UI_ITEM, N_("_Undelete files (ext2fs only)..."), N_("Recover deleted files"), undelete_cmd },*/
#endif
#ifdef WITH_BACKGROUND
{ GNOME_APP_UI_ITEM, N_("_Background jobs..."), N_("List of background operations"), jobs_cmd },
@ -330,27 +327,19 @@ GnomeUIInfo gnome_panel_commands_menu [] = {
{ GNOME_APP_UI_ENDOFINFO, 0, 0 }
};
GnomeUIInfo gnome_panel_desktop_menu [] = {
#if 0
{ GNOME_APP_UI_ITEM, N_("_Arrange icons"), N_("Arranges the icons on the desktop"), gnome_arrange_icons },
#endif
/* { GNOME_APP_UI_TOGGLEITEM, N_("Desktop grid"), N_("Use a grid for laying out icons"), gnome_toggle_snap }, */
{ GNOME_APP_UI_ENDOFINFO, 0, 0 }
};
GnomeUIInfo gnome_panel_about_menu [] = {
/* GNOMEUIINFO_HELP ("midnight-commander"), */
{ GNOME_APP_UI_ITEM, N_("_About"), N_("Information on this program"), gnome_about_cmd, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ABOUT },
/* GNOMEUIINFO_HELP ("midnight-commander"), */
GNOMEUIINFO_END
};
GnomeUIInfo gnome_panel_menu [] = {
{ GNOME_APP_UI_SUBTREE, N_("_File"), NULL, &gnome_panel_file_menu },
{ GNOME_APP_UI_SUBTREE, N_("_Window"), NULL, &gnome_panel_panel_menu },
{ GNOME_APP_UI_SUBTREE, N_("_Edit"), NULL, &gnome_panel_edit_menu },
{ GNOME_APP_UI_SUBTREE, N_("_Layout"), NULL, &gnome_panel_layout_menu },
{ GNOME_APP_UI_SUBTREE, N_("_Commands"), NULL, &gnome_panel_commands_menu },
{ GNOME_APP_UI_SUBTREE, N_("_Options"), NULL, &gnome_panel_options_menu },
{ GNOME_APP_UI_SUBTREE, N_("_Desktop"), NULL, &gnome_panel_desktop_menu },
{ GNOME_APP_UI_SUBTREE, N_("_Help"), NULL, &gnome_panel_about_menu },
{ GNOME_APP_UI_ENDOFINFO, 0, 0 }
};
@ -358,7 +347,7 @@ GnomeUIInfo gnome_panel_menu [] = {
GtkCheckMenuItem *
gnome_toggle_snap (void)
{
return GTK_CHECK_MENU_ITEM (gnome_panel_desktop_menu [1].widget);
return NULL; /*GTK_CHECK_MENU_ITEM (gnome_panel_desktop_menu [1].widget);*/
}
void

View File

@ -1629,7 +1629,8 @@ compute_dir_size (char *dirname, long *ret_marked, double *ret_total)
*
* compute the number of files and the number of bytes
* used up by the whole selection, recursing directories
* as required.
* as required. In addition, it checks to see if it will
* overwrite any files by doing the copy.
*/
static void
panel_compute_totals (WPanel *panel, long *ret_marked, double *ret_total)
@ -1868,7 +1869,9 @@ panel_operate_flags (void *source_panel, FileOperation operation, char *thedefau
unmark_files (panel);
} else {
/* Many files */
/* Many files */
/* Need to determine this.*/
int policy_over_write_necessary = 1;
/* Check destination for copy or move operation */
if (operation != OP_DELETE){
@ -1889,12 +1892,19 @@ panel_operate_flags (void *source_panel, FileOperation operation, char *thedefau
file_progress_count = panel->marked;
file_progress_bytes = panel->total;
}
#ifdef HAVE_GNOME
/* FIXME: we need to determine if this dialog is actually needed. */
if (file_progress_query_replace_policy () == FILE_ABORT)
goto clean_up;
/* We need to pre-copy all the files and see if there are any
* over-writes. Ugh, this sounds yucky. )-: */
if (policy_over_write_necessary) {
if (file_progress_query_replace_policy (TRUE) == FILE_ABORT)
goto clean_up;
else
/* this will initialize some variables */
file_progress_query_replace_policy (FALSE);
}
#endif
/* We now have ETA in all cases */
create_op_win (operation, 1);