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
);
50 KSystemTrayIcon
*systemTray() const { return m_dock
;};
56 // ignore/accept quit events
57 virtual void closeEvent( QCloseEvent
* );
60 virtual void dragEnterEvent(QDragEnterEvent
*);
61 virtual void dropEvent(QDropEvent
*);
63 // set sensitive initial size
64 virtual QSize
sizeHint() const;
67 // slots connected to actions
68 void slotToggleDropTarget();
69 void slotNewTransfer();
70 void slotImportTransfers();
71 void slotExportTransfers();
72 void slotPreferences();
73 void slotDeleteGroup();
74 void slotRenameGroup();
75 void slotSetIconGroup();
76 void slotStartDownload();
77 void slotStopDownload();
78 void slotConfigureNotifications();
79 void slotConfigureKeys();
80 void slotConfigureToolbars();
81 void slotToggleAutoPaste();
82 void slotTrayKonquerorIntegration(bool);
83 void slotKonquerorIntegration( bool );
84 void slotShowMenubar();
85 void slotTransferGroupSettings();
86 void slotTransferSettings();
89 void slotStopAllDownload();
90 void slotStopSelectedDownload();
91 void slotStartAllDownload();
92 void slotStartSelectedDownload();
93 void slotDeleteSelected();
94 void slotRedownloadSelected();
95 void slotTransfersOpenDest();
96 void slotTransfersOpenFile();
97 void slotTransfersShowDetails();
98 void slotTransfersCopySourceUrl();
101 void slotDelayedInit();
102 void slotSaveMyself();
103 void slotNewToolbarConfig();
104 void slotNewConfig();
105 void slotCheckClipboard();
106 void slotTransferHistory();
109 // one-time functions
113 ViewsContainer
* m_viewsContainer
;
114 // dbus modelObserver to export the transfer percents
115 DBusModelObserver
*m_dbusModelObserver
;
122 KToggleAction
* m_autoPasteAction
;
123 KToggleAction
* m_menubarAction
;
124 KToggleAction
* m_konquerorIntegration
;
126 // for autopaste function
127 QString lastClipboard
;
128 // timer for checking clipboard - autopaste function
129 QTimer
*clipboardTimer
;
131 bool m_startWithoutAnimation
;
133 HttpServer
*m_webinterface
;