~ubuntu-branches/ubuntu/dapper/file-roller/dapper-updates

« back to all changes in this revision

Viewing changes to src/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-12-13 00:19:53 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051213001953-0klipgnhk6vikhrt
Tags: 2.13.2-0ubuntu1
* New upstream version:
  - Fixed bug #323713: "Save as" should default to current archive filename
    (Ubuntu: #20132)
  - Fixed bug #315069: file-roller: drag 'n drop doesn't work for more
    than 1 file.
  - Fixed bug #323534: Passwords improperly escaped for zip files
  - Do not open a progress dialog when dragging files, use a progressbar
    in the statusbar instead.
  - Fixed bug #316364: Nautilus dependency should be optional
  - Fixed bug #311821: ascending and descending indicators are opposite
    from expected.
  - Fixed bug #317423: Conflicting mnemonic in "Extract" dialog.
  - Fixed bug #323068: file-roller fails in chosing extract-to directory
  - Fixed bug #322197: Improve Naming Filename when create new Archive file
  - Fixed bug #316564: needs unzip AND zip
    (Ubuntu: #15595)
  - Simplified the add dialog populating the file type combobox with the
    extensions instead of the descriptions.
  - Set progress dialog display delay to 1 second.
  - More HIG compliant progress dialog.
  - Use a single command execution to add many files and folders to an
    archive to speed up the operation.
  - Allow to stop creation of a new archive.
  - Correctly associate fr to 7zip files.
* debian/patches/03_lp-autoconf.patch:
  - updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include <libgnomevfs/gnome-vfs-utils.h>
33
33
#include <glade/glade.h>
34
34
#include "file-utils.h"
 
35
#include "glib-utils.h"
35
36
#include "fr-process.h"
36
37
#include "fr-stock.h"
37
38
#include "gconf-utils.h"
48
49
static gboolean session_is_restored (void);
49
50
static gboolean load_session        (void);
50
51
 
51
 
 
52
52
GList        *window_list = NULL;
53
53
GList        *viewer_list = NULL;
54
54
GList        *command_list = NULL;
62
62
static gint   extract_here;
63
63
static gchar *default_url = NULL;
64
64
 
65
 
extern void get_supported_archive_types (void);
 
65
FRFileTypeDescription file_type_desc[] = {
 
66
        { FR_FILE_TYPE_AR,           ".ar",      "application/x-ar", N_("Ar (.ar)") },
 
67
        { FR_FILE_TYPE_DEB,          ".deb",     "application/x-deb", NULL },
 
68
        { FR_FILE_TYPE_ARJ,          ".arj",     "application/x-arj", N_("Arj (.arj)") },
 
69
        { FR_FILE_TYPE_BZIP,         ".bz",      "application/x-bzip", NULL },
 
70
        { FR_FILE_TYPE_BZIP2,        ".bz2",     "application/x-bzip", NULL },
 
71
        { FR_FILE_TYPE_COMPRESS,     ".Z",       "application/x-compress", NULL },
 
72
        { FR_FILE_TYPE_ISO,          ".iso",     "application/x-cd-image", NULL },
 
73
        { FR_FILE_TYPE_EAR,          ".ear",     "application/x-ear", N_("Ear (.ear)") },
 
74
        { FR_FILE_TYPE_GZIP,         ".gz",      "application/x-gzip", NULL},
 
75
        { FR_FILE_TYPE_JAR,          ".jar",     "application/x-jar", N_("Jar (.jar)")},
 
76
        { FR_FILE_TYPE_LHA,          ".lzh",     "application/x-lha", N_("Lha (.lzh)") },
 
77
        { FR_FILE_TYPE_LZOP,         ".lzo",     "application/x-lzop", NULL },
 
78
        { FR_FILE_TYPE_RAR,          ".rar",     "application/x-rar", N_("Rar (.rar)") },
 
79
        { FR_FILE_TYPE_RPM,          ".rpm",     "application/x-rpm", NULL },
 
80
        { FR_FILE_TYPE_TAR,          ".tar",     "application/x-tar", N_("Tar uncompressed (.tar)") },
 
81
        { FR_FILE_TYPE_TAR_BZ,       ".tar.bz",  "application/x-bzip-compressed-tar", N_("Tar compressed with bzip (.tar.bz)") },
 
82
        { FR_FILE_TYPE_TAR_BZ2,      ".tar.bz2", "application/x-bzip-compressed-tar", N_("Tar compressed with bzip2 (.tar.bz2)") },
 
83
        { FR_FILE_TYPE_TAR_GZ,       ".tar.gz",  "application/x-compressed-tar", N_("Tar compressed with gzip (.tar.gz)") },
 
84
        { FR_FILE_TYPE_TAR_LZOP,     ".tar.lzo", "application/x-lzop-compressed-tar", N_("Tar compressed with lzop (.tar.lzo)") },
 
85
        { FR_FILE_TYPE_TAR_COMPRESS, ".tar.Z",   "application/x-compressed-tar", N_("Tar compressed with compress (.tar.Z)") },
 
86
        { FR_FILE_TYPE_STUFFIT,      ".sit",     "application/x-stuffit", NULL },
 
87
        { FR_FILE_TYPE_WAR,          ".war",     "application/zip", N_("War (.war)") },
 
88
        { FR_FILE_TYPE_ZIP,          ".zip",     "application/zip", N_("Zip (.zip)") },
 
89
        { FR_FILE_TYPE_ZOO,          ".zoo",     "application/x-zoo", N_("Zoo (.zoo)") },
 
90
        { FR_FILE_TYPE_7ZIP,         ".7z",      "application/x-7z-compressed", N_("7-Zip (.7z)") }
 
91
};
 
92
 
 
93
 
 
94
FRFileType single_file_save_type[32];
 
95
FRFileType save_type[32];
 
96
FRFileType open_type[32];
 
97
 
 
98
 
 
99
FRCommandDescription command_desc[] = {
 
100
        { "tar",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_TAR },
 
101
        { "zip",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_ZIP },
 
102
        { "unzip",      TRUE,  FALSE, TRUE,  FR_FILE_TYPE_ZIP },
 
103
        { "rar",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_RAR },
 
104
        { "gzip",       TRUE,  TRUE,  FALSE, FR_FILE_TYPE_GZIP },
 
105
        { "bzip2",      TRUE,  TRUE,  FALSE, FR_FILE_TYPE_BZIP2 },
 
106
        { "ar",         TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_AR },
 
107
        { "ar",         TRUE,  FALSE, TRUE,  FR_FILE_TYPE_DEB },
 
108
        { "arj",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_ARJ },
 
109
        { "bzip2",      TRUE,  FALSE, FALSE, FR_FILE_TYPE_BZIP },
 
110
        { "compress",   TRUE,  TRUE,  FALSE, FR_FILE_TYPE_COMPRESS },
 
111
        { "isoinfo",    TRUE,  FALSE, TRUE,  FR_FILE_TYPE_ISO },
 
112
        { "zip",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_EAR },
 
113
        { "zip",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_JAR },
 
114
        { "lha",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_LHA },
 
115
        { "lzop",       TRUE,  TRUE,  FALSE, FR_FILE_TYPE_LZOP },
 
116
        { "rpm2cpio",   TRUE,  FALSE, TRUE,  FR_FILE_TYPE_RPM },
 
117
        { "uncompress", TRUE,  FALSE, FALSE, FR_FILE_TYPE_COMPRESS },
 
118
        { "unstuff",    TRUE,  FALSE, FALSE, FR_FILE_TYPE_STUFFIT },
 
119
        { "zip",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_WAR },
 
120
        { "zoo",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_ZOO },
 
121
        { "7za",        TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_7ZIP }
 
122
};
 
123
 
 
124
FRCommandDescription tar_command_desc[] = {
 
125
        { "gzip",      TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_TAR_GZ },
 
126
        { "bzip2",     TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_TAR_BZ2 },
 
127
        { "bzip",      FALSE, TRUE,  TRUE,  FR_FILE_TYPE_TAR_BZ },
 
128
        { "lzop",      TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_TAR_LZOP },
 
129
        { "compress",  TRUE,  TRUE,  TRUE,  FR_FILE_TYPE_TAR_COMPRESS }
 
130
};
 
131
 
66
132
 
67
133
struct poptOption options[] = {
68
134
        { "add-to", 'a', POPT_ARG_STRING, &add_to, 0,
119
185
}
120
186
 
121
187
 
122
 
int main (int argc, char **argv)
 
188
int 
 
189
main (int argc, char **argv)
123
190
{
124
191
        GnomeProgram *program;
125
192
        GValue value = { 0 };
346
413
 
347
414
 
348
415
static void 
 
416
compute_supported_archive_types (void)
 
417
{
 
418
        int i, j;
 
419
        int sf_i = 0, s_i = 0, o_i = 0;
 
420
 
 
421
        for (i = 0; i < G_N_ELEMENTS (command_desc); i++) {
 
422
                FRCommandDescription com = command_desc[i];
 
423
 
 
424
                if (!is_program_in_path (com.command)) 
 
425
                        continue;
 
426
 
 
427
                if (strcmp (com.command, "tar") == 0) 
 
428
                        for (j = 0; j < G_N_ELEMENTS (tar_command_desc); j++) {
 
429
                                FRCommandDescription com2 = tar_command_desc[j];
 
430
                                
 
431
                                if (!is_program_in_path (com2.command)) 
 
432
                                        continue;
 
433
                                open_type[o_i++] = com2.file_type;
 
434
                                save_type[s_i++] = com2.file_type;
 
435
                                single_file_save_type[sf_i++] = com2.file_type;
 
436
                        }
 
437
 
 
438
                if (com.can_open)
 
439
                        open_type[o_i++] = com.file_type;
 
440
                if (com.can_save && com.support_many_files)
 
441
                        save_type[s_i++] = com.file_type;
 
442
                if (com.can_save)
 
443
                        single_file_save_type[sf_i++] = com.file_type;
 
444
        }
 
445
 
 
446
        open_type[o_i++] = FR_FILE_TYPE_NULL;
 
447
        save_type[s_i++] = FR_FILE_TYPE_NULL;
 
448
        single_file_save_type[sf_i++] = FR_FILE_TYPE_NULL;
 
449
}
 
450
 
 
451
 
 
452
static void 
349
453
prepare_app (poptContext pctx)
350
454
{
351
455
        char *path;
367
471
        if (eel_gconf_get_boolean (PREF_MIGRATE_DIRECTORIES, TRUE))
368
472
                migrate_to_new_directories ();
369
473
 
370
 
        get_supported_archive_types();
 
474
        compute_supported_archive_types();
371
475
 
372
476
        if (session_is_restored ()) {
373
477
                load_session ();