Commit 3aec6937 authored by Elliot Lee's avatar Elliot Lee

If an empty string is passed for a status string, just unset it all. If we



* src/ntl-window.c: If an empty string is passed for a status string, just unset it all.
* src/ntl-window-msgs.c: If we get a selection of size 1, indicate it on the status bar.
(Triggers a nautilus_window_set_status bug, will fix later.)
parent cbff85b2
2000-02-11 Elliot Lee <sopwith@redhat.com>
* src/ntl-window.c: If an empty string is passed for a status string, just unset it all.
* src/ntl-window-msgs.c: If we get a selection of size 1, indicate it on the status bar.
(Triggers a nautilus_window_set_status bug, will fix later.)
2000-02-11 John Sullivan <sullivan@eazel.com>
* src/ntl-window.h:
......
......@@ -28,6 +28,7 @@
#include "config.h"
#include <gnome.h>
#include <math.h>
#include "nautilus.h"
#include "nautilus-bookmarks-menu.h"
#include "explorer-location-bar.h"
......@@ -37,6 +38,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libnautilus/nautilus-gtk-extensions.h>
#include "nautilus-zoom-control.h"
#include <ctype.h>
static void nautilus_window_realize (GtkWidget *widget);
static void nautilus_window_real_set_content_view (NautilusWindow *window, NautilusView *new_view);
......@@ -426,7 +428,7 @@ nautilus_window_set_status(NautilusWindow *window, const char *txt)
g_source_remove(window->statusbar_clear_id);
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->statusbar_ctx);
if(txt)
if(txt && *txt)
{
window->statusbar_clear_id = g_timeout_add(STATUSBAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->statusbar_ctx, txt);
......@@ -514,7 +516,16 @@ nautilus_window_constructed(NautilusWindow *window)
window->content_hbox = gtk_hbox_new(FALSE, 0);
#else
window->content_hbox = gtk_hpaned_new();
gtk_paned_set_position(GTK_PANED(window->content_hbox), 136);
{
/* Extrapolate width based on username. 'andy' will get 136, 'sopwith' will get 275, others will
watch funky things happen. Go ahead and laugh - this is serious UI research here! */
char *un = getenv("USER");
double pos = 136;
if(un)
pos += ((double)(275-136))/((double)('s'-'a')) * ((double)(tolower(*un) - 'a'));
gtk_paned_set_position(GTK_PANED(window->content_hbox), floor(pos));
}
#endif
gnome_app_set_contents(app, window->content_hbox);
......
......@@ -28,6 +28,7 @@
#include "config.h"
#include <gnome.h>
#include <math.h>
#include "nautilus.h"
#include "nautilus-bookmarks-menu.h"
#include "explorer-location-bar.h"
......@@ -37,6 +38,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libnautilus/nautilus-gtk-extensions.h>
#include "nautilus-zoom-control.h"
#include <ctype.h>
static void nautilus_window_realize (GtkWidget *widget);
static void nautilus_window_real_set_content_view (NautilusWindow *window, NautilusView *new_view);
......@@ -426,7 +428,7 @@ nautilus_window_set_status(NautilusWindow *window, const char *txt)
g_source_remove(window->statusbar_clear_id);
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->statusbar_ctx);
if(txt)
if(txt && *txt)
{
window->statusbar_clear_id = g_timeout_add(STATUSBAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->statusbar_ctx, txt);
......@@ -514,7 +516,16 @@ nautilus_window_constructed(NautilusWindow *window)
window->content_hbox = gtk_hbox_new(FALSE, 0);
#else
window->content_hbox = gtk_hpaned_new();
gtk_paned_set_position(GTK_PANED(window->content_hbox), 136);
{
/* Extrapolate width based on username. 'andy' will get 136, 'sopwith' will get 275, others will
watch funky things happen. Go ahead and laugh - this is serious UI research here! */
char *un = getenv("USER");
double pos = 136;
if(un)
pos += ((double)(275-136))/((double)('s'-'a')) * ((double)(tolower(*un) - 'a'));
gtk_paned_set_position(GTK_PANED(window->content_hbox), floor(pos));
}
#endif
gnome_app_set_contents(app, window->content_hbox);
......
......@@ -28,6 +28,7 @@
#include "config.h"
#include <gnome.h>
#include <math.h>
#include "nautilus.h"
#include "nautilus-bookmarks-menu.h"
#include "explorer-location-bar.h"
......@@ -37,6 +38,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libnautilus/nautilus-gtk-extensions.h>
#include "nautilus-zoom-control.h"
#include <ctype.h>
static void nautilus_window_realize (GtkWidget *widget);
static void nautilus_window_real_set_content_view (NautilusWindow *window, NautilusView *new_view);
......@@ -426,7 +428,7 @@ nautilus_window_set_status(NautilusWindow *window, const char *txt)
g_source_remove(window->statusbar_clear_id);
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->statusbar_ctx);
if(txt)
if(txt && *txt)
{
window->statusbar_clear_id = g_timeout_add(STATUSBAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->statusbar_ctx, txt);
......@@ -514,7 +516,16 @@ nautilus_window_constructed(NautilusWindow *window)
window->content_hbox = gtk_hbox_new(FALSE, 0);
#else
window->content_hbox = gtk_hpaned_new();
gtk_paned_set_position(GTK_PANED(window->content_hbox), 136);
{
/* Extrapolate width based on username. 'andy' will get 136, 'sopwith' will get 275, others will
watch funky things happen. Go ahead and laugh - this is serious UI research here! */
char *un = getenv("USER");
double pos = 136;
if(un)
pos += ((double)(275-136))/((double)('s'-'a')) * ((double)(tolower(*un) - 'a'));
gtk_paned_set_position(GTK_PANED(window->content_hbox), floor(pos));
}
#endif
gnome_app_set_contents(app, window->content_hbox);
......
......@@ -99,6 +99,11 @@ nautilus_window_request_selection_change(NautilusWindow *window,
GSList *cur;
Nautilus_SelectionInfo selinfo;
if(loc->selected_uris._length == 1)
nautilus_window_set_status(window, loc->selected_uris._buffer[0]);
else
nautilus_window_set_status(window, NULL);
selinfo.selected_uris = loc->selected_uris;
selinfo.content_view = nautilus_view_get_objref(NAUTILUS_VIEW(window->content_view));
......
......@@ -28,6 +28,7 @@
#include "config.h"
#include <gnome.h>
#include <math.h>
#include "nautilus.h"
#include "nautilus-bookmarks-menu.h"
#include "explorer-location-bar.h"
......@@ -37,6 +38,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libnautilus/nautilus-gtk-extensions.h>
#include "nautilus-zoom-control.h"
#include <ctype.h>
static void nautilus_window_realize (GtkWidget *widget);
static void nautilus_window_real_set_content_view (NautilusWindow *window, NautilusView *new_view);
......@@ -426,7 +428,7 @@ nautilus_window_set_status(NautilusWindow *window, const char *txt)
g_source_remove(window->statusbar_clear_id);
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->statusbar_ctx);
if(txt)
if(txt && *txt)
{
window->statusbar_clear_id = g_timeout_add(STATUSBAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->statusbar_ctx, txt);
......@@ -514,7 +516,16 @@ nautilus_window_constructed(NautilusWindow *window)
window->content_hbox = gtk_hbox_new(FALSE, 0);
#else
window->content_hbox = gtk_hpaned_new();
gtk_paned_set_position(GTK_PANED(window->content_hbox), 136);
{
/* Extrapolate width based on username. 'andy' will get 136, 'sopwith' will get 275, others will
watch funky things happen. Go ahead and laugh - this is serious UI research here! */
char *un = getenv("USER");
double pos = 136;
if(un)
pos += ((double)(275-136))/((double)('s'-'a')) * ((double)(tolower(*un) - 'a'));
gtk_paned_set_position(GTK_PANED(window->content_hbox), floor(pos));
}
#endif
gnome_app_set_contents(app, window->content_hbox);
......
......@@ -99,6 +99,11 @@ nautilus_window_request_selection_change(NautilusWindow *window,
GSList *cur;
Nautilus_SelectionInfo selinfo;
if(loc->selected_uris._length == 1)
nautilus_window_set_status(window, loc->selected_uris._buffer[0]);
else
nautilus_window_set_status(window, NULL);
selinfo.selected_uris = loc->selected_uris;
selinfo.content_view = nautilus_view_get_objref(NAUTILUS_VIEW(window->content_view));
......
......@@ -28,6 +28,7 @@
#include "config.h"
#include <gnome.h>
#include <math.h>
#include "nautilus.h"
#include "nautilus-bookmarks-menu.h"
#include "explorer-location-bar.h"
......@@ -37,6 +38,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libnautilus/nautilus-gtk-extensions.h>
#include "nautilus-zoom-control.h"
#include <ctype.h>
static void nautilus_window_realize (GtkWidget *widget);
static void nautilus_window_real_set_content_view (NautilusWindow *window, NautilusView *new_view);
......@@ -426,7 +428,7 @@ nautilus_window_set_status(NautilusWindow *window, const char *txt)
g_source_remove(window->statusbar_clear_id);
gtk_statusbar_pop(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->statusbar_ctx);
if(txt)
if(txt && *txt)
{
window->statusbar_clear_id = g_timeout_add(STATUSBAR_CLEAR_TIMEOUT, (GSourceFunc)nautilus_window_clear_status, window);
gtk_statusbar_push(GTK_STATUSBAR(GNOME_APP(window)->statusbar), window->statusbar_ctx, txt);
......@@ -514,7 +516,16 @@ nautilus_window_constructed(NautilusWindow *window)
window->content_hbox = gtk_hbox_new(FALSE, 0);
#else
window->content_hbox = gtk_hpaned_new();
gtk_paned_set_position(GTK_PANED(window->content_hbox), 136);
{
/* Extrapolate width based on username. 'andy' will get 136, 'sopwith' will get 275, others will
watch funky things happen. Go ahead and laugh - this is serious UI research here! */
char *un = getenv("USER");
double pos = 136;
if(un)
pos += ((double)(275-136))/((double)('s'-'a')) * ((double)(tolower(*un) - 'a'));
gtk_paned_set_position(GTK_PANED(window->content_hbox), floor(pos));
}
#endif
gnome_app_set_contents(app, window->content_hbox);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment