1 /***************************************************************************
2 * Copyright (C) 2010 by Ixonos Plc *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; version 2 of the License. *
8 * This program is distributed in the hope that it will be useful, *
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11 * GNU General Public License for more details. *
13 * You should have received a copy of the GNU General Public License *
14 * along with this program; if not, write to the *
15 * Free Software Foundation, Inc., *
16 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
17 ***************************************************************************/
18 #include <QApplication>
21 //#include <QDesktopWidget>
22 //#include "DownloadView.h"
25 #include "MainWindow.h"
27 using qtrapids::MainWindow;
29 int main(int argc, char *argv[])
34 QCoreApplication::setOrganizationName("Ixonos");
35 QCoreApplication::setOrganizationDomain("ixonos.com");
36 QCoreApplication::setApplicationName("QtRapids");
38 // Q_INIT_RESOURCE(application);
39 QApplication app(argc, argv);
40 MainWindow mainWindow;
42 QDBusConnection dbus = QDBusConnection::sessionBus();
43 dbus.registerObject("/qtrapids_gui", &mainWindow);
44 dbus.registerService("com.ixonos.qtrapids_gui");
46 mainWindow.connectToServer();
47 mainWindow.RestoreSettings();
48 // mainWindow->setGeometry(QApplication::desktop()->screenGeometry());
53 DownloadView* dlw = new DownloadView(NULL);
54 //qtrapids * mw = new qtrapids();
56 DownloadViewItem* dlwItem = new DownloadViewItem(QStringList() << "Name"
58 << "Progress" << "DL speed"
59 << "UL speed" << "Seeds/Leechers"
61 DownloadViewItem* dlwItem2 = new DownloadViewItem(QStringList() << "Name"
62 << "1000" << "Downloading"
66 //dlwItem->insertChild(0, new DownloadViewItem(QStringList() << "Name"));
67 dlw->insertTopLevelItem(0,dlwItem);
68 dlw->insertTopLevelItem(1,dlwItem2);
70 for (unsigned i = 0; i < 10; ++i)
72 DownloadViewItem *editItem = dynamic_cast<DownloadViewItem*>
73 (dlw->itemAt(QPoint(0,0)));
74 editItem->setData ( 8, Qt::DisplayRole, QVariant("EDITED" + QString::number(i, 'g', 2)));