1
1

1999-09-21 Federico Mena Quintero <federico@redhat.com>

* gsession.c (create_panel_from_info): The widgets are not created
	yet, so just set the panel->list_type field.
Этот коммит содержится в:
Miguel de Icaza 1999-09-21 09:04:50 +00:00
родитель c10db1f41c
Коммит 2bded57962
4 изменённых файлов: 4 добавлений и 121 удалений

Просмотреть файл

@ -1,5 +1,8 @@
1999-09-21 Federico Mena Quintero <federico@redhat.com>
* gsession.c (create_panel_from_info): The widgets are not created
yet, so just set the panel->list_type field.
* gscreen.c (x_create_panel): Do not change the dialog head's
current pointer.

Просмотреть файл

@ -205,32 +205,6 @@ set_list_type (GtkWidget *widget, WPanel *panel, enum list_types type)
g_assert_not_reached ();
}
/* Sets the listing view for a panel */
void
gnome_set_panel_list_type (WPanel *panel, int list_type)
{
g_return_if_fail (panel != NULL);
g_return_if_fail (list_type >= list_full && list_type <= list_icons);
/* Set the list type by poking a toolbar item. Yes, this is hackish.
* We fall back to icon view if a certain listing type is not supported.
* Be sure to keep this in sync with the uiinfo arrays in glayout.c.
*/
if (list_type == list_brief)
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (panel_view_toolbar_uiinfo[1].widget), TRUE);
else if (list_type == list_full)
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (panel_view_toolbar_uiinfo[2].widget), TRUE);
else if (list_type == list_user)
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (panel_view_toolbar_uiinfo[3].widget), TRUE);
else
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (panel_view_toolbar_uiinfo[0].widget), TRUE);
}
void
gnome_icon_view_cmd (GtkWidget *widget, WPanel *panel)
{

Просмотреть файл

@ -44,6 +44,4 @@ void set_cursor_normal (WPanel *panel);
void set_cursor_busy (WPanel *panel);
void gnome_new_link (GtkWidget *widget, WPanel *panel);
void gnome_set_panel_list_type (WPanel *panel, int list_type);
#endif /* __GCMD_H */

Просмотреть файл

@ -127,7 +127,7 @@ create_panel_from_info (PanelInfo *pi)
g_free (panel->user_format);
panel->user_format = g_strdup (pi->user_format);
memcpy (panel->column_width, pi->column_width, sizeof (pi->column_width));
gnome_set_panel_list_type (panel, pi->list_type);
panel->list_type = pi->list_type;
}
static void
@ -151,67 +151,6 @@ load_session_info (char *filename)
}
}
#if 0
/* Idle handler to create the list of panels loaded from the session info file */
static gint
idle_create_panels (gpointer data)
{
GSList *panels, *p;
PanelInfo *pi;
WPanel *panel;
panels = data;
for (p = panels; p; p = p->next) {
pi = p->data;
panel = new_panel_at (pi->cwd);
g_free (panel->user_format);
panel->user_format = g_strdup (pi->user_format);
memcpy (panel->column_width, pi->column_width, sizeof (pi->column_width));
gnome_set_panel_list_type (panel, pi->list_type);
free_panel_info (pi);
}
g_slist_free (panels);
return FALSE;
}
/* Loads session information from the specified gnome-config file */
static void
load_session_info (char *filename)
{
void *iterator;
char *key, *value;
GSList *panels;
PanelInfo *pi;
/* Slurp the list of panels to create */
iterator = gnome_config_init_iterator_sections (filename);
panels = NULL;
while ((iterator = gnome_config_iterator_next (iterator, &key, &value)) != NULL)
if (key && strncmp (key, "panel ", 6) == 0) {
pi = load_panel_info (filename, key);
if (!pi)
continue;
panels = g_slist_prepend (panels, pi);
g_free (key);
}
/* Create the panels in the idle loop to keep run_dlg() happy. See the
* comment in gmain.c:non_corba_create_panels().
*/
gtk_idle_add_priority (GTK_PRIORITY_DEFAULT + 1, idle_create_panels, panels);
}
#endif
static void
create_default_panel (const char *startup_dir)
{
@ -226,37 +165,6 @@ create_default_panel (const char *startup_dir)
new_panel_with_geometry_at (dir, cmdline_geometry);
}
#if 0
/* Idle handler to create the default panel */
static gint
idle_create_default_panel (gpointer data)
{
char *cwd;
cwd = data;
new_panel_with_geometry_at (cwd, cmdline_geometry);
g_free (cwd);
return FALSE;
}
/* Queues the creation of the default panel */
static void
create_default_panel (const char *startup_dir)
{
char buf[MC_MAXPATHLEN];
char *dir = buf;
if (startup_dir == NULL)
mc_get_current_wd (buf, MC_MAXPATHLEN);
else
dir = startup_dir;
gtk_idle_add_priority (GTK_PRIORITY_DEFAULT + 1, idle_create_default_panel, g_strdup (dir));
}
#endif
/* Callback from the master client to save the session */
static gint
session_save (GnomeClient *client, gint phase, GnomeSaveStyle save_style, gint shutdown,