Add initial BTDataSource-class
[kdenetwork.git] / kget / mainwindow.cpp
blobac7a7bbf71c256dbd06b3c930968e923ff9103e3
1 /* This file is part of the KDE project
3 Copyright (C) 2002 by Patrick Charbonnier <pch@freeshell.org>
4 Based On Caitoo v.0.7.3 (c) 1998 - 2000, Matej Koss
5 Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.org>
6 Copyright (C) 2006, 2007 Urs Wolfer <uwolfer @ kde.org>
7 Copyright (C) 2006 Dario Massarin <nekkar@libero.it>
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
15 #include "mainwindow.h"
17 #include "core/kget.h"
18 #include "core/transferhandler.h"
19 #include "core/transfergrouphandler.h"
20 #include "dbus/dbusmodelobserver.h"
21 #include "settings.h"
22 #include "conf/preferencesdialog.h"
23 #include "ui/viewscontainer.h"
24 #include "ui/tray.h"
25 #include "ui/droptarget.h"
26 #include "ui/newtransferdialog.h"
27 #include "ui/transferhistory.h"
29 #include <kapplication.h>
30 #include <kstandarddirs.h>
31 #include <KInputDialog>
32 #include <kmessagebox.h>
33 #include <kshortcutsdialog.h>
34 #include <kedittoolbar.h>
35 #include <knotifyconfigwidget.h>
36 #include <kfiledialog.h>
37 #include <ktoolinvocation.h>
38 #include <kmenubar.h>
39 #include <kiconloader.h>
40 #include <kstandardaction.h>
41 #include <klocale.h>
42 #include <kicon.h>
43 #include <kactionmenu.h>
44 #include <krun.h>
46 #include <QClipboard>
47 #include <QTimer>
49 MainWindow::MainWindow(bool showMainwindow, bool startWithoutAnimation, QWidget *parent)
50 : KXmlGuiWindow( parent ),
51 m_drop(0), m_dock(0), m_startWithoutAnimation(startWithoutAnimation)
53 // create the model
54 KGet::self( this );
56 // create actions
57 setupActions();
59 createGUI("kgetui.rc");
61 m_viewsContainer = new ViewsContainer(this);
62 // initialize the model observer to export percents over dbus
63 m_dbusModelObserver = new DBusModelObserver();
65 setCentralWidget(m_viewsContainer);
67 // restore position, size and visibility
68 move( Settings::mainPosition() );
69 setAutoSaveSettings();
70 setPlainCaption(i18n("KGet"));
72 if ( Settings::showMain() && showMainwindow)
73 show();
74 else
75 hide();
77 //Some of the widgets are initialized in slotDelayedInit()
78 QTimer::singleShot( 0, this, SLOT(slotDelayedInit()) );
81 MainWindow::~MainWindow()
83 //Save the user's transfers
84 KGet::save();
86 slotSaveMyself();
87 delete clipboardTimer;
88 delete m_drop;
89 delete m_dock;
90 // reset konqueror integration (necessary if user enabled / disabled temporarily integration from tray)
91 slotKonquerorIntegration( Settings::konquerorIntegration() );
92 // the following call saves options set in above dtors
93 Settings::self()->writeConfig();
96 QSize MainWindow::sizeHint() const
98 return QSize(720, 380);
101 void MainWindow::setupActions()
103 QAction *newDownloadAction = actionCollection()->addAction("new_download");
104 newDownloadAction->setText(i18n("&New Download..."));
105 newDownloadAction->setIcon(KIcon("document-new"));
106 newDownloadAction->setShortcuts(KShortcut("Ctrl+N"));
107 connect(newDownloadAction, SIGNAL(triggered()), SLOT(slotNewTransfer()));
109 QAction *openAction = actionCollection()->addAction("import_transfers");
110 openAction->setText(i18n("&Import Transfers..."));
111 openAction->setIcon(KIcon("document-open"));
112 openAction->setShortcuts(KShortcut("Ctrl+I"));
113 connect(openAction, SIGNAL(triggered()), SLOT(slotImportTransfers()));
115 QAction *exportAction = actionCollection()->addAction("export_transfers");
116 exportAction->setText(i18n("&Export Transfers List..."));
117 exportAction->setIcon(KIcon("document-export"));
118 exportAction->setShortcuts(KShortcut("Ctrl+E"));
119 connect(exportAction, SIGNAL(triggered()), SLOT(slotExportTransfers()));
121 QAction *deleteGroupAction = actionCollection()->addAction("delete_groups");
122 deleteGroupAction->setText(i18n("Delete Group"));
123 deleteGroupAction->setIcon(KIcon("edit-delete"));
124 connect(deleteGroupAction, SIGNAL(triggered()), SLOT(slotDeleteGroup()));
126 QAction *renameGroupAction = actionCollection()->addAction("rename_groups");
127 renameGroupAction->setText(i18n("Rename Group"));
128 renameGroupAction->setIcon(KIcon("edit-rename"));
129 connect(renameGroupAction, SIGNAL(triggered()), SLOT(slotRenameGroup()));
131 m_autoPasteAction = new KToggleAction(KIcon("edit-paste"),
132 i18n("Auto-Paste Mode"), actionCollection());
133 actionCollection()->addAction("auto_paste", m_autoPasteAction);
134 m_autoPasteAction->setChecked(Settings::autoPaste());
135 m_autoPasteAction->setWhatsThis(i18n("<b>Auto paste</b> button toggles the auto-paste mode "
136 "on and off.\nWhen set, KGet will periodically scan "
137 "the clipboard for URLs and paste them automatically."));
138 connect(m_autoPasteAction, SIGNAL(triggered()), SLOT(slotToggleAutoPaste()));
140 m_konquerorIntegration = new KToggleAction(KIcon("konqueror"),
141 i18n("Use KGet as Konqueror Download Manager"), actionCollection());
142 actionCollection()->addAction("konqueror_integration", m_konquerorIntegration);
143 connect(m_konquerorIntegration, SIGNAL(triggered(bool)), SLOT(slotTrayKonquerorIntegration(bool)));
144 m_konquerorIntegration->setChecked(Settings::konquerorIntegration());
146 // local - Destroys all sub-windows and exits
147 QAction *quitAction = KStandardAction::quit(this, SLOT(slotQuit()), actionCollection());
148 actionCollection()->addAction("quit", quitAction);
149 // local - Standard configure actions
150 QAction *preferencesAction = KStandardAction::preferences(this, SLOT(slotPreferences()), actionCollection());
151 actionCollection()->addAction("preferences", preferencesAction);
152 QAction *configToolbarAction = KStandardAction::configureToolbars(this, SLOT(slotConfigureToolbars()), actionCollection());
153 actionCollection()->addAction("configure_toolbars", configToolbarAction);
154 QAction *keyBindingsAction = KStandardAction::keyBindings(this, SLOT(slotConfigureKeys()), actionCollection());
155 actionCollection()->addAction("configure_keys", keyBindingsAction);
156 QAction *cinfigNotifyAction = KStandardAction::configureNotifications(this, SLOT(slotConfigureNotifications()), actionCollection());
157 actionCollection()->addAction("configure_notifications", cinfigNotifyAction);
158 m_menubarAction = KStandardAction::showMenubar(this, SLOT(slotShowMenubar()), actionCollection());
159 m_menubarAction->setChecked(!menuBar()->isHidden());
160 actionCollection()->addAction("settings_showmenubar", m_menubarAction);
162 // Transfer related actions
163 QAction *deleteSelectedAction = actionCollection()->addAction("delete_selected_download");
164 deleteSelectedAction->setText(i18nc("delete selected transfer item", "Delete Selected"));
165 deleteSelectedAction->setIcon(KIcon("edit-delete"));
166 deleteSelectedAction->setShortcuts(KShortcut("Del"));
167 connect(deleteSelectedAction, SIGNAL(triggered()), SLOT(slotDeleteSelected()));
169 QAction *startAllAction = actionCollection()->addAction("start_all_download");
170 startAllAction->setText(i18n("Start / Resume All"));
171 startAllAction->setIcon(KIcon("media-seek-forward"));
172 startAllAction->setShortcuts(KShortcut("Ctrl+R"));
173 connect(startAllAction, SIGNAL(triggered()), SLOT(slotStartAllDownload()));
175 QAction *startSelectedAction = actionCollection()->addAction("start_selected_download");
176 startSelectedAction->setText(i18n("Start / Resume Selected"));
177 startSelectedAction->setIcon(KIcon("media-playback-start"));
178 connect(startSelectedAction, SIGNAL(triggered()), SLOT(slotStartSelectedDownload()));
180 QAction *stopAllAction = actionCollection()->addAction("stop_all_download");
181 stopAllAction->setText(i18n("Stop All"));
182 stopAllAction->setIcon(KIcon("media-playback-pause"));
183 stopAllAction->setShortcuts(KShortcut("Ctrl+P"));
184 connect(stopAllAction, SIGNAL(triggered()), SLOT(slotStopAllDownload()));
186 QAction *stopSelectedAction = actionCollection()->addAction("stop_selected_download");
187 stopSelectedAction->setText(i18n("Stop Selected"));
188 stopSelectedAction->setIcon(KIcon("media-playback-pause"));
189 connect(stopSelectedAction, SIGNAL(triggered()), SLOT(slotStopSelectedDownload()));
191 KActionMenu *startActionMenu = new KActionMenu(KIcon("media-playback-start"), i18n("Start / Resume"),
192 actionCollection());
193 actionCollection()->addAction("start_menu", startActionMenu);
194 startActionMenu->setDelayed(true);
195 startActionMenu->addAction(startAllAction);
196 startActionMenu->addAction(startSelectedAction);
197 connect(startActionMenu, SIGNAL(triggered()), SLOT(slotStartDownload()));
199 KActionMenu *stopActionMenu = new KActionMenu(KIcon("media-playback-pause"), i18n("Stop"),
200 actionCollection());
201 actionCollection()->addAction("stop_menu", stopActionMenu);
202 stopActionMenu->setDelayed(true);
203 stopActionMenu->addAction(stopAllAction);
204 stopActionMenu->addAction(stopSelectedAction);
205 connect(stopActionMenu, SIGNAL(triggered()), SLOT(slotStopDownload()));
207 QAction *openDestAction = actionCollection()->addAction("transfer_open_dest");
208 openDestAction->setText(i18n("Open Destination"));
209 openDestAction->setIcon(KIcon("document-open"));
210 connect(openDestAction, SIGNAL(triggered()), SLOT(slotTransfersOpenDest()));
212 QAction *openFileAction = actionCollection()->addAction("transfer_open_file");
213 openFileAction->setText(i18n("Open File"));
214 openFileAction->setIcon(KIcon("document-open"));
215 connect(openFileAction, SIGNAL(triggered()), SLOT(slotTransfersOpenFile()));
217 QAction *showDetailsAction = actionCollection()->addAction("transfer_show_details");
218 showDetailsAction->setText(i18n("Show Details"));
219 showDetailsAction->setIcon(KIcon("document-properties"));
220 connect(showDetailsAction, SIGNAL(triggered()), SLOT(slotTransfersShowDetails()));
222 QAction *copyUrlAction = actionCollection()->addAction("transfer_copy_source_url");
223 copyUrlAction->setText(i18n("Copy URL to Clipboard"));
224 copyUrlAction->setIcon(KIcon("edit-copy"));
225 connect(copyUrlAction, SIGNAL(triggered()), SLOT(slotTransfersCopySourceUrl()));
227 KToggleAction *showDropTargetAction = new KToggleAction(KIcon("kget"),
228 i18n("Show Drop Target"), actionCollection());
229 actionCollection()->addAction("show_drop_target", showDropTargetAction);
230 showDropTargetAction->setChecked(Settings::showDropTarget());
231 connect(showDropTargetAction, SIGNAL(triggered()), SLOT(slotToggleDropTarget()));
233 QAction *transferHistoryAction = actionCollection()->addAction("Transfer History");
234 transferHistoryAction->setText(i18n("&Transfer History"));
235 transferHistoryAction->setIcon(KIcon("view-history"));
236 transferHistoryAction->setShortcuts(KShortcut("Ctrl+H"));
237 connect(transferHistoryAction, SIGNAL(triggered()), SLOT(slotTransferHistory()));
240 void MainWindow::slotDelayedInit()
242 //Here we import the user's transfers.
243 KGet::load( KStandardDirs::locateLocal("appdata", "transfers.kgt") );
245 m_dock = new Tray(this);
246 if(Settings::enableSystemTray()) {
247 // DockWidget
248 m_dock->show();
251 // enable dropping
252 setAcceptDrops(true);
254 // enable hide toolbar
255 setStandardToolBarMenuEnabled(true);
257 // session management stuff
258 connect(kapp, SIGNAL(saveYourself()), SLOT(slotSaveMyself()));
260 // set auto-resume in kioslaverc (is there a cleaner way?)
261 KConfig cfg("kioslaverc", KConfig::NoGlobals);
262 cfg.group(QString()).writeEntry("AutoResume", true);
263 cfg.sync();
265 // immediately start downloading if configured this way
266 if ( Settings::downloadAtStartup() )
267 slotStartDownload();
269 // DropTarget
270 m_drop = new DropTarget(this);
272 if (Settings::firstRun()) {
273 if (KMessageBox::questionYesNoCancel(this ,i18n("This is the first time you have run KGet.\n"
274 "Would you like to enable KGet as the download manager for Konqueror?"),
275 i18n("Konqueror Integration"), KGuiItem(i18n("Enable")),
276 KGuiItem(i18n("Do Not Enable")))
277 == KMessageBox::Yes) {
278 Settings::setKonquerorIntegration(true);
279 slotKonquerorIntegration(true);
282 m_drop->setDropTargetVisible(true);
284 // reset the FirstRun config option
285 Settings::setFirstRun(false);
288 if (Settings::showDropTarget() && !m_startWithoutAnimation)
289 m_drop->setDropTargetVisible(true);
291 //auto paste stuff
292 lastClipboard = QApplication::clipboard()->text( QClipboard::Clipboard ).trimmed();
293 clipboardTimer = new QTimer(this);
294 connect(clipboardTimer, SIGNAL(timeout()), SLOT(slotCheckClipboard()));
295 if ( Settings::autoPaste() )
296 clipboardTimer->start(1000);
299 void MainWindow::slotToggleDropTarget()
301 actionCollection()->action("show_drop_target")->setChecked(!m_drop->isVisible());
303 m_drop->setDropTargetVisible(!m_drop->isVisible());
306 void MainWindow::slotNewTransfer()
308 NewTransferDialog::showNewTransferDialog();
311 void MainWindow::slotImportTransfers()
313 QString filename = KFileDialog::getOpenFileName(KUrl(),
314 "*.kgt *.metalink|" + i18n("All Openable Files") +
315 " (*.kgt *.metalink)", this, i18n("Open File"));
317 if(filename.endsWith(".kgt"))
319 KGet::load(filename);
320 return;
323 if(!filename.isEmpty())
324 KGet::addTransfer( KUrl( filename ) );
327 void MainWindow::slotQuit()
329 if (KGet::schedulerRunning()) {
330 if (KMessageBox::warningYesNoCancel(this,
331 i18n("Some transfers are still running.\n"
332 "Are you sure you want to close KGet?"),
333 i18n("Confirm Quit"),
334 KStandardGuiItem::yes(), KStandardGuiItem::no(), KStandardGuiItem::cancel(),
335 "ExitWithActiveTransfers") != KMessageBox::Yes)
336 return;
338 KGet::setSchedulerRunning(false);
341 Settings::self()->writeConfig();
342 qApp->quit();
345 void MainWindow::slotPreferences()
347 // an instance the dialog could be already created and could be cached,
348 // in which case you want to display the cached dialog
349 if ( PreferencesDialog::showDialog( "preferences" ) )
350 return;
352 // we didn't find an instance of this dialog, so lets create it
353 PreferencesDialog * dialog = new PreferencesDialog( this, Settings::self() );
354 KGet::setPluginsSettingsWidget( dialog->pluginsWidget() );
355 // keep us informed when the user changes settings
356 connect( dialog, SIGNAL(settingsChanged(const QString&)),
357 this, SLOT(slotNewConfig()) );
359 dialog->show();
362 void MainWindow::slotExportTransfers()
364 QString filename = KFileDialog::getSaveFileName
365 (KUrl(),
366 "*.kgt|" + i18n("KGet Transfer List") + " (*.kgt)",
367 this,
368 i18n("Export Transfers")
371 if(!filename.isEmpty())
372 KGet::save(filename);
375 void MainWindow::slotDeleteGroup()
377 foreach(TransferGroupHandler * it, KGet::selectedTransferGroups())
379 it->stop();
380 KGet::delGroup(it->name());
384 void MainWindow::slotRenameGroup()
386 bool ok = true;
387 QString groupName;
389 foreach(TransferGroupHandler * it, KGet::selectedTransferGroups())
391 groupName = KInputDialog::getText(i18n("Enter Group Name"),
392 i18n("Group name:"), it->name(), &ok, this);
393 if(ok)
394 it->setName(groupName);
398 void MainWindow::slotStartDownload()
400 if(KGet::selectedTransfers().size() == 0)
401 slotStartAllDownload();
402 else
403 slotStartSelectedDownload();
406 void MainWindow::slotStartAllDownload()
408 KGet::setSchedulerRunning(true);
411 void MainWindow::slotStartSelectedDownload()
413 foreach(TransferHandler * it, KGet::selectedTransfers())
414 it->start();
417 void MainWindow::slotStopDownload()
419 if(KGet::selectedTransfers().size() == 0)
420 slotStopAllDownload();
421 else
422 slotStopSelectedDownload();
425 void MainWindow::slotStopAllDownload()
427 KGet::setSchedulerRunning(false);
430 void MainWindow::slotStopSelectedDownload()
432 foreach (TransferHandler * it, KGet::selectedTransfers())
433 it->stop();
436 void MainWindow::slotDeleteSelected()
438 foreach(TransferHandler * it, KGet::selectedTransfers())
440 it->stop();
441 m_viewsContainer->closeTransferDetails(it);
442 KGet::delTransfer(it);
446 void MainWindow::slotTransfersOpenDest()
448 QStringList openedDirs;
449 foreach(TransferHandler * it, KGet::selectedTransfers())
451 QString directory = it->dest().directory();
452 if( !openedDirs.contains( directory ) )
454 new KRun(directory, this, 0, true, false);
455 openedDirs.append( directory );
460 void MainWindow::slotTransfersOpenFile()
462 foreach(TransferHandler * it, KGet::selectedTransfers())
464 new KRun(it->dest(), this, 0, true, false);
468 void MainWindow::slotTransfersShowDetails()
470 foreach(TransferHandler * it, KGet::selectedTransfers())
472 m_viewsContainer->showTransferDetails(it);
476 void MainWindow::slotTransfersCopySourceUrl()
478 foreach(TransferHandler * it, KGet::selectedTransfers())
480 QString sourceurl = it->source().url();
481 QClipboard *cb = QApplication::clipboard();
482 cb->setText(sourceurl, QClipboard::Selection);
483 cb->setText(sourceurl, QClipboard::Clipboard);
487 void MainWindow::slotConfigureNotifications()
489 KNotifyConfigWidget::configure(this);
492 void MainWindow::slotConfigureKeys()
494 KShortcutsDialog::configure(actionCollection());
497 void MainWindow::slotConfigureToolbars()
499 KEditToolBar edit( actionCollection() );
500 connect(&edit, SIGNAL( newToolbarConfig() ), this, SLOT( slotNewToolbarConfig() ));
501 edit.exec();
505 void MainWindow::slotSaveMyself()
507 // save last parameters ..
508 Settings::setMainPosition( pos() );
509 // .. and write config to disk
510 Settings::self()->writeConfig();
513 void MainWindow::slotNewToolbarConfig()
515 createGUI();
518 void MainWindow::slotNewConfig()
520 // Update here properties modified in the config dialog and not
521 // parsed often by the code. When clicking Ok or Apply of
522 // PreferencesDialog, this function is called.
524 m_viewsContainer->setExpandableDetails(Settings::showExpandableTransferDetails());
525 m_drop->setDropTargetVisible(Settings::showDropTarget(), false);
526 m_dock->setVisible(Settings::enableSystemTray());
527 if(!Settings::enableSystemTray()) setVisible(true);
529 slotKonquerorIntegration(Settings::konquerorIntegration());
530 m_konquerorIntegration->setChecked(Settings::konquerorIntegration());
532 KGet::reloadKJobs();
534 if (Settings::autoPaste())
535 clipboardTimer->start(1000);
536 else
537 clipboardTimer->stop();
538 m_autoPasteAction->setChecked(Settings::autoPaste());
540 KGet::settingsChanged();
543 void MainWindow::slotToggleAutoPaste()
545 bool autoPaste = !Settings::autoPaste();
546 Settings::setAutoPaste( autoPaste );
548 if (autoPaste)
549 clipboardTimer->start(1000);
550 else
551 clipboardTimer->stop();
552 m_autoPasteAction->setChecked(autoPaste);
555 void MainWindow::slotCheckClipboard()
557 QString clipData = QApplication::clipboard()->text( QClipboard::Clipboard ).trimmed();
559 if (clipData != lastClipboard)
561 lastClipboard = clipData;
562 if (lastClipboard.isEmpty())
563 return;
565 KUrl url = KUrl(lastClipboard);
567 if (url.isValid() && !url.isLocalFile())
568 KGet::addTransfer( url );
572 void MainWindow::slotTrayKonquerorIntegration(bool enable)
574 slotKonquerorIntegration(enable);
575 if (!enable && Settings::konquerorIntegration() && !Settings::expertMode())
577 KMessageBox::information(this,
578 i18n("KGet has been temporarily disabled as download manager for Konqueror. "
579 "If you want to disable it forever, go to Settings->Advanced and disable \"Use "
580 "as download manager for Konqueror\"."),
581 i18n("Konqueror Integration disabled"),
582 "KonquerorIntegrationDisabled");
586 void MainWindow::slotKonquerorIntegration(bool konquerorIntegration)
588 KConfig cfgKonqueror("konquerorrc", KConfig::NoGlobals);
589 cfgKonqueror.group("HTML Settings").writeEntry("DownloadManager",
590 QString(konquerorIntegration ? "kget" : QString()));
591 cfgKonqueror.sync();
594 void MainWindow::slotShowMenubar()
596 if (m_menubarAction->isChecked())
597 menuBar()->show();
598 else
599 menuBar()->hide();
602 void MainWindow::setSystemTrayDownloading(bool running)
604 kDebug(5001);
606 m_dock->setDownloading(running);
609 void MainWindow::slotTransferHistory()
611 TransferHistory *history = new TransferHistory();
612 history->exec();
615 /** widget events */
617 void MainWindow::closeEvent( QCloseEvent * e )
619 e->ignore();
620 if(!Settings::enableSystemTray()) {
621 slotQuit();
623 else {
624 hide();
628 void MainWindow::dragEnterEvent(QDragEnterEvent * event)
630 event->setAccepted(KUrl::List::canDecode(event->mimeData())
631 || event->mimeData()->hasText());
634 void MainWindow::dropEvent(QDropEvent * event)
636 KUrl::List list = KUrl::List::fromMimeData(event->mimeData());
637 QString str;
639 if (!list.isEmpty())
641 /**if (list.count() == 1 && list.first().url().endsWith(".kgt"))
643 int msgBoxResult = KMessageBox::questionYesNoCancel(this, "The dropped file is a KGet-Transferlist", "KGet",
644 KGuiItem(i18n("&Download"), KIcon("document-save")), KGuiItem(i18n("&Load transferlist"), KIcon("list-add")), KStandardGuiItem::cancel());
646 if (msgBoxResult == 3) //Download
647 NewTransferDialog::showNewTransferDialog(list.first().url());
648 if (msgBoxResult == 4) //Load
649 KGet::load(list.first().url());
651 else
652 {**/
653 if (list.count() == 1)
655 str = event->mimeData()->text();
656 NewTransferDialog::showNewTransferDialog(str);
658 else
659 NewTransferDialog::showNewTransferDialog(list);
662 else
664 NewTransferDialog::showNewTransferDialog();
669 /** DBUS interface */
671 void MainWindow::addTransfers(const QString& src, const QString& dest, bool start)
673 // split src for the case it is a QStringList (e.g. from konqueror plugin)
674 KGet::addTransfer(src.split(";"), dest, QString(), start);
677 bool MainWindow::dropTargetVisible() const
679 return m_drop->isVisible();
682 void MainWindow::setDropTargetVisible( bool setVisible )
684 if ( setVisible != Settings::showDropTarget() )
685 m_drop->setDropTargetVisible( setVisible );
688 void MainWindow::setOfflineMode( bool offline )
690 KGet::setSchedulerRunning(offline);
693 bool MainWindow::offlineMode() const
695 return !KGet::schedulerRunning();
698 QVariantMap MainWindow::transfers() const
700 return m_dbusModelObserver->transfers();
703 int MainWindow::transfersSpeed() const
705 return m_dbusModelObserver->transfersSpeed();
708 #include "mainwindow.moc"