2000-01-26 Federico Mena Quintero <federico@helixcode.com>
* idl/FileManager.idl (Desktop): Added arrange_icons() method and an ArrangeType enum.
Этот коммит содержится в:
родитель
5124817446
Коммит
075ccc0046
@ -1,3 +1,8 @@
|
||||
2000-01-26 Federico Mena Quintero <federico@helixcode.com>
|
||||
|
||||
* idl/FileManager.idl (Desktop): Added arrange_icons() method and
|
||||
an ArrangeType enum.
|
||||
|
||||
2000-01-03 Aaron Lehmann <aaronl@vitelus.com>
|
||||
|
||||
* gdesktop.c, gdnd.c, gaction.c, gicon.c,
|
||||
|
@ -1,3 +1,17 @@
|
||||
2000-01-26 Federico Mena Quintero <federico@helixcode.com>
|
||||
|
||||
* gmc-client.c (options): Added the --arrange-desktop-icons
|
||||
option.
|
||||
(arrange_desktop_icons): Implemented.
|
||||
|
||||
* gcorba.c (Desktop_arrange_icons): Implemented.
|
||||
(Desktop_class_init): Put the function in the desktop_epv.
|
||||
|
||||
* gdesktop.c (desktop_arrange_icons): Made public.
|
||||
|
||||
* gnome-file-property-dialog.c (align_label_new): Renamed from
|
||||
label_new() to avoid a conflict with widget.h.
|
||||
|
||||
2000-01-02 Federico Mena Quintero <federico@helixcode.com>
|
||||
|
||||
* gaction.c (gmc_open_filename): Use gnome_mime_needsterminal()
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "../vfs/vfs.h"
|
||||
#include <libgnorba/gnorba.h>
|
||||
#include "FileManager.h"
|
||||
#include "gcmd.h"
|
||||
#include "gcorba.h"
|
||||
#include "gdesktop.h"
|
||||
#include "global.h"
|
||||
@ -85,6 +84,46 @@ Desktop_rescan_devices (PortableServer_Servant servant, CORBA_Environment *ev)
|
||||
desktop_rescan_devices ();
|
||||
}
|
||||
|
||||
/* Desktop::arrange_icons method */
|
||||
static void
|
||||
Desktop_arrange_icons (PortableServer_Servant servant,
|
||||
GNOME_FileManager_Desktop_ArrangeType type,
|
||||
CORBA_Environment *ev)
|
||||
{
|
||||
SortType sort_type;
|
||||
|
||||
switch (type) {
|
||||
case GNOME_FileManager_Desktop_BY_NAME:
|
||||
sort_type = SORT_NAME;
|
||||
break;
|
||||
|
||||
case GNOME_FileManager_Desktop_BY_TYPE:
|
||||
sort_type = SORT_EXTENSION;
|
||||
break;
|
||||
|
||||
case GNOME_FileManager_Desktop_BY_SIZE:
|
||||
sort_type = SORT_SIZE;
|
||||
break;
|
||||
|
||||
case GNOME_FileManager_Desktop_BY_ATIME:
|
||||
sort_type = SORT_ACCESS;
|
||||
break;
|
||||
|
||||
case GNOME_FileManager_Desktop_BY_MTIME:
|
||||
sort_type = SORT_MODIFY;
|
||||
break;
|
||||
|
||||
case GNOME_FileManager_Desktop_BY_CTIME:
|
||||
sort_type = SORT_CHANGE;
|
||||
break;
|
||||
|
||||
default:
|
||||
return; /* Should we raise an exception instead? */
|
||||
}
|
||||
|
||||
desktop_arrange_icons (sort_type);
|
||||
}
|
||||
|
||||
/* Fills the vepv structure for the desktop object */
|
||||
static void
|
||||
Desktop_class_init (void)
|
||||
@ -98,6 +137,7 @@ Desktop_class_init (void)
|
||||
|
||||
desktop_epv.rescan = Desktop_rescan;
|
||||
desktop_epv.rescan_devices = Desktop_rescan_devices;
|
||||
desktop_epv.arrange_icons = Desktop_arrange_icons;
|
||||
|
||||
desktop_vepv._base_epv = &desktop_base_epv;
|
||||
desktop_vepv.GNOME_FileManager_Desktop_epv = &desktop_epv;
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "gdesktop.h"
|
||||
#include <gnome.h>
|
||||
#include <sys/stat.h>
|
||||
#include <X11/Xlib.h>
|
||||
@ -13,7 +14,6 @@
|
||||
#include <gdk/gdkx.h>
|
||||
#include "gdesktop-icon.h"
|
||||
#include "dir.h"
|
||||
#include "gdesktop.h"
|
||||
|
||||
|
||||
/* Spacing between icon and text */
|
||||
|
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "gdesktop.h"
|
||||
#include <gnome.h>
|
||||
#include "gdesktop-prefs.h"
|
||||
#include "gdesktop.h"
|
||||
|
||||
|
||||
/* Size of the icon position box */
|
||||
|
@ -56,7 +56,9 @@ int desktop_arr_rows = FALSE;
|
||||
* 1 -- Enable shaped text always
|
||||
* 2 -- Disable shaped text
|
||||
*
|
||||
* This might seem a bit stra
|
||||
* This might seem a bit strange, but it is like that for compatibility reasons.
|
||||
*/
|
||||
|
||||
int desktop_use_shaped_text = 0;
|
||||
|
||||
/* The computed name of the user's desktop directory */
|
||||
@ -727,7 +729,7 @@ static WPanel *create_panel_from_desktop(); /* Fwd decl */
|
||||
static void free_panel_from_desktop(WPanel *panel);
|
||||
|
||||
/* Perform automatic arrangement of the desktop icons */
|
||||
static void
|
||||
void
|
||||
desktop_arrange_icons (SortType type)
|
||||
{
|
||||
WPanel *panel;
|
||||
|
@ -10,6 +10,7 @@
|
||||
#define GDESKTOP_H
|
||||
|
||||
#include "dir.h"
|
||||
#include "gcmd.h"
|
||||
|
||||
|
||||
/* Snap granularity for desktop icons -- maybe these should be calculated in
|
||||
@ -73,6 +74,7 @@ gboolean do_eject (char *filename);
|
||||
void desktop_rescan_devices (void);
|
||||
void desktop_recreate_default_icons (void);
|
||||
void desktop_reload_icons (int user_pos, int xpos, int ypos);
|
||||
void desktop_arrange_icons (SortType type);
|
||||
void desktop_create_url (const char *filename, const char *title, const char *url, const char *icon);
|
||||
|
||||
extern int desktop_wm_is_gnome_compliant;
|
||||
|
@ -119,6 +119,39 @@ rescan_desktop_devices (CORBA_Environment *ev)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Arrange the desktop icons */
|
||||
static int
|
||||
arrange_desktop_icons (const char *type, CORBA_Environment *ev)
|
||||
{
|
||||
CORBA_Object obj;
|
||||
GNOME_FileManager_Desktop_ArrangeType arr_type;
|
||||
|
||||
if (strcmp (type, "name") == 0)
|
||||
arr_type = GNOME_FileManager_Desktop_BY_NAME;
|
||||
else if (strcmp (type, "type") == 0)
|
||||
arr_type = GNOME_FileManager_Desktop_BY_TYPE;
|
||||
else if (strcmp (type, "size") == 0)
|
||||
arr_type = GNOME_FileManager_Desktop_BY_SIZE;
|
||||
else if (strcmp (type, "atime") == 0)
|
||||
arr_type = GNOME_FileManager_Desktop_BY_ATIME;
|
||||
else if (strcmp (type, "mtime") == 0)
|
||||
arr_type = GNOME_FileManager_Desktop_BY_MTIME;
|
||||
else if (strcmp (type, "ctime") == 0)
|
||||
arr_type = GNOME_FileManager_Desktop_BY_CTIME;
|
||||
else {
|
||||
fprintf (stderr, _("Unknown arrange type `%s'\n"), type);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
obj = get_desktop ();
|
||||
if (obj == CORBA_OBJECT_NIL)
|
||||
return FALSE;
|
||||
|
||||
GNOME_FileManager_Desktop_arrange_icons (obj, arr_type, ev);
|
||||
CORBA_Object_release (obj, ev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Close invalid windows */
|
||||
static int
|
||||
close_invalid_windows (CORBA_Environment *ev)
|
||||
@ -143,11 +176,13 @@ enum {
|
||||
ARG_RESCAN_DIRECTORY,
|
||||
ARG_RESCAN_DESKTOP,
|
||||
ARG_RESCAN_DESKTOP_DEVICES,
|
||||
ARG_ARRANGE_DESKTOP_ICONS,
|
||||
ARG_CLOSE_INVALID_WINDOWS
|
||||
};
|
||||
|
||||
static int selected_option = -1;
|
||||
static char *directory;
|
||||
static char *arrange_type;
|
||||
|
||||
/* Parse an argument */
|
||||
static void
|
||||
@ -175,6 +210,9 @@ static const struct poptOption options[] = {
|
||||
N_("Rescan the desktop icons"), NULL },
|
||||
{ "rescan-desktop-devices", '\0', POPT_ARG_NONE, NULL, ARG_RESCAN_DESKTOP_DEVICES,
|
||||
N_("Rescan the desktop device icons"), NULL },
|
||||
{ "arrange-desktop-icons", '\0', POPT_ARG_STRING, &arrange_type, ARG_ARRANGE_DESKTOP_ICONS,
|
||||
N_("Arrange the desktop icons"),
|
||||
N_("name | type | size | atime | mtime | ctime") },
|
||||
{ "close-invalid-windows", '\0', POPT_ARG_NONE, NULL, ARG_CLOSE_INVALID_WINDOWS,
|
||||
N_("Close windows whose directories cannot be reached"), NULL },
|
||||
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
|
||||
@ -215,6 +253,10 @@ main (int argc, char **argv)
|
||||
result = rescan_desktop_devices (&ev);
|
||||
break;
|
||||
|
||||
case ARG_ARRANGE_DESKTOP_ICONS:
|
||||
result = arrange_desktop_icons (arrange_type, &ev);
|
||||
break;
|
||||
|
||||
case ARG_CLOSE_INVALID_WINDOWS:
|
||||
result = close_invalid_windows (&ev);
|
||||
break;
|
||||
|
@ -634,10 +634,9 @@ create_settings_pane (GnomeFilePropertyDialog *fp_dlg)
|
||||
}
|
||||
|
||||
/* Permissions Pane */
|
||||
/* Name changed to dialog_label_new so it doesn't conflict with something
|
||||
in widget.h */
|
||||
|
||||
static GtkWidget *
|
||||
dialog_label_new (char *text, double xalign, double yalign)
|
||||
align_label_new (char *text, double xalign, double yalign)
|
||||
{
|
||||
GtkWidget *label;
|
||||
|
||||
@ -736,7 +735,7 @@ gtk_table_attach (GTK_TABLE (table), widget, \
|
||||
w = perm_check_new (NULL, fp_dlg->st.st_mode & wmask, fp_dlg); \
|
||||
x = perm_check_new (NULL, fp_dlg->st.st_mode & xmask, fp_dlg); \
|
||||
\
|
||||
ATTACH (table, dialog_label_new (name, 0.0, 0.5), 0, 1, y, y + 1);\
|
||||
ATTACH (table, align_label_new (name, 0.0, 0.5), 0, 1, y, y + 1); \
|
||||
ATTACH (table, r, 1, 2, y, y + 1); \
|
||||
ATTACH (table, w, 2, 3, y, y + 1); \
|
||||
ATTACH (table, x, 3, 4, y, y + 1); \
|
||||
@ -762,9 +761,10 @@ perm_mode_new (GnomeFilePropertyDialog *fp_dlg)
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox), dialog_label_new (_("Current mode: "), 0.0, 0.5), FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), align_label_new (_("Current mode: "), 0.0, 0.5),
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
fp_dlg->mode_label = dialog_label_new ("0000", 0.0, 0.5);
|
||||
fp_dlg->mode_label = align_label_new ("0000", 0.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), fp_dlg->mode_label, FALSE, FALSE, 0);
|
||||
|
||||
table = gtk_table_new (4, 5, FALSE);
|
||||
@ -777,10 +777,10 @@ perm_mode_new (GnomeFilePropertyDialog *fp_dlg)
|
||||
|
||||
/* Headings */
|
||||
|
||||
ATTACH (table, dialog_label_new (_("Read"), 0.0, 0.5), 1, 2, 0, 1);
|
||||
ATTACH (table, dialog_label_new (_("Write"), 0.0, 0.5), 2, 3, 0, 1);
|
||||
ATTACH (table, dialog_label_new (_("Exec"), 0.0, 0.5), 3, 4, 0, 1);
|
||||
ATTACH (table, dialog_label_new (_("Special"), 0.0, 0.5), 4, 5, 0, 1);
|
||||
ATTACH (table, align_label_new (_("Read"), 0.0, 0.5), 1, 2, 0, 1);
|
||||
ATTACH (table, align_label_new (_("Write"), 0.0, 0.5), 2, 3, 0, 1);
|
||||
ATTACH (table, align_label_new (_("Exec"), 0.0, 0.5), 3, 4, 0, 1);
|
||||
ATTACH (table, align_label_new (_("Special"), 0.0, 0.5), 4, 5, 0, 1);
|
||||
|
||||
/* Permissions */
|
||||
|
||||
@ -939,7 +939,7 @@ perm_ownership_new (GnomeFilePropertyDialog *fp_dlg)
|
||||
|
||||
/* Owner */
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), dialog_label_new (_("Owner"), 0.0, 0.5),
|
||||
gtk_table_attach (GTK_TABLE (table), align_label_new (_("Owner"), 0.0, 0.5),
|
||||
0, 1, 0, 1,
|
||||
GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK,
|
||||
0, 0);
|
||||
@ -954,7 +954,7 @@ perm_ownership_new (GnomeFilePropertyDialog *fp_dlg)
|
||||
|
||||
/* Group */
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), dialog_label_new (_("Group"), 0.0, 0.5),
|
||||
gtk_table_attach (GTK_TABLE (table), align_label_new (_("Group"), 0.0, 0.5),
|
||||
0, 1, 1, 2,
|
||||
GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_SHRINK,
|
||||
0, 0);
|
||||
|
@ -5,8 +5,18 @@ module GNOME {
|
||||
exception POSIX_ERROR { string errorstr; };
|
||||
|
||||
interface Desktop {
|
||||
enum ArrangeType {
|
||||
BY_NAME,
|
||||
BY_TYPE,
|
||||
BY_SIZE,
|
||||
BY_ATIME,
|
||||
BY_MTIME,
|
||||
BY_CTIME
|
||||
};
|
||||
|
||||
void rescan ();
|
||||
void rescan_devices ();
|
||||
void arrange_icons (in ArrangeType type);
|
||||
};
|
||||
|
||||
interface Window {
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user