Example #1
0
        public FDOperationQueue(FDDataStore store, FDUserSettings userset, FDOperationLog oplog)
        {
            stopQueue = false;
            DataStore = store;
            settings = userset;
            log = oplog;
            UploadRunning = DownloadRunning = false;

            uploadQueue = new ConcurrentQueue<FDQueueItem>();
            downloadQueue = new ConcurrentQueue<FDQueueItem>();
            current = new ConcurrentStack<FDQueueItem>();
            finished = new ConcurrentStack<FDQueueItem>();

            ignoreGuid = new HashSet<Guid>();
        }
Example #2
0
        public FDArchiveBrowser(FDDataStore ds)
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build ();
            DataStore = ds;
            TreeModel = new Gtk.TreeStore(
                typeof(string),	//file or dirname, 0
                typeof(string),	//time modified, 1
                typeof(string),	//time uploaded, 2
                typeof(int),	//versions, 3
                typeof(string),	//checksum, 4
                typeof(string),	//archiveid, 5
                typeof(Int64),	//id 6
                typeof(Int64),	//parent 7
                typeof(bool)	//if expanded 8
            );

            //Create the tree view columns and misc
            TreeViewColumn filename = new TreeViewColumn();
            TreeViewColumn modified = new TreeViewColumn();
            TreeViewColumn uploaded = new TreeViewColumn();
            filename.Title = "Filename";
            modified.Title = "Modified";
            uploaded.Title = "Uploaded";
            Gtk.CellRendererText filenameCell = new Gtk.CellRendererText();
            Gtk.CellRendererText modifiedCell = new Gtk.CellRendererText();
            Gtk.CellRendererText uploadedCell = new Gtk.CellRendererText();
            filename.PackStart(filenameCell, true);
            modified.PackStart(modifiedCell, false);
            uploaded.PackStart(uploadedCell, false);
            filename.AddAttribute(filenameCell, "text", 0);
            modified.AddAttribute(modifiedCell, "text", 1);
            uploaded.AddAttribute(uploadedCell, "text", 2);
            treeview1.AppendColumn(filename);
            treeview1.AppendColumn(modified);
            treeview1.AppendColumn(uploaded);
            treeview1.Model = this.TreeModel;
            Gtk.TreeSelection selection = treeview1.Selection;
            selection.Mode = Gtk.SelectionMode.Multiple;
            treeview1.Selection.Changed += OnTreeview1RowSelected;

            //insert root node, and populate the first set of directories/files
            TreeIter rootIter = TreeModel.AppendValues ("(root)");
            TreeModel.AppendValues (rootIter, "(loading…)");
        }
Example #3
0
 public FDOperationLog(FDDataStore ds, FDLogVerbosity logVerbosity, bool toConsole)
 {
     DataStore = ds;
     verbosity = logVerbosity;
     console = toConsole;
 }
Example #4
0
    public FDQueueView()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();
        UserSettings = new FDUserSettings();
        DataStore = new FDDataStore(UserSettings.CurrentDataStore, FDLogVerbosity.Warning);
        log = new FDOperationLog(DataStore, FDLogVerbosity.Warning, true);
        operationQueue = new FDOperationQueue(DataStore, UserSettings, log);
        treeview1.Selection.Changed += RemoveSensitive;

        //Create the item list
        items = new List<ListItem>();
        this.uploadQueue = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(Guid), typeof(FDItemStatus));

        //Create the tree view columns and misc
        TreeViewColumn icon = new TreeViewColumn();
        TreeViewColumn filename = new TreeViewColumn();
        TreeViewColumn progress = new TreeViewColumn();
        icon.Title = "";
        filename.Title = "Filename";
        progress.Title = "Progress";
        Gtk.CellRendererPixbuf iconCell = new Gtk.CellRendererPixbuf();
        Gtk.CellRendererText filenameCell = new Gtk.CellRendererText();
        Gtk.CellRendererText progressCell = new Gtk.CellRendererText();
        icon.PackStart(iconCell, true);
        filename.PackStart(filenameCell, true);
        progress.PackStart(progressCell, false);
        icon.AddAttribute(iconCell, "pixbuf", 0);
        filename.AddAttribute(filenameCell, "text", 1);
        progress.AddAttribute(progressCell, "text", 2);
        treeview1.AppendColumn(icon);
        treeview1.AppendColumn(filename);
        treeview1.AppendColumn(progress);
        treeview1.Model = this.uploadQueue;
        Gtk.TreeSelection selection = treeview1.Selection;
        selection.Mode = Gtk.SelectionMode.Multiple;

        //Verify our settings. If they aren't present, we need to show the settings dialog
        if(String.IsNullOrWhiteSpace(UserSettings.AWSAccessKey) ||
           String.IsNullOrWhiteSpace(UserSettings.AWSSecretKey) ||
           String.IsNullOrWhiteSpace(UserSettings.AWSGlacierVaultName))
        {
            FDPreferences preferences = new FDPreferences(this, DialogFlags.Modal, UserSettings, true);
            preferences.Run();
            preferences.Destroy();
        }

        //Create the uploader thread
        uploadQueueWorker = new BackgroundWorker();
        uploadQueueWorker.DoWork += new DoWorkEventHandler(_uploadQueueWork);
        uploadQueueWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_uploadQueueDone);
        if(!uploadQueueWorker.IsBusy)
        {
            uploadQueueWorker.RunWorkerAsync();
        }

        //Create the downloader thred
        downloadQueueWorker = new BackgroundWorker();
        downloadQueueWorker.DoWork += new DoWorkEventHandler(_downloadQueueWork);
        downloadQueueWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_downloadQueueDone);
        if(!downloadQueueWorker.IsBusy)
        {
            downloadQueueWorker.RunWorkerAsync();
        }

        //Now create the UI update thread that watches the uploader
        updateUIWorker = new BackgroundWorker();
        updateUIWorker.DoWork += new DoWorkEventHandler(_updateUIWork);
        updateUIWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_updateUIDone);
        if(!updateUIWorker.IsBusy)
        {
            updateUIWorker.RunWorkerAsync();
        }

        //Housekeeping functions for window
        this.DeleteEvent += OnDeleteEvent;

        //System.Console.WriteLine (Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData));
        //System.Console.WriteLine (Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
    }