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) 2006 Dario Massarin <nekkar@libero.it>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
16 #include <ktoggleaction.h>
17 #include <kxmlguiwindow.h>
24 class DBusModelObserver
;
28 * The main window of KGet.
30 * Can be collapsed or expanded.
32 class MainWindow
: public KXmlGuiWindow
36 explicit MainWindow(bool showMainwindow
= true, bool startWithoutAnimation
= false, QWidget
*parent
= 0);
39 // from the DBUS interface
40 virtual void addTransfers(const QString
& src
, const QString
& destDir
= QString(),
42 virtual bool dropTargetVisible() const;
43 virtual void setDropTargetVisible( bool setVisible
);
44 virtual void setOfflineMode( bool online
);
45 virtual bool offlineMode() const;
46 virtual QVariantMap
transfers() const;
47 virtual int transfersSpeed() const;
48 virtual void setSystemTrayDownloading(bool running
);
49 virtual void importLinks(const QList
<QString
> &links
);
51 KSystemTrayIcon
*systemTray() const { return m_dock
;};
55 void slotImportUrl(const QString
&url
);
58 // ignore/accept quit events
59 virtual void closeEvent( QCloseEvent
* );
62 virtual void dragEnterEvent(QDragEnterEvent
*);
63 virtual void dropEvent(QDropEvent
*);
65 // set sensitive initial size
66 virtual QSize
sizeHint() const;
69 // slots connected to actions
70 void slotToggleDropTarget();
71 void slotNewTransfer();
72 void slotImportTransfers();
73 void slotExportTransfers();
74 void slotPreferences();
75 void slotDeleteGroup();
76 void slotRenameGroup();
77 void slotSetIconGroup();
78 void slotStartDownload();
79 void slotStopDownload();
80 void slotConfigureNotifications();
81 void slotConfigureKeys();
82 void slotConfigureToolbars();
83 void slotToggleAutoPaste();
84 void slotTrayKonquerorIntegration(bool);
85 void slotKonquerorIntegration( bool );
86 void slotShowMenubar();
87 void slotTransferGroupSettings();
88 void slotTransferSettings();
91 void slotStopAllDownload();
92 void slotStopSelectedDownload();
93 void slotStartAllDownload();
94 void slotStartSelectedDownload();
95 void slotDeleteSelected();
96 void slotRedownloadSelected();
97 void slotTransfersOpenDest();
98 void slotTransfersOpenFile();
99 void slotTransfersShowDetails();
100 void slotTransfersCopySourceUrl();
101 void slotDeleteFinished();
104 void slotDelayedInit();
105 void slotSaveMyself();
106 void slotNewToolbarConfig();
107 void slotNewConfig();
108 void slotCheckClipboard();
109 void slotTransferHistory();
111 // import links slots
112 void slotShowListLinks();
115 // one-time functions
119 ViewsContainer
* m_viewsContainer
;
120 // dbus modelObserver to export the transfer percents
121 DBusModelObserver
*m_dbusModelObserver
;
128 KToggleAction
* m_autoPasteAction
;
129 KToggleAction
* m_menubarAction
;
130 KToggleAction
* m_konquerorIntegration
;
132 // for autopaste function
133 QString lastClipboard
;
134 // timer for checking clipboard - autopaste function
135 QTimer
*clipboardTimer
;
137 bool m_startWithoutAnimation
;
139 HttpServer
*m_webinterface
;