Package org.gnome.gtk

Examples of org.gnome.gtk.TreeIter


        tree.setModel(model);
    }

    public void addDownload(Download tDownload)
    {
        TreeIter row = model.appendRow();
        model.setValue(row, download, tDownload);
        model.setValue(row, name, tDownload.getName());
        double percent = (float)tDownload.getSize() / (float)tDownload.getTotalSize() * 100;
        long pct = Math.round(percent);
        if(pct == 100 && tDownload.getSize() != tDownload.getTotalSize())
View Full Code Here


    {
        if(event instanceof DownloadSizeChanged)
        {
            Download d = ((DownloadSizeChanged)event).getDownload();

            TreeIter row = model.getIterFirst();
            if(row != null)
            {
                do
                {
                    if(model.getValue(row, download) == d)
                    {
                        model.setValue(row, size, d.getSize() + "B");
                        double percent = (float)d.getSize() / (float)d.getTotalSize() * 100;
                        model.setValue(row, progress, Math.round(percent) + "%");
                        model.setValue(row, speed, d.getSpeed()/1024f + " KB/s");
                    }
                }
                while(row.iterNext());
            }
        }
        else if(event instanceof DownloadStatusChanged)
        {
            Download d = ((DownloadStatusChanged)event).getDownload();

            TreeIter row = model.getIterFirst();
            if(row != null)
            {
                do
                {
                    if(model.getValue(row, download) == d)
                    {
                        model.setValue(row, speed, "");
                        model.setValue(row, status, d.getStatus());
                    }
                }
                while(row.iterNext());
            }
        }
    }
View Full Code Here

            TreeView tree = (TreeView)mainGlade.getWidget("treeview");

            TreePath[] rows = tree.getSelection().getSelectedRows();
            for(TreePath tp : rows)
            {
                TreeIter row = model.getIter(tp);
                Download d = (Download)model.getValue(row, download);
                d.removeTempFolder();
                model.removeRow(row);
            }
        }
        else if(userData.equals("pause"))
        {
            TreeView tree = (TreeView)mainGlade.getWidget("treeview");

            TreePath[] rows = tree.getSelection().getSelectedRows();
            for(TreePath tp : rows)
            {
                TreeIter row = model.getIter(tp);
                Download d = (Download)model.getValue(row, download);
                d.pause();
            }
        }
        else if(userData.equals("resume"))
        {
            TreeView tree = (TreeView)mainGlade.getWidget("treeview");

            TreePath[] rows = tree.getSelection().getSelectedRows();
            for(TreePath tp : rows)
            {
                TreeIter row = model.getIter(tp);
                Download d = (Download)model.getValue(row, download);
                d.resume();
            }
        }
        else if(userData.equals("preferences"))
View Full Code Here

TOP

Related Classes of org.gnome.gtk.TreeIter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.