~ubuntu-branches/debian/sid/file-roller/sid

« back to all changes in this revision

Viewing changes to src/dlg-add-folder.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl, Josselin Mouette, Michael Biebl
  • Date: 2011-10-13 22:43:53 UTC
  • mfrom: (5.1.5 experimental)
  • Revision ID: package-import@ubuntu.com-20111013224353-7fub412oa8jwkcgt
Tags: 3.0.2-2
[ Josselin Mouette ]
* file-roller.mime: dropped. We don’t do necromancy anymore.
* Drop desktop-check-mime-types call too.

[ Michael Biebl ]
* Upload to unstable.
* debian/control.in:
  - Set pkg-gnome-maintainers@lists.alioth.debian.org as Maintainer.
* debian/watch:
  - Switch to .xz tarballs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 *  GNU General Public License for more details.
17
17
 *
18
18
 *  You should have received a copy of the GNU General Public License
19
 
 *  along with this program; if not, write to the Free Software
20
 
 *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
 
19
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
20
 */
22
21
 
23
22
#include <config.h>
31
30
#include "file-utils.h"
32
31
#include "fr-stock.h"
33
32
#include "fr-window.h"
34
 
#include "gconf-utils.h"
35
33
#include "gtk-utils.h"
36
34
#include "preferences.h"
37
35
 
38
36
typedef struct {
39
37
        FrWindow    *window;
 
38
        GSettings   *settings;
40
39
        GtkWidget   *dialog;
41
40
        GtkWidget   *include_subfold_checkbutton;
42
41
        GtkWidget   *add_if_newer_checkbutton;
59
58
open_file_destroy_cb (GtkWidget  *widget,
60
59
                      DialogData *data)
61
60
{
 
61
        g_object_unref (data->settings);
62
62
        g_free (data->last_options);
63
63
        g_free (data);
64
64
}
185
185
        DialogData *data = callback_data;
186
186
 
187
187
        gtk_widget_set_sensitive (data->exclude_symlinks,
188
 
                                  GTK_TOGGLE_BUTTON (widget)->active);
 
188
                                  gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
189
189
 
190
190
        return FALSE;
191
191
}
210
210
        GtkWidget   *align;
211
211
 
212
212
        data = g_new0 (DialogData, 1);
213
 
 
 
213
        data->settings = g_settings_new (FILE_ROLLER_SCHEMA_ADD);
214
214
        data->window = callback_data;
215
 
 
216
215
        data->dialog = file_sel =
217
216
                gtk_file_chooser_dialog_new (_("Add a Folder"),
218
217
                                             GTK_WINDOW (data->window),
444
443
        gboolean   recursive;
445
444
        gboolean   no_symlinks;
446
445
 
447
 
        options_dir = get_home_relative_file (RC_OPTIONS_DIR);
 
446
        options_dir = get_user_config_subdirectory (ADD_FOLDER_OPTIONS_DIR, TRUE);
448
447
        options_file = g_file_get_child (options_dir, name);
449
448
        file_path = g_file_get_path (options_file);
450
449
        key_file = g_key_file_new ();
505
504
        gboolean  recursive;
506
505
        gboolean  no_symlinks;
507
506
 
508
 
        base_dir = eel_gconf_get_string (PREF_ADD_CURRENT_FOLDER, "");
509
 
        filename = eel_gconf_get_string (PREF_ADD_FILENAME, "");
510
 
        include_files = eel_gconf_get_string (PREF_ADD_INCLUDE_FILES, "");
511
 
        exclude_files = eel_gconf_get_string (PREF_ADD_EXCLUDE_FILES, "");
512
 
        exclude_folders = eel_gconf_get_string (PREF_ADD_EXCLUDE_FOLDERS, "");
513
 
        update = eel_gconf_get_boolean (PREF_ADD_UPDATE, FALSE);
514
 
        recursive = eel_gconf_get_boolean (PREF_ADD_RECURSIVE, TRUE);
515
 
        no_symlinks = eel_gconf_get_boolean (PREF_ADD_NO_SYMLINKS, FALSE);
 
507
        base_dir = g_settings_get_string (data->settings, PREF_ADD_CURRENT_FOLDER);
 
508
        filename = g_settings_get_string (data->settings, PREF_ADD_FILENAME);
 
509
        include_files = g_settings_get_string (data->settings, PREF_ADD_INCLUDE_FILES);
 
510
        exclude_files = g_settings_get_string (data->settings, PREF_ADD_EXCLUDE_FILES);
 
511
        exclude_folders = g_settings_get_string (data->settings, PREF_ADD_EXCLUDE_FOLDERS);
 
512
        update = g_settings_get_boolean (data->settings, PREF_ADD_UPDATE);
 
513
        recursive = g_settings_get_boolean (data->settings, PREF_ADD_RECURSIVE);
 
514
        no_symlinks = g_settings_get_boolean (data->settings, PREF_ADD_NO_SYMLINKS);
516
515
 
517
516
        sync_widgets_with_options (data,
518
517
                                   base_dir,
629
628
                                  &recursive,
630
629
                                  &no_symlinks);
631
630
 
632
 
        eel_gconf_set_string (PREF_ADD_CURRENT_FOLDER, base_dir);
633
 
        eel_gconf_set_string (PREF_ADD_FILENAME, filename);
634
 
        eel_gconf_set_string (PREF_ADD_INCLUDE_FILES, include_files);
635
 
        eel_gconf_set_string (PREF_ADD_EXCLUDE_FILES, exclude_files);
636
 
        eel_gconf_set_string (PREF_ADD_EXCLUDE_FOLDERS, exclude_folders);
637
 
        eel_gconf_set_boolean (PREF_ADD_UPDATE, update);
638
 
        eel_gconf_set_boolean (PREF_ADD_RECURSIVE, recursive);
639
 
        eel_gconf_set_boolean (PREF_ADD_NO_SYMLINKS, no_symlinks);
 
631
        g_settings_set_string (data->settings, PREF_ADD_CURRENT_FOLDER, base_dir);
 
632
        g_settings_set_string (data->settings, PREF_ADD_FILENAME, filename);
 
633
        g_settings_set_string (data->settings, PREF_ADD_INCLUDE_FILES, include_files);
 
634
        g_settings_set_string (data->settings, PREF_ADD_EXCLUDE_FILES, exclude_files);
 
635
        g_settings_set_string (data->settings, PREF_ADD_EXCLUDE_FOLDERS, exclude_folders);
 
636
        g_settings_set_boolean (data->settings, PREF_ADD_UPDATE, update);
 
637
        g_settings_set_boolean (data->settings, PREF_ADD_RECURSIVE, recursive);
 
638
        g_settings_set_boolean (data->settings, PREF_ADD_NO_SYMLINKS, no_symlinks);
640
639
 
641
640
        g_free (base_dir);
642
641
        g_free (filename);
705
704
 
706
705
        gtk_list_store_clear (list_store);
707
706
 
708
 
        options_dir = get_home_relative_file (RC_OPTIONS_DIR);
 
707
        options_dir = get_user_config_subdirectory (ADD_FOLDER_OPTIONS_DIR, TRUE);
709
708
        make_directory_tree (options_dir, 0700, NULL);
710
709
 
711
710
        file_enum = g_file_enumerate_children (options_dir, G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, &err);
767
766
        gtk_tree_model_get (aod_data->aod_model, &iter, 1, &filename, -1);
768
767
        gtk_list_store_remove (GTK_LIST_STORE (aod_data->aod_model), &iter);
769
768
 
770
 
        options_dir = get_home_relative_file (RC_OPTIONS_DIR);
 
769
        options_dir = get_user_config_subdirectory (ADD_FOLDER_OPTIONS_DIR, TRUE);
771
770
        options_file = g_file_get_child (options_dir, filename);
772
771
        if (! g_file_delete (options_file, NULL, &error)) {
773
772
                g_warning ("could not delete the options: %s", error->message);
874
873
        GFile *options_file;
875
874
        char  *opt_filename;
876
875
 
877
 
        options_dir = get_home_relative_file (RC_OPTIONS_DIR);
 
876
        options_dir = get_user_config_subdirectory (ADD_FOLDER_OPTIONS_DIR, TRUE);
878
877
        make_directory_tree (options_dir, 0700, NULL);
879
878
 
880
879
        opt_filename = _gtk_request_dialog_run (