David's "Hex View in GMC & some June patches" sent on June 14 (don't blame
David for the ChangeLog entries). 1999-06-22 David Martin <dmartina@usa.net> * gnome/gnome-file-property-dialog.c (switch_metadata_box): Tag some strings for localization. * gnome/gnome-open-dialog.c (gnome_open_dialog_new): Don't assemble label_string from seperate strings (makes it easier to translate). * src/view.c (display): added view_gotoxy's in order to make hex mode work in the gnome edition. * gtkedit/gtkedit.c (tb_items): Mark strings for localization. 1999-06-22 Norbert Warmuth <nwarmuth@privat.circular.de> * gnome/gview.c (viewer_size_changed): Update internal viewer state used in hex mode. And some fixes to the bug reported on mc-bugs ("Two Big Bugs in Quickview@mc"). 1999-06-22 Norbert Warmuth <nwarmuth@privat.circular.de> * src/cmd.c (quick_view_cmd): Change panel when the file we want to view isn't in the current panel (prevents a "file not found" error). * src/menu.c (menubar_execute): De-activate the menubar previous to invoking the callback. This is needed to make change_panel in quick_view_cmd work (the activated menubar doesn't allow unfocus, i.e. dlg_one_down|up don't change anything). * src/view.c (do_view_init): improved error handling w.r.t quick view (mc used to dump core when the file to view couldn't be opened).
Этот коммит содержится в:
родитель
090e4436db
Коммит
c1fb49b689
@ -1,3 +1,7 @@
|
||||
1999-06-22 David Martin <dmartina@usa.net>
|
||||
|
||||
* gtkedit/gtkedit.c (tb_items): Mark strings for localization.
|
||||
|
||||
1999-06-07 Shooby Ban <bansz@szif.hu>
|
||||
|
||||
* po/hu.po, configure.in: added hungarian translations...
|
||||
|
@ -1,3 +1,16 @@
|
||||
1999-06-22 David Martin <dmartina@usa.net>
|
||||
|
||||
* gnome-file-property-dialog.c (switch_metadata_box): Tag some
|
||||
strings for localization.
|
||||
|
||||
* gnome-open-dialog.c (gnome_open_dialog_new): Don't assemble
|
||||
label_string from seperate strings (makes it easier to translate).
|
||||
|
||||
1999-06-22 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* gview.c (viewer_size_changed): Update internal viewer state used
|
||||
in hex mode.
|
||||
|
||||
1999-06-17 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gdesktop.c (set_icon_wmclass): New function to set the wmclass
|
||||
|
@ -384,8 +384,8 @@ switch_metadata_box (GnomeFilePropertyDialog *fp_dlg)
|
||||
}
|
||||
|
||||
if (fp_dlg->executable) {
|
||||
gtk_label_set_text (GTK_LABEL (fp_dlg->prop1_label), "Drop Action");
|
||||
gtk_label_set_text (GTK_LABEL (GTK_BIN (fp_dlg->prop1_cbox)->child), "Use default Drop Action options");
|
||||
gtk_label_set_text (GTK_LABEL (fp_dlg->prop1_label), _("Drop Action"));
|
||||
gtk_label_set_text (GTK_LABEL (GTK_BIN (fp_dlg->prop1_cbox)->child), _("Use default Drop Action options"));
|
||||
if (fp_dlg->drop_target) {
|
||||
gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (fp_dlg->prop1_cbox), FALSE);
|
||||
gtk_entry_set_text (GTK_ENTRY (fp_dlg->prop1_entry), fp_dlg->drop_target);
|
||||
|
@ -380,8 +380,8 @@ gnome_open_dialog_new (gchar *file_name)
|
||||
dialog = gtk_type_new (gnome_open_dialog_get_type ());
|
||||
|
||||
/* the first label */
|
||||
label_string = g_strconcat (_("Select an application to open \""),
|
||||
file_name, "\" with.", NULL);
|
||||
label_string = g_strdup_printf (
|
||||
_("Select an application to open \"%s\" with."),file_name);
|
||||
label = gtk_label_new (label_string);
|
||||
gtk_widget_set_usize (label, 300, -1);
|
||||
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
|
||||
|
@ -36,6 +36,7 @@ static void
|
||||
viewer_size_changed (GtkWidget *widget, guint cols, guint lines, WView *view)
|
||||
{
|
||||
widget_set_size (&view->widget, 0, 0, lines, cols);
|
||||
view_update_bytes_per_line (view);
|
||||
dlg_redraw (view->widget.parent);
|
||||
}
|
||||
|
||||
|
@ -1243,17 +1243,17 @@ struct _TbItems {
|
||||
|
||||
static TbItems tb_items[] =
|
||||
{
|
||||
{"F1", "Help", "Interactive help browser", GNOME_STOCK_MENU_BLANK, 0, NULL},
|
||||
{"F2", "Save", "Save to current file name", GNOME_STOCK_MENU_SAVE, gtk_edit_save_file, NULL},
|
||||
{"F3", "Mark", "Toggle In/Off invisible marker to highlight text", GNOME_STOCK_MENU_BLANK, gtk_edit_toggle_mark, NULL},
|
||||
{"F4", "Replc", "Find and replace strings/regular expressions", GNOME_STOCK_MENU_SRCHRPL, gtk_edit_replace, NULL},
|
||||
{"F5", "Copy", "Copy highlighted block to cursor postition", GNOME_STOCK_MENU_COPY, gtk_edit_copy, NULL},
|
||||
{"F1", N_("Help"), N_("Interactive help browser"), GNOME_STOCK_MENU_BLANK, 0, NULL},
|
||||
{"F2", N_("Save"), N_("Save to current file name"), GNOME_STOCK_MENU_SAVE, gtk_edit_save_file, NULL},
|
||||
{"F3", N_("Mark"), N_("Toggle In/Off invisible marker to highlight text"), GNOME_STOCK_MENU_BLANK, gtk_edit_toggle_mark, NULL},
|
||||
{"F4", N_("Replc"), N_("Find and replace strings/regular expressions"), GNOME_STOCK_MENU_SRCHRPL, gtk_edit_replace, NULL},
|
||||
{"F5", N_("Copy"), N_("Copy highlighted block to cursor position"), GNOME_STOCK_MENU_COPY, gtk_edit_copy, NULL},
|
||||
|
||||
{"F6", "Move", "Copy highlighted block to cursor postition", GNOME_STOCK_MENU_BLANK, gtk_edit_move, NULL},
|
||||
{"F7", "Find", "Find strings/regular expressions", GNOME_STOCK_MENU_SEARCH, gtk_edit_search, NULL},
|
||||
{"F8", "Dlete", "Delete highlighted text", GNOME_STOCK_MENU_BLANK, gtk_edit_delete, NULL},
|
||||
{"F9", "Menu", "Pull down menu", GNOME_STOCK_MENU_BLANK, /* gtk_edit_menu*/ 0, NULL},
|
||||
{"F10", "Quit", "Exit editor", GNOME_STOCK_MENU_QUIT, gtk_edit_quit, NULL},
|
||||
{"F6", N_("Move"), N_("Move highlighted block to cursor position"), GNOME_STOCK_MENU_BLANK, gtk_edit_move, NULL},
|
||||
{"F7", N_("Find"), N_("Find strings/regular expressions"), GNOME_STOCK_MENU_SEARCH, gtk_edit_search, NULL},
|
||||
{"F8", N_("Dlete"), N_("Delete highlighted text"), GNOME_STOCK_MENU_BLANK, gtk_edit_delete, NULL},
|
||||
{"F9", N_("Menu"), N_("Pull down menu"), GNOME_STOCK_MENU_BLANK, /* gtk_edit_menu*/ 0, NULL},
|
||||
{"F10", N_("Quit"), N_("Exit editor"), GNOME_STOCK_MENU_QUIT, gtk_edit_quit, NULL},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@ -1264,8 +1264,8 @@ static GtkWidget *create_toolbar (GtkWidget * window, GtkEdit * edit)
|
||||
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
|
||||
for (t = &tb_items[0]; t->text; t++) {
|
||||
t->widget = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
|
||||
t->text,
|
||||
t->tooltip,
|
||||
_(t->text),
|
||||
_(t->tooltip),
|
||||
0,
|
||||
gnome_stock_pixmap_widget (window, t->icon),
|
||||
t->cb,
|
||||
|
@ -1,3 +1,22 @@
|
||||
1999-06-22 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* cmd.c (quick_view_cmd): Change panel when the file we want to
|
||||
view isn't in the current panel (prevents a "file not found"
|
||||
error).
|
||||
|
||||
* menu.c (menubar_execute): De-activate the menubar previous to
|
||||
invoking the callback. This is needed to make change_panel in
|
||||
quick_view_cmd work (the activated menubar doesn't allow unfocus,
|
||||
i.e. dlg_one_down|up don't change anything).
|
||||
|
||||
* view.c (do_view_init): improved error handling w.r.t quick view
|
||||
(mc used to dump core when the file to view couldn't be opened).
|
||||
|
||||
1999-06-22 David Martin <dmartina@usa.net>
|
||||
|
||||
* view.c (display): added view_gotoxy's in order to make the gnome
|
||||
edition operational in hex mode.
|
||||
|
||||
Fri Jun 18 11:29:56 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* user.c (user_menu_cmd): Allow national characters as hotkeys.
|
||||
|
@ -1495,6 +1495,8 @@ info_cmd (void)
|
||||
void
|
||||
quick_view_cmd (void)
|
||||
{
|
||||
if (get_panel_widget (MENU_PANEL_IDX) == cpanel)
|
||||
change_panel ();
|
||||
set_display_type (MENU_PANEL_IDX, view_quick);
|
||||
}
|
||||
#endif
|
||||
|
@ -229,10 +229,16 @@ static void menubar_drop (WMenu *menubar, int selected)
|
||||
static void menubar_execute (WMenu *menubar, int entry)
|
||||
{
|
||||
const Menu menu = menubar->menu [menubar->selected];
|
||||
const callfn call_back = menu->entries [entry].call_back;
|
||||
|
||||
is_right = menubar->selected != 0;
|
||||
(*menu->entries [entry].call_back)(0);
|
||||
|
||||
/* This used to be the other way round, i.e. first callback and
|
||||
then menubar_finish. The new order (hack?) is needed to make
|
||||
change_panel () work which is used in quick_view_cmd () -- Norbert
|
||||
*/
|
||||
menubar_finish (menubar);
|
||||
(*call_back)(0);
|
||||
}
|
||||
|
||||
static void menubar_move (WMenu *menubar, int step)
|
||||
|
34
src/view.c
34
src/view.c
@ -564,15 +564,23 @@ do_view_init (WView *view, char *_command, char *_file, int start_line)
|
||||
int fd;
|
||||
|
||||
if ((fd = mc_open(_file, O_RDONLY)) == -1) {
|
||||
message (1, MSG_ERROR, _(" Can't open \"%s\"\n %s "),
|
||||
char tmp[BUF_MEDIUM];
|
||||
g_snprintf (tmp, sizeof (tmp),
|
||||
_(" Can't open \"%s\"\n %s "),
|
||||
_file, unix_error_string (errno));
|
||||
return -1;
|
||||
view->filename = g_strdup (_file);
|
||||
error = set_view_init_error (view, tmp);
|
||||
goto finish;
|
||||
}
|
||||
if (mc_fstat (fd, &view->s) == -1) {
|
||||
message (1, MSG_ERROR, _(" Can't open \"%s\"\n %s "),
|
||||
char tmp[BUF_MEDIUM];
|
||||
g_snprintf (tmp, sizeof (tmp),
|
||||
_(" Can't stat \"%s\"\n %s "),
|
||||
_file, unix_error_string (errno));
|
||||
mc_close(fd);
|
||||
return -1;
|
||||
view->filename = g_strdup (_file);
|
||||
error = set_view_init_error (view, tmp);
|
||||
goto finish;
|
||||
}
|
||||
|
||||
if (_file[0] && view->viewer_magic_flag && (is_gunzipable (fd, &type)) != 0)
|
||||
@ -587,6 +595,7 @@ do_view_init (WView *view, char *_command, char *_file, int start_line)
|
||||
else
|
||||
error = load_view_file (view, view->filename);
|
||||
|
||||
finish:
|
||||
if (error){
|
||||
if (!view->have_frame){
|
||||
message (1, MSG_ERROR, error);
|
||||
@ -608,6 +617,7 @@ do_view_init (WView *view, char *_command, char *_file, int start_line)
|
||||
/* Special case: The data points to the error message */
|
||||
if (error){
|
||||
view->data = error;
|
||||
view->file = -1;
|
||||
view->s.st_size = view->bytes_read = strlen (view->data);
|
||||
}
|
||||
view->last_byte = view->first + view->s.st_size;
|
||||
@ -863,11 +873,11 @@ display (WView *view)
|
||||
|
||||
/* Start of text column */
|
||||
int text_start = width - view->bytes_per_line - 1 + frame_shift;
|
||||
|
||||
|
||||
for (;row < height && from < view->last_byte; row++){
|
||||
/* Print the hex offset */
|
||||
g_snprintf (hex_buff, sizeof (hex_buff), "%05X", (int) (from - view->first));
|
||||
widget_move (view, row, frame_shift);
|
||||
view_gotoyx (view, row, frame_shift);
|
||||
view_add_string (view, hex_buff);
|
||||
|
||||
/* Hex dump starts from column seven */
|
||||
@ -919,18 +929,22 @@ display (WView *view)
|
||||
/* Hex numbers are printed in the groups of four */
|
||||
/* Groups are separated by a vline */
|
||||
|
||||
view_gotoyx (view, row, col-1);
|
||||
view_add_character (view, ' ');
|
||||
view_gotoyx (view, row, col);
|
||||
view_add_one_vline ();
|
||||
view_gotoyx (view, row, col + 1);
|
||||
col += 2;
|
||||
|
||||
if (boldflag && from==view->search_start+view->found_len-1)
|
||||
view_set_color (view, BOLD_COLOR);
|
||||
|
||||
}
|
||||
if (boldflag && from < view->search_start + view->found_len - 1
|
||||
&& bytes != view->bytes_per_line - 1)
|
||||
view_add_character (view, ' ');
|
||||
if (boldflag &&
|
||||
from < view->search_start + view->found_len - 1 &&
|
||||
bytes != view->bytes_per_line - 1) {
|
||||
view_gotoyx (view, row, col);
|
||||
view_add_character (view, ' ');
|
||||
}
|
||||
|
||||
/* Print the corresponding ascii character */
|
||||
view_gotoyx (view, row, text_start + bytes);
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user