├── src ├── icons │ ├── CMakeLists.txt │ ├── hi16-app-kwooty.png │ ├── hi22-app-kwooty.png │ ├── hi32-app-kwooty.png │ └── hi64-app-kwooty.png ├── plugins │ ├── CMakeLists.txt │ ├── autoretry │ │ ├── kwooty_autoretrysettings.kcfgc │ │ ├── kwooty_autoretrysettings.kcfg │ │ ├── kwooty_autoretrysettings.desktop │ │ ├── CMakeLists.txt │ │ ├── kwooty_autoretryplugin.desktop │ │ ├── autoretryplugin.h │ │ ├── preferencesautoretry.h │ │ ├── autoretry.h │ │ ├── autoretryplugin.cpp │ │ └── preferencesautoretry.cpp │ ├── scheduler │ │ ├── kwooty_schedulersettings.kcfgc │ │ ├── kwooty_schedulersettings.desktop │ │ ├── CMakeLists.txt │ │ ├── kwooty_schedulersettings.kcfg │ │ ├── kwooty_schedulerplugin.desktop │ │ ├── schedulerplugin.h │ │ ├── schedulertableitemdelegate.h │ │ ├── schedulerplugin.cpp │ │ ├── schedulerfilehandler.h │ │ └── preferencesscheduler.h │ ├── categories │ │ ├── kwooty_categoriessettings.kcfgc │ │ ├── kwooty_categoriessettings.desktop │ │ ├── kwooty_categoriessettings.kcfg │ │ ├── CMakeLists.txt │ │ ├── kwooty_categoriesplugin.desktop │ │ ├── categoriesplugin.h │ │ ├── categoriesplugin.cpp │ │ ├── categoriesmanual.h │ │ ├── categoriesfilehandler.h │ │ ├── utilitycategories.h │ │ ├── mimedata.h │ │ └── preferencescategories.h │ ├── watchfolder │ │ ├── kwooty_watchfoldersettings.kcfgc │ │ ├── kwooty_watchfoldersettings.desktop │ │ ├── kwooty_watchfoldersettings.kcfg │ │ ├── CMakeLists.txt │ │ ├── kwooty_watchfolderplugin.desktop │ │ ├── watchfolderplugin.h │ │ ├── preferenceswatchfolder.h │ │ ├── watchfolderplugin.cpp │ │ ├── preferenceswatchfolder.ui │ │ ├── watchfolder.h │ │ └── preferenceswatchfolder.cpp │ ├── plugin.cpp │ ├── plugin.h │ └── pluginmanager.h ├── preferences │ ├── kwootysettings.kcfgc │ ├── preferencesserver.ui │ ├── preferencesdisplay.cpp │ ├── preferencesdisplay.h │ ├── preferencesgeneral.h │ ├── preferencesshutdown.h │ ├── preferencesplugins.h │ ├── preferencesserver.h │ └── preferencesprograms.h ├── kwootyplugin.desktop ├── kwooty.desktop ├── widgets │ ├── centralwidget.h │ ├── iconcapacitywidget.h │ ├── statusbarwidgetbase.h │ ├── textpushbuttonwidget.h │ ├── statusbarwidgetbase.cpp │ ├── sidebarwidget.h │ └── serverpreferenceswidget.h ├── kwooty.notifyrc ├── kwootyui.rc ├── uniqueapp.h ├── nzbfilehandler.h ├── kwooty_export.h ├── shutdown │ ├── sessionkde.h │ ├── sessiongnome2.h │ ├── sessionbase.h │ ├── sessiongnome3.h │ └── sessionbase.cpp ├── extractzip.h ├── actions │ ├── actionrenamemanager.h │ ├── actionfiledeletemanager.h │ ├── actionmergemanager.h │ ├── actionbuttonsmanager.h │ └── actionfilemanagerbase.h ├── itemdelegate.h ├── fileoperations.h ├── extractrar.h ├── itempostdownloadupdater.h ├── jobs │ └── concatsplitfilesjob.h ├── data │ ├── jobnotifydata.h │ ├── globalfiledata.h │ ├── segmentinfodata.h │ ├── jobnotifydata.cpp │ └── serverdata.h ├── notificationmanager.h ├── sidebar.h ├── segmentdecoderuuenc.h ├── segmentdecoderbase.h ├── itemchildrenmanager.h ├── itemdownloadupdater.h ├── observers │ ├── clientsobserver.h │ └── clientsobserverbase.h ├── systray.h ├── utilities │ └── utilityserverstatus.h └── systraylegacy.h ├── TODO ├── Messages.sh ├── CMakeLists.txt └── INSTALL.txt /src/icons/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # install standard icons 2 | kde4_install_icons( ${ICON_INSTALL_DIR} ) 3 | -------------------------------------------------------------------------------- /src/icons/hi16-app-kwooty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kwooty/HEAD/src/icons/hi16-app-kwooty.png -------------------------------------------------------------------------------- /src/icons/hi22-app-kwooty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kwooty/HEAD/src/icons/hi22-app-kwooty.png -------------------------------------------------------------------------------- /src/icons/hi32-app-kwooty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kwooty/HEAD/src/icons/hi32-app-kwooty.png -------------------------------------------------------------------------------- /src/icons/hi64-app-kwooty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kwooty/HEAD/src/icons/hi64-app-kwooty.png -------------------------------------------------------------------------------- /src/plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(watchfolder) 2 | add_subdirectory(scheduler) 3 | add_subdirectory(autoretry) 4 | add_subdirectory(categories) 5 | -------------------------------------------------------------------------------- /src/preferences/kwootysettings.kcfgc: -------------------------------------------------------------------------------- 1 | # Code generation options for kconfig_compiler 2 | File=kwootysettings.kcfg 3 | ClassName=Settings 4 | Singleton=true 5 | Mutators=true 6 | # will create the necessary code for setting those variables 7 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | TODO list for next releases : 2 | ============================= 3 | 4 | - Compute and display verify % progression 5 | 6 | - Plugin : statistics management(download by day / month / year) 7 | 8 | - Plugin : Send mail when a job is finished (lib to write) 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/plugins/autoretry/kwooty_autoretrysettings.kcfgc: -------------------------------------------------------------------------------- 1 | # Code generation options for kconfig_compiler 2 | File=kwooty_autoretrysettings.kcfg 3 | ClassName=AutoRetrySettings 4 | Inherits=KConfigSkeleton 5 | Mutators=true 6 | Singleton=true 7 | # will create the necessary code for setting those variables -------------------------------------------------------------------------------- /src/plugins/scheduler/kwooty_schedulersettings.kcfgc: -------------------------------------------------------------------------------- 1 | # Code generation options for kconfig_compiler 2 | File=kwooty_schedulersettings.kcfg 3 | ClassName=SchedulerSettings 4 | Inherits=KConfigSkeleton 5 | Mutators=true 6 | Singleton=true 7 | # will create the necessary code for setting those variables -------------------------------------------------------------------------------- /src/plugins/categories/kwooty_categoriessettings.kcfgc: -------------------------------------------------------------------------------- 1 | # Code generation options for kconfig_compiler 2 | File=kwooty_categoriessettings.kcfg 3 | ClassName=CategoriesSettings 4 | Inherits=KConfigSkeleton 5 | Mutators=true 6 | Singleton=true 7 | # will create the necessary code for setting those variables -------------------------------------------------------------------------------- /src/plugins/watchfolder/kwooty_watchfoldersettings.kcfgc: -------------------------------------------------------------------------------- 1 | # Code generation options for kconfig_compiler 2 | File=kwooty_watchfoldersettings.kcfg 3 | ClassName=WatchFolderSettings 4 | Inherits=KConfigSkeleton 5 | Mutators=true 6 | Singleton=true 7 | # will create the necessary code for setting those variables -------------------------------------------------------------------------------- /Messages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> rc.cpp 4 | echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> rc.cpp 5 | 6 | SOURCE_FILES=`find . -name \*.ui -o -name \*.rc -o -name \*.kcfg` 7 | $EXTRACTRC $SOURCE_FILES >> rc.cpp 8 | 9 | LIST=`find . -name \*.cpp -o -name \*.h` 10 | $XGETTEXT $LIST -o $podir/kwooty.pot 11 | 12 | rm -f rc.cpp 13 | 14 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6) 2 | project (Kwooty) 3 | 4 | set(KDE_MIN_VERSION "4.6.0") 5 | find_package(KDE4 REQUIRED) 6 | find_package(KDE4Workspace REQUIRED) 7 | include(KDE4Defaults) 8 | 9 | macro_ensure_version("4.3.80" ${KDE_VERSION} KSTATUSNOTIFIERITEM_FOUND) 10 | macro_bool_to_01(KSTATUSNOTIFIERITEM_FOUND HAVE_KSTATUSNOTIFIERITEM) 11 | 12 | macro_ensure_version("4.5.82" ${KDE_VERSION} NEW_SOLID_POWERMANAGEMENT_FOUND) 13 | 14 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) 15 | add_subdirectory(src) 16 | -------------------------------------------------------------------------------- /src/kwootyplugin.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=ServiceType 3 | X-KDE-ServiceType=Kwooty/Plugin 4 | X-KDE-Derived=KPluginInfo 5 | Name=Kwooty Plugin 6 | Name[cs]=Modul Kwooty 7 | Name[de]=Kwooty-Modul 8 | Name[es]=Complemento de Kwooty 9 | Name[gl]=Complemento de Kwooty 10 | Name[it]=Estensione Kwooty 11 | Name[nl]=Kwooty-plug-in 12 | Name[pl]=Wtyczka Kwooty 13 | Name[pt]='Plugin' do Kwooty 14 | Name[pt_BR]=Plugin Kwooty 15 | Name[sv]=Kwooty-insticksprogram 16 | Name[uk]=Додаток Kwooty 17 | Name[x-test]=xxKwooty Pluginxx 18 | # Defines the plugin version that will be loaded : 19 | [PropertyDef::X-Kwooty-Plugin-Version] 20 | Type=int 21 | -------------------------------------------------------------------------------- /src/plugins/autoretry/kwooty_autoretrysettings.kcfg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 1 12 | 13 | 14 | 15 | 1 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/plugins/categories/kwooty_categoriessettings.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Service 3 | X-KDE-ServiceTypes=KCModule 4 | X-KDE-Library=kwooty_categoriessettings 5 | X-KDE-ParentComponents=kwooty_categoriesplugin 6 | X-KDE-PluginInfo-Name=kwooty_categoriessettings 7 | X-KDE-PluginInfo-Author=Xavier Lefage 8 | X-KDE-PluginInfo-Email=xavier.kwooty@gmail.com 9 | X-KDE-PluginInfo-Version=0.2 10 | X-KDE-PluginInfo-License=GPL 11 | 12 | Name=File Categories 13 | Name[de]=Datei-Kategorien 14 | Name[es]=Categorías de archivos 15 | Name[gl]=Categorías de ficheiros 16 | Name[it]=Categorie dei file 17 | Name[nl]=Categorieën bestanden 18 | Name[pl]=Kategorie plików 19 | Name[pt]=Categorias dos Ficheiros 20 | Name[pt_BR]=Categorias de arquivo 21 | Name[sv]=Filkategorier 22 | Name[uk]=Категорії файлів 23 | Name[x-test]=xxFile Categoriesxx 24 | name[cs]=Skupiny souborů 25 | 26 | -------------------------------------------------------------------------------- /src/plugins/scheduler/kwooty_schedulersettings.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Service 3 | X-KDE-ServiceTypes=KCModule 4 | X-KDE-Library=kwooty_schedulersettings 5 | X-KDE-ParentComponents=kwooty_schedulerplugin 6 | X-KDE-PluginInfo-Name=kwooty_schedulersettings 7 | X-KDE-PluginInfo-Author=Xavier Lefage 8 | X-KDE-PluginInfo-Email=xavier.kwooty@gmail.com 9 | X-KDE-PluginInfo-Version=0.1 10 | X-KDE-PluginInfo-License=GPL 11 | 12 | Name=Scheduler Configuration 13 | Name[es]=Configuración del planificador 14 | Name[gl]=Configuración do planificador 15 | Name[it]=Configurazione pianificatore 16 | Name[nl]=Instelling van planner 17 | Name[pl]=Ustawienia planu 18 | Name[pt]=Configuração do Escalonamento 19 | Name[pt_BR]=Configuração do agendador 20 | Name[sv]=Inställning av schemaläggning 21 | Name[uk]=Налаштування планувальника 22 | Name[x-test]=xxScheduler Configurationxx 23 | name[cs]=Nastavení plánovače 24 | -------------------------------------------------------------------------------- /src/kwooty.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | MimeType=application/x-nzb; 3 | Name=Kwooty 4 | Name[cs]=Kwooty 5 | Name[de]=Kwooty 6 | Name[es]=Kwooty 7 | Name[gl]=Kwooty 8 | Name[it]=Kwooty 9 | Name[nl]=Kwooty 10 | Name[pl]=Kwooty 11 | Name[pt]=Kwooty 12 | Name[pt_BR]=Kwooty 13 | Name[sk]=Kwooty 14 | Name[sv]=Kwooty 15 | Name[uk]=Kwooty 16 | Name[x-test]=xxKwootyxx 17 | GenericName=Nzb usenet client 18 | GenericName[de]=Nzb-Usenet-Programm 19 | GenericName[es]=Cliente usenet nzb 20 | GenericName[gl]=Cliente de usenet de Nzb. 21 | GenericName[it]=Client usenet NZB 22 | GenericName[nl]=Nzb usenet-client 23 | GenericName[pl]=Klient usenet Nzb 24 | GenericName[pt]=Cliente de Nzb da Usenet 25 | GenericName[pt_BR]=Cliente usenet Nzb 26 | GenericName[sv]=Nzb usenet-klient 27 | GenericName[uk]=Клієнт usenet nzb 28 | GenericName[x-test]=xxNzb usenet clientxx 29 | Icon=kwooty 30 | Exec=kwooty 31 | Type=Application 32 | Categories=Qt;KDE;Network;News; 33 | Terminal=false 34 | -------------------------------------------------------------------------------- /src/plugins/watchfolder/kwooty_watchfoldersettings.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Service 3 | X-KDE-ServiceTypes=KCModule 4 | X-KDE-Library=kwooty_watchfoldersettings 5 | X-KDE-ParentComponents=kwooty_watchfolderplugin 6 | X-KDE-PluginInfo-Name=kwooty_watchfoldersettings 7 | X-KDE-PluginInfo-Author=Xavier Lefage 8 | X-KDE-PluginInfo-Email=xavier.kwooty@gmail.com 9 | X-KDE-PluginInfo-Version=0.1 10 | X-KDE-PluginInfo-License=GPL 11 | 12 | Name=Watch folder Configuration 13 | Name[de]=Einrichtung überwachter Ordner 14 | Name[es]=Configuración de la carpeta a vigilar 15 | Name[gl]=Configuración da vixilancia de cartafol 16 | Name[it]=Configurazione cartella sorvegliata 17 | Name[nl]=Instelling van bewaken van mappen 18 | Name[pl]=Ustawienia katalogu obserwowanego 19 | Name[pt]=Configuração da Monitorização de Pastas 20 | Name[pt_BR]=Configuração do monitoramento de pasta 21 | Name[sv]=Inställning av katalogövervakning 22 | Name[uk]=Налаштування спостереження за текою 23 | Name[x-test]=xxWatch folder Configurationxx 24 | name[cs]=Nastavení sledování složek 25 | 26 | -------------------------------------------------------------------------------- /src/plugins/watchfolder/kwooty_watchfoldersettings.kcfg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | false 13 | 14 | 15 | 16 | 17 | 18 | 19 | false 20 | 21 | 22 | 23 | true 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/plugins/autoretry/kwooty_autoretrysettings.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Service 3 | X-KDE-ServiceTypes=KCModule 4 | X-KDE-Library=kwooty_autoretrysettings 5 | X-KDE-ParentComponents=kwooty_autoretryplugin 6 | X-KDE-PluginInfo-Name=kwooty_autoretrysettings 7 | X-KDE-PluginInfo-Author=Xavier Lefage 8 | X-KDE-PluginInfo-Email=xavier.kwooty@gmail.com 9 | X-KDE-PluginInfo-Version=0.1 10 | X-KDE-PluginInfo-License=GPL 11 | 12 | Name=Automatic download retry Configuration 13 | Name[es]=Configuración del reintento de descarga automático 14 | Name[gl]=Configuración dos intentos de descarga automáticos 15 | Name[it]=Configurazione scaricamento automatico 16 | Name[nl]=Instelling van automatisch opnieuw downloaden 17 | Name[pl]=Samoczynnie ponów pobieranie ustawień 18 | Name[pt]=Configuração da repetição automática das transferências 19 | Name[pt_BR]=Configuração da repetição automática do download 20 | Name[sv]=Inställning av automatiskt åternerladdning 21 | Name[uk]=Налаштування автоматичного повторного отримування 22 | Name[x-test]=xxAutomatic download retry Configurationxx 23 | name[cs]=Nastavení automatického nového pokusu o stažení 24 | -------------------------------------------------------------------------------- /src/widgets/centralwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef CENTRALWIDGET_H 2 | #define CENTRALWIDGET_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | #include "utilities/utility.h" 10 | using namespace UtilityNamespace; 11 | 12 | class MainWindow; 13 | 14 | 15 | class CentralWidget : public QWidget { 16 | 17 | Q_OBJECT 18 | 19 | public: 20 | CentralWidget(MainWindow*); 21 | 22 | QString extractPasswordRequired(const QString&, bool&); 23 | int displayRestoreMessageBox(); 24 | int displaySaveMessageBox(SaveFileBehavior); 25 | int displayAboutToShutdownMessageBox(const QString&); 26 | int displayRemoveAllFilesMessageBox(); 27 | int displayRemoveSelectedFilesMessageBox(); 28 | int displayMergeItemsMessageBox(const QString&, const QString&); 29 | bool isDialogExisting(); 30 | void saveFileError(const int); 31 | void displaySorryMessageBox(const QString&); 32 | void closeAboutToShutdownMessageBox(); 33 | void displayNzbHandleErrorMessageBox(const QString&); 34 | 35 | 36 | private: 37 | int saveErrorButtonCode; 38 | QPointer aboutToShutdownDialog; 39 | 40 | 41 | signals: 42 | 43 | 44 | public slots: 45 | 46 | 47 | 48 | }; 49 | 50 | #endif // CENTRALWIDGET_H 51 | -------------------------------------------------------------------------------- /src/plugins/autoretry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${KWOOTY_INCLUDES}) 2 | 3 | # plugin target : 4 | set(kwooty_autoretryplugin_PART_SRCS autoretryplugin.cpp autoretry.cpp) 5 | kde4_add_kcfg_files(kwooty_autoretryplugin_PART_SRCS kwooty_autoretrysettings.kcfgc) 6 | kde4_add_plugin(kwooty_autoretryplugin ${kwooty_autoretryplugin_PART_SRCS}) 7 | target_link_libraries(kwooty_autoretryplugin ${KDE4_KIO_LIBS} kwootycore ${KDE4_KDEUI_LIBS} ${KDE4_KUTILS_LIBS}) 8 | 9 | 10 | # plugin config target : 11 | set(kwooty_autoretrysettings_PART_SRCS preferencesautoretry.cpp) 12 | kde4_add_ui_files(kwooty_autoretrysettings_PART_SRCS preferencesautoretry.ui) 13 | kde4_add_kcfg_files(kwooty_autoretrysettings_PART_SRCS kwooty_autoretrysettings.kcfgc) 14 | kde4_add_plugin(kwooty_autoretrysettings ${kwooty_autoretrysettings_PART_SRCS}) 15 | target_link_libraries(kwooty_autoretrysettings ${KDE4_KIO_LIBS} kwootycore ${KDE4_KDEUI_LIBS} ${KDE4_KUTILS_LIBS}) 16 | 17 | 18 | install(TARGETS kwooty_autoretrysettings kwooty_autoretryplugin DESTINATION ${PLUGIN_INSTALL_DIR}) 19 | install(FILES kwooty_autoretrysettings.kcfg DESTINATION ${KCFG_INSTALL_DIR}) 20 | install(FILES kwooty_autoretrysettings.desktop kwooty_autoretryplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR}) 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/plugins/watchfolder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${KWOOTY_INCLUDES}) 2 | 3 | # plugin target : 4 | set(kwooty_watchfolderplugin_PART_SRCS watchfolderplugin.cpp watchfolder.cpp) 5 | kde4_add_kcfg_files(kwooty_watchfolderplugin_PART_SRCS kwooty_watchfoldersettings.kcfgc) 6 | kde4_add_plugin(kwooty_watchfolderplugin ${kwooty_watchfolderplugin_PART_SRCS}) 7 | target_link_libraries(kwooty_watchfolderplugin ${KDE4_KIO_LIBS} kwootycore ${KDE4_KDEUI_LIBS} ${KDE4_KUTILS_LIBS}) 8 | 9 | 10 | # plugin config target : 11 | set(kwooty_watchfoldersettings_PART_SRCS preferenceswatchfolder.cpp) 12 | kde4_add_ui_files(kwooty_watchfoldersettings_PART_SRCS preferenceswatchfolder.ui) 13 | kde4_add_kcfg_files(kwooty_watchfoldersettings_PART_SRCS kwooty_watchfoldersettings.kcfgc) 14 | kde4_add_plugin(kwooty_watchfoldersettings ${kwooty_watchfoldersettings_PART_SRCS}) 15 | target_link_libraries(kwooty_watchfoldersettings ${KDE4_KIO_LIBS} kwootycore ${KDE4_KDEUI_LIBS} ${KDE4_KUTILS_LIBS}) 16 | 17 | 18 | install(TARGETS kwooty_watchfoldersettings kwooty_watchfolderplugin DESTINATION ${PLUGIN_INSTALL_DIR}) 19 | install(FILES kwooty_watchfoldersettings.kcfg DESTINATION ${KCFG_INSTALL_DIR}) 20 | install(FILES kwooty_watchfoldersettings.desktop kwooty_watchfolderplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR}) 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/plugins/scheduler/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${KWOOTY_INCLUDES}) 2 | 3 | # plugin target : 4 | set(kwooty_schedulerplugin_PART_SRCS schedulerplugin.cpp scheduler.cpp schedulerfilehandler.cpp) 5 | kde4_add_kcfg_files(kwooty_schedulerplugin_PART_SRCS kwooty_schedulersettings.kcfgc) 6 | kde4_add_plugin(kwooty_schedulerplugin ${kwooty_schedulerplugin_PART_SRCS}) 7 | target_link_libraries(kwooty_schedulerplugin ${KDE4_KIO_LIBS} kwootycore ${KDE4_KDEUI_LIBS} ${KDE4_KUTILS_LIBS}) 8 | 9 | 10 | # plugin config target : 11 | set(kwooty_schedulersettings_PART_SRCS preferencesscheduler.cpp schedulertableitemdelegate.cpp schedulerfilehandler.cpp) 12 | kde4_add_ui_files(kwooty_schedulersettings_PART_SRCS preferencesscheduler.ui) 13 | kde4_add_kcfg_files(kwooty_schedulersettings_PART_SRCS kwooty_schedulersettings.kcfgc) 14 | kde4_add_plugin(kwooty_schedulersettings ${kwooty_schedulersettings_PART_SRCS}) 15 | target_link_libraries(kwooty_schedulersettings ${KDE4_KIO_LIBS} kwootycore ${KDE4_KDEUI_LIBS} ${KDE4_KUTILS_LIBS}) 16 | 17 | 18 | install(TARGETS kwooty_schedulersettings kwooty_schedulerplugin DESTINATION ${PLUGIN_INSTALL_DIR}) 19 | install(FILES kwooty_schedulersettings.kcfg DESTINATION ${KCFG_INSTALL_DIR}) 20 | install(FILES kwooty_schedulersettings.desktop kwooty_schedulerplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR}) 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/plugins/categories/kwooty_categoriessettings.kcfg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | true 13 | 14 | 15 | 16 | 17 | 0 18 | 19 | 20 | 21 | false 22 | 23 | 24 | 25 | false 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/kwooty.notifyrc: -------------------------------------------------------------------------------- 1 | [Global] 2 | IconName=kwooty 3 | Comment=Kwooty 4 | Comment[cs]=Kwooty 5 | Comment[de]=Kwooty 6 | Comment[es]=Kwooty 7 | Comment[gl]=Kwooty 8 | Comment[it]=Kwooty 9 | Comment[nl]=Kwooty 10 | Comment[pl]=Kwooty 11 | Comment[pt]=Kwooty 12 | Comment[pt_BR]=Kwooty 13 | Comment[sk]=Kwooty 14 | Comment[sv]=Kwooty 15 | Comment[uk]=Kwooty 16 | Comment[x-test]=xxKwootyxx 17 | 18 | [Event/jobFinished] 19 | Name=Job Finished 20 | Name[cs]=Úloha byla dokončena 21 | Name[de]=Vorgang abgeschlossen 22 | Name[es]=Trabajo finalizado 23 | Name[gl]=Rematou a tarefa 24 | Name[it]=Operazione terminata 25 | Name[nl]=Job voltooid 26 | Name[pl]=Ukończono zadanie 27 | Name[pt]=Tarefa Terminada 28 | Name[pt_BR]=Tarefa concluída 29 | Name[sk]=Úloha ukončená 30 | Name[sv]=Jobb klart 31 | Name[uk]=Завдання виконано 32 | Name[x-test]=xxJob Finishedxx 33 | Action=Popup 34 | 35 | [Event/insufficientDiskSpace] 36 | Name=Insufficient Disk Space 37 | Name[cs]=Nedostatek místa na disku 38 | Name[de]=Unzureichender Plattenplatz 39 | Name[es]=Espacio insuficiente en disco 40 | Name[gl]=Espazo insuficiente 41 | Name[it]=Spazio su disco insufficiente 42 | Name[nl]=Onvoldoende schijfruimte 43 | Name[pl]=Brak wystarczającej przestrzeni na dysku 44 | Name[pt]=Espaço em Disco Insuficiente 45 | Name[pt_BR]=Espaço em disco insuficiente 46 | Name[sk]=Nedostatok miesta na disku 47 | Name[sv]=Otillräckligt diskutrymme 48 | Name[uk]=Недостатньо місця на диску 49 | Name[x-test]=xxInsufficient Disk Spacexx 50 | Action=Popup 51 | Persistent=True 52 | -------------------------------------------------------------------------------- /src/plugins/categories/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${KWOOTY_INCLUDES}) 2 | 3 | set(Kwooty_categoriesglobal_SRCS 4 | categoriesfilehandler.cpp 5 | mimedata.cpp 6 | categoriesmodel.cpp 7 | utilitycategories.cpp 8 | ) 9 | 10 | # plugin target : 11 | set(kwooty_categoriesplugin_PART_SRCS categoriesplugin.cpp categories.cpp categoriesmanual.cpp ${Kwooty_categoriesglobal_SRCS}) 12 | kde4_add_kcfg_files(kwooty_categoriesplugin_PART_SRCS kwooty_categoriessettings.kcfgc) 13 | kde4_add_plugin(kwooty_categoriesplugin ${kwooty_categoriesplugin_PART_SRCS}) 14 | target_link_libraries(kwooty_categoriesplugin ${KDE4_KIO_LIBS} kwootycore ${KDE4_KDEUI_LIBS} ${KDE4_KUTILS_LIBS}) 15 | 16 | 17 | # plugin config target : 18 | set(kwooty_categoriessettings_PART_SRCS preferencescategories.cpp ${Kwooty_categoriesglobal_SRCS}) 19 | kde4_add_ui_files(kwooty_categoriessettings_PART_SRCS preferencescategories.ui) 20 | kde4_add_kcfg_files(kwooty_categoriessettings_PART_SRCS kwooty_categoriessettings.kcfgc) 21 | kde4_add_plugin(kwooty_categoriessettings ${kwooty_categoriessettings_PART_SRCS}) 22 | target_link_libraries(kwooty_categoriessettings ${KDE4_KIO_LIBS} kwootycore ${KDE4_KDEUI_LIBS} ${KDE4_KUTILS_LIBS}) 23 | 24 | 25 | install(TARGETS kwooty_categoriessettings kwooty_categoriesplugin DESTINATION ${PLUGIN_INSTALL_DIR}) 26 | install(FILES kwooty_categoriessettings.kcfg DESTINATION ${KCFG_INSTALL_DIR}) 27 | install(FILES kwooty_categoriessettings.desktop kwooty_categoriesplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR}) 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/kwootyui.rc: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | Download 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Main Toolbar 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/preferences/preferencesserver.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | PreferencesServer 4 | 5 | 6 | 7 | 0 8 | 0 9 | 177 10 | 71 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Store passwords with KWallet 25 | 26 | 27 | Store passwords with KWallet 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | Qt::Vertical 38 | 39 | 40 | 41 | 20 42 | 0 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/plugins/scheduler/kwooty_schedulersettings.kcfg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | true 13 | 14 | 15 | 16 | 17 | false 18 | 19 | 20 | 21 | 22 | 0 23 | 0 24 | 99999 25 | 26 | 27 | 28 | 29 | false 30 | 31 | 32 | 33 | 34 | false 35 | 36 | 37 | 38 | 39 | 0 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/plugins/scheduler/kwooty_schedulerplugin.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | X-Kwooty-Plugin-Version=2 3 | X-KDE-Library=kwooty_schedulerplugin 4 | X-KDE-PluginInfo-Author=Xavier Lefage 5 | X-KDE-PluginInfo-Email=xavier.kwooty@gmail.com 6 | X-KDE-PluginInfo-Name=kwooty_schedulerplugin 7 | X-KDE-PluginInfo-Version=0.5 8 | X-KDE-PluginInfo-Website=http://kwooty.sourceforge.net 9 | X-KDE-PluginInfo-License=GPL 10 | X-KDE-PluginInfo-EnabledByDefault=false 11 | ServiceTypes=Kwooty/Plugin 12 | Type=Service 13 | Icon=view-calendar 14 | 15 | Name=Bandwidth manager 16 | Name[cs]=Správce šířky pásma 17 | Name[de]=Bandbreitenverwaltung 18 | Name[es]=Gestor del ancho de banda 19 | Name[gl]=Xestor da largura de banda 20 | Name[it]=Gestore della banda 21 | Name[nl]=Beheerder van bandbreedte 22 | Name[pl]=Zarządzanie przepustowością 23 | Name[pt]=Gestor da largura de banda 24 | Name[pt_BR]=Gerenciador de banda 25 | Name[sv]=Bandbreddshanterare 26 | Name[uk]=Керування потоком даних 27 | Name[x-test]=xxBandwidth managerxx 28 | name[cs]=Správce šířky pásma 29 | 30 | Comment=Schedule and limit bandwidth 31 | Comment[es]=Planificar y limitar el ancho de banda 32 | Comment[gl]=Planificar e liminar a largura de banda 33 | Comment[it]=Pianifica e limita la banda 34 | Comment[nl]=Bandbreedte plannen en beperken 35 | Comment[pl]=Zaplanuj i ogranicz przepustowość 36 | Comment[pt]=Agendar e limitar a largura de banda 37 | Comment[pt_BR]=Agenda e limite de banda 38 | Comment[sv]=Schemalägg och begränsa bandbredd 39 | Comment[uk]=Планування і обмеження потоку даних 40 | Comment[x-test]=xxSchedule and limit bandwidthxx 41 | 42 | -------------------------------------------------------------------------------- /src/preferences/preferencesdisplay.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #include "preferencesdisplay.h" 22 | 23 | PreferencesDisplay::PreferencesDisplay() 24 | { 25 | setupUi(this); 26 | } 27 | -------------------------------------------------------------------------------- /src/plugins/categories/kwooty_categoriesplugin.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | X-Kwooty-Plugin-Version=2 3 | X-KDE-Library=kwooty_categoriesplugin 4 | X-KDE-PluginInfo-Author=Xavier Lefage 5 | X-KDE-PluginInfo-Email=xavier.kwooty@gmail.com 6 | X-KDE-PluginInfo-Name=kwooty_categoriesplugin 7 | X-KDE-PluginInfo-Version=0.2 8 | X-KDE-PluginInfo-Website=http://kwooty.sourceforge.net 9 | X-KDE-PluginInfo-License=GPL 10 | X-KDE-PluginInfo-EnabledByDefault=false 11 | ServiceTypes=Kwooty/Plugin 12 | Type=Service 13 | Icon=folder-favorites 14 | 15 | Name=Categories 16 | Name[cs]=Kategorie 17 | Name[de]=Kategorien 18 | Name[es]=Categorías 19 | Name[gl]=Categorías 20 | Name[it]=Categorie 21 | Name[nl]=Categorieën 22 | Name[pl]=Kategorie 23 | Name[pt]=Categorias 24 | Name[pt_BR]=Categorias 25 | Name[sk]=Kategórie 26 | Name[sv]=Kategorier 27 | Name[uk]=Категорії 28 | Name[x-test]=xxCategoriesxx 29 | 30 | Comment=Transfer downloaded contents to favorite folders 31 | Comment[de]=Heruntergeladene Inhalte in bevorzugte Ordner übertragen 32 | Comment[es]=Transferir el contenido descargado a las carpetas favoritas 33 | Comment[gl]=Transferir o contido descargado aos cartafoles favoritos. 34 | Comment[it]=Trasferisci il contenuto scaricato nelle cartelle preferite 35 | Comment[nl]=Gedownloade inhoud naar voorkeurmappen overbrengen 36 | Comment[pl]=Przenieś pobrane pliki do ulubionych katalogów 37 | Comment[pt]=Transferir o conteúdo transferido para as pastas favoritas 38 | Comment[pt_BR]=Transferir os conteúdos baixados para as pastas favoritas 39 | Comment[sv]=Överför nerladdat innehåll till favoritkataloger 40 | Comment[uk]=Перенести отримані дані до улюблених каталогів 41 | Comment[x-test]=xxTransfer downloaded contents to favorite foldersxx 42 | 43 | -------------------------------------------------------------------------------- /src/plugins/watchfolder/kwooty_watchfolderplugin.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | X-Kwooty-Plugin-Version=2 3 | X-KDE-Library=kwooty_watchfolderplugin 4 | X-KDE-PluginInfo-Author=Xavier Lefage 5 | X-KDE-PluginInfo-Email=xavier.kwooty@gmail.com 6 | X-KDE-PluginInfo-Name=kwooty_watchfolderplugin 7 | X-KDE-PluginInfo-Version=0.2 8 | X-KDE-PluginInfo-Website=http://kwooty.sourceforge.net 9 | X-KDE-PluginInfo-License=GPL 10 | X-KDE-PluginInfo-EnabledByDefault=false 11 | ServiceTypes=Kwooty/Plugin 12 | Type=Service 13 | Icon=folder-sync 14 | 15 | Name=Watch Folder 16 | Name[cs]=Sledovat složku 17 | Name[de]=Ordner überwachen 18 | Name[es]=Carpeta a vigilar 19 | Name[gl]=Vixiar o cartafol 20 | Name[it]=Sorveglia cartella 21 | Name[nl]=Map bewaken 22 | Name[pl]=Obserwowany katalog 23 | Name[pt]=Monitorização de Pastas 24 | Name[pt_BR]=Monitorar pasta 25 | Name[sv]=Övervaka katalog 26 | Name[uk]=Спостереження за текою 27 | Name[x-test]=xxWatch Folderxx 28 | 29 | Comment=Watch folder for nzb files and load them 30 | Comment[de]=Ordner auf nzb-Dateien überwachen und laden 31 | Comment[es]=Vigilar la existencia de archivos nzb en la carpeta para abrirlos 32 | Comment[gl]=Vixiar os ficheiros Nzb do cartafol e cargalos. 33 | Comment[it]=Sorveglia la cartella per la presenza di file nzb e caricali 34 | Comment[nl]=Map bewaken op nzb-bestanden en ze laden 35 | Comment[pl]=Obserwuj katalog na występowanie plików nzb i wczytuj je 36 | Comment[pt]=Sondar uma pasta à procura de ficheiros 'nzb' e carregá-los 37 | Comment[pt_BR]=Monitora a pasta por arquivos nzb e carrega-os 38 | Comment[sv]=Övervaka nzb-filer i katalog och läs in dem 39 | Comment[uk]=Шукати у теці файли nzb і завантажувати їх 40 | Comment[x-test]=xxWatch folder for nzb files and load themxx 41 | 42 | -------------------------------------------------------------------------------- /src/plugins/autoretry/kwooty_autoretryplugin.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | X-Kwooty-Plugin-Version=2 3 | X-KDE-Library=kwooty_autoretryplugin 4 | X-KDE-PluginInfo-Author=Xavier Lefage 5 | X-KDE-PluginInfo-Email=xavier.kwooty@gmail.com 6 | X-KDE-PluginInfo-Name=kwooty_autoretryplugin 7 | X-KDE-PluginInfo-Version=0.1 8 | X-KDE-PluginInfo-Website=http://kwooty.sourceforge.net 9 | X-KDE-PluginInfo-License=GPL 10 | X-KDE-PluginInfo-EnabledByDefault=false 11 | ServiceTypes=Kwooty/Plugin 12 | Type=Service 13 | Icon=task-recurring 14 | 15 | Name=Automatic Retry 16 | Name[de]=Automatisch versuchen 17 | Name[es]=Reintento automático 18 | Name[gl]=Intentar de novo automaticamente 19 | Name[it]=Tentativo automatico 20 | Name[nl]=Automatisch opnieuw proberen 21 | Name[pl]=Samoczynne ponowienie 22 | Name[pt]=Repetição Automática 23 | Name[pt_BR]=Repetição automática 24 | Name[sv]=Försök igen automatiskt 25 | Name[uk]=Автоматичні повторні спроби 26 | Name[x-test]=xxAutomatic Retryxx 27 | Comment=Re-download corrupted files automatically 28 | Comment[de]=Defekte Dateien automatisch wieder herunterladen 29 | Comment[es]=Volver a descargar archivos dañados de forma automática 30 | Comment[gl]=Descargar de novo automaticamente os ficheiros corrompidos. 31 | Comment[it]=Riscarica automaticamente i file danneggiati 32 | Comment[nl]=Automatisch beschadigde bestanden opnieuw downloaden 33 | Comment[pl]=Samoczynnie wznów pobieranie uszkodzonego pliku 34 | Comment[pt]=Voltar a transferir automaticamente os ficheiros danificados 35 | Comment[pt_BR]=Baixar novamente os arquivos corrompidos 36 | Comment[sv]=Ladda ner felaktiga filer igen automatiskt 37 | Comment[uk]=Автоматично повторно отримувати файли, якщо виявлено пошкодження 38 | Comment[x-test]=xxRe-download corrupted files automaticallyxx 39 | -------------------------------------------------------------------------------- /src/preferences/preferencesdisplay.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef PREFERENCESDISPLAY_H 22 | #define PREFERENCESDISPLAY_H 23 | 24 | #include 25 | #include "ui_preferencesdisplay.h" 26 | 27 | class PreferencesDisplay : public QWidget, public Ui::PreferencesDisplay 28 | { 29 | public: 30 | PreferencesDisplay(); 31 | }; 32 | 33 | #endif // PREFERENCESDISPLAY_H 34 | -------------------------------------------------------------------------------- /INSTALL.txt: -------------------------------------------------------------------------------- 1 | Requirements to build the project: 2 | ================================== 3 | Kwooty requires KDE >= 4.6. 4 | 5 | - cmake 6 | - gcc 7 | - KDE core libraries 8 | - KDE development files for the core libraries 9 | - KDE development files for the workspace libraries 10 | => Look at ANNEX at the bottom of the page for packages to install on several distributions. 11 | 12 | Kwooty use 'par2' program for automatic archive verification/repairing and 13 | 'unrar' program for automatic rar extraction. 14 | 15 | The folowing packages should additionally be installed : 16 | - par2 17 | - unrar 18 | 19 | Build and install the project: 20 | ============================== 21 | 1. untar the archive 22 | > tar xvfz kwooty.tgz 23 | 24 | 2. build and install: 25 | > cd kwooty 26 | > cd build 27 | > cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` .. 28 | > sudo make install OR > su -c 'make install' 29 | 30 | 3. uninstall : 31 | > sudo make uninstall OR > su -c 'make uninstall' 32 | 33 | 34 | ANNEX: Packages required to build kwooty on several distributions: 35 | ****************************************************************** 36 | Names of packages could be different according to the distribution used, 37 | you could find below the list of packages to install in order to build Kwooty on 38 | several distributions : 39 | 40 | 1. OpenSuse 11.1 (make sure your KDE version is >=4.6, visit http://en.opensuse.org/KDE/Repositories if you wish to upgrade KDE in order to compile kwooty): 41 | cmake (>=2.6) 42 | gcc 43 | gcc-c++ 44 | libkde4-devel 45 | kdebase4-workspace-devel 46 | par2 47 | unrar 48 | 49 | 2. Mandriva 2009 : 50 | make 51 | cmake 52 | gcc 53 | gcc-c++ 54 | kdebase4-workspace-devel 55 | parchive2 56 | unrar 57 | 58 | 3. Ubuntu 9.04 : 59 | cmake 60 | g++ 61 | kdelibs5-dev 62 | kdebase-workspace-bin 63 | kdebase-workspace-dev 64 | par2 65 | unrar (non-free version) 66 | 67 | -------------------------------------------------------------------------------- /src/uniqueapp.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef UNIQUEAPP_H 22 | #define UNIQUEAPP_H 23 | 24 | #include 25 | #include 26 | class MainWindow; 27 | 28 | 29 | 30 | class UniqueApp : public KUniqueApplication 31 | { 32 | 33 | public: 34 | UniqueApp(); 35 | virtual ~UniqueApp(); 36 | virtual int newInstance(); 37 | 38 | private: 39 | QPointer mainWindow; 40 | bool kwootyInstance; 41 | 42 | }; 43 | 44 | 45 | #endif // UNIQUEAPP_H 46 | -------------------------------------------------------------------------------- /src/nzbfilehandler.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef NZBFILEHANDLER_H 22 | #define NZBFILEHANDLER_H 23 | 24 | #include 25 | #include 26 | 27 | 28 | class GlobalFileData; 29 | class Core; 30 | 31 | class NzbFileHandler : public QObject { 32 | 33 | Q_OBJECT 34 | 35 | public: 36 | 37 | NzbFileHandler(Core*); 38 | QList processNzbFile(QFile&, const QString&); 39 | 40 | private: 41 | Core* parent; 42 | 43 | 44 | signals: 45 | void displayMessageBoxSignal(const QString&); 46 | 47 | }; 48 | 49 | #endif // NZBFILEHANDLER_H 50 | -------------------------------------------------------------------------------- /src/kwooty_export.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef KWOOTY_EXPORT_H 23 | #define KWOOTY_EXPORT_H 24 | 25 | // needed for KDE_EXPORT and KDE_IMPORT macros 26 | #include 27 | 28 | #ifndef KWOOTY_EXPORT 29 | # if defined(MAKE_KWOOTYCORE_LIB) 30 | // We are building this library 31 | # define KWOOTY_EXPORT KDE_EXPORT 32 | # else 33 | // We are using this library 34 | # define KWOOTY_EXPORT KDE_IMPORT 35 | # endif 36 | #endif 37 | 38 | # ifndef KWOOTY_EXPORT_DEPRECATED 39 | # define KWOOTY_EXPORT_DEPRECATED KDE_DEPRECATED KWOOTY_EXPORT 40 | # endif 41 | 42 | #endif -------------------------------------------------------------------------------- /src/preferences/preferencesgeneral.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef PREFERENCESGENERAL_H 22 | #define PREFERENCESGENERAL_H 23 | 24 | #include 25 | #include "ui_preferencesgeneral.h" 26 | 27 | 28 | class PreferencesGeneral : public QWidget, public Ui::PreferencesGeneral 29 | { 30 | 31 | Q_OBJECT 32 | 33 | public: 34 | PreferencesGeneral(); 35 | 36 | private: 37 | void setupConnections(); 38 | void enableSaveRestoreItems(const bool&); 39 | 40 | 41 | private slots: 42 | void stateChangedSlot(); 43 | 44 | 45 | }; 46 | 47 | #endif // PREFERENCESGENERAL_H 48 | -------------------------------------------------------------------------------- /src/preferences/preferencesshutdown.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef PREFERENCESSHUTDOWN_H 22 | #define PREFERENCESSHUTDOWN_H 23 | 24 | #include 25 | #include "ui_preferencesshutdown.h" 26 | 27 | class Core; 28 | 29 | class PreferencesShutdown : public QWidget, public Ui::PreferencesShutdown 30 | { 31 | 32 | Q_OBJECT 33 | public: 34 | PreferencesShutdown(Core*); 35 | 36 | private: 37 | void setupConnections(); 38 | 39 | 40 | public slots: 41 | void currentIndexChangedSlot(); 42 | void radioButtonToggledSlot(); 43 | }; 44 | 45 | #endif // PREFERENCESSHUTDOWN_H 46 | -------------------------------------------------------------------------------- /src/plugins/plugin.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #include "plugin.h" 23 | 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | #include "mainwindow.h" 31 | 32 | 33 | Plugin::Plugin(const KComponentData& instance, QObject* parent): QObject(parent), KXMLGUIClient() 34 | { 35 | 36 | //kDebug() << instance.componentName(); 37 | this->setComponentData(instance); 38 | 39 | } 40 | 41 | 42 | 43 | void Plugin::setCore(MainWindow* core) { 44 | this->core = core; 45 | } 46 | 47 | 48 | MainWindow* Plugin::getMainWindow() { 49 | return this->core; 50 | } 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/plugins/autoretry/autoretryplugin.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef AUTORETRYPLUGIN_H 23 | #define AUTORETRYPLUGIN_H 24 | 25 | 26 | #include "plugin.h" 27 | #include "autoretry.h" 28 | 29 | 30 | class Core; 31 | 32 | class AutoRetryPlugin : public Plugin 33 | { 34 | 35 | Q_OBJECT 36 | 37 | public: 38 | 39 | AutoRetryPlugin(QObject*, const QList&); 40 | ~AutoRetryPlugin(); 41 | 42 | 43 | private: 44 | 45 | AutoRetry* autoRetry; 46 | 47 | void load(); 48 | void unload(); 49 | void configUpdated(); 50 | 51 | 52 | signals: 53 | 54 | public slots: 55 | 56 | private slots: 57 | 58 | 59 | }; 60 | 61 | #endif // AUTORETRYPLUGIN_H 62 | -------------------------------------------------------------------------------- /src/plugins/scheduler/schedulerplugin.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SCHEDULERPLUGIN_H 23 | #define SCHEDULERPLUGIN_H 24 | 25 | 26 | #include "plugin.h" 27 | #include "scheduler.h" 28 | 29 | 30 | class Core; 31 | 32 | class SchedulerPlugin : public Plugin 33 | { 34 | 35 | Q_OBJECT 36 | 37 | public: 38 | 39 | SchedulerPlugin(QObject*, const QList&); 40 | ~SchedulerPlugin(); 41 | 42 | 43 | private: 44 | 45 | Scheduler* scheduler; 46 | 47 | void load(); 48 | void unload(); 49 | void configUpdated(); 50 | 51 | 52 | signals: 53 | 54 | public slots: 55 | 56 | private slots: 57 | 58 | 59 | }; 60 | 61 | #endif // SCHEDULERPLUGIN_H 62 | -------------------------------------------------------------------------------- /src/plugins/categories/categoriesplugin.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef CATEGORIESPLUGIN_H 23 | #define CATEGORIESPLUGIN_H 24 | 25 | 26 | #include "plugin.h" 27 | #include "categories.h" 28 | 29 | 30 | class Core; 31 | 32 | class CategoriesPlugin : public Plugin 33 | { 34 | 35 | Q_OBJECT 36 | 37 | public: 38 | 39 | CategoriesPlugin(QObject*, const QList&); 40 | ~CategoriesPlugin(); 41 | 42 | 43 | private: 44 | 45 | Categories* categories; 46 | 47 | void load(); 48 | void unload(); 49 | void configUpdated(); 50 | 51 | 52 | signals: 53 | 54 | public slots: 55 | 56 | private slots: 57 | 58 | 59 | }; 60 | 61 | #endif // CATEGORIESPLUGIN_H 62 | -------------------------------------------------------------------------------- /src/plugins/watchfolder/watchfolderplugin.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef WATCHFOLDERPLUGIN_H 23 | #define WATCHFOLDERPLUGIN_H 24 | 25 | 26 | #include "plugin.h" 27 | #include "watchfolder.h" 28 | 29 | 30 | class Core; 31 | 32 | class WatchFolderPlugin : public Plugin 33 | { 34 | 35 | Q_OBJECT 36 | 37 | public: 38 | 39 | WatchFolderPlugin(QObject*, const QList&); 40 | ~WatchFolderPlugin(); 41 | 42 | 43 | private: 44 | 45 | WatchFolder* watchFolder; 46 | 47 | void load(); 48 | void unload(); 49 | void configUpdated(); 50 | 51 | 52 | signals: 53 | 54 | public slots: 55 | 56 | private slots: 57 | 58 | 59 | }; 60 | 61 | #endif // WATCHFOLDERPLUGIN_H 62 | -------------------------------------------------------------------------------- /src/preferences/preferencesplugins.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef PREFERENCESPLUGINS_H 23 | #define PREFERENCESPLUGINS_H 24 | 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | 32 | class PluginManager; 33 | 34 | class PreferencesPlugins : public QWidget 35 | { 36 | 37 | Q_OBJECT 38 | 39 | 40 | public: 41 | 42 | PreferencesPlugins(KConfigDialog*, PluginManager*); 43 | 44 | 45 | private: 46 | 47 | PluginManager* pluginManager; 48 | KPluginSelector* kPluginSelector; 49 | KConfigDialog* kConfigDialog; 50 | 51 | 52 | public slots: 53 | 54 | void configButtonClickedSlot(KDialog::ButtonCode); 55 | 56 | }; 57 | 58 | #endif // PREFERENCESPLUGINS_H 59 | -------------------------------------------------------------------------------- /src/plugins/plugin.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef PLUGIN_H 23 | #define PLUGIN_H 24 | 25 | 26 | #include 27 | #include 28 | #include "kwooty_export.h" 29 | 30 | class MainWindow; 31 | 32 | 33 | class KWOOTY_EXPORT Plugin : public QObject, public KXMLGUIClient { 34 | 35 | Q_OBJECT 36 | 37 | public: 38 | 39 | Plugin(const KComponentData&, QObject*); 40 | void setCore(MainWindow*); 41 | MainWindow* getMainWindow(); 42 | 43 | virtual void load() = 0; 44 | virtual void unload() = 0; 45 | virtual void configUpdated() = 0; 46 | 47 | 48 | private: 49 | 50 | MainWindow* core; 51 | 52 | signals: 53 | 54 | public slots: 55 | 56 | private slots: 57 | 58 | 59 | }; 60 | 61 | #endif // PLUGIN_H 62 | -------------------------------------------------------------------------------- /src/shutdown/sessionkde.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SESSIONKDE_H 23 | #define SESSIONKDE_H 24 | 25 | #include 26 | #if KDE_IS_VERSION(4, 5, 82) 27 | // nothing to do for KDE >= 4.6 28 | #else 29 | #include 30 | using namespace Solid::Control; 31 | #endif 32 | 33 | #include 34 | using namespace Solid::PowerManagement; 35 | 36 | #include "sessionbase.h" 37 | 38 | 39 | class SessionKde : public SessionBase { 40 | 41 | 42 | public: 43 | 44 | SessionKde(ShutdownManager*); 45 | QList retrieveAvailableShutdownMethods(); 46 | 47 | private: 48 | 49 | void requestShutdown(); 50 | void requestSuspend(); 51 | 52 | 53 | }; 54 | 55 | #endif // SESSIONKDE_H 56 | -------------------------------------------------------------------------------- /src/widgets/iconcapacitywidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef ICONCAPACITYWIDGET_H 23 | #define ICONCAPACITYWIDGET_H 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | #include "statusbarwidgetbase.h" 31 | 32 | 33 | class IconCapacityWidget : public StatusBarWidgetBase { 34 | 35 | 36 | Q_OBJECT 37 | 38 | public: 39 | IconCapacityWidget(QWidget*, MyStatusBar::WidgetIdentity); 40 | void showIcon(); 41 | void hideIcon(); 42 | void setIcon(const QString&); 43 | void updateCapacity(const QString&, const int&); 44 | 45 | private: 46 | 47 | KCapacityBar* capacityBar; 48 | QLabel* iconLabel; 49 | 50 | signals: 51 | 52 | 53 | public slots: 54 | 55 | 56 | }; 57 | 58 | #endif // ICONCAPACITYWIDGET_H 59 | -------------------------------------------------------------------------------- /src/extractzip.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef EXTRACTZIP_H 23 | #define EXTRACTZIP_H 24 | 25 | 26 | #include "extractbase.h" 27 | 28 | 29 | class ExtractZip : public ExtractBase 30 | { 31 | public: 32 | Q_OBJECT 33 | 34 | public: 35 | ExtractZip(RepairDecompressThread*); 36 | ~ExtractZip(); 37 | 38 | private: 39 | 40 | QStringList createProcessArguments(const QString&, const QString&, const bool&, const QString&) ; 41 | void extractUpdate(const QString&); 42 | void checkIfArchivePassworded(const QString&, bool&); 43 | void sendExtractProgramNotFoundNotification(); 44 | QString searchExtractProgram(); 45 | 46 | signals: 47 | 48 | public slots: 49 | 50 | private slots: 51 | void startedSlot(); 52 | 53 | }; 54 | 55 | #endif // EXTRACTZIP_H 56 | -------------------------------------------------------------------------------- /src/plugins/autoretry/preferencesautoretry.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef PREFERENCESAUTORETRY_H 22 | #define PREFERENCESAUTORETRY_H 23 | 24 | #include 25 | #include "ui_preferencesautoretry.h" 26 | 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | 33 | 34 | class PreferencesAutoRetry : public KCModule 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | PreferencesAutoRetry(QWidget* = 0, const QVariantList& = QVariantList()); 40 | ~PreferencesAutoRetry(); 41 | 42 | virtual void save(); 43 | virtual void load(); 44 | 45 | private: 46 | Ui_PreferencesAutoRetry preferencesAutoRetryUi; 47 | 48 | 49 | signals: 50 | 51 | public slots: 52 | 53 | private slots: 54 | 55 | }; 56 | 57 | #endif // PREFERENCESAUTORETRY_H 58 | -------------------------------------------------------------------------------- /src/plugins/scheduler/schedulertableitemdelegate.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SCHEDULERTABLEITEMDELEGATE_H 23 | #define SCHEDULERTABLEITEMDELEGATE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "schedulerfilehandler.h" 29 | using namespace SchedulerNamespace; 30 | 31 | class SchedulerTableItemDelegate : public QStyledItemDelegate { 32 | 33 | Q_OBJECT 34 | 35 | public: 36 | SchedulerTableItemDelegate(QObject* parent = 0); 37 | void paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const; 38 | 39 | 40 | private: 41 | bool isSchedulerEnabled() const; 42 | QHash statusColorMap; 43 | 44 | signals: 45 | 46 | 47 | public slots: 48 | 49 | 50 | }; 51 | 52 | #endif // SCHEDULERTABLEITEMDELEGATE_H 53 | -------------------------------------------------------------------------------- /src/shutdown/sessiongnome2.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SESSIONGNOME2_H 23 | #define SESSIONGNOME2_H 24 | 25 | #include 26 | #if KDE_IS_VERSION(4, 5, 82) 27 | // nothing to do for KDE >= 4.6 28 | #else 29 | #include 30 | using namespace Solid::Control; 31 | #endif 32 | 33 | #include 34 | using namespace Solid::PowerManagement; 35 | 36 | 37 | 38 | #include "sessionbase.h" 39 | 40 | class SessionGnome2 : public SessionBase { 41 | 42 | 43 | public: 44 | 45 | SessionGnome2(ShutdownManager*); 46 | QList retrieveAvailableShutdownMethods(); 47 | 48 | private: 49 | 50 | void requestShutdown(); 51 | void requestSuspend(); 52 | 53 | }; 54 | 55 | #endif // SESSIONGNOME2_H 56 | -------------------------------------------------------------------------------- /src/plugins/watchfolder/preferenceswatchfolder.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef PREFERENCESWATCHFOLDER_H 22 | #define PREFERENCESWATCHFOLDER_H 23 | 24 | #include 25 | #include "ui_preferenceswatchfolder.h" 26 | 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | 33 | 34 | class PreferencesWatchFolder : public KCModule 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | PreferencesWatchFolder(QWidget* = 0, const QVariantList& = QVariantList()); 40 | ~PreferencesWatchFolder(); 41 | 42 | virtual void save(); 43 | virtual void load(); 44 | 45 | private: 46 | Ui_PreferencesWatchFolder preferencesWatchFolderUi; 47 | 48 | 49 | signals: 50 | 51 | public slots: 52 | 53 | private slots: 54 | 55 | }; 56 | 57 | #endif // PREFERENCESWATCHFOLDER_H 58 | -------------------------------------------------------------------------------- /src/actions/actionrenamemanager.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef ACTIONRENAMEMANAGER_H 23 | #define ACTIONRENAMEMANAGER_H 24 | 25 | #include "actionfilemanagerbase.h" 26 | 27 | 28 | class ActionRenameManager : public ActionFileManagerBase { 29 | 30 | Q_OBJECT 31 | 32 | public: 33 | ActionRenameManager(ActionsManager*); 34 | void checkRenameCandidates(bool&); 35 | 36 | private: 37 | 38 | QString input; 39 | QString selectedItemUuid; 40 | 41 | bool validateNewFolderName(QStandardItem*) const; 42 | bool isRenameAllowed(QStandardItem*) const; 43 | void processRename(QStandardItem*); 44 | void launchProcess(); 45 | 46 | signals: 47 | 48 | 49 | public slots: 50 | void actionTriggeredSlot(); 51 | void handleResultSlot(KJob*); 52 | 53 | }; 54 | 55 | #endif // ACTIONRENAMEMANAGER_H 56 | -------------------------------------------------------------------------------- /src/actions/actionfiledeletemanager.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef ACTIONFILEDELETEMANAGER_H 23 | #define ACTIONFILEDELETEMANAGER_H 24 | 25 | #include "actionfilemanagerbase.h" 26 | 27 | 28 | class ActionFileDeleteManager : public ActionFileManagerBase { 29 | 30 | Q_OBJECT 31 | 32 | public: 33 | ActionFileDeleteManager(ActionsManager*); 34 | 35 | private: 36 | 37 | QStringList selectedItemUuidList; 38 | 39 | QString retrieveFileSavePath(QStandardItem*) const; 40 | bool isDeleteAllowed(QStandardItem*) const; 41 | void removeRowDeleteFile(); 42 | void launchProcess(); 43 | void resetState(); 44 | 45 | signals: 46 | 47 | public slots: 48 | 49 | 50 | private slots: 51 | void handleResultSlot(KJob*); 52 | void actionTriggeredSlot(); 53 | 54 | }; 55 | 56 | #endif // ACTIONFILEDELETEMANAGER_H 57 | 58 | -------------------------------------------------------------------------------- /src/itemdelegate.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef ITEMDELEGATE_H 22 | #define ITEMDELEGATE_H 23 | 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | class ItemDelegate : public QStyledItemDelegate 31 | { 32 | 33 | public: 34 | ItemDelegate(QWidget*); 35 | void paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const; 36 | void drawProgressBar(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const; 37 | QSize sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const; 38 | 39 | 40 | private: 41 | static const int PARENT_ROW_PADDING = 5; 42 | static const int PARENT_BAR_PADDING = 2; 43 | 44 | QHash statusTextMap; 45 | QHash statusColorMap; 46 | 47 | }; 48 | 49 | #endif // ITEMDELEGATE_H 50 | -------------------------------------------------------------------------------- /src/plugins/autoretry/autoretry.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef AUTORETRY_H 23 | #define AUTORETRY_H 24 | 25 | #include 26 | #include 27 | 28 | #include "utilities/utility.h" 29 | using namespace UtilityNamespace; 30 | 31 | class Core; 32 | class AutoRetryPlugin; 33 | 34 | class AutoRetry : public QObject 35 | { 36 | 37 | Q_OBJECT 38 | 39 | public: 40 | AutoRetry(AutoRetryPlugin*); 41 | ~AutoRetry(); 42 | void settingsChanged(); 43 | 44 | 45 | private: 46 | 47 | Core* core; 48 | 49 | void setupConnections(); 50 | void retryDownload(QStandardItem*); 51 | 52 | 53 | signals: 54 | 55 | 56 | public slots: 57 | void parentStatusItemChangedSlot(QStandardItem*); 58 | void childStatusItemChangedSlot(QStandardItem*); 59 | 60 | private slots: 61 | 62 | 63 | }; 64 | 65 | #endif // AUTORETRY_H 66 | -------------------------------------------------------------------------------- /src/fileoperations.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef FILEOPERATIONS_H 23 | #define FILEOPERATIONS_H 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | #include "kwooty_export.h" 30 | 31 | #include "utilities/utility.h" 32 | using namespace UtilityNamespace; 33 | 34 | class Core; 35 | class CentralWidget; 36 | 37 | class KWOOTY_EXPORT FileOperations : public QObject { 38 | 39 | Q_OBJECT 40 | 41 | public: 42 | 43 | FileOperations(Core*); 44 | void openFile(); 45 | void openFileWithFileMode(KUrl, UtilityNamespace::OpenFileMode); 46 | 47 | static bool isSplitFileFormat(const QFile&); 48 | 49 | private: 50 | Core* core; 51 | void openUrl(KUrl, bool&, UtilityNamespace::OpenFileMode); 52 | 53 | 54 | signals: 55 | 56 | public slots: 57 | 58 | 59 | 60 | }; 61 | 62 | #endif // FILEOPERATIONS_H 63 | 64 | -------------------------------------------------------------------------------- /src/extractrar.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef EXTRACTRAR_H 23 | #define EXTRACTRAR_H 24 | 25 | 26 | #include "extractbase.h" 27 | 28 | 29 | class ExtractRar : public ExtractBase 30 | { 31 | public: 32 | Q_OBJECT 33 | 34 | public: 35 | ExtractRar(RepairDecompressThread*); 36 | ~ExtractRar(); 37 | 38 | private: 39 | 40 | QStringList createProcessArguments(const QString&, const QString&, const bool&, const QString&) ; 41 | void extractUpdate(const QString&); 42 | void checkIfArchivePassworded(const QString&, bool&); 43 | void sendExtractProgramNotFoundNotification(); 44 | QString searchExtractProgram(); 45 | void emitStatusToAllArchives(const int&, const UtilityNamespace::ItemStatus, const UtilityNamespace::ItemTarget); 46 | 47 | 48 | signals: 49 | 50 | 51 | public slots: 52 | 53 | 54 | private slots: 55 | 56 | }; 57 | 58 | #endif // EXTRACTRAR_H 59 | -------------------------------------------------------------------------------- /src/shutdown/sessionbase.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SESSIONBASE_H 23 | #define SESSIONBASE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "shutdown/shutdownmanager.h" 29 | 30 | #include "utilities/utility.h" 31 | using namespace UtilityNamespace; 32 | 33 | class SessionBase : public QObject { 34 | 35 | Q_OBJECT 36 | 37 | public: 38 | 39 | SessionBase(ShutdownManager*); 40 | UtilityNamespace::SystemShutdownType getChosenShutdownType(); 41 | void launchSystemShutdown(); 42 | virtual QList retrieveAvailableShutdownMethods() = 0; 43 | 44 | 45 | 46 | protected: 47 | 48 | ShutdownManager* shutdownManager; 49 | 50 | virtual void requestShutdown() = 0; 51 | virtual void requestSuspend() = 0; 52 | 53 | 54 | signals: 55 | 56 | 57 | public slots: 58 | 59 | 60 | }; 61 | 62 | #endif // SESSIONBASE_H 63 | -------------------------------------------------------------------------------- /src/plugins/autoretry/autoretryplugin.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #include "autoretryplugin.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "plugin.h" 29 | #include "mainwindow.h" 30 | #include "core.h" 31 | 32 | 33 | K_PLUGIN_FACTORY(PluginFactory, registerPlugin();) 34 | K_EXPORT_PLUGIN(PluginFactory("kwooty_autoretryplugin")) 35 | 36 | 37 | AutoRetryPlugin::AutoRetryPlugin(QObject* parent, const QList&) : Plugin(PluginFactory::componentData(), parent) 38 | { 39 | 40 | } 41 | 42 | 43 | AutoRetryPlugin::~AutoRetryPlugin() 44 | { 45 | 46 | } 47 | 48 | 49 | 50 | void AutoRetryPlugin::load() { 51 | this->autoRetry = new AutoRetry(this); 52 | } 53 | 54 | void AutoRetryPlugin::unload() { 55 | delete this->autoRetry; 56 | } 57 | 58 | 59 | void AutoRetryPlugin::configUpdated() { 60 | this->autoRetry->settingsChanged(); 61 | } 62 | 63 | -------------------------------------------------------------------------------- /src/preferences/preferencesserver.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef PREFERENCESSERVER_H 22 | #define PREFERENCESSERVER_H 23 | 24 | #include 25 | 26 | #include 27 | 28 | #include "ui_serversettings.h" 29 | #include "ui_preferencesserver.h" 30 | 31 | class ServerTabWidget; 32 | 33 | 34 | class PreferencesServer : public QWidget, public Ui::PreferencesServer { 35 | 36 | Q_OBJECT 37 | 38 | public: 39 | 40 | 41 | 42 | PreferencesServer(KConfigDialog*); 43 | 44 | 45 | private: 46 | ServerTabWidget* tabWidget; 47 | KConfigDialog* dialog; 48 | 49 | void loadSettings(); 50 | void saveSettings(); 51 | void restorePreviousSettings(); 52 | void defaultSettings(); 53 | 54 | private slots: 55 | void configButtonClickedSlot(KDialog::ButtonCode); 56 | 57 | 58 | public slots: 59 | 60 | 61 | signals: 62 | void saveDataSignal(); 63 | 64 | 65 | }; 66 | 67 | #endif // PREFERENCESSERVER_H 68 | -------------------------------------------------------------------------------- /src/widgets/statusbarwidgetbase.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | 23 | #ifndef STATUSBARWIDGETBASE_H 24 | #define STATUSBARWIDGETBASE_H 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | #include "widgets/mystatusbar.h" 32 | 33 | class StatusBarWidgetBase : public QWidget { 34 | 35 | Q_OBJECT 36 | 37 | public: 38 | StatusBarWidgetBase(QWidget*, MyStatusBar::WidgetIdentity); 39 | MyStatusBar::WidgetIdentity getWidgetIdentity(); 40 | 41 | 42 | protected: 43 | 44 | void mouseDoubleClickEvent(QMouseEvent*); 45 | MyStatusBar::WidgetIdentity widgetIdentity; 46 | 47 | KIconLoader* iconLoader; 48 | QHBoxLayout* hBoxLayout; 49 | 50 | 51 | private: 52 | 53 | void setupConnections(); 54 | 55 | 56 | signals: 57 | 58 | void statusBarWidgetDblClickSignal(MyStatusBar::WidgetIdentity); 59 | 60 | 61 | public slots: 62 | 63 | 64 | }; 65 | 66 | #endif // STATUSBARWIDGETBASE_H 67 | -------------------------------------------------------------------------------- /src/preferences/preferencesprograms.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef PREFERENCESPROGRAMS_H 22 | #define PREFERENCESPROGRAMS_H 23 | 24 | #include 25 | #include 26 | #include "ui_preferencesprograms.h" 27 | 28 | 29 | class PreferencesPrograms : public QWidget, public Ui::PreferencesPrograms 30 | { 31 | 32 | Q_OBJECT 33 | 34 | 35 | public: 36 | PreferencesPrograms(); 37 | ~PreferencesPrograms(); 38 | 39 | private: 40 | KIconLoader* iconLoader; 41 | 42 | void setupConnections(); 43 | void displayProgramInfo(const bool, const QString&, QLabel*, QLabel*, const QString&); 44 | void enableGroupBox(bool, const QString&); 45 | QString buildNicePriorityToolTip(); 46 | 47 | public slots: 48 | void aboutToShowSettingsSlot(); 49 | 50 | private slots: 51 | void verifyProcessPriorityChangedSlot(); 52 | void extractProcessPriorityChangedSlot(); 53 | 54 | 55 | }; 56 | 57 | #endif // PREFERENCESPROGRAMS_H 58 | -------------------------------------------------------------------------------- /src/itempostdownloadupdater.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef ITEMPOSTDOWNLOADUPDATER_H 22 | #define ITEMPOSTDOWNLOADUPDATER_H 23 | 24 | #include "itemabstractupdater.h" 25 | #include "utilities/utility.h" 26 | using namespace UtilityNamespace; 27 | 28 | class StandardItemModel; 29 | class NzbFileData; 30 | class PostDownloadInfoData; 31 | 32 | 33 | class ItemPostDownloadUpdater : public ItemAbstractUpdater { 34 | 35 | public: 36 | 37 | ItemPostDownloadUpdater(ItemParentUpdater*); 38 | void updateItems(const PostDownloadInfoData&); 39 | void addFileTypeInfo(const PostDownloadInfoData&); 40 | 41 | private: 42 | 43 | void updateNzbChildrenItems(const QModelIndex&, const int, const int); 44 | void updateDecodeItems(const PostDownloadInfoData&); 45 | void updateRepairExtractItems(const PostDownloadInfoData&); 46 | void updateRepairExtractParentItems(const PostDownloadInfoData&); 47 | 48 | 49 | }; 50 | 51 | #endif // ITEMPOSTDOWNLOADUPDATER_H 52 | -------------------------------------------------------------------------------- /src/plugins/watchfolder/watchfolderplugin.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #include "watchfolderplugin.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "plugin.h" 29 | #include "mainwindow.h" 30 | #include "core.h" 31 | 32 | 33 | K_PLUGIN_FACTORY(PluginFactory, registerPlugin();) 34 | K_EXPORT_PLUGIN(PluginFactory("kwooty_watchfolderplugin")) 35 | 36 | 37 | WatchFolderPlugin::WatchFolderPlugin(QObject* parent, const QList&) : Plugin(PluginFactory::componentData(), parent) 38 | { 39 | 40 | } 41 | 42 | 43 | WatchFolderPlugin::~WatchFolderPlugin() 44 | { 45 | 46 | } 47 | 48 | 49 | 50 | void WatchFolderPlugin::load() { 51 | this->watchFolder = new WatchFolder(this); 52 | } 53 | 54 | void WatchFolderPlugin::unload() { 55 | delete this->watchFolder; 56 | } 57 | 58 | 59 | void WatchFolderPlugin::configUpdated() { 60 | this->watchFolder->settingsChanged(); 61 | } 62 | 63 | -------------------------------------------------------------------------------- /src/plugins/pluginmanager.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef PLUGINMANAGER_H 23 | #define PLUGINMANAGER_H 24 | 25 | 26 | #include 27 | 28 | #include 29 | 30 | #include "plugin.h" 31 | #include "kwooty_export.h" 32 | 33 | class MainWindow; 34 | 35 | 36 | class KWOOTY_EXPORT PluginManager : public QObject 37 | { 38 | 39 | Q_OBJECT 40 | 41 | public: 42 | 43 | PluginManager(MainWindow*); 44 | ~PluginManager(); 45 | QList getPluginInfoList(); 46 | void loadPlugins(); 47 | 48 | private: 49 | 50 | MainWindow* core; 51 | QList pluginInfoList; 52 | QMap loadedInfoPluginMap; 53 | 54 | void loadCurrentPlugin(const KPluginInfo&); 55 | void unloadCurrentPlugin(const KPluginInfo&); 56 | 57 | 58 | signals: 59 | 60 | public slots: 61 | 62 | void configCommittedSlot(const QByteArray&); 63 | 64 | 65 | private slots: 66 | 67 | }; 68 | 69 | #endif // PLUGINMANAGER_H 70 | -------------------------------------------------------------------------------- /src/shutdown/sessiongnome3.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SESSIONGNOME3_H 23 | #define SESSIONGNOME3_H 24 | 25 | 26 | #include "sessionbase.h" 27 | 28 | #include 29 | 30 | class SessionGnome3 : public SessionBase { 31 | 32 | 33 | public: 34 | 35 | // type of Dbus methods called : 36 | enum DbusMethodCall { 37 | DbusStopAllowed, 38 | DbusSuspendAllowed, 39 | DbusHibernateAllowed, 40 | DbusStop, 41 | DbusSuspend, 42 | DbusHibernate 43 | }; 44 | 45 | 46 | SessionGnome3(ShutdownManager*); 47 | QList retrieveAvailableShutdownMethods(); 48 | 49 | private: 50 | 51 | QMap methodCallEnumStringMap; 52 | QDBusInterface* dbusUpowerInterface; 53 | 54 | void requestShutdown(); 55 | void requestSuspend(); 56 | bool callDbusMethod(const SessionGnome3::DbusMethodCall); 57 | 58 | }; 59 | 60 | #endif // SESSIONGNOME3_H 61 | -------------------------------------------------------------------------------- /src/plugins/categories/categoriesplugin.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #include "categoriesplugin.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "plugin.h" 29 | #include "mainwindow.h" 30 | #include "core.h" 31 | 32 | 33 | K_PLUGIN_FACTORY(PluginFactory, registerPlugin();) 34 | K_EXPORT_PLUGIN(PluginFactory("kwooty_categoriesplugin")) 35 | 36 | 37 | CategoriesPlugin::CategoriesPlugin(QObject* parent, const QList&) : Plugin(PluginFactory::componentData(), parent) 38 | { 39 | 40 | } 41 | 42 | 43 | CategoriesPlugin::~CategoriesPlugin() 44 | { 45 | 46 | } 47 | 48 | 49 | 50 | void CategoriesPlugin::load() { 51 | this->categories = new Categories(this); 52 | } 53 | 54 | void CategoriesPlugin::unload() { 55 | 56 | this->categories->unload(); 57 | delete this->categories; 58 | 59 | } 60 | 61 | 62 | void CategoriesPlugin::configUpdated() { 63 | this->categories->settingsChanged(); 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/jobs/concatsplitfilesjob.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef CONCATSPLITFILESJOB_H 23 | #define CONCATSPLITFILESJOB_H 24 | 25 | #include 26 | #include 27 | 28 | #include "data/nzbfiledata.h" 29 | #include "utilities/utility.h" 30 | using namespace UtilityNamespace; 31 | 32 | class ExtractSplit; 33 | 34 | 35 | class ConcatSplitFilesJob : public QObject { 36 | 37 | Q_OBJECT 38 | 39 | public: 40 | ConcatSplitFilesJob(ExtractSplit*); 41 | ~ConcatSplitFilesJob(); 42 | 43 | 44 | private: 45 | QList nzbFileDataList; 46 | QString fileSavePath; 47 | QString joinFileName; 48 | QThread* dedicatedThread; 49 | 50 | bool joinSplittedFiles(); 51 | 52 | 53 | signals: 54 | void progressPercentSignal(int, QString); 55 | void resultSignal(int); 56 | 57 | 58 | public slots: 59 | void joinFilesSlot(QList, const QString, const QString); 60 | 61 | 62 | private slots: 63 | 64 | 65 | }; 66 | 67 | #endif // CONCATSPLITFILESJOB_H 68 | -------------------------------------------------------------------------------- /src/actions/actionmergemanager.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef ACTIONMERGEMANAGER_H 23 | #define ACTIONMERGEMANAGER_H 24 | 25 | #include "actionfilemanagerbase.h" 26 | 27 | 28 | class ActionMergeManager : public ActionFileManagerBase { 29 | 30 | Q_OBJECT 31 | 32 | public: 33 | ActionMergeManager(ActionsManager*); 34 | QList checkMergeCandidates(bool&); 35 | 36 | private: 37 | 38 | QString selectedItemUuid; 39 | QString targetItemUuid; 40 | 41 | bool isMergeAllowed(QStandardItem*) const; 42 | void processMerge(QStandardItem*, QStandardItem*); 43 | void launchProcess(); 44 | void setupConnections(); 45 | 46 | 47 | signals: 48 | void recalculateNzbSizeSignal(const QModelIndex); 49 | 50 | 51 | public slots: 52 | void mergeSubMenuAboutToShowSlot(); 53 | void actionTriggeredSlot(); 54 | void actionTriggeredSlot(QAction*); 55 | void handleResultSlot(KJob*); 56 | 57 | private slots: 58 | 59 | 60 | }; 61 | 62 | #endif // ACTIONMERGEMANAGER_H 63 | -------------------------------------------------------------------------------- /src/data/jobnotifydata.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef JOBNOTIFYDATA_H 23 | #define JOBNOTIFYDATA_H 24 | 25 | #include 26 | 27 | #include "utilities/utility.h" 28 | using namespace UtilityNamespace; 29 | 30 | class JobNotifyData 31 | { 32 | 33 | 34 | public: 35 | JobNotifyData(); 36 | 37 | QString getParentUniqueIdentifier() const; 38 | void setParentUniqueIdentifier(const QString&); 39 | UtilityNamespace::ItemStatus getStatus() const; 40 | void setStatus(const UtilityNamespace::ItemStatus&); 41 | QDateTime getDateTime() const; 42 | void setDateTime(const QDateTime&); 43 | QString getNzbFileName() const; 44 | void setNzbFileName(const QString&); 45 | bool operator==(const JobNotifyData&); 46 | 47 | 48 | private: 49 | 50 | QString parentUniqueIdentifier; 51 | UtilityNamespace::ItemStatus status; 52 | QDateTime dateTime; 53 | QString nzbFileName; 54 | 55 | 56 | signals: 57 | 58 | public slots: 59 | 60 | 61 | 62 | }; 63 | 64 | #endif // JOBNOTIFYDATA_H 65 | -------------------------------------------------------------------------------- /src/notificationmanager.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef NOTIFICATIONMANAGER_H 23 | #define NOTIFICATIONMANAGER_H 24 | 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | #include "utilities/utility.h" 31 | using namespace UtilityNamespace; 32 | 33 | class Core; 34 | 35 | 36 | class NotificationManager : public QObject { 37 | 38 | Q_OBJECT 39 | 40 | 41 | public: 42 | NotificationManager(Core*); 43 | 44 | private: 45 | 46 | Core* parent; 47 | QHash finishSatusTextMap; 48 | 49 | void init(); 50 | void setupConnections(); 51 | void sendEvent(const QString&, const QString&, KNotification::NotificationFlags = KNotification::CloseOnTimeout); 52 | 53 | 54 | 55 | signals: 56 | 57 | 58 | public slots: 59 | void jobFinishSlot(const UtilityNamespace::ItemStatus, const QString); 60 | void insufficientDiskSpaceSlot(const QString); 61 | 62 | private slots: 63 | 64 | }; 65 | 66 | #endif // NOTIFICATIONMANAGER_H 67 | -------------------------------------------------------------------------------- /src/widgets/textpushbuttonwidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef TEXTPUSHBUTTONWIDGET_H 23 | #define TEXTPUSHBUTTONWIDGET_H 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "utilities/utilityserverstatus.h" 31 | 32 | class TextPushButtonWidget : public QWidget { 33 | 34 | 35 | Q_OBJECT 36 | 37 | 38 | public: 39 | 40 | TextPushButtonWidget(QWidget*); 41 | 42 | void setIcon(const ServerConnectionIcon&); 43 | void setText(const QString&); 44 | QString getText() const; 45 | void showIcon(); 46 | void hideIcon(); 47 | 48 | 49 | 50 | protected: 51 | 52 | 53 | private: 54 | 55 | QLabel* textLabel; 56 | QPushButton* pushButton; 57 | QHBoxLayout* hBoxLayout; 58 | ServerConnectionIcon serverConnectionIcon; 59 | 60 | void setupConnections(); 61 | 62 | 63 | 64 | signals: 65 | 66 | void pressedSignal(); 67 | 68 | 69 | public slots: 70 | 71 | 72 | }; 73 | 74 | #endif // TEXTPUSHBUTTONWIDGET_H 75 | -------------------------------------------------------------------------------- /src/sidebar.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SIDEBAR_H 23 | #define SIDEBAR_H 24 | 25 | #include 26 | 27 | #include "utilities/utility.h" 28 | using namespace UtilityNamespace; 29 | 30 | 31 | class Core; 32 | class MainWindow; 33 | class SideBarWidget; 34 | class ServerManager; 35 | class ServerStatusWidget; 36 | 37 | 38 | class SideBar : public QObject { 39 | 40 | 41 | Q_OBJECT 42 | 43 | 44 | public: 45 | SideBar(MainWindow*); 46 | SideBarWidget* getSideBarWidget(); 47 | void saveState(); 48 | void loadState(); 49 | void serverStatisticsUpdate(const int); 50 | 51 | private: 52 | Core* core; 53 | SideBarWidget* sideBarWidget; 54 | ServerManager* serverManager; 55 | bool stateRestored; 56 | 57 | void createSideBarWidgets(); 58 | void setupConnections(); 59 | 60 | 61 | signals: 62 | 63 | 64 | public slots: 65 | void activeSlot(bool); 66 | void serverManagerSettingsChangedSlot(); 67 | 68 | 69 | private slots: 70 | 71 | 72 | 73 | }; 74 | 75 | #endif // SIDEBAR_H 76 | -------------------------------------------------------------------------------- /src/plugins/scheduler/schedulerplugin.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #include "schedulerplugin.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "plugin.h" 29 | #include "mainwindow.h" 30 | #include "core.h" 31 | 32 | 33 | K_PLUGIN_FACTORY(PluginFactory, registerPlugin();) 34 | K_EXPORT_PLUGIN(PluginFactory("kwooty_schedulerplugin")) 35 | 36 | 37 | SchedulerPlugin::SchedulerPlugin(QObject* parent, const QList&) : Plugin(PluginFactory::componentData(), parent) 38 | { 39 | 40 | } 41 | 42 | 43 | SchedulerPlugin::~SchedulerPlugin() 44 | { 45 | 46 | } 47 | 48 | 49 | 50 | void SchedulerPlugin::load() { 51 | 52 | this->scheduler = new Scheduler(this); 53 | } 54 | 55 | void SchedulerPlugin::unload() { 56 | 57 | // disable speed limit when plugin is unloaded : 58 | this->scheduler->disableSpeedLimit(); 59 | 60 | delete this->scheduler; 61 | 62 | } 63 | 64 | 65 | void SchedulerPlugin::configUpdated() { 66 | this->scheduler->settingsChanged(); 67 | } 68 | 69 | -------------------------------------------------------------------------------- /src/widgets/statusbarwidgetbase.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #include "statusbarwidgetbase.h" 23 | 24 | 25 | 26 | StatusBarWidgetBase::StatusBarWidgetBase(QWidget* parent, MyStatusBar::WidgetIdentity widgetIdentity) : QWidget(parent) { 27 | 28 | this->widgetIdentity = widgetIdentity; 29 | this->setupConnections(); 30 | 31 | } 32 | 33 | 34 | void StatusBarWidgetBase::setupConnections() { 35 | 36 | // notify status bar that double mouse click on widget has been caught : 37 | connect (this, 38 | SIGNAL(statusBarWidgetDblClickSignal(MyStatusBar::WidgetIdentity)), 39 | this->parent(), 40 | SLOT(statusBarWidgetDblClickSlot(MyStatusBar::WidgetIdentity))); 41 | 42 | 43 | } 44 | 45 | 46 | MyStatusBar::WidgetIdentity StatusBarWidgetBase::getWidgetIdentity() { 47 | return this->widgetIdentity; 48 | } 49 | 50 | 51 | void StatusBarWidgetBase::mouseDoubleClickEvent(QMouseEvent* event) { 52 | 53 | emit statusBarWidgetDblClickSignal(this->widgetIdentity); 54 | QWidget::mouseDoubleClickEvent(event); 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/segmentdecoderuuenc.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SEGMENTDECODERUUENC_H 23 | #define SEGMENTDECODERUUENC_H 24 | 25 | #include "segmentdecoderbase.h" 26 | 27 | class SegmentDecoderUUEnc : public SegmentDecoderBase 28 | { 29 | 30 | Q_OBJECT 31 | 32 | public: 33 | SegmentDecoderUUEnc(SegmentsDecoderThread*); 34 | ~SegmentDecoderUUEnc(); 35 | void decodeSegments(NzbFileData, const QString&); 36 | 37 | 38 | private: 39 | enum UUValues { 40 | UUMaxDecodedLineSize = 45, 41 | UUMaxEncodedLineSize = 61 42 | }; 43 | 44 | void decodeEncodedData(QFile&, SegmentData&, int&, const QByteArray& , bool&, bool&); 45 | QString searchPattern(QIODevice* segmentFile); 46 | bool decodeUUenc(const QByteArray&, QFile&, const int&); 47 | bool isUUEncodedLine(QByteArray&); 48 | void decodeProgression(PostDownloadInfoData&); 49 | bool decodeSegmentFiles(QFile&); 50 | 51 | 52 | signals: 53 | 54 | public slots: 55 | 56 | private slots: 57 | 58 | 59 | }; 60 | 61 | #endif // SEGMENTDECODERUUENC_H 62 | -------------------------------------------------------------------------------- /src/segmentdecoderbase.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SEGMENTDECODERBASE_H 23 | #define SEGMENTDECODERBASE_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include "data/nzbfiledata.h" 30 | #include "data/segmentdata.h" 31 | #include "data/postdownloadinfodata.h" 32 | #include "utilities/utility.h" 33 | using namespace UtilityNamespace; 34 | 35 | class Core; 36 | class SegmentsDecoderThread; 37 | 38 | 39 | class SegmentDecoderBase : public QObject { 40 | 41 | Q_OBJECT 42 | 43 | public: 44 | SegmentDecoderBase(SegmentsDecoderThread*); 45 | 46 | 47 | QString scanSegmentFiles(const NzbFileData&); 48 | QString scanCurrentSegment(SegmentData&); 49 | 50 | 51 | protected: 52 | virtual QString searchPattern(QIODevice*) = 0; 53 | virtual void decodeProgression(PostDownloadInfoData& decodeInfoData) = 0; 54 | 55 | SegmentsDecoderThread* segmentsDecoderThread; 56 | QList segmentDataList; 57 | QVariant parentIdentifer; 58 | bool crc32Match; 59 | 60 | 61 | signals: 62 | 63 | }; 64 | 65 | #endif // SEGMENTDECODERBASE_H 66 | -------------------------------------------------------------------------------- /src/plugins/categories/categoriesmanual.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef CATEGORIESMANUAL_H 23 | #define CATEGORIESMANUAL_H 24 | 25 | #include 26 | #include 27 | #include 28 | #include "categories.h" 29 | 30 | class Core; 31 | class StandardItemModel; 32 | class MyTreeView; 33 | 34 | class CategoriesManual : public QObject { 35 | 36 | Q_OBJECT 37 | 38 | public: 39 | CategoriesManual(Categories* parent); 40 | bool isManualFolderSelected(const QString&); 41 | QString getMoveFolderPath(const QString&); 42 | void unload(); 43 | 44 | 45 | private: 46 | 47 | void setupConnections(); 48 | void updateNzbFileNameToolTip(QStandardItem*, const QString& = QString()); 49 | bool isActionAllowed(QStandardItem*) const; 50 | 51 | Core* core; 52 | MyTreeView* treeView; 53 | StandardItemModel* downloadModel; 54 | QHash uuidFolderMap; 55 | 56 | 57 | signals: 58 | 59 | 60 | public slots: 61 | void addExternalActionSlot(KMenu*, QStandardItem*); 62 | void manualTransferFolderSlot(); 63 | 64 | 65 | }; 66 | 67 | #endif // CATEGORIESMANUAL_H 68 | -------------------------------------------------------------------------------- /src/itemchildrenmanager.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef ITEMCHILDRENMANAGER_H 22 | #define ITEMCHILDRENMANAGER_H 23 | 24 | #include 25 | #include 26 | #include "itemabstractupdater.h" 27 | #include "utilities/utility.h" 28 | using namespace UtilityNamespace; 29 | 30 | class Core; 31 | class ItemParentUpdater; 32 | 33 | 34 | class ItemChildrenManager : public ItemAbstractUpdater { 35 | 36 | Q_OBJECT 37 | 38 | public: 39 | ItemChildrenManager(Core*, ItemParentUpdater*); 40 | bool resetItemStatusIfExtractFail(const QModelIndex); 41 | void resetFinishedChildrenItemToDecodeFinish(QStandardItem*); 42 | void resetItemStatusToTarget(QStandardItem*, const ItemStatus&); 43 | 44 | private: 45 | Core* parent; 46 | bool smartPar2Download; 47 | 48 | void setupConnections(); 49 | 50 | 51 | signals: 52 | void downloadWaitingPar2Signal(); 53 | 54 | 55 | public slots: 56 | void changePar2FilesStatusSlot(const QModelIndex, UtilityNamespace::ItemStatus); 57 | void settingsChangedSlot(); 58 | 59 | 60 | private slots: 61 | 62 | 63 | }; 64 | 65 | #endif // ITEMCHILDRENMANAGER_H 66 | -------------------------------------------------------------------------------- /src/data/globalfiledata.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef GLOBALFILEDATA_H 22 | #define GLOBALFILEDATA_H 23 | 24 | 25 | #include "nzbfiledata.h" 26 | #include "itemstatusdata.h" 27 | #include "utilities/utility.h" 28 | using namespace UtilityNamespace; 29 | 30 | 31 | class GlobalFileData 32 | { 33 | 34 | public: 35 | 36 | GlobalFileData(const NzbFileData&, const ItemStatusData& itemStatusData = ItemStatusData(), const int& progressValue = 0); 37 | GlobalFileData(); 38 | ~GlobalFileData(); 39 | 40 | NzbFileData getNzbFileData() const; 41 | void setNzbFileData(const NzbFileData&); 42 | 43 | ItemStatusData getItemStatusData() const; 44 | void setItemStatusData(const ItemStatusData&); 45 | 46 | int getProgressValue() const; 47 | void setProgressValue(const int&); 48 | 49 | 50 | private: 51 | NzbFileData nzbFileData; 52 | ItemStatusData itemStatusData; 53 | int progressValue; 54 | 55 | 56 | }; 57 | 58 | 59 | QDataStream& operator<<(QDataStream&, const GlobalFileData&); 60 | QDataStream& operator>>(QDataStream&, GlobalFileData&); 61 | 62 | Q_DECLARE_METATYPE(GlobalFileData); 63 | 64 | #endif // GLOBALFILEDATA_H 65 | -------------------------------------------------------------------------------- /src/plugins/categories/categoriesfilehandler.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef CATEGORIESFILEHANDLER_H 23 | #define CATEGORIESFILEHANDLER_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | class CategoriesModel; 30 | class MimeData; 31 | 32 | 33 | class CategoriesFileHandler : public QObject { 34 | 35 | Q_OBJECT 36 | 37 | public: 38 | 39 | CategoriesFileHandler(QObject*); 40 | CategoriesFileHandler(); 41 | 42 | CategoriesModel* loadModelFromFile(QObject*); 43 | QStringList retrieveMainTypeList(); 44 | void saveModelToFile(CategoriesModel*); 45 | void addListToModel(CategoriesModel*, const QStringList&); 46 | void reloadModel(CategoriesModel*); 47 | 48 | 49 | private: 50 | 51 | void fillModel(CategoriesModel*); 52 | QString retrieveCategoriesFilePath(); 53 | QString readNextCharacters(QXmlStreamReader&); 54 | bool isStartElement(QXmlStreamReader&, const QString&); 55 | bool isEndElement(QXmlStreamReader&, const QString&); 56 | 57 | 58 | signals: 59 | 60 | 61 | public slots: 62 | 63 | }; 64 | 65 | #endif // CATEGORIESFILEHANDLER_H 66 | -------------------------------------------------------------------------------- /src/itemdownloadupdater.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef ITEMDOWNLOADUPDATER_H 22 | #define ITEMDOWNLOADUPDATER_H 23 | 24 | #include 25 | #include 26 | #include "data/nzbfiledata.h" 27 | #include "itemabstractupdater.h" 28 | 29 | class StandardItemModel; 30 | class ItemStatusData; 31 | class SegmentData; 32 | 33 | 34 | class ItemDownloadUpdater : public ItemAbstractUpdater 35 | { 36 | 37 | Q_OBJECT 38 | 39 | public: 40 | ItemDownloadUpdater(ItemParentUpdater*); 41 | void updateItems(const QModelIndex&, const NzbFileData&); 42 | 43 | private: 44 | ItemStatusData updateStatusNzbChildrenItem(ItemStatusData&, const int&); 45 | ItemStatusData updateDataStatus(ItemStatusData&); 46 | ItemStatusData postDownloadProcessing(const QModelIndex&, const NzbFileData&, ItemStatusData&); 47 | void updateNzbChildrenItems(const NzbFileData&, const QModelIndex&); 48 | void countGlobalItemStatus(const SegmentData&); 49 | 50 | 51 | signals: 52 | void statusBarDecrementSignal(quint64, int); 53 | void decodeSegmentsSignal(NzbFileData); 54 | 55 | public slots: 56 | 57 | private slots: 58 | 59 | }; 60 | 61 | #endif // ITEMDOWNLOADUPDATER_H 62 | -------------------------------------------------------------------------------- /src/plugins/categories/utilitycategories.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef UTILITYCATEGORIES_H 23 | #define UTILITYCATEGORIES_H 24 | 25 | #include 26 | 27 | #include 28 | #include "categoriesmodel.h" 29 | #include "mimedata.h" 30 | 31 | class UtilityCategories { 32 | 33 | public: 34 | UtilityCategories(); 35 | 36 | static QString buildSubcategoryPattern(const QString&); 37 | static QString buildMaincategoryPattern(const QString&); 38 | static QString buildFullCategoryPattern(CategoriesModel*, QStandardItem*, const QString&); 39 | static QString builExtensionStringFromMimeType(KSharedPtr< KMimeType>); 40 | static QString buildFullCategoryPattern(const QString&, const QString&); 41 | static QString buildTextToDisplay(const QString&, const QString&); 42 | static QString buildTextToDisplayFromFullCategoryPattern(const QString&); 43 | static void builPartialMimeData(MimeData&); 44 | static QStringList retrieveMainCategoryList(); 45 | static QStringList retrieveFilteredMainCategoryList(CategoriesModel*); 46 | 47 | 48 | private: 49 | static QString buildPattern(const QString&, const int&); 50 | 51 | }; 52 | 53 | #endif // UTILITYCATEGORIES_H 54 | -------------------------------------------------------------------------------- /src/plugins/scheduler/schedulerfilehandler.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SCHEDULERFILEHANDLER_H 23 | #define SCHEDULERFILEHANDLER_H 24 | 25 | #include 26 | #include 27 | 28 | 29 | namespace SchedulerNamespace { 30 | 31 | enum DownloadLimitStatus { 32 | NoLimitDownload, 33 | LimitDownload, 34 | DisabledDownload 35 | }; 36 | 37 | 38 | // custom roles used for storing data in items : 39 | enum SchedulerRoles { 40 | DownloadLimitRole = Qt::UserRole + 1 41 | }; 42 | 43 | static const int HEADER_ROW_SCHEDULER = 0; 44 | static const int ROW_NUMBER_SCHEDULER = 8; 45 | static const int COLUMN_NUMBER_SCHEDULER = 48; 46 | 47 | 48 | } 49 | 50 | 51 | class SchedulerFileHandler : public QObject { 52 | 53 | Q_OBJECT 54 | 55 | 56 | public: 57 | SchedulerFileHandler(QObject*); 58 | SchedulerFileHandler(); 59 | 60 | QStandardItemModel* loadModelFromFile(QObject*); 61 | void reloadModel(QStandardItemModel*); 62 | void saveModelToFile(QStandardItemModel*); 63 | 64 | private: 65 | QString retrieveSchedulerFilePath(); 66 | void fillModel(QStandardItemModel*); 67 | 68 | 69 | signals: 70 | 71 | public slots: 72 | 73 | }; 74 | 75 | #endif // SCHEDULERFILEHANDLER_H 76 | -------------------------------------------------------------------------------- /src/plugins/autoretry/preferencesautoretry.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #include "preferencesautoretry.h" 22 | 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include "kwooty_autoretrysettings.h" 30 | #include 31 | 32 | 33 | K_PLUGIN_FACTORY(PluginFactory, registerPlugin();) 34 | K_EXPORT_PLUGIN(PluginFactory("kwooty_autoretrysettings")) 35 | 36 | 37 | PreferencesAutoRetry::PreferencesAutoRetry(QWidget* parent, const QVariantList& args) : 38 | KCModule(PluginFactory::componentData(), parent, args) { 39 | 40 | // set layout config layout : 41 | QHBoxLayout* layout = new QHBoxLayout(this); 42 | layout->setMargin(0); 43 | 44 | // setup ui file : 45 | QWidget* widget = new QWidget(this); 46 | this->preferencesAutoRetryUi.setupUi(widget); 47 | layout->addWidget(widget); 48 | 49 | // add main kconfigskeleton : 50 | this->addConfig(AutoRetrySettings::self(), widget); 51 | 52 | } 53 | 54 | 55 | PreferencesAutoRetry::~PreferencesAutoRetry() { 56 | 57 | } 58 | 59 | 60 | void PreferencesAutoRetry::load(){ 61 | KCModule::load(); 62 | } 63 | 64 | 65 | void PreferencesAutoRetry::save(){ 66 | KCModule::save(); 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/data/segmentinfodata.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SEGMENTINFODATA_H 23 | #define SEGMENTINFODATA_H 24 | 25 | #include 26 | #include 27 | 28 | class SegmentInfoData { 29 | 30 | public: 31 | SegmentInfoData(); 32 | SegmentInfoData(const QString&, const int&, const int&); 33 | void reset(); 34 | 35 | void setNzbFileName(const QString&); 36 | QString getNzbFileName() const; 37 | 38 | QString getTemporaryFileName() const; 39 | void setTemporaryFileName(const QString&); 40 | 41 | QString getDestinationFileSavePath() const; 42 | void setDestinationFileSavePath(const QString&); 43 | 44 | void setNzbRowModelPosition(const int&); 45 | int getNzbRowModelPosition() const; 46 | 47 | void setFileNameItemRowModelPosition(const int&); 48 | int getFileNameItemRowModelPosition() const; 49 | 50 | void setBytesDownloaded(const int&); 51 | int getBytesDownloaded() const; 52 | 53 | 54 | private: 55 | QString nzbFileName; 56 | QString temporaryFileName; 57 | QString destinationFileSavePath; 58 | int nzbRowModelPosition; 59 | int fileNameItemRowModelPosition; 60 | int bytesDownloaded; 61 | 62 | 63 | signals: 64 | 65 | public slots: 66 | 67 | }; 68 | 69 | #endif // SEGMENTINFODATA_H 70 | -------------------------------------------------------------------------------- /src/data/jobnotifydata.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #include "jobnotifydata.h" 23 | 24 | JobNotifyData::JobNotifyData(){ 25 | 26 | } 27 | 28 | 29 | QString JobNotifyData::getParentUniqueIdentifier() const { 30 | return this->parentUniqueIdentifier; 31 | } 32 | 33 | void JobNotifyData::setParentUniqueIdentifier(const QString& parentUniqueIdentifier) { 34 | this->parentUniqueIdentifier = parentUniqueIdentifier; 35 | } 36 | 37 | 38 | UtilityNamespace::ItemStatus JobNotifyData::getStatus() const { 39 | return this->status; 40 | } 41 | 42 | void JobNotifyData::setStatus(const UtilityNamespace::ItemStatus& status) { 43 | this->status = status; 44 | } 45 | 46 | 47 | QDateTime JobNotifyData::getDateTime() const { 48 | return this->dateTime; 49 | } 50 | 51 | void JobNotifyData::setDateTime(const QDateTime& dateTime) { 52 | this->dateTime = dateTime; 53 | } 54 | 55 | 56 | QString JobNotifyData::getNzbFileName() const { 57 | return this->nzbFileName; 58 | } 59 | 60 | void JobNotifyData::setNzbFileName(const QString& nzbFileName) { 61 | this->nzbFileName = nzbFileName; 62 | } 63 | 64 | bool JobNotifyData::operator==(const JobNotifyData& jobNotifyDataToCompare) { 65 | return (this->getParentUniqueIdentifier() == jobNotifyDataToCompare.getParentUniqueIdentifier()); 66 | } 67 | -------------------------------------------------------------------------------- /src/plugins/watchfolder/preferenceswatchfolder.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | PreferencesWatchFolder 4 | 5 | 6 | 7 | 0 8 | 0 9 | 421 10 | 92 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Watch folder: 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 300 31 | 0 32 | 33 | 34 | 35 | Set download folder 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | Copy nzb file in destination folder 51 | 52 | 53 | Copy nzb file in destination folder 54 | 55 | 56 | 57 | 58 | 59 | 60 | Suppress nzb file from watch folder when enqueued 61 | 62 | 63 | Suppress nzb file from watch folder when enqueued 64 | 65 | 66 | 67 | 68 | 69 | 70 | Qt::Vertical 71 | 72 | 73 | 74 | 20 75 | 13 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | KUrlRequester 85 | QFrame 86 |
kurlrequester.h
87 | 1 88 |
89 |
90 | 91 | 92 |
93 | -------------------------------------------------------------------------------- /src/plugins/watchfolder/watchfolder.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef WATCHFOLDER_H 23 | #define WATCHFOLDER_H 24 | 25 | #include 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #include "utilities/utility.h" 36 | using namespace UtilityNamespace; 37 | 38 | class Core; 39 | class WatchFolderPlugin; 40 | 41 | class WatchFolder : public QObject 42 | { 43 | 44 | Q_OBJECT 45 | 46 | public: 47 | WatchFolder(WatchFolderPlugin*); 48 | ~WatchFolder(); 49 | void settingsChanged(); 50 | 51 | 52 | private: 53 | static const int MAX_LIST_SIZE = 10; 54 | 55 | KDirWatch* kDirWatch; 56 | Core* core; 57 | QTimer* fileCompleteTimer; 58 | QStringList nzbFileList; 59 | QHash nzbFilePathlastEnqueuedMap; 60 | QSet nzbFileInWatchFolderSet; 61 | QString currentWatchDir; 62 | bool firstEnqueueMethod; 63 | 64 | void setupConnections(); 65 | QSet getNzbFileSetFromWatchFolder(); 66 | void appendFileToList(const QString&); 67 | 68 | 69 | signals: 70 | 71 | 72 | public slots: 73 | 74 | 75 | private slots: 76 | void watchFileSlot(const QString&); 77 | void fileCompleteTimerSlot(); 78 | 79 | 80 | }; 81 | 82 | #endif // WATCHFOLDER_H 83 | -------------------------------------------------------------------------------- /src/plugins/categories/mimedata.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef MIMEDATA_H 23 | #define MIMEDATA_H 24 | 25 | #include "utilities/utility.h" 26 | using namespace UtilityNamespace; 27 | 28 | 29 | class MimeData { 30 | 31 | public: 32 | 33 | // category hierarchy : 34 | enum HierarchyCategory { 35 | MainCategory, 36 | SubCategory 37 | }; 38 | 39 | MimeData(MimeData::HierarchyCategory, const QString& = QString()); 40 | MimeData(); 41 | 42 | QString getMainCategory() const; 43 | void setMainCategory(const QString&); 44 | 45 | QString getSubCategory() const; 46 | void setSubCategory(const QString&); 47 | 48 | void setPatterns(const QString&); 49 | QString getPatterns() const; 50 | 51 | void setMoveFolderPath(const QString&); 52 | QString getMoveFolderPath() const; 53 | 54 | void setComments(const QString&); 55 | QString getComments() const; 56 | 57 | void setDisplayedText(const QString&); 58 | QString getDisplayedText(); 59 | 60 | bool isCategoryMatch(const QString&); 61 | 62 | 63 | private: 64 | 65 | HierarchyCategory hierarchyCategory; 66 | QString mainCategory; 67 | QString subCategory; 68 | QString patterns; 69 | QString moveFolderPath; 70 | QString comments; 71 | QString displayedText; 72 | 73 | 74 | }; 75 | 76 | Q_DECLARE_METATYPE(MimeData); 77 | 78 | #endif // MIMEDATA_H 79 | -------------------------------------------------------------------------------- /src/observers/clientsobserver.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef CLIENTSOBSERVER_H 23 | #define CLIENTSOBSERVER_H 24 | 25 | 26 | #include "clientsobserverbase.h" 27 | 28 | class Core; 29 | class StatsInfoBuilder; 30 | 31 | 32 | class ClientsObserver : public ClientsObserverBase 33 | { 34 | Q_OBJECT 35 | 36 | 37 | public: 38 | ClientsObserver(Core*); 39 | StatsInfoBuilder* getStatsInfoBuilder() const; 40 | void fullFileSizeUpdate(const quint64, const quint64); 41 | void sendFullUpdate(); 42 | quint64 getTotalSize() const; 43 | void resetTotalBytesDownloaded(); 44 | bool isSingleServer(QString&) const; 45 | bool isSslActive() const; 46 | 47 | 48 | private: 49 | 50 | Core* parent; 51 | StatsInfoBuilder* statsInfoBuilder; 52 | quint64 totalFiles; 53 | quint64 totalSize; 54 | 55 | void resetVariables(); 56 | 57 | 58 | 59 | signals: 60 | void updateConnectionStatusSignal(); 61 | void updateFileSizeInfoSignal(const quint64, const quint64); 62 | 63 | 64 | public slots: 65 | 66 | void nntpClientSpeedSlot(const int); 67 | void connectionStatusSlot(const int); 68 | void encryptionStatusSlot(const bool, const QString, const bool, const QString, const QStringList); 69 | void nntpErrorSlot(const int); 70 | void decrementSlot(const quint64, const int); 71 | 72 | 73 | 74 | 75 | 76 | }; 77 | 78 | #endif // CLIENTSOBSERVER_H 79 | -------------------------------------------------------------------------------- /src/plugins/watchfolder/preferenceswatchfolder.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #include "preferenceswatchfolder.h" 22 | 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include "kwooty_watchfoldersettings.h" 30 | #include 31 | 32 | 33 | K_PLUGIN_FACTORY(PluginFactory, registerPlugin();) 34 | K_EXPORT_PLUGIN(PluginFactory("kwooty_watchfoldersettings")) 35 | 36 | 37 | PreferencesWatchFolder::PreferencesWatchFolder(QWidget* parent, const QVariantList& args) : 38 | KCModule(PluginFactory::componentData(), parent, args) { 39 | 40 | // set layout config layout : 41 | QHBoxLayout* layout = new QHBoxLayout(this); 42 | layout->setMargin(0); 43 | 44 | // setup ui file : 45 | QWidget* widget = new QWidget(this); 46 | this->preferencesWatchFolderUi.setupUi(widget); 47 | layout->addWidget(widget); 48 | 49 | // add main kconfigskeleton : 50 | this->addConfig(WatchFolderSettings::self(), widget); 51 | 52 | // set folder mode : 53 | this->preferencesWatchFolderUi.kcfg_watchFolder->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly); 54 | 55 | 56 | } 57 | 58 | 59 | PreferencesWatchFolder::~PreferencesWatchFolder() { 60 | 61 | } 62 | 63 | 64 | void PreferencesWatchFolder::load(){ 65 | KCModule::load(); 66 | } 67 | 68 | 69 | void PreferencesWatchFolder::save(){ 70 | KCModule::save(); 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/actions/actionbuttonsmanager.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef ACTIONBUTTONSMANAGER_H 23 | #define ACTIONBUTTONSMANAGER_H 24 | 25 | #include 26 | 27 | #include "utilities/utility.h" 28 | using namespace UtilityNamespace; 29 | 30 | 31 | class ActionsManager; 32 | class Core; 33 | class MyTreeView; 34 | class StandardItemModel; 35 | class StandardItemModelQuery; 36 | 37 | class ActionButtonsManager : public QObject { 38 | 39 | Q_OBJECT 40 | 41 | public: 42 | ActionButtonsManager(ActionsManager*); 43 | 44 | 45 | private: 46 | ActionsManager* actionsManager; 47 | Core* core; 48 | MyTreeView* treeView; 49 | StandardItemModel* downloadModel; 50 | StandardItemModelQuery* downloadModelQuery; 51 | 52 | 53 | signals: 54 | void setMoveButtonEnabledSignal(bool); 55 | void setPauseButtonEnabledSignal(bool); 56 | void setPauseAllButtonEnabledSignal(bool); 57 | void setStartButtonEnabledSignal(bool); 58 | void setStartAllButtonEnabledSignal(bool); 59 | void setRemoveButtonEnabledSignal(bool); 60 | void setRetryButtonEnabledSignal(bool); 61 | void setMergeNzbButtonEnabledSignal(bool); 62 | void setRenameNzbButtonEnabledSignal(bool); 63 | void setManualExtractActionSignal(bool); 64 | void setRemoveDeleteFileButtonEnabledSignal(bool); 65 | 66 | 67 | public slots: 68 | void selectedItemSlot(); 69 | 70 | }; 71 | 72 | #endif // ACTIONBUTTONSMANAGER_H 73 | -------------------------------------------------------------------------------- /src/widgets/sidebarwidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef SIDEBARWIDGET_H 22 | #define SIDEBARWIDGET_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "utilities/utilityserverstatus.h" 29 | 30 | class MainWindow; 31 | 32 | 33 | class SideBarWidget : public QWidget { 34 | 35 | Q_OBJECT 36 | 37 | public: 38 | SideBarWidget(QWidget*); 39 | 40 | void addTab(QWidget*, const ServerConnectionIcon&, const QString&); 41 | void removeTabAndWidgetByIndex(int); 42 | void removeTabByWidget(QWidget*); 43 | void removeLast(); 44 | int count() const; 45 | QWidget* widget(const int& index); 46 | int indexOf(QWidget*) const; 47 | int currentIndex() const; 48 | void setDisplay(const bool&); 49 | bool isDisplayed() const; 50 | void updateIconByIndex(const int&, const ServerConnectionIcon&); 51 | void updateTextByIndex(const int&, const QString&); 52 | void updateToolTipByIndex(const int&, const QString&); 53 | void activeDefaultTab(const int&); 54 | bool isOnlyTabDisplayed() const; 55 | void displayTabOnly(); 56 | 57 | private: 58 | QStackedWidget* stackedWidget; 59 | KMultiTabBar* multiTabBar; 60 | QHash indexServerIconMap; 61 | bool display; 62 | 63 | 64 | public slots: 65 | 66 | 67 | private slots: 68 | void tabClickedSlot(const int&); 69 | 70 | }; 71 | 72 | #endif // SIDEBARWIDGET_H 73 | -------------------------------------------------------------------------------- /src/systray.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SYSTRAY_H 23 | #define SYSTRAY_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #include "utilities/utility.h" 30 | using namespace UtilityNamespace; 31 | 32 | class QueueFileObserver; 33 | class ClientsObserver; 34 | class StatsInfoBuilder; 35 | class MainWindow; 36 | 37 | 38 | class SysTray : public KStatusNotifierItem 39 | { 40 | 41 | Q_OBJECT 42 | 43 | public: 44 | SysTray(MainWindow*); 45 | 46 | 47 | private: 48 | 49 | MainWindow* parent; 50 | QueueFileObserver* queueFileObserver; 51 | ClientsObserver* clientsObserver; 52 | StatsInfoBuilder* statsInfoBuilder; 53 | QPixmap normalBaseIcon; 54 | QPixmap grayedBaseIcon; 55 | QPixmap renderedIcon; 56 | int oldMergePos; 57 | 58 | bool updateIconStatus(const UtilityNamespace::ItemStatus&); 59 | bool blendOverlay(const QPixmap&); 60 | void setupConnections(); 61 | void setupActions(); 62 | void initPixmaps(); 63 | void initShow(); 64 | void updateIconProgress(const int&); 65 | void createToolTip(); 66 | 67 | signals: 68 | 69 | 70 | public slots: 71 | 72 | void progressUpdateSlot(const int); 73 | void statusUpdateSlot(const UtilityNamespace::ItemStatus); 74 | void updateDownloadSpeedInfoSlot(); 75 | void updateConnectionStatusSlot(); 76 | 77 | private slots: 78 | 79 | 80 | 81 | 82 | 83 | }; 84 | 85 | #endif // SYSTRAY_H 86 | -------------------------------------------------------------------------------- /src/utilities/utilityserverstatus.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef UTILITYSERVERSTATUS_H 23 | #define UTILITYSERVERSTATUS_H 24 | 25 | #include 26 | 27 | #include "observers/clientsobserverbase.h" 28 | 29 | 30 | namespace UtilityServerStatusNamespace 31 | { 32 | 33 | // process priority : 34 | enum ServerConnectionIcon { 35 | InitIcon, 36 | DisconnectedIcon, 37 | ConnectedNormalIcon, 38 | ConnectedEncryptedIcon, 39 | ConnectedEncryptedOverlayIcon, 40 | ConnectedDownloadingIcon 41 | }; 42 | 43 | 44 | } 45 | 46 | using namespace UtilityServerStatusNamespace; 47 | 48 | 49 | class UtilityServerStatus { 50 | 51 | public: 52 | 53 | UtilityServerStatus(); 54 | 55 | enum EncryptionMethodDisplay { 56 | DisplayEncryptionMethod, 57 | DoNotDisplayEncryptionMethod 58 | }; 59 | 60 | static KIcon getConnectionIcon(const ServerConnectionIcon&); 61 | static QPixmap getConnectionPixmap(const ServerConnectionIcon&); 62 | static ServerConnectionIcon buildConnectionStringFromStatus(const ClientsObserverBase*, QString&, EncryptionMethodDisplay = DisplayEncryptionMethod); 63 | static QString buildSslHandshakeStatus(const ClientsObserverBase*); 64 | static QString buildConnectionToolTip(const ClientsObserverBase*, const QString&, const QString&); 65 | static QString getServerModeString(UtilityNamespace::BackupServerMode); 66 | 67 | 68 | private: 69 | 70 | 71 | }; 72 | 73 | #endif // UTILITYSERVERSTATUS_H 74 | -------------------------------------------------------------------------------- /src/observers/clientsobserverbase.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef CLIENTSOBSERVERBASE_H 23 | #define CLIENTSOBSERVERBASE_H 24 | 25 | #include 26 | #include 27 | 28 | #include "utilities/utility.h" 29 | using namespace UtilityNamespace; 30 | 31 | class ClientsObserverBase : public QObject 32 | { 33 | 34 | Q_OBJECT 35 | public: 36 | 37 | ClientsObserverBase(QObject*); 38 | int getTotalConnections() const; 39 | bool isCertificateVerified() const; 40 | int getNttpErrorStatus() const; 41 | QString getEncryptionMethod() const; 42 | QString getIssuerOrgranisation() const; 43 | QStringList getSslErrors() const; 44 | quint64 getTotalBytesDownloaded() const; 45 | bool isConnected() const; 46 | virtual bool isSslActive() const = 0; 47 | 48 | 49 | protected: 50 | quint64 totalBytesDownloaded; 51 | QStringList sslErrors; 52 | QString encryptionMethod; 53 | QString issuerOrgranisation; 54 | int totalConnections; 55 | int nttpErrorStatus; 56 | bool sslActive; 57 | bool certificateVerified; 58 | 59 | void resetVariables(); 60 | void addBytesDownloaded(const int&); 61 | void updateTotalConnections(const int&); 62 | void setNntpErrorStatus(const int&); 63 | void setSslHandshakeParameters(const bool&, const QString&, const bool&, const QString&, const QStringList&); 64 | 65 | 66 | private: 67 | 68 | 69 | signals: 70 | 71 | public slots: 72 | 73 | 74 | protected slots: 75 | 76 | 77 | }; 78 | 79 | #endif // CLIENTSOBSERVERBASE_H 80 | -------------------------------------------------------------------------------- /src/widgets/serverpreferenceswidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SERVERPREFERENCESWIDGET_H 23 | #define SERVERPREFERENCESWIDGET_H 24 | 25 | #include 26 | 27 | #include "ui_serversettings.h" 28 | #include "data/serverdata.h" 29 | #include "servertabwidget.h" 30 | 31 | class PreferencesServer; 32 | class ServerTabWidget; 33 | 34 | 35 | class ServerPreferencesWidget : public QWidget { 36 | 37 | Q_OBJECT 38 | 39 | 40 | public: 41 | ServerPreferencesWidget(ServerTabWidget*, PreferencesServer*, int, const ServerTabWidget::ServerNameQuery); 42 | ~ServerPreferencesWidget(); 43 | 44 | void setData(const int&); 45 | ServerData getData(); 46 | int getTabIndex(); 47 | void setGroupBoxTitle(const int&); 48 | 49 | private: 50 | Ui_ServerSettings* serverSettingsUi; 51 | PreferencesServer* preferencesServer; 52 | ServerTabWidget* serverTabWidget; 53 | int tabIndex; 54 | 55 | bool checkFormText(const QString&); 56 | void setupConnections(); 57 | void setupButtons(); 58 | void hideWidgets(const int&) ; 59 | void enableWidgets(const bool&); 60 | void fillWarningLabel(QLabel*, const QString&); 61 | void clearWarningLabel(QLabel*); 62 | 63 | 64 | signals: 65 | 66 | public slots: 67 | 68 | private slots: 69 | void portValueChangedSlot(int); 70 | void valueChangedSlot(); 71 | void serverModeValueChangedSlot(int); 72 | void pushButtonInfoClickedSlot(); 73 | void formEditingFinishedSlot(); 74 | 75 | 76 | 77 | }; 78 | 79 | #endif // SERVERPREFERENCESWIDGET_H 80 | -------------------------------------------------------------------------------- /src/actions/actionfilemanagerbase.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2013 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef ACTIONFILEMANAGERBASE_H 23 | #define ACTIONFILEMANAGERBASE_H 24 | 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | #include 31 | #include 32 | 33 | #include "core.h" 34 | #include "mainwindow.h" 35 | #include "actionsmanager.h" 36 | #include "standarditemmodel.h" 37 | #include "servermanager.h" 38 | #include "segmentbuffer.h" 39 | #include "widgets/mytreeview.h" 40 | #include "widgets/centralwidget.h" 41 | 42 | #include "utilities/utility.h" 43 | using namespace UtilityNamespace; 44 | 45 | 46 | class ActionFileManagerBase : public QObject { 47 | 48 | Q_OBJECT 49 | 50 | public: 51 | 52 | ActionFileManagerBase(ActionsManager*); 53 | 54 | protected: 55 | 56 | enum ActionFileStep { 57 | ActionFileRequested, 58 | ActionFileProcessing, 59 | ActionFileIdle 60 | }; 61 | 62 | Core* core; 63 | MyTreeView* treeView; 64 | SegmentBuffer* segmentBuffer; 65 | ActionsManager* actionsManager; 66 | StandardItemModel* downloadModel; 67 | ActionFileStep actionFileStep; 68 | 69 | void setupConnections(); 70 | void displayMessage(const QString&); 71 | virtual void launchProcess() = 0; 72 | 73 | 74 | signals: 75 | 76 | public slots: 77 | 78 | void processFileSlot(); 79 | virtual void actionTriggeredSlot() = 0; 80 | 81 | protected slots: 82 | 83 | virtual void handleResultSlot(KJob*) = 0; 84 | 85 | }; 86 | 87 | #endif // ACTIONFILEMANAGERBASE_H 88 | 89 | -------------------------------------------------------------------------------- /src/data/serverdata.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SERVERDATA_H 23 | #define SERVERDATA_H 24 | 25 | #include 26 | 27 | class ServerData { 28 | 29 | public: 30 | ServerData(); 31 | 32 | void setServerId(const int&); 33 | int getServerId() const; 34 | 35 | void setServerName(const QString&); 36 | QString getServerName() const; 37 | 38 | void setHostName(const QString&); 39 | QString getHostName() const; 40 | 41 | void setLogin(const QString&); 42 | QString getLogin() const; 43 | 44 | void setPassword(const QString&); 45 | QString getPassword() const; 46 | 47 | void setPort(const uint&); 48 | uint getPort() const; 49 | 50 | void setDisconnectTimeout(const uint&); 51 | uint getDisconnectTimeout() const; 52 | 53 | void setAuthentication(const bool&); 54 | bool isAuthentication() const; 55 | 56 | void setEnableSSL(const bool&); 57 | bool isEnableSSL() const; 58 | 59 | void setConnectionNumber(const uint&); 60 | uint getConnectionNumber() const; 61 | 62 | void setServerModeIndex(const uint&); 63 | uint getServerModeIndex() const; 64 | 65 | 66 | bool operator!=(const ServerData&); 67 | 68 | private: 69 | 70 | int serverId; 71 | QString serverName; 72 | QString hostName; 73 | QString login; 74 | QString password; 75 | uint port; 76 | uint disconnectTimeout; 77 | bool authentication; 78 | bool enableSSL; 79 | uint connectionNumber; 80 | uint serverModeIndex; 81 | 82 | 83 | }; 84 | 85 | #endif // SERVERDATA_H 86 | -------------------------------------------------------------------------------- /src/systraylegacy.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #ifndef SYSTRAYLEGACY_H 23 | #define SYSTRAYLEGACY_H 24 | 25 | #include 26 | 27 | #include 28 | 29 | #include "utilities/utility.h" 30 | using namespace UtilityNamespace; 31 | 32 | class QueueFileObserver; 33 | class ClientsObserver; 34 | class StatsInfoBuilder; 35 | class MainWindow; 36 | 37 | 38 | class SysTray : public KSystemTrayIcon 39 | { 40 | 41 | Q_OBJECT 42 | 43 | public: 44 | SysTray(MainWindow*); 45 | ~SysTray(); 46 | 47 | private: 48 | 49 | MainWindow* parent; 50 | QueueFileObserver* queueFileObserver; 51 | ClientsObserver* clientsObserver; 52 | StatsInfoBuilder* statsInfoBuilder; 53 | QPixmap normalBaseIcon; 54 | QPixmap grayedBaseIcon; 55 | QPixmap renderedIcon; 56 | int oldMergePos; 57 | bool displayToolTip; 58 | 59 | bool blendOverlay(const QPixmap&); 60 | bool updateIconStatus(const UtilityNamespace::ItemStatus&); 61 | void setupConnections(); 62 | void setupActions(); 63 | void initPixmaps(); 64 | void initShow(); 65 | void updateIconProgress(const int&); 66 | void createToolTip(); 67 | 68 | signals: 69 | 70 | 71 | public slots: 72 | 73 | void progressUpdateSlot(const int); 74 | void statusUpdateSlot(const UtilityNamespace::ItemStatus); 75 | void updateDownloadSpeedInfoSlot(); 76 | void updateConnectionStatusSlot(); 77 | 78 | private slots: 79 | 80 | void menuAboutToHideSlot(); 81 | void menuAboutToShowSlot(); 82 | 83 | 84 | 85 | 86 | }; 87 | 88 | #endif // SYSTRAYLEGACY_H 89 | -------------------------------------------------------------------------------- /src/plugins/categories/preferencescategories.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef PREFERENCESCATEGORIES_H 22 | #define PREFERENCESCATEGORIES_H 23 | 24 | #include 25 | #include 26 | 27 | #include "ui_preferencescategories.h" 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include "mimedata.h" 34 | 35 | class CategoriesModel; 36 | 37 | class PreferencesCategories : public KCModule { 38 | 39 | Q_OBJECT 40 | 41 | public: 42 | PreferencesCategories(QWidget* = 0, const QVariantList& = QVariantList()); 43 | ~PreferencesCategories(); 44 | 45 | virtual void save(); 46 | virtual void load(); 47 | 48 | private: 49 | 50 | QStandardItem* getSelectedItem(); 51 | QStringList retrieveSelectionList(QStandardItem*); 52 | QString buildGroupBoxTitle(const QString& = QString()); 53 | void subCategoryWidgets(const QModelIndex&); 54 | void addMimeTypeToGroup(QStandardItem*); 55 | void setupConnections(); 56 | void saveChanges(); 57 | 58 | Ui_PreferencesCategories preferencesCategoriesUi; 59 | CategoriesModel* categoriesModel; 60 | bool saveChangesRequested; 61 | 62 | signals: 63 | 64 | 65 | public slots: 66 | 67 | 68 | private slots: 69 | 70 | void toolButtonAddClickSlot(); 71 | void toolButtonRemoveClickSlot(); 72 | void toolButtonEditSubcategoryClickSlot(); 73 | void urlChangedSlot(const QString&); 74 | void categoryWidgetsSlot(); 75 | void defaultTransferValueButtonToggledSlot(); 76 | 77 | }; 78 | 79 | #endif // PREFERENCESCATEGORIES_H 80 | -------------------------------------------------------------------------------- /src/plugins/scheduler/preferencesscheduler.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2011 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef PREFERENCESSCHEDULER_H 22 | #define PREFERENCESSCHEDULER_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | #include "ui_preferencesscheduler.h" 33 | #include "schedulerfilehandler.h" 34 | using namespace SchedulerNamespace; 35 | 36 | 37 | class PreferencesScheduler : public KCModule { 38 | 39 | Q_OBJECT 40 | Q_ENUMS(DownloadLimitStatus) 41 | 42 | public: 43 | 44 | PreferencesScheduler(QWidget* = 0, const QVariantList& = QVariantList()); 45 | ~PreferencesScheduler(); 46 | 47 | virtual void save(); 48 | virtual void load(); 49 | 50 | private: 51 | 52 | QStandardItemModel* schedulerModel; 53 | Ui_PreferencesScheduler preferencesSchedulerUi; 54 | int mousePressedRow; 55 | int mousePressedColumn; 56 | bool schedulerPressed; 57 | bool permanentSpeedLimitPressed; 58 | 59 | void assignDownloadRateToCell(int, int); 60 | void setupConnections(); 61 | 62 | 63 | signals: 64 | 65 | public slots: 66 | 67 | private slots: 68 | void cellEnteredSlot(const QModelIndex&); 69 | void cellPressedSlot(const QModelIndex&); 70 | void downloadLimitValueChangedSlot(int); 71 | void schedulerToggledSlot(bool); 72 | void schedulerPressedSlot(); 73 | void permanentSpeedLimitPressedSlot(); 74 | void radioButtonReleasedSlot(); 75 | void checkBoxStateChangedSlot(int); 76 | 77 | }; 78 | 79 | #endif // PREFERENCESSCHEDULER_H 80 | -------------------------------------------------------------------------------- /src/shutdown/sessionbase.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2012 by Xavier Lefage * 3 | * xavier.kwooty@gmail.com * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 19 | ***************************************************************************/ 20 | 21 | 22 | #include "sessionbase.h" 23 | 24 | #include 25 | #include "kwootysettings.h" 26 | 27 | 28 | SessionBase::SessionBase(ShutdownManager* shutdownManager) : QObject(shutdownManager) { 29 | 30 | this->shutdownManager = shutdownManager; 31 | } 32 | 33 | 34 | void SessionBase::launchSystemShutdown() { 35 | 36 | 37 | // get type of system shutdown : 38 | switch (this->getChosenShutdownType()) { 39 | 40 | case UtilityNamespace::Shutdown: { 41 | this->requestShutdown(); 42 | break; 43 | } 44 | 45 | case UtilityNamespace::Standby: 46 | case UtilityNamespace::Suspend: 47 | case UtilityNamespace::Hibernate:{ 48 | 49 | this->requestSuspend(); 50 | break; 51 | } 52 | 53 | 54 | default: { 55 | this->shutdownManager->handleShutdownError(i18n("System shutdown type unknown, shutdown is not possible!")); 56 | break; 57 | } 58 | 59 | } 60 | 61 | } 62 | 63 | 64 | UtilityNamespace::SystemShutdownType SessionBase::getChosenShutdownType() { 65 | 66 | UtilityNamespace::SystemShutdownType systemShutdownType = UtilityNamespace::ShutdownMethodUnknown; 67 | 68 | QList indexShutdownTypeList = this->retrieveAvailableShutdownMethods(); 69 | 70 | // ensure that list contains element : 71 | if (indexShutdownTypeList.size() > Settings::shutdownMethods()) { 72 | systemShutdownType = indexShutdownTypeList.at(Settings::shutdownMethods()); 73 | } 74 | 75 | return systemShutdownType; 76 | 77 | } 78 | 79 | 80 | 81 | --------------------------------------------------------------------------------