├── .gitignore ├── AUTHORS ├── CMakeLists.txt ├── COPYING ├── INSTALL ├── README.md ├── backgrounds-previews ├── CMakeLists.txt ├── abstract.png ├── alien-artifact.png ├── basket-title.png ├── green-curves.png ├── light.png ├── painting.png ├── pens.png ├── pins.png ├── rainbow-balls.png ├── rounds-line.png ├── strings.png ├── todo.png └── working.png ├── backgrounds ├── CMakeLists.txt ├── abstract.png ├── alien-artifact.png ├── alien-artifact.png.config ├── basket-title.png ├── green-curves.png ├── light.png ├── painting.png ├── pens.png ├── pins.png ├── rainbow-balls.png ├── rounds-line.png ├── strings.png ├── todo.png └── working.png ├── basket.qrc ├── builddeb.sh ├── cmake └── Modules │ ├── FindGpgme.cmake │ └── FindLibgit2.cmake ├── config.h.cmake ├── debian-upstream ├── changelog.in ├── compat ├── control ├── copyright ├── docs └── rules ├── doc ├── CMakeLists.txt ├── en │ ├── CMakeLists.txt │ └── index.docbook └── index.docbook ├── extract-messages.sh ├── file-integration ├── CMakeLists.txt ├── basket.xml ├── basketthumbcreator.cpp ├── basketthumbcreator.desktop └── basketthumbcreator.h ├── images ├── 128-apps-basket.png ├── 16-actions-likeback_bug.png ├── 16-actions-likeback_dislike.png ├── 16-actions-likeback_feature.png ├── 16-actions-likeback_like.png ├── 16-apps-basket.png ├── 22-apps-basket.png ├── 32-apps-basket.png ├── 48-apps-basket.png ├── 64-apps-basket.png ├── CMakeLists.txt ├── insertion_help.png ├── tag_export_help.png └── tag_export_on_every_lines_help.png ├── installer ├── links.sh ├── po ├── CMakeLists.txt ├── basket.pot ├── cs.po ├── da.po ├── de.po ├── es.po ├── fr.po ├── it.po ├── ja.po ├── nl.po ├── nn.po ├── pl_PL.po ├── pt.po ├── ru.po ├── tr.po ├── zh_CN.po └── zh_TW.po ├── src ├── CMakeLists.txt ├── Messages.sh ├── aboutdata.cpp ├── aboutdata.h ├── application.cpp ├── application.h ├── archive.cpp ├── archive.h ├── backgroundmanager.cpp ├── backgroundmanager.h ├── backup.cpp ├── backup.h ├── basket.desktop ├── basket_config_apps.desktop ├── basket_config_baskets.desktop ├── basket_config_general.desktop ├── basket_config_new_notes.desktop ├── basket_config_notes_appearance.desktop ├── basket_config_version_sync.desktop ├── basket_export.h ├── basket_options.h ├── basket_part.cpp ├── basket_part.desktop ├── basket_part.h ├── basket_part.rc ├── basket_plugin.cpp ├── basket_plugin.desktop ├── basket_plugin.h ├── basketfactory.cpp ├── basketfactory.h ├── basketlistview.cpp ├── basketlistview.h ├── basketproperties.cpp ├── basketproperties.h ├── basketproperties.ui ├── basketscene.cpp ├── basketscene.h ├── basketstatusbar.cpp ├── basketstatusbar.h ├── basketui.rc ├── basketview.cpp ├── basketview.h ├── bnpview.cpp ├── bnpview.h ├── colorpicker.cpp ├── colorpicker.h ├── crashhandler.cpp ├── crashhandler.h ├── debugwindow.cpp ├── debugwindow.h ├── decoratedbasket.cpp ├── decoratedbasket.h ├── diskerrordialog.cpp ├── diskerrordialog.h ├── file_metadata.cpp ├── file_metadata.h ├── file_mimetypes.h ├── filter.cpp ├── filter.h ├── focusedwidgets.cpp ├── focusedwidgets.h ├── formatimporter.cpp ├── formatimporter.h ├── gitwrapper.cpp ├── gitwrapper.h ├── global.cpp ├── global.h ├── history.cpp ├── history.h ├── htmlexporter.cpp ├── htmlexporter.h ├── icon_names.h ├── kcm_basket.cpp ├── kcolorcombo2.cpp ├── kcolorcombo2.h ├── kde4_migration.h ├── kgpgme.cpp ├── kgpgme.h ├── ksystemtrayicon2.cpp ├── ksystemtrayicon2.h ├── likeback.cpp ├── likeback.h ├── likeback_p.h ├── linklabel.cpp ├── linklabel.h ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── nepomukintegration.cpp ├── nepomukintegration.h ├── newbasketdialog.cpp ├── newbasketdialog.h ├── note.cpp ├── note.h ├── notecontent.cpp ├── notecontent.h ├── notedrag.cpp ├── notedrag.h ├── noteedit.cpp ├── noteedit.h ├── notefactory.cpp ├── notefactory.h ├── noteselection.cpp ├── noteselection.h ├── org.basket.BNPView.xml ├── password.cpp ├── password.h ├── passwordlayout.ui ├── regiongrabber.cpp ├── regiongrabber.h ├── settings.cpp ├── settings.h ├── settings_versionsync.cpp ├── settings_versionsync.h ├── settings_versionsync.ui ├── softwareimporters.cpp ├── softwareimporters.h ├── systemtray.cpp ├── systemtray.h ├── tag.cpp ├── tag.h ├── tagsedit.cpp ├── tagsedit.h ├── tests │ ├── CMakeLists.txt │ ├── basketviewtest.cpp │ ├── htmltotext │ │ ├── 1.html │ │ ├── 1.txt │ │ ├── 2.html │ │ ├── 2.txt │ │ ├── 3.html │ │ ├── 3.txt │ │ ├── 4.html │ │ ├── 4.txt │ │ ├── 5.html │ │ └── 5.txt │ ├── notetest.cpp │ └── toolstest.cpp ├── tools.cpp ├── tools.h ├── transparentwidget.cpp ├── transparentwidget.h ├── variouswidgets.cpp ├── variouswidgets.h ├── xmlwork.cpp └── xmlwork.h ├── tags ├── 16-actions-tag_checkbox.png ├── 16-actions-tag_checkbox_checked.png ├── 16-actions-tag_for_later.png ├── 16-actions-tag_fun.png ├── 16-actions-tag_important.png ├── 16-actions-tag_preference_bad.png ├── 16-actions-tag_preference_excellent.png ├── 16-actions-tag_preference_good.png ├── 16-actions-tag_priority_high.png ├── 16-actions-tag_priority_low.png ├── 16-actions-tag_priority_medium.png ├── 16-actions-tag_progress_000.png ├── 16-actions-tag_progress_025.png ├── 16-actions-tag_progress_050.png ├── 16-actions-tag_progress_075.png ├── 16-actions-tag_progress_100.png └── CMakeLists.txt └── welcome ├── CMakeLists.txt ├── Welcome_de.baskets ├── Welcome_en_US.baskets ├── Welcome_fr.baskets ├── Welcome_it.baskets ├── Welcome_ja.baskets ├── Welcome_nn.baskets ├── Welcome_pt.baskets └── Welcome_ru.baskets /.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | .kdev4 3 | qtcreator-build 4 | build/* 5 | *.user 6 | *~ 7 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Sébastien Laoût 2 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.12) 2 | cmake_policy(SET CMP0063 NEW) 3 | set(BASKET_DISABLE_GPG "0" CACHE BOOL "Disables GPG Support") 4 | 5 | include(FeatureSummary) 6 | 7 | find_package(X11 REQUIRED) 8 | 9 | # KDE 10 | find_package(ECM REQUIRED NO_MODULE) 11 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) 12 | 13 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") 14 | IF(NOT BASKET_DISABLE_GPG) 15 | find_package(Gpgme) 16 | ENDIF(NOT BASKET_DISABLE_GPG) 17 | 18 | # libgit2 19 | find_package(Libgit2) 20 | IF(LIBGIT2_FOUND) 21 | include_directories(${LIBGIT2_INCLUDE_DIR}) 22 | add_definitions(-DWITH_LIBGIT2) 23 | ELSE(LIBGIT2_FOUND) 24 | message("libgit2 not found, configuring without") 25 | ENDIF(LIBGIT2_FOUND) 26 | 27 | 28 | 29 | if (BUILD_KPARTS) 30 | find_package(KdepimLibs REQUIRED) 31 | include_directories(${KDEPIMLIBS_INCLUDE_DIRS}) 32 | endif (BUILD_KPARTS) 33 | 34 | find_package(Qt5 REQUIRED COMPONENTS 35 | Concurrent 36 | Core 37 | DBus 38 | Gui 39 | Widgets 40 | Xml 41 | ) 42 | 43 | include(KDECompilerSettings NO_POLICY_SCOPE) 44 | include(KDEInstallDirs) 45 | include(ECMInstallIcons) 46 | include(KDECMakeSettings) 47 | 48 | find_package(KF5 REQUIRED COMPONENTS 49 | Archive 50 | Completion 51 | Config 52 | ConfigWidgets #KCM 53 | CoreAddons 54 | Crash 55 | DBusAddons 56 | DocTools 57 | FileMetaData 58 | GlobalAccel 59 | GuiAddons 60 | I18n 61 | IconThemes 62 | KCMUtils 63 | KIO 64 | Notifications 65 | Parts 66 | Service 67 | TextWidgets 68 | WidgetsAddons 69 | WindowSystem 70 | XmlGui 71 | ) 72 | 73 | find_package(Phonon4Qt5 REQUIRED) 74 | 75 | #find_package(KF5 COMPONENTS Baloo) 76 | 77 | 78 | IF(GPGME_FOUND) 79 | SET(HAVE_LIBGPGME 1) 80 | SET(LARGEFILE_SOURCE_1) 81 | ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64) 82 | ELSE(GPGME_FOUND) 83 | IF (BASKET_DISABLE_GPG) 84 | MESSAGE("GPG disabled, configuring without") 85 | ELSE (BASKET_DISABLE_GPG) 86 | MESSAGE("GPG not found, configuring without") 87 | ENDIF (BASKET_DISABLE_GPG) 88 | ENDIF(GPGME_FOUND) 89 | 90 | #IF(KF5BALOO_FOUND) 91 | # SET(HAVE_BALOO 1) 92 | #ENDIF(KF5BALOO_FOUND) 93 | 94 | #TODO: find meinproc 95 | 96 | #Make libbasketcommon search for translations in basket.mo 97 | ADD_DEFINITIONS(-DTRANSLATION_DOMAIN=\"basket\") 98 | 99 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ) 100 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) 101 | 102 | add_subdirectory(doc) 103 | add_subdirectory(src) 104 | add_subdirectory(po) 105 | add_subdirectory(tags) 106 | add_subdirectory(welcome) 107 | add_subdirectory(backgrounds) 108 | add_subdirectory(images) 109 | add_subdirectory(file-integration) 110 | 111 | feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 112 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installing BasKet Note Pads 2 | ============================ 3 | 4 | To install BasKet Note Pads, just run the installer executable in a terminal and 5 | follow the on screen instructions. 6 | 7 | Dependencies 8 | ------------ 9 | 10 | To build BasKet, the following development packages are required: 11 | 12 | Qt v4.4 13 | kdelibs v4.1 14 | qimageblitz 15 | kdepimlibs v4.1 16 | GnuPG 1.x (optional) 17 | 18 | If you get an error message about FindGPGMe.cmake not found, you are probably 19 | missing kdepimlibs. 20 | 21 | In addition, handbook generation requires DocBook stylesheets, which are typically found in docbook-xsl package. 22 | 23 | Building on Windows from source 24 | ------------------------------- 25 | . install cmake (http://cmake.org), automoc (git://anongit.kde.org/automoc.git) 26 | . download and run KDE for Windows installer (http://download.kde.org/stable/kdewin/installer/kdewin-installer-gui-latest.exe) 27 | .. choose Install Mode: Package Manager, Compiler Mode: (for example) MSVC 2010 32bit 28 | .. install essential packages as described on http://techbase.kde.org/Projects/KDE_on_Windows/Compiling_Applications 29 | .. besides, install oxygen-icons-* package 30 | . use CMake to configure and build Basket -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | BasKet Note Pads 2 | ================ 3 | Gleb Baryshev 4 | 5 | Kelvie Wong 6 | 7 | Purpose 8 | ------- 9 | (From the original README by Sébastien) 10 | 11 | This application provides as many baskets as you wish, and you can drag and drop 12 | various objects (text, URLs, images, sounds...) into its. 13 | 14 | Objects can be edited, copied, dragged... So, you can arrange them as you want ! 15 | 16 | It's a DropDrawers clone (http://www.sigsoftware.com/dropdrawers/index.html) for 17 | KDE 4. 18 | 19 | Project Status 20 | -------------- 21 | In the previous years, porting from KDE 3 to KDE 4 was generally finished. 22 | However, some features remained not ported or became broken. Currently bug 23 | fixing is under way. 24 | 25 | Developers 26 | ----------- 27 | As you may or may not have noticed, there isn't a user's section currently. 28 | If you are reading this, chances are, you are a developer (if I'm wrong email me 29 | ;), so most of the developers documentation will go here until we can finalize a 30 | user README after we're done porting. 31 | 32 | 33 | Contact 34 | ------- 35 | If you have any questions, or would like to contribute (always welcome!) please 36 | send me an email to the development mailing list at 37 | basket-devel@lists.sourceforge.net. 38 | 39 | Developers are usually idle on #basket-devel @ freenode on IRC, and it's quite 40 | likely you'll catch one of us there Due to timezone differences, however, it's 41 | generally better to email the list. 42 | 43 | The BasKet web site is at: 44 | https://launchpad.net/basket 45 | 46 | 47 | Building/Installation 48 | ---------------------- 49 | 50 | To build and install BasKet, follow these steps (this assumes you have the relevant 51 | kde4 development libraries and CMake): 52 | 53 | ```bash 54 | mkdir build 55 | cd build 56 | cmake -DCMAKE_INSTALL_PREFIX=`kf5-config --prefix` -DKDE_INSTALL_QTPLUGINDIR=`qtpaths --plugin-dir` .. 57 | make 58 | # make install 59 | ``` 60 | 61 | Or you can try your luck with the installer script: 62 | 63 | `./installer` 64 | -------------------------------------------------------------------------------- /backgrounds-previews/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | install(FILES abstract.png alien-artifact.png basket-title.png green-curves.png light.png painting.png pens.png pins.png rainbow-balls.png rounds-line.png strings.png todo.png working.png DESTINATION ${DATA_INSTALL_DIR}/basket/backgrounds/previews) 3 | 4 | 5 | -------------------------------------------------------------------------------- /backgrounds-previews/abstract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/abstract.png -------------------------------------------------------------------------------- /backgrounds-previews/alien-artifact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/alien-artifact.png -------------------------------------------------------------------------------- /backgrounds-previews/basket-title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/basket-title.png -------------------------------------------------------------------------------- /backgrounds-previews/green-curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/green-curves.png -------------------------------------------------------------------------------- /backgrounds-previews/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/light.png -------------------------------------------------------------------------------- /backgrounds-previews/painting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/painting.png -------------------------------------------------------------------------------- /backgrounds-previews/pens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/pens.png -------------------------------------------------------------------------------- /backgrounds-previews/pins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/pins.png -------------------------------------------------------------------------------- /backgrounds-previews/rainbow-balls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/rainbow-balls.png -------------------------------------------------------------------------------- /backgrounds-previews/rounds-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/rounds-line.png -------------------------------------------------------------------------------- /backgrounds-previews/strings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/strings.png -------------------------------------------------------------------------------- /backgrounds-previews/todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/todo.png -------------------------------------------------------------------------------- /backgrounds-previews/working.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds-previews/working.png -------------------------------------------------------------------------------- /backgrounds/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | install(FILES abstract.png alien-artifact.png alien-artifact.png.config basket-title.png green-curves.png light.png painting.png pens.png pins.png rainbow-balls.png rounds-line.png strings.png todo.png working.png DESTINATION ${DATA_INSTALL_DIR}/basket/backgrounds) 3 | 4 | -------------------------------------------------------------------------------- /backgrounds/abstract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/abstract.png -------------------------------------------------------------------------------- /backgrounds/alien-artifact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/alien-artifact.png -------------------------------------------------------------------------------- /backgrounds/alien-artifact.png.config: -------------------------------------------------------------------------------- 1 | [BasKet Background Image Configuration] 2 | tiled = true 3 | -------------------------------------------------------------------------------- /backgrounds/basket-title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/basket-title.png -------------------------------------------------------------------------------- /backgrounds/green-curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/green-curves.png -------------------------------------------------------------------------------- /backgrounds/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/light.png -------------------------------------------------------------------------------- /backgrounds/painting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/painting.png -------------------------------------------------------------------------------- /backgrounds/pens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/pens.png -------------------------------------------------------------------------------- /backgrounds/pins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/pins.png -------------------------------------------------------------------------------- /backgrounds/rainbow-balls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/rainbow-balls.png -------------------------------------------------------------------------------- /backgrounds/rounds-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/rounds-line.png -------------------------------------------------------------------------------- /backgrounds/strings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/strings.png -------------------------------------------------------------------------------- /backgrounds/todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/todo.png -------------------------------------------------------------------------------- /backgrounds/working.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/backgrounds/working.png -------------------------------------------------------------------------------- /basket.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/tag_export_help.png 4 | images/tag_export_on_every_lines_help.png 5 | images/insertion_help.png 6 | images/16-actions-likeback_bug.png 7 | images/16-actions-likeback_dislike.png 8 | images/16-actions-likeback_like.png 9 | images/16-actions-likeback_feature.png 10 | images/16-apps-basket.png 11 | images/22-apps-basket.png 12 | images/32-apps-basket.png 13 | images/48-apps-basket.png 14 | images/64-apps-basket.png 15 | images/128-apps-basket.png 16 | tags/16-actions-tag_checkbox.png 17 | tags/16-actions-tag_checkbox_checked.png 18 | tags/16-actions-tag_for_later.png 19 | tags/16-actions-tag_fun.png 20 | tags/16-actions-tag_important.png 21 | tags/16-actions-tag_preference_bad.png 22 | tags/16-actions-tag_preference_excellent.png 23 | tags/16-actions-tag_preference_good.png 24 | tags/16-actions-tag_priority_high.png 25 | tags/16-actions-tag_priority_low.png 26 | tags/16-actions-tag_priority_medium.png 27 | tags/16-actions-tag_progress_000.png 28 | tags/16-actions-tag_progress_025.png 29 | tags/16-actions-tag_progress_075.png 30 | tags/16-actions-tag_progress_100.png 31 | 32 | 33 | -------------------------------------------------------------------------------- /builddeb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ln -sf debian-upstream debian 3 | cat debian/changelog.in | sed "s/##DATE##/`date +%Y%m%d`/g" | sed "s/##RDATE##/`date -R`/g" | sed "s/##DIST##/`lsb_release -cs`/g" > debian/changelog 4 | debuild -b 5 | fakeroot debian/rules clean 6 | rm debian/changelog 7 | rm debian 8 | -------------------------------------------------------------------------------- /cmake/Modules/FindLibgit2.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find the libgit2 library 2 | # Once done this will define 3 | # 4 | # LIBGIT2_FOUND - System has libgit2 5 | # LIBGIT2_INCLUDE_DIR - The libgit2 include directory 6 | # LIBGIT2_LIBRARIES - The libraries needed to use libgit2 7 | # LIBGIT2_DEFINITIONS - Compiler switches required for using libgit2 8 | 9 | 10 | # use pkg-config to get the directories and then use these values 11 | # in the FIND_PATH() and FIND_LIBRARY() calls 12 | FIND_PACKAGE(PkgConfig) 13 | PKG_SEARCH_MODULE(PC_LIBGIT2 libgit2) 14 | 15 | SET(LIBGIT2_DEFINITIONS ${PC_LIBGIT2_CFLAGS_OTHER}) 16 | 17 | FIND_PATH(LIBGIT2_INCLUDE_DIR NAMES git2.h 18 | HINTS 19 | ${PC_LIBGIT2_INCLUDEDIR} 20 | ${PC_LIBGIT2_INCLUDE_DIRS} 21 | ) 22 | 23 | FIND_LIBRARY(LIBGIT2_LIBRARIES NAMES git2 24 | HINTS 25 | ${PC_LIBGIT2_LIBDIR} 26 | ${PC_LIBGIT2_LIBRARY_DIRS} 27 | ) 28 | 29 | 30 | INCLUDE(FindPackageHandleStandardArgs) 31 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(libgit2 DEFAULT_MSG LIBGIT2_LIBRARIES LIBGIT2_INCLUDE_DIR) 32 | 33 | MARK_AS_ADVANCED(LIBGIT2_INCLUDE_DIR LIBGIT2_LIBRARIES) 34 | -------------------------------------------------------------------------------- /config.h.cmake: -------------------------------------------------------------------------------- 1 | /* Define if libgpgme is available */ 2 | #cmakedefine HAVE_LIBGPGME 3 | 4 | /* Define if Baloo is available */ 5 | #cmakedefine HAVE_BALOO 6 | 7 | /* Version number of package */ 8 | #define VERSION "2.49-beta" 9 | 10 | -------------------------------------------------------------------------------- /debian-upstream/changelog.in: -------------------------------------------------------------------------------- 1 | basket (1.9x~git##DATE##-1~##DIST##1~upstream1) ##DIST##; urgency=low 2 | 3 | * Initial release. 4 | 5 | -- Riyad Preukschas ##RDATE## 6 | -------------------------------------------------------------------------------- /debian-upstream/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /debian-upstream/control: -------------------------------------------------------------------------------- 1 | Source: basket 2 | Section: kde 3 | Priority: extra 4 | Maintainer: Riyad Preukschas 5 | Build-Depends: debhelper (>= 7), devscripts, fakeroot, cmake, kdelibs5-dev (>= 4.2), kdepimlibs5-dev (>= 4.2), libqimageblitz-dev 6 | Standards-Version: 3.8.0 7 | Homepage: http://gitorious.org/basket 8 | 9 | Package: basket 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Description: A multi-purpose note-taking application for KDE 13 | This application provides as many baskets (drawers) as you wish; Several kinds 14 | of objects (texts, URLs, images,...) can be drag-n-drop'd into it. 15 | . 16 | Objects can be edited, copied, dragged... So, they can be arranged according 17 | to users' taste. Moreover, Basket allows you to keep all objects you want in 18 | one place, keep data on hand, take notes... 19 | -------------------------------------------------------------------------------- /debian-upstream/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by: 2 | 3 | Riyad Preukschas on Tue, 14 Jul 2009 14:27:11 +0200 4 | 5 | It was downloaded from: 6 | 7 | http://basket.kde.org/ 8 | 9 | Upstream Author(s): 10 | 11 | Riyad Preukschas 12 | 13 | Copyright: 14 | 15 | Copyright (C) 2006-2007 Alex Gontmakher 16 | Copyright (C) 2008 Andrew Wang 17 | Copyright (C) 2008 Carsten Lohrke 18 | Copyright (C) 2009 David Damerell 19 | Copyright (C) 2008-2010 Dr. Robert Marmorstein 20 | Copyright (C) 2009 Guillaume Martres 21 | Copyright (C) 2009 jesper 22 | Copyright (C) 2008 Juliano F. Ravasi 23 | Copyright (C) 2008-2009 Kelvie Wong 24 | Copyright (C) 2008 Laurent Montel 25 | Copyright (C) 2009 Maranatha Luckanachai 26 | Copyright (C) 2009 Marek Janukowicz 27 | Copyright (C) 2009 Matt Rogers 28 | Copyright (C) 2009-2010 Riyad Preukschas 29 | Copyright (C) 2008 Rui Machado 30 | Copyright (C) 2008 Terry 31 | Copyright (C) 2009 Trever Fischer 32 | Copyright (C) 2008 Voker57 33 | 34 | Copyright (C) 2006-2007 danil 35 | Copyright (C) 2006-2007 huftis 36 | Copyright (C) 2006 kodaaja 37 | Copyright (C) 2006-2007 njsg 38 | Copyright (C) 2009 perihelion 39 | Copyright (C) 2006-2007 phobeus 40 | Copyright (C) 2006-2007 seb 41 | Copyright (C) 2006-2007 soytetir 42 | Copyright (C) 2006-2007 tosky 43 | Copyright (C) 2007 under2x 44 | Copyright (C) 2006-2007 yukiko 45 | 46 | License: 47 | 48 | This package is free software; you can redistribute it and/or modify 49 | it under the terms of the GNU General Public License version 2 as 50 | published by the Free Software Foundation. 51 | 52 | This package is distributed in the hope that it will be useful, 53 | but WITHOUT ANY WARRANTY; without even the implied warranty of 54 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 55 | GNU General Public License for more details. 56 | 57 | You should have received a copy of the GNU General Public License 58 | along with this package; if not, write to the Free Software 59 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 60 | 61 | On Debian systems, the complete text of the GNU General 62 | Public License can be found in `/usr/share/common-licenses/GPL'. 63 | 64 | The Debian packaging is: 65 | 66 | Copyright (C) 2009 Riyad Preukschas 67 | 68 | and is licensed under the GPL, see above. 69 | -------------------------------------------------------------------------------- /debian-upstream/docs: -------------------------------------------------------------------------------- 1 | README 2 | TODO 3 | -------------------------------------------------------------------------------- /debian-upstream/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | 13 | 14 | 15 | 16 | builddir/Makefile: 17 | dh_testdir 18 | # Add here commands to configure the package. 19 | mkdir -p builddir 20 | cd builddir && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_LD_FLAGS="-Wl,-z,defs" -DCMAKE_CXX_FLAGS="$(CXXFLAGS)" -DCMAKE_SKIP_RPATH=ON -DCMAKE_VERBOSE_MAKEFILE=ON 21 | 22 | 23 | build: build-stamp 24 | 25 | build-stamp: builddir/Makefile 26 | dh_testdir 27 | 28 | # Add here commands to compile the package. 29 | $(MAKE) -C builddir 30 | #docbook-to-man debian/basket.sgml > basket.1 31 | 32 | touch $@ 33 | 34 | clean: 35 | dh_testdir 36 | dh_testroot 37 | rm -f build-stamp 38 | 39 | # Add here commands to clean up after the build process. 40 | rm -rf builddir 41 | 42 | 43 | dh_clean 44 | 45 | install: build 46 | dh_testdir 47 | dh_testroot 48 | dh_prep 49 | dh_installdirs 50 | 51 | # Add here commands to install the package into debian/basket. 52 | $(MAKE) -C builddir DESTDIR=$(CURDIR)/debian/basket install 53 | 54 | 55 | # Build architecture-independent files here. 56 | binary-indep: install 57 | # We have nothing to do by default. 58 | 59 | # Build architecture-dependent files here. 60 | binary-arch: install 61 | dh_testdir 62 | dh_testroot 63 | dh_installchangelogs 64 | dh_installdocs 65 | dh_installexamples 66 | # dh_install 67 | # dh_installmenu 68 | # dh_installdebconf 69 | # dh_installlogrotate 70 | # dh_installemacsen 71 | # dh_installpam 72 | # dh_installmime 73 | # dh_python 74 | # dh_installinit 75 | # dh_installcron 76 | # dh_installinfo 77 | dh_installman 78 | dh_link 79 | dh_strip 80 | dh_compress 81 | dh_fixperms 82 | # dh_perl 83 | # dh_makeshlibs 84 | dh_installdeb 85 | dh_shlibdeps 86 | dh_gencontrol 87 | dh_md5sums 88 | dh_builddeb 89 | 90 | binary: binary-indep binary-arch 91 | .PHONY: build clean binary-indep binary-arch binary install 92 | -------------------------------------------------------------------------------- /doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(en) 2 | -------------------------------------------------------------------------------- /doc/en/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | include_directories(${QT_INCLUDES} ) 3 | 4 | 5 | ########### install files ############### 6 | 7 | 8 | kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR basket) 9 | 10 | 11 | 12 | #original Makefile.am contents follow: 13 | 14 | #KDE_DOCS = basket 15 | #KDE_LANG = en 16 | -------------------------------------------------------------------------------- /doc/index.docbook: -------------------------------------------------------------------------------- 1 | en/index.docbook -------------------------------------------------------------------------------- /extract-messages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copied from http://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems#Extracting_and_merging_messages 4 | 5 | BASEDIR="." # root of translatable sources 6 | PROJECT="basket" # project name 7 | BUGADDR="" # MSGID-Bugs 8 | WDIR=`pwd` # working dir 9 | 10 | echo "Preparing rc files" 11 | cd ${BASEDIR} 12 | # we use simple sorting to make sure the lines do not jump around too much from system to system 13 | find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > ${WDIR}/rcfiles.list 14 | xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp 15 | # additional string for KAboutData 16 | echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp 17 | echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp 18 | cd ${WDIR} 19 | echo "Done preparing rc files" 20 | 21 | 22 | echo "Extracting messages" 23 | cd ${BASEDIR} 24 | # see above on sorting 25 | find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort > ${WDIR}/infiles.list 26 | echo "rc.cpp" >> ${WDIR}/infiles.list 27 | cd ${WDIR} 28 | xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \ 29 | -kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \ 30 | --msgid-bugs-address="${BUGADDR}" \ 31 | --files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${BASEDIR}/po/${PROJECT}.pot || { echo "error while calling xgettext. aborting."; exit 1; } 32 | echo "Done extracting messages" 33 | 34 | 35 | echo "Merging translations" 36 | catalogs=`find . -name '*.po'` 37 | for cat in $catalogs; do 38 | echo $cat 39 | msgmerge -o $cat.new $cat ${BASEDIR}/po/${PROJECT}.pot 40 | mv $cat.new $cat 41 | done 42 | echo "Done merging translations" 43 | 44 | 45 | echo "Cleaning up" 46 | cd ${WDIR} 47 | rm rcfiles.list 48 | rm infiles.list 49 | rm rc.cpp 50 | echo "Done" 51 | -------------------------------------------------------------------------------- /file-integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(basketthumbcreator_PART_SRCS basketthumbcreator.cpp) 2 | 3 | add_library(basketthumbcreator MODULE ${basketthumbcreator_PART_SRCS}) 4 | 5 | target_link_libraries(basketthumbcreator 6 | Qt5::Core Qt5::Gui 7 | KF5::I18n KF5::XmlGui KF5::KIOWidgets) 8 | 9 | install(TARGETS basketthumbcreator DESTINATION ${PLUGIN_INSTALL_DIR}) 10 | 11 | 12 | ########### install files ############### 13 | 14 | find_program(XDG-MIME_EXECUTABLE xdg-mime) 15 | find_program(XDG-DESKTOP-MENU_EXECUTABLE xdg-desktop-menu) 16 | 17 | install(FILES basketthumbcreator.desktop DESTINATION ${SERVICES_INSTALL_DIR}) 18 | install(CODE " 19 | execute_process(COMMAND ${XDG-MIME_EXECUTABLE} install --novendor 20 | ${CMAKE_CURRENT_SOURCE_DIR}/basket.xml) 21 | execute_process(COMMAND ${XDG-DESKTOP-MENU_EXECUTABLE} install 22 | --novendor ${CMAKE_SOURCE_DIR}/src/basket.desktop) 23 | execute_process(COMMAND ${XDG-MIME_EXECUTABLE} default 24 | ${CMAKE_SOURCE_DIR}/src/basket.desktop application/x-basket-item) 25 | ") 26 | -------------------------------------------------------------------------------- /file-integration/basket.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Basket Archive 5 | verskille tussen lêers 6 | Korbarchiv 7 | Archivo de cestas 8 | Archive de paniers 9 | Archivio di canestri 10 | バスケットアーカイブ 11 | Kurvarkiv 12 | Korgarkiv 13 | Ficheiro de cestos 14 | Контейнер Basket 15 | Basket Arşivi 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Basket Template 25 | Korbvorlage 26 | Plantilla de cesta 27 | Modèle de panier 28 | Modello di canestri 29 | バスケットテンプレート 30 | Kurvmal 31 | Korgmal 32 | Modelo de cesto 33 | Шаблон корзины 34 | Basket Şabolonu 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Basket Note Pads 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /file-integration/basketthumbcreator.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Type=Service 4 | Name=Basket Archives & Templates 5 | Name[de]=Korbarchiv und Korbvorlagen 6 | Name[es]=Archivo de cestas y plantillas 7 | Name[fr]=Archive de paniers et modèles 8 | Name[it]=Archivi e modelli di cesti 9 | Name[ja]=バスケットアーカイブとテンプレート 10 | Name[nb]=Kurvarkiv og kurvmaler 11 | Name[nn]=Korgarkiv og korgmalar 12 | Name[pt]=Arquivos e modelos de cestos 13 | Name[ru]=Шаблоны и контейнеры Basket 14 | Name[tr]=Basket Arşivleri & Şablonları 15 | ServiceTypes=ThumbCreator 16 | MimeTypes=application/x-basket-archive,application/x-basket-template 17 | CacheThumbnail=true 18 | X-KDE-Library=basketthumbcreator 19 | -------------------------------------------------------------------------------- /file-integration/basketthumbcreator.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2006 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 22 | #include 23 | #include 24 | 25 | class BasketThumbCreator : public ThumbCreator 26 | { 27 | bool create(const QString &path, int width, int height, QImage &image); 28 | Flags flags() const; 29 | }; 30 | -------------------------------------------------------------------------------- /images/128-apps-basket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/128-apps-basket.png -------------------------------------------------------------------------------- /images/16-actions-likeback_bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/16-actions-likeback_bug.png -------------------------------------------------------------------------------- /images/16-actions-likeback_dislike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/16-actions-likeback_dislike.png -------------------------------------------------------------------------------- /images/16-actions-likeback_feature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/16-actions-likeback_feature.png -------------------------------------------------------------------------------- /images/16-actions-likeback_like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/16-actions-likeback_like.png -------------------------------------------------------------------------------- /images/16-apps-basket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/16-apps-basket.png -------------------------------------------------------------------------------- /images/22-apps-basket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/22-apps-basket.png -------------------------------------------------------------------------------- /images/32-apps-basket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/32-apps-basket.png -------------------------------------------------------------------------------- /images/48-apps-basket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/48-apps-basket.png -------------------------------------------------------------------------------- /images/64-apps-basket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/64-apps-basket.png -------------------------------------------------------------------------------- /images/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_install_icons(ICONS 2 | 128-apps-basket.png 3 | 16-actions-likeback_bug.png 4 | 16-actions-likeback_dislike.png 5 | 16-actions-likeback_feature.png 6 | 16-actions-likeback_like.png 7 | 16-apps-basket.png 8 | 22-apps-basket.png 9 | 32-apps-basket.png 10 | 48-apps-basket.png 11 | 64-apps-basket.png 12 | DESTINATION ${ICON_INSTALL_DIR} 13 | THEME hicolor 14 | ) 15 | -------------------------------------------------------------------------------- /images/insertion_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/insertion_help.png -------------------------------------------------------------------------------- /images/tag_export_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/tag_export_help.png -------------------------------------------------------------------------------- /images/tag_export_on_every_lines_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/images/tag_export_on_every_lines_help.png -------------------------------------------------------------------------------- /po/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copied from http://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems#Compiling_and_installing_message_catalogs 2 | 3 | FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt) 4 | 5 | IF(NOT GETTEXT_MSGFMT_EXECUTABLE) 6 | MESSAGE( 7 | "------ 8 | NOTE: msgfmt not found. Translations will *not* be installed 9 | ------") 10 | ELSE(NOT GETTEXT_MSGFMT_EXECUTABLE) 11 | 12 | SET(catalogname basket) 13 | 14 | FILE(GLOB PO_FILES *.po) 15 | SET(GMO_FILES) 16 | 17 | FOREACH(_poFile ${PO_FILES}) 18 | GET_FILENAME_COMPONENT(_poFileName ${_poFile} NAME) 19 | STRING(REGEX REPLACE "^${catalogname}_?" "" _langCode ${_poFileName} ) 20 | STRING(REGEX REPLACE "\\.po$" "" _langCode ${_langCode} ) 21 | 22 | IF( _langCode ) 23 | GET_FILENAME_COMPONENT(_lang ${_poFile} NAME_WE) 24 | SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo) 25 | 26 | ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile} 27 | COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile} 28 | DEPENDS ${_poFile}) 29 | INSTALL(FILES ${_gmoFile} DESTINATION ${LOCALE_INSTALL_DIR}/${_langCode}/LC_MESSAGES/ RENAME ${catalogname}.mo) 30 | LIST(APPEND GMO_FILES ${_gmoFile}) 31 | ENDIF( _langCode ) 32 | 33 | ENDFOREACH(_poFile ${PO_FILES}) 34 | 35 | ADD_CUSTOM_TARGET(translations ALL DEPENDS ${GMO_FILES}) 36 | 37 | ENDIF(NOT GETTEXT_MSGFMT_EXECUTABLE) 38 | -------------------------------------------------------------------------------- /src/Messages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | $(XGETTEXT) *.cpp -o $(podir)/basket.pot 3 | -------------------------------------------------------------------------------- /src/aboutdata.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 "aboutdata.h" 22 | #include 23 | 24 | #include 25 | #include 26 | 27 | static const char description[] = I18N_NOOP( 28 | "

Taking care of your ideas.

" 29 | "

A note-taking application that makes it easy to record ideas as you think, and quickly find them later. " 30 | "Organizing your notes has never been so easy.

"); 31 | 32 | // Or how to make order of disorganized toughts. 33 | 34 | AboutData::AboutData() 35 | : KAboutData(AboutData::componentName(), AboutData::displayName(), 36 | VERSION, i18n(description), KAboutLicense::GPL_V2, 37 | i18n("Copyright © 2003–2007, Sébastien Laoût; Copyright © 2013–2019, Gleb Baryshev"), 38 | QString(), 39 | "http://basket.kde.org/") 40 | { 41 | //Pass basket.kde.org to constructor to be used as D-Bus domain name, but set the displayed address below 42 | setHomepage("https://launchpad.net/basket"); 43 | setBugAddress("https://bugs.launchpad.net/basket"); 44 | 45 | addAuthor(i18n("OmegaPhil"), 46 | i18n("Paste as plaintext option"), 47 | "OmegaPhil@startmail.com"); 48 | 49 | addAuthor(i18n("Kelvie Wong"), 50 | i18n("Maintainer"), 51 | "kelvie@ieee.org"); 52 | 53 | addAuthor(i18n("Sébastien Laoût"), 54 | i18n("Original Author"), 55 | "slaout@linux62.org"); 56 | 57 | addAuthor(i18n("Petri Damstén"), 58 | i18n("Basket encryption, Kontact integration, KnowIt importer"), 59 | "damu@iki.fi"); 60 | 61 | addAuthor(i18n("Alex Gontmakher"), 62 | i18n("Baskets auto lock, save-status icon, HTML copy/paste, basket name tooltip, drop to basket name"), 63 | "gsasha@cs.technion.ac.il"); 64 | 65 | addAuthor(i18n("Marco Martin"), 66 | i18n("Original icon"), 67 | "m4rt@libero.it"); 68 | } 69 | 70 | QString AboutData::componentName() 71 | { 72 | return QString("basket"); 73 | } 74 | 75 | QString AboutData::displayName() 76 | { 77 | return i18n("BasKet Note Pads"); 78 | } 79 | -------------------------------------------------------------------------------- /src/aboutdata.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 | #ifndef ABOUTDATA_H 21 | #define ABOUTDATA_H 22 | 23 | #include 24 | #include "basket_export.h" 25 | 26 | /** 27 | @author Sébastien Laoût 28 | */ 29 | 30 | class BASKET_EXPORT AboutData : public KAboutData 31 | { 32 | public: 33 | static QString componentName(); 34 | static QString displayName(); 35 | 36 | AboutData(); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/application.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 APPLICATION_H 22 | #define APPLICATION_H 23 | 24 | #include 25 | #include 26 | 27 | /** 28 | * @author Sébastien Laoût 29 | */ 30 | class Application : public QApplication 31 | { 32 | public: 33 | Application(int &argc, char **argv); 34 | ~Application(); 35 | int newInstance(); 36 | void tryLoadFile(const QStringList &args, const QString& workingDir); //!< Open a file passed as command line argument 37 | private slots: 38 | /// Activate program window if duplicate instance is started, load file from args 39 | void onActivateRequested(const QStringList& args, const QString& workingDir); 40 | private: 41 | KDBusService m_service; 42 | }; 43 | 44 | #endif // APPLICATION_H 45 | -------------------------------------------------------------------------------- /src/archive.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2006 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 ARCHIVE_H 22 | #define ARCHIVE_H 23 | 24 | #include 25 | #include 26 | 27 | class BasketScene; 28 | class Tag; 29 | 30 | class QString; 31 | class QStringList; 32 | class QDomNode; 33 | class QProgressDialog; 34 | class QDomElement; 35 | 36 | class KTar; 37 | class KProgress; 38 | 39 | /** 40 | * @author Sébastien Laoût 41 | */ 42 | class Archive 43 | { 44 | public: 45 | static void save(BasketScene *basket, bool withSubBaskets, const QString &destination); 46 | static void open(const QString &path); 47 | private: 48 | // Convenient Methods for Saving: 49 | static void saveBasketToArchive(BasketScene *basket, bool recursive, KTar *tar, QStringList &backgrounds, const QString &tempFolder, QProgressDialog *progress); 50 | static void listUsedTags(BasketScene *basket, bool recursive, QList &list); 51 | // Convenient Methods for Loading: 52 | static void renameBasketFolders(const QString &extractionFolder, QMap &mergedStates); 53 | static void renameBasketFolder(const QString &extractionFolder, QDomNode &basketNode, QMap &folderMap, QMap &mergedStates); 54 | static void renameMergedStatesAndBasketIcon(const QString &fullPath, QMap &mergedStates, const QString &extractionFolder); 55 | static void renameMergedStates(QDomNode notes, QMap &mergedStates); 56 | static void importBasketIcon(QDomElement properties, const QString &extractionFolder); 57 | static void loadExtractedBaskets(const QString &extractionFolder, QDomNode &basketNode, QMap &folderMap, BasketScene *parent); 58 | static void importTagEmblems(const QString &extractionFolder); 59 | static void importArchivedBackgroundImages(const QString &extractionFolder); 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/backup.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 BACKUP_H 22 | #define BACKUP_H 23 | 24 | #include 25 | 26 | #include 27 | 28 | class QApplication; 29 | class QLabel; 30 | 31 | #include "basket_export.h" 32 | 33 | /** 34 | * @author Sébastien Laoût 35 | */ 36 | class BackupDialog : public QDialog 37 | { 38 | Q_OBJECT 39 | public: 40 | explicit BackupDialog(QWidget *parent = 0, const char *name = 0); 41 | ~BackupDialog(); 42 | private slots: 43 | void moveToAnotherFolder(); 44 | void useAnotherExistingFolder(); 45 | void backup(); 46 | void restore(); 47 | void populateLastBackup(); 48 | private: 49 | QLabel *m_lastBackup; 50 | }; 51 | 52 | /** 53 | * @author Sébastien Laoût 54 | */ 55 | class BASKET_EXPORT Backup 56 | { 57 | public: 58 | static void figureOutBinaryPath(const char *argv0, QApplication &app); 59 | static void setFolderAndRestart(const QString &folder, const QString &message); 60 | static QString newSafetyFolder(); 61 | 62 | private: 63 | static QString binaryPath; 64 | }; 65 | 66 | class BackupThread : public QThread 67 | { 68 | public: 69 | BackupThread(const QString &tarFile, const QString &folderToBackup); 70 | protected: 71 | virtual void run(); 72 | private: 73 | QString m_tarFile; 74 | QString m_folderToBackup; 75 | }; 76 | 77 | class RestoreThread : public QThread 78 | { 79 | public: 80 | RestoreThread(const QString &tarFile, const QString &destFolder); 81 | inline bool success() { 82 | return m_success; 83 | } 84 | protected: 85 | virtual void run(); 86 | private: 87 | QString m_tarFile; 88 | QString m_destFolder; 89 | bool m_success; 90 | }; 91 | 92 | #endif // BACKUP_H 93 | -------------------------------------------------------------------------------- /src/basket.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | 4 | Exec=basket %f 5 | MimeType=application/x-basket-archive;application/x-basket-template;application/x-basket-item; 6 | Icon=basket 7 | Categories=Qt;KDE;Office; 8 | 9 | X-DBUS-StartupType=Unique 10 | 11 | Name=BasKet Note Pads 12 | Name[de]=BasKet Notizblätter 13 | Name[es]=Blocs de notas BasKet 14 | Name[fr]=Blocs notes BasKet 15 | Name[it]=Blocco appunti BasKet 16 | Name[ja]=BasKet メモパッド 17 | Name[nb]=Kurvnotat 18 | Name[nn]=Korgnotat 19 | Name[pt]=Bloco de Notas BasKet 20 | Name[ru]=Альбом заметок BasKet 21 | Name[tr]=Basket 22 | Name[xx]=xxBasKet Note Padsxx 23 | GenericName=Multi-Purpose Notepad 24 | GenericName[tr]=Not Tutma Aracı 25 | 26 | Comment=Taking care of your ideas. 27 | Comment[de]=Bewahren Sie Ihre Ideen. 28 | Comment[es]=Cuidando de sus ideas. 29 | Comment[fr]=Prendre soin de vos idées. 30 | Comment[it]=Ci prendiamo cura delle tue idee 31 | Comment[nb]=Ta vare på tankene dine. 32 | Comment[nn]=Ta vare på tankane dine. 33 | Comment[ja]=あなたのアイデアのお世話をします。 34 | Comment[pt]=Cuidando das suas ideias. 35 | Comment[ru]=Заботимся о ваших идеях. 36 | Comment[tr]=Not Tutma Aracı 37 | Comment[xx]=xxTaking care of your ideas.xx 38 | -------------------------------------------------------------------------------- /src/basket_config_apps.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Icon=system-run 4 | Type=Service 5 | X-KDE-ServiceTypes=KCModule 6 | 7 | X-KDE-ModuleType=Library 8 | X-KDE-Library=kcm_basket 9 | X-KDE-FactoryName=basket_config_apps 10 | X-KDE-HasReadOnlyMode=false 11 | X-KDE-ParentApp=basket 12 | X-KDE-ParentComponents=basket,kontact_basketplugin 13 | X-KDE-CfgDlgHierarchy=Basket 14 | X-KDE-Weight=30 15 | 16 | Name=Applications 17 | Name[de]=Anwendungen 18 | Name[es]=Aplicaciones 19 | Name[fr]=Applications 20 | Name[it]=Applicazioni 21 | Name[ja]=アプリケーション 22 | Name[nb]=Programmer 23 | Name[nn]=Program 24 | Name[pt]=Aplicações 25 | Name[ru]=Приложения 26 | Name[tr]=Uygulamalar 27 | Comment=Applications 28 | Comment[de]=Anwendungen 29 | Comment[es]=Aplicaciones 30 | Comment[fr]=Applications 31 | Comment[it]=Applicazioni 32 | Comment[ja]=アプリケーション 33 | Comment[nb]=Programmer 34 | Comment[nn]=Program 35 | Comment[pt]=Aplicações 36 | Comment[ru]=Приложения 37 | Comment[tr]=Uygulamalar 38 | -------------------------------------------------------------------------------- /src/basket_config_baskets.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Icon=basket 4 | Type=Service 5 | X-KDE-ServiceTypes=KCModule 6 | 7 | X-KDE-ModuleType=Library 8 | X-KDE-Library=kcm_basket 9 | X-KDE-FactoryName=basket_config_baskets 10 | X-KDE-HasReadOnlyMode=false 11 | X-KDE-ParentApp=basket 12 | X-KDE-ParentComponents=basket,kontact_basketplugin 13 | X-KDE-CfgDlgHierarchy=Basket 14 | X-KDE-Weight=10 15 | 16 | Name=Baskets 17 | Name[de]=Körbe 18 | Name[es]=Cestas 19 | Name[fr]=Paniers 20 | Name[it]=Cesti 21 | Name[ja]=バスケット 22 | Name[nb]=Kurver 23 | Name[nn]=Korger 24 | Name[pt]=Cestos 25 | Name[ru]=Корзины 26 | Name[tr]=Sepetler 27 | Comment=Baskets 28 | Comment[de]=Körbe 29 | Comment[es]=Cestas 30 | Comment[fr]=Paniers 31 | Comment[it]=Cesti 32 | Comment[ja]=バスケット 33 | Comment[nb]=Kurver 34 | Comment[nn]=Korger 35 | Comment[pt]=Cestos 36 | Comment[ru]=Корзины 37 | Comment[tr]=Sepetler 38 | -------------------------------------------------------------------------------- /src/basket_config_general.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Icon=configure 4 | Type=Service 5 | X-KDE-ServiceTypes=KCModule 6 | 7 | X-KDE-ModuleType=Library 8 | X-KDE-Library=kcm_basket 9 | X-KDE-FactoryName=basket_config_general 10 | X-KDE-HasReadOnlyMode=false 11 | X-KDE-ParentApp=basket 12 | X-KDE-ParentComponents=basket,kontact_basketplugin 13 | X-KDE-CfgDlgHierarchy=Basket 14 | X-KDE-Weight=10 15 | 16 | Name=General 17 | Name[de]=Allgemein 18 | Name[es]=General 19 | Name[fr]=Général 20 | Name[it]=Generale 21 | Name[ja]=全般 22 | Name[nb]=Generelt 23 | Name[nn]=Generelt 24 | Name[pt]=Geral 25 | Name[ru]=Общие 26 | Name[tr]=Genel 27 | Comment=General 28 | Comment[de]=Allgemein 29 | Comment[es]=General 30 | Comment[fr]=Général 31 | Comment[it]=Generale 32 | Comment[ja]=全般 33 | Comment[nb]=Generelt 34 | Comment[nn]=Generelt 35 | Comment[pt]=Geral 36 | Comment[ru]=Общие 37 | Comment[de]=Genel 38 | -------------------------------------------------------------------------------- /src/basket_config_new_notes.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Icon=document-new 4 | Type=Service 5 | X-KDE-ServiceTypes=KCModule 6 | 7 | X-KDE-ModuleType=Library 8 | X-KDE-Library=kcm_basket 9 | X-KDE-FactoryName=basket_config_new_notes 10 | X-KDE-HasReadOnlyMode=false 11 | X-KDE-ParentApp=basket 12 | X-KDE-ParentComponents=basket,kontact_basketplugin 13 | X-KDE-CfgDlgHierarchy=Basket 14 | X-KDE-Weight=10 15 | 16 | Name=New Notes 17 | Name[de]=Neue Notizen 18 | Name[es]=Notas nuevas 19 | Name[fr]=Nouvelles notes 20 | Name[it]=Nuove note 21 | Name[ja]=新しいメモ 22 | Name[nb]=Nye notat 23 | Name[nn]=Nye notat 24 | Name[pt]=Anotações novas 25 | Name[ru]=Новые заметки 26 | Name[tr]=Yeni Notlar 27 | Comment=New Notes 28 | Comment[de]=Neue Notizen 29 | Comment[es]=Notas nuevas 30 | Comment[fr]=Nouvelles notes 31 | Comment[it]=Nuove note 32 | Comment[ja]=新しいメモ 33 | Comment[nb]=Nye notat 34 | Comment[nn]=Nye notat 35 | Comment[pt]=Anotações novas 36 | Comment[ru]=Новые заметки 37 | Comment[tr]=Yeni Notlar 38 | -------------------------------------------------------------------------------- /src/basket_config_notes_appearance.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Icon=preferences-desktop-theme 4 | Type=Service 5 | X-KDE-ServiceTypes=KCModule 6 | 7 | X-KDE-ModuleType=Library 8 | X-KDE-Library=kcm_basket 9 | X-KDE-FactoryName=basket_config_notes_appearance 10 | X-KDE-HasReadOnlyMode=false 11 | X-KDE-ParentApp=basket 12 | X-KDE-ParentComponents=basket,kontact_basketplugin 13 | X-KDE-CfgDlgHierarchy=Basket 14 | X-KDE-Weight=10 15 | 16 | Name=Notes Appearance 17 | Name[de]=Erscheinungsbild 18 | Name[es]=Apariencia de las notas 19 | Name[fr]=Apparence des notes 20 | Name[it]=Aspetto delle note 21 | Name[ja]=メモの外観 22 | Name[nb]=Notatutseende 23 | Name[nn]=Notatutsjånad 24 | Name[ru]=Вид 25 | Name[tr]=Not Görünümleri 26 | Comment=Notes Appearance 27 | Comment[de]=Erscheinungsbild der Notizen 28 | Comment[es]=Apariencia de las notas 29 | Comment[fr]=Apparence des notes 30 | Comment[it]=Aspetto delle note 31 | Comment[ja]=メモの外観 32 | Comment[nb]=Notatutseende 33 | Comment[nn]=Notatutsjånad 34 | Comment[ru]=Вид 35 | Comment[tr]=Not Görünümleri 36 | -------------------------------------------------------------------------------- /src/basket_config_version_sync.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Icon=folder-sync 4 | Type=Service 5 | X-KDE-ServiceTypes=KCModule 6 | 7 | X-KDE-ModuleType=Library 8 | X-KDE-Library=kcm_basket 9 | X-KDE-FactoryName=basket_config_version_sync 10 | X-KDE-HasReadOnlyMode=false 11 | X-KDE-ParentApp=basket 12 | X-KDE-ParentComponents=basket,kontact_basketplugin 13 | X-KDE-CfgDlgHierarchy=Basket 14 | X-KDE-Weight=40 15 | 16 | Name=Version Sync 17 | Name[de]=Version Sync 18 | Name[es]=Version Sync 19 | Name[fr]=Version Sync 20 | Name[it]=Sincronizzazione versione 21 | Name[ja]=Version Sync 22 | Name[nb]=Version Sync 23 | Name[nn]=Version Sync 24 | Name[pt]=Version Sync 25 | Name[ru]=Синхронизация изменений 26 | Name[tr]=Version Sync 27 | Comment=Version Sync 28 | Comment[de]=Version Sync 29 | Comment[es]=Version Sync 30 | Comment[fr]=Version Sync 31 | Comment[it]=Sincronizzazione della versione 32 | Comment[ja]=Version Sync 33 | Comment[nb]=Version Sync 34 | Comment[nn]=Version Sync 35 | Comment[pt]=Version Sync 36 | Comment[ru]=Синхронизация изменений 37 | Comment[tr]=Version Sync 38 | -------------------------------------------------------------------------------- /src/basket_export.h: -------------------------------------------------------------------------------- 1 | /* This file is part of Basket 2 | Copyright (C) 2009 Matt Rogers 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with this library; see the file COPYING.LIB. If not, write to 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef BASKET_EXPORT_H 21 | #define BASKET_EXPORT_H 22 | 23 | 24 | #ifndef BASKET_EXPORT 25 | # if defined(MAKE_BASKETCOMMON_LIB) 26 | /* We are building this library */ 27 | # define BASKET_EXPORT Q_DECL_EXPORT 28 | # else 29 | /* We are using this library */ 30 | # define BASKET_EXPORT Q_DECL_IMPORT 31 | # endif 32 | #endif 33 | 34 | # ifndef BASKET_EXPORT_DEPRECATED 35 | # define BASKET_EXPORT_DEPRECATED KDE_DEPRECATED BASKET_EXPORT 36 | # endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/basket_options.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 BASKET_OPTIONS_H 22 | #define BASKET_OPTIONS_H 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include "global.h" 30 | #include "aboutdata.h" 31 | 32 | 33 | 34 | void setupCmdLineOptions(QCommandLineParser *opts) 35 | { 36 | opts->addHelpOption(); 37 | opts->addVersionOption(); 38 | 39 | opts->addOption(QCommandLineOption(QStringList() << "d" << "debug", 40 | i18n("Show the debug window"))); 41 | opts->addOption(QCommandLineOption(QStringList() << "f" << "data-folder", 42 | i18n("Custom folder to load and save baskets and other application data."), 43 | i18nc("Command line help: --data-folder ", "folder"))); 44 | opts->addOption(QCommandLineOption("start-hidden", 45 | i18n("Automatically hide the main window in the system tray on startup."))); // 46 | opts->addOption(QCommandLineOption(QStringList() << "k" << "use-drkonqi", 47 | i18n("On crash, use the standard KDE crash handler rather than send an email."))); 48 | 49 | opts->addPositionalArgument("file", i18n("Open a basket archive or template.")); 50 | } 51 | 52 | #endif // BASKET_OPTIONS_H 53 | -------------------------------------------------------------------------------- /src/basket_part.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Petri Damsten * 3 | * petri.damsten@iki.fi * 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 "basket_part.h" 22 | 23 | #include 24 | 25 | #include "aboutdata.h" 26 | #include "basketstatusbar.h" 27 | #include "bnpview.h" 28 | 29 | K_PLUGIN_FACTORY_DEFINITION(BasketFactory, 30 | registerPlugin(); 31 | ) 32 | 33 | BasketPart::BasketPart(QWidget *parentWidget, QObject *parent, const QList &) 34 | : KParts::ReadWritePart(parent) 35 | { 36 | // we need an instance 37 | //setInstance( BasketFactory::instance() ); 38 | 39 | BasketStatusBar* bar = new BasketStatusBar(new KParts::StatusBarExtension(this)); 40 | // this should be your custom internal widget 41 | m_view = new BNPView(parentWidget, "BNPViewPart", this, actionCollection(), bar); 42 | connect(m_view, SIGNAL(setWindowCaption(const QString &)), this, SLOT(setWindowTitle(const QString &))); 43 | connect(m_view, SIGNAL(showPart()), this, SIGNAL(showPart())); 44 | m_view->setFocusPolicy(Qt::ClickFocus); 45 | 46 | // notify the part that this is our internal widget 47 | setWidget(m_view); 48 | 49 | setComponentName(AboutData::componentName(), AboutData::displayName()); 50 | 51 | // set our XML-UI resource file 52 | setXMLFile("basket_part.rc", true); 53 | 54 | // we are read-write by default 55 | setReadWrite(true); 56 | 57 | // we are not modified since we haven't done anything yet 58 | setModified(false); 59 | } 60 | 61 | BasketPart::~BasketPart() 62 | {} 63 | 64 | void BasketPart::setReadWrite(bool rw) 65 | { 66 | // TODO: notify your internal widget of the read-write state 67 | ReadWritePart::setReadWrite(rw); 68 | } 69 | 70 | void BasketPart::setModified(bool modified) 71 | { 72 | // in any event, we want our parent to do it's thing 73 | ReadWritePart::setModified(modified); 74 | } 75 | 76 | bool BasketPart::openFile() 77 | { 78 | // TODO 79 | return false; 80 | } 81 | 82 | bool BasketPart::saveFile() 83 | { 84 | //TODO 85 | return false; 86 | } 87 | 88 | KAboutData *BasketPart::createAboutData() 89 | { 90 | return new AboutData(); 91 | } 92 | 93 | void BasketPart::setWindowTitle(const QString &caption) 94 | { 95 | emit setWindowCaption(caption); 96 | } 97 | -------------------------------------------------------------------------------- /src/basket_part.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Name=BasketPart 4 | Name[br]=Perzhbasket 5 | Name[ca]=Part per a basket 6 | Name[el]=Τμήμαbasket 7 | Name[es]=Componente de Basket 8 | Name[et]=basket komponent 9 | Name[it]=Componente Basket 10 | Name[ja]=basket パート 11 | Name[nb]=kurvDel 12 | Name[nn]=korgDel 13 | Name[pt_BR]=Parte basket 14 | Name[sv]=basket-del 15 | Name[ta]=basketபாகம் 16 | Name[tr]=basket Bileşeni 17 | Name[ru]=Модуль basket 18 | MimeType=application/x-basket; 19 | X-KDE-ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart 20 | X-KDE-Library=basketpart 21 | Type=Service 22 | -------------------------------------------------------------------------------- /src/basket_part.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Petri Damsten * 3 | * petri.damsten@iki.fi * 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 _BASKETPART_H_ 22 | #define _BASKETPART_H_ 23 | 24 | #include 25 | #include 26 | 27 | class QWidget; 28 | class QPainter; 29 | 30 | class KAboutData; 31 | class QUrl; 32 | 33 | class BNPView; 34 | 35 | /** 36 | * This is a "Part". It that does all the real work in a KPart 37 | * application. 38 | * 39 | * @short Main Part 40 | * @author Petri Damsten 41 | * @version 0.1 42 | */ 43 | class BasketPart : public KParts::ReadWritePart 44 | { 45 | Q_OBJECT 46 | public: 47 | /** 48 | * Default constructor 49 | */ 50 | BasketPart(QWidget *parentWidget, QObject *parent, const QList &); 51 | 52 | /** 53 | * Destructor 54 | */ 55 | virtual ~BasketPart(); 56 | 57 | /** 58 | * This is a virtual function inherited from KParts::ReadWritePart. 59 | * A shell will use this to inform this Part if it should act 60 | * read-only 61 | */ 62 | virtual void setReadWrite(bool rw); 63 | 64 | /** 65 | * Reimplemented to disable and enable Save action 66 | */ 67 | virtual void setModified(bool modified); 68 | 69 | static KAboutData *createAboutData(); 70 | 71 | signals: 72 | void showPart(); 73 | 74 | protected: 75 | /** 76 | * This must be implemented by each part 77 | */ 78 | virtual bool openFile(); 79 | 80 | /** 81 | * This must be implemented by each read-write part 82 | */ 83 | virtual bool saveFile(); 84 | 85 | protected slots: 86 | void setWindowTitle(const QString &caption); 87 | 88 | private: 89 | BNPView *m_view; 90 | }; 91 | 92 | K_PLUGIN_FACTORY_DECLARATION(BasketFactory) 93 | 94 | #endif // _BASKETPART_H_ 95 | -------------------------------------------------------------------------------- /src/basket_plugin.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Robert Marmorstein * 3 | * robert@narnia.homeunix.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 "basket_plugin.h" 22 | #include "global.h" 23 | 24 | #include "basket_part.h" 25 | 26 | #include 27 | 28 | EXPORT_KONTACT_PLUGIN(BasketPlugin, basket) 29 | 30 | BasketPlugin::BasketPlugin(KontactInterface::Core *core, const QVariantList &) 31 | : KontactInterface::Plugin(core, core, "Basket") 32 | { 33 | setComponentData(KontactPluginFactory::componentData()); 34 | Global::basketConfig = KSharedConfig::openConfig("basketrc"); 35 | } 36 | 37 | BasketPlugin::~BasketPlugin() 38 | { 39 | } 40 | 41 | KParts::ReadOnlyPart *BasketPlugin::createPart() 42 | { 43 | KParts::ReadOnlyPart *part = loadPart(); 44 | 45 | connect(part, SIGNAL(showPart()), this, SLOT(showPart())); 46 | 47 | return part; 48 | } 49 | 50 | void BasketPlugin::readProperties(const KConfigGroup &config) 51 | { 52 | if (part()) { 53 | BasketPart *myPart = static_cast(part()); 54 | } 55 | } 56 | 57 | void BasketPlugin::saveProperties(KConfigGroup &config) 58 | { 59 | if (part()) { 60 | BasketPart *myPart = static_cast(part()); 61 | } 62 | } 63 | 64 | void BasketPlugin::showPart() 65 | { 66 | core()->selectPlugin(this); 67 | } 68 | -------------------------------------------------------------------------------- /src/basket_plugin.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Service 3 | Icon=basket 4 | X-KDE-ServiceTypes=Kontact/Plugin,KPluginInfo 5 | 6 | X-KDE-Library=kontact_basketplugin 7 | X-KDE-KontactPluginVersion=9 8 | X-KDE-KontactPartLibraryName=libbasketpart 9 | X-KDE-KontactPluginHasSummary=false 10 | 11 | X-KDE-PluginInfo-Name=kontact_basketplugin 12 | X-KDE-PluginInfo-Version=0.1 13 | X-KDE-PluginInfo-License=GPL 14 | X-KDE-PluginInfo-EnabledByDefault=true 15 | 16 | Comment=BasKet NotePads -- a KDE note organization application 17 | Name=basket 18 | -------------------------------------------------------------------------------- /src/basket_plugin.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 by Robert Marmorstein * 3 | * robert@narnia.homeunix.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 BASKET_PLUGIN_H 22 | #define BASKET_PLUGIN_H 23 | 24 | #include 25 | 26 | namespace KParts { 27 | class ReadOnlyPart; 28 | } 29 | 30 | class BasketPlugin : public KontactInterface::Plugin 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | BasketPlugin(KontactInterface::Core *core, const QVariantList &); 36 | ~BasketPlugin(); 37 | 38 | virtual void readProperties(const KConfigGroup &config); 39 | virtual void saveProperties(KConfigGroup &config); 40 | 41 | private slots: 42 | void showPart(); 43 | 44 | protected: 45 | KParts::ReadOnlyPart *createPart(); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/basketfactory.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 BASKETFACTORY_H 22 | #define BASKETFACTORY_H 23 | 24 | class QColor; 25 | class QString; 26 | 27 | class BasketScene; 28 | 29 | /** Methods to create various baskets (mkdir, init the properties and load it). 30 | * @author Sébastien Laoût 31 | */ 32 | namespace BasketFactory 33 | { 34 | /** You should use this method to create a new basket: */ 35 | void newBasket(const QString &icon, 36 | const QString &name, 37 | const QString &backgroundImage, 38 | const QColor &backgroundColor, 39 | const QColor &textColor, 40 | const QString &templateName, 41 | BasketScene *parent); 42 | /** Internal tool methods to process the method above: */ 43 | QString newFolderName(); 44 | QString unpackTemplate(const QString &templateName); 45 | } 46 | 47 | #endif // BASKETFACTORY_H 48 | -------------------------------------------------------------------------------- /src/basketproperties.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 BASKETPROPERTIES_H 22 | #define BASKETPROPERTIES_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "ui_basketproperties.h" 29 | 30 | class KIconButton; 31 | class QLineEdit; 32 | class QGroupBox; 33 | class QVBoxLayout; 34 | class QRadioButton; 35 | class QString; 36 | 37 | class KComboBox; 38 | class KShortcutWidget; 39 | class QKeySequence; 40 | class KColorCombo2; 41 | 42 | class BasketScene; 43 | 44 | /** The dialog that hold basket settings. 45 | * @author Sébastien Laoût 46 | */ 47 | class BasketPropertiesDialog : public QDialog, private Ui::BasketPropertiesUi 48 | { 49 | Q_OBJECT 50 | public: 51 | explicit BasketPropertiesDialog(BasketScene *basket, QWidget *parent = 0); 52 | ~BasketPropertiesDialog(); 53 | void ensurePolished(); 54 | 55 | public slots: 56 | void applyChanges(); 57 | 58 | protected slots: 59 | void capturedShortcut(const QList& shortcut); 60 | void selectColumnsLayout(); 61 | 62 | private: 63 | BasketScene *m_basket; 64 | KColorCombo2 *m_backgroundColor; 65 | KColorCombo2 *m_textColor; 66 | 67 | QMap m_backgroundImagesMap; 68 | }; 69 | 70 | #endif // BASKETPROPERTIES_H 71 | -------------------------------------------------------------------------------- /src/basketstatusbar.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 | #ifndef BASKETSTATUSBAR_H 21 | #define BASKETSTATUSBAR_H 22 | 23 | #include 24 | #include 25 | 26 | #include "basket_export.h" 27 | 28 | class QStatusBar; 29 | namespace KParts 30 | { 31 | class StatusBarExtension; 32 | } 33 | 34 | class QWidget; 35 | class QLabel; 36 | 37 | /** 38 | @author Sébastien Laoût 39 | */ 40 | class BASKET_EXPORT BasketStatusBar : public QObject 41 | { 42 | Q_OBJECT 43 | public: 44 | BasketStatusBar(QStatusBar *bar); 45 | BasketStatusBar(KParts::StatusBarExtension *extension); 46 | ~BasketStatusBar(); 47 | 48 | public slots: 49 | /** GUI Main Window actions **/ 50 | void setStatusBarHint(const QString &hint); /// << Set a specific message or update if hint is empty 51 | void updateStatusBarHint(); /// << Display the current state message (dragging, editing) or reset the startsbar message 52 | void postStatusbarMessage(const QString &text); 53 | void setSelectionStatus(const QString &s); 54 | void setLockStatus(bool isLocked); 55 | void setupStatusBar(); 56 | void setUnsavedStatus(bool isUnsaved); 57 | 58 | protected: 59 | QStatusBar *statusBar() const; 60 | void addWidget(QWidget * widget, int stretch = 0, bool permanent = false); 61 | void setStatusText(const QString &txt); 62 | bool eventFilter(QObject * obj, QEvent * event); 63 | private: 64 | QStatusBar *m_bar; 65 | KParts::StatusBarExtension *m_extension; 66 | QLabel *m_selectionStatus; 67 | QLabel *m_lockStatus; 68 | QLabel *m_basketStatus; 69 | QLabel *m_savedStatus; 70 | QPixmap m_savedStatusPixmap; 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/basketview.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 "basketview.h" 22 | 23 | #include "basketscene.h" 24 | 25 | BasketView::BasketView( BasketScene *scene, QWidget * parent ) 26 | : QGraphicsView(scene, parent) 27 | { 28 | } 29 | 30 | BasketView::~BasketView() 31 | { 32 | } 33 | 34 | void BasketView::resizeEvent( QResizeEvent* ) 35 | { 36 | static_cast(scene())->relayoutNotes(true); 37 | } 38 | -------------------------------------------------------------------------------- /src/basketview.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 BASKET_VIEW_H 22 | #define BASKET_VIEW_H 23 | 24 | #include 25 | 26 | class BasketScene; 27 | 28 | class BasketView : public QGraphicsView 29 | { 30 | Q_OBJECT 31 | public: 32 | BasketView( BasketScene *scene, QWidget * parent = 0 ); 33 | virtual ~BasketView(); 34 | protected: 35 | virtual void resizeEvent( QResizeEvent * event ); 36 | }; 37 | 38 | #endif // BASKET_VIEW_H 39 | -------------------------------------------------------------------------------- /src/colorpicker.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 COLORPICKER_H 22 | #define COLORPICKER_H 23 | 24 | #include 25 | 26 | class QKeyEvent; 27 | class QMouseEvent; 28 | 29 | /** Class to pick a color on the screen 30 | * @author Sébastien Laoût 31 | */ 32 | class DesktopColorPicker : public QDesktopWidget 33 | { 34 | Q_OBJECT 35 | public: 36 | /** Construtor, initializer and destructor */ 37 | DesktopColorPicker(); 38 | ~DesktopColorPicker(); 39 | public slots: 40 | /** Begin color picking. 41 | * This function returns immediately, and pickedColor() is emitted if user has 42 | * chozen a color, and not canceled the process (by pressing Escape). 43 | */ 44 | void pickColor(); 45 | signals: 46 | /** When user picked a color, this signal is emitted. 47 | */ 48 | void pickedColor(const QColor &color); 49 | /** When user cancel a picking (by pressing Escape), this signal is emitted. 50 | */ 51 | void canceledPick(); 52 | protected slots: 53 | void slotDelayedPick(); 54 | protected: 55 | void mouseReleaseEvent(QMouseEvent *event); 56 | void keyPressEvent(QKeyEvent *event); 57 | bool m_gettingColorFromScreen; 58 | }; 59 | 60 | #endif // COLORPICKER_H 61 | -------------------------------------------------------------------------------- /src/crashhandler.h: -------------------------------------------------------------------------------- 1 | // Code from Amarok. 2 | 3 | /*************************************************************************** 4 | * Copyright (C) 2005 Max Howell * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 2 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | ***************************************************************************/ 12 | 13 | #ifndef CRASH_H 14 | #define CRASH_H 15 | 16 | #include 17 | 18 | /** 19 | * @author Max Howell 20 | * @short The amaroK crash-handler 21 | * 22 | * I'm not entirely sure why this had to be inside a class, but it 23 | * wouldn't work otherwise *shrug* 24 | */ 25 | class Crash 26 | { 27 | public: 28 | static void crashHandler(int signal); 29 | static QString getOSVersionInfo(); 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/debugwindow.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 "debugwindow.h" 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | #include "global.h" 33 | 34 | DebugWindow::DebugWindow(QWidget *parent) 35 | : QWidget(parent) 36 | { 37 | Global::debugWindow = this; 38 | setWindowTitle(i18n("Debug Window")); 39 | 40 | layout = new QVBoxLayout(this); 41 | textBrowser = new QTextBrowser(this); 42 | 43 | textBrowser->setWordWrapMode(QTextOption::NoWrap); 44 | 45 | layout->addWidget(textBrowser); 46 | textBrowser->show(); 47 | } 48 | 49 | DebugWindow::~DebugWindow() 50 | { 51 | delete textBrowser; 52 | delete layout; 53 | } 54 | 55 | void DebugWindow::postMessage(const QString msg) 56 | { 57 | textBrowser->append(msg); 58 | } 59 | 60 | DebugWindow& DebugWindow::operator<<(const QString msg) 61 | { 62 | //This can be used from a different thread 63 | QMetaObject::invokeMethod(this, "postMessage", Qt::QueuedConnection, Q_ARG(QString, msg)); 64 | return *this; 65 | } 66 | 67 | void DebugWindow::insertHLine() 68 | { 69 | textBrowser->append("
"); 70 | } 71 | 72 | void DebugWindow::closeEvent(QCloseEvent *event) 73 | { 74 | Global::debugWindow = 0L; 75 | QWidget::closeEvent(event); 76 | } 77 | 78 | -------------------------------------------------------------------------------- /src/debugwindow.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 DEBUGWINDOW_H 22 | #define DEBUGWINDOW_H 23 | 24 | #include 25 | 26 | class QVBoxLayout; 27 | class QTextBrowser; 28 | class QString; 29 | class QCloseEvent; 30 | 31 | /**A simple window that display text through debugging messages. 32 | *@author Sébastien Laoût 33 | */ 34 | 35 | class DebugWindow : public QWidget 36 | { 37 | Q_OBJECT 38 | public: 39 | /** Construtor and destructor */ 40 | DebugWindow(QWidget *parent = 0); 41 | ~DebugWindow(); 42 | /** Methods to post a message to the debug window */ 43 | Q_INVOKABLE void postMessage(const QString msg); 44 | DebugWindow& operator<<(const QString msg); 45 | void insertHLine(); 46 | protected: 47 | virtual void closeEvent(QCloseEvent *event); 48 | private: 49 | QVBoxLayout *layout; 50 | QTextBrowser *textBrowser; 51 | }; 52 | 53 | #define DEBUG_WIN if (Global::debugWindow) *Global::debugWindow 54 | 55 | #endif // DEBUGWINDOW_H 56 | -------------------------------------------------------------------------------- /src/decoratedbasket.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 "decoratedbasket.h" 22 | 23 | #include 24 | #include 25 | 26 | #include "basketscene.h" 27 | #include "filter.h" 28 | #include "settings.h" 29 | 30 | /** Class DecoratedBasket: */ 31 | 32 | DecoratedBasket::DecoratedBasket(QWidget *parent, const QString &folderName, Qt::WindowFlags fl) 33 | : QWidget(parent, fl) 34 | { 35 | m_layout = new QVBoxLayout(this); 36 | m_filter = new FilterBar(this); 37 | m_basket = new BasketScene(this, folderName); 38 | m_basket->graphicsView()->setParent(this); 39 | m_layout->addWidget(m_basket->graphicsView()); 40 | setFilterBarPosition(Settings::filterOnTop()); 41 | 42 | m_filter->hide(); 43 | m_basket->setFocus(); // To avoid the filter bar have focus on load 44 | 45 | connect(m_filter, SIGNAL(newFilter(const FilterData&)), m_basket, SLOT(newFilter(const FilterData&))); 46 | 47 | connect(m_basket, SIGNAL(postMessage(const QString&)), Global::bnpView, SLOT(postStatusbarMessage(const QString&))); 48 | connect(m_basket, SIGNAL(setStatusBarText(const QString&)), Global::bnpView, SLOT(setStatusBarHint(const QString&))); 49 | connect(m_basket, SIGNAL(resetStatusBarText()), Global::bnpView, SLOT(updateStatusBarHint())); 50 | } 51 | 52 | DecoratedBasket::~DecoratedBasket() 53 | { 54 | } 55 | 56 | void DecoratedBasket::setFilterBarPosition(bool onTop) 57 | { 58 | m_layout->removeWidget(m_filter); 59 | if (onTop) { 60 | m_layout->insertWidget(0, m_filter); 61 | setTabOrder(this/*(QWidget*)parent()*/, m_filter); 62 | setTabOrder(m_filter, m_basket->graphicsView()); 63 | setTabOrder(m_basket->graphicsView(), (QWidget*)parent()); 64 | } else { 65 | m_layout->addWidget(m_filter); 66 | setTabOrder(this/*(QWidget*)parent()*/, m_basket->graphicsView()); 67 | setTabOrder(m_basket->graphicsView(), m_filter); 68 | setTabOrder(m_filter, (QWidget*)parent()); 69 | } 70 | } 71 | 72 | void DecoratedBasket::setFilterBarVisible(bool show, bool switchFocus) 73 | { 74 | // m_basket->setShowFilterBar(true);//show); 75 | // m_basket->save(); 76 | // In this order (m_basket and then m_filter) because setShown(false) 77 | // will call resetFilter() that will update actions, and then check the 78 | // Ctrl+F action whereas it should be unchecked 79 | // FIXME: It's very uggly all those things 80 | m_filter->setVisible(show); 81 | if (show) { 82 | if (switchFocus) 83 | m_filter->setEditFocus(); 84 | } else if (m_filter->hasEditFocus()) 85 | m_basket->setFocus(); 86 | } 87 | 88 | void DecoratedBasket::resetFilter() 89 | { 90 | m_filter->reset(); 91 | } 92 | 93 | void DecoratedBasket::resizeEvent(QResizeEvent *event) 94 | { 95 | QWidget::resizeEvent(event); 96 | m_basket->relayoutNotes(true); 97 | } 98 | -------------------------------------------------------------------------------- /src/decoratedbasket.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 DECORATEDBASKET_H 22 | #define DECORATEDBASKET_H 23 | 24 | class QString; 25 | class BasketScene; 26 | class QVBoxLayout; 27 | class QGraphicsView; 28 | 29 | #include 30 | 31 | #include "filter.h" 32 | 33 | /** This class handle Basket and add a FilterWidget on top of it. 34 | * @author Sébastien Laoût 35 | */ 36 | class DecoratedBasket : public QWidget 37 | { 38 | Q_OBJECT 39 | public: 40 | DecoratedBasket(QWidget *parent, const QString &folderName, Qt::WindowFlags fl = 0); 41 | ~DecoratedBasket(); 42 | void setFilterBarPosition(bool onTop); 43 | void resetFilter(); 44 | void setFilterBarVisible(bool show, bool switchFocus = true); 45 | bool isFilterBarVisible() { 46 | return m_filter->isVisible(); 47 | } 48 | const FilterData& filterData() { 49 | return m_filter->filterData(); 50 | } 51 | FilterBar* filterBar() { 52 | return m_filter; 53 | } 54 | BasketScene* basket() { 55 | return m_basket; 56 | } 57 | 58 | void resizeEvent(QResizeEvent *event); 59 | 60 | private: 61 | QVBoxLayout *m_layout; 62 | FilterBar *m_filter; 63 | BasketScene *m_basket; 64 | }; 65 | #endif // DECORATEDBASKET_H 66 | -------------------------------------------------------------------------------- /src/diskerrordialog.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 "diskerrordialog.h" 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | DiskErrorDialog::DiskErrorDialog(const QString &titleMessage, const QString &message, QWidget *parent) 36 | : QDialog(parent) 37 | { 38 | setObjectName("DiskError"); 39 | setWindowTitle(i18n("Save Error")); 40 | //enableButtonCancel(false); 41 | //enableButtonClose(false); 42 | //enableButton(Close, false); 43 | //okButton->setEnabled(false); 44 | setModal(true); 45 | //QHBoxLayout *layout = new QHBoxLayout(mainWidget(), /*margin=*/0, spacingHint()); 46 | QWidget *mainWidget = new QWidget(this); 47 | QVBoxLayout *mainLayout = new QVBoxLayout; 48 | setLayout(mainLayout); 49 | mainLayout->addWidget(mainWidget); 50 | QHBoxLayout *layout = new QHBoxLayout(mainWidget); 51 | QPixmap icon = KIconLoader::global()->loadIcon( 52 | "drive-harddisk", KIconLoader::NoGroup, 64, KIconLoader::DefaultState, 53 | QStringList(), /*path_store=*/0L, /*canReturnNull=*/true 54 | ); 55 | QLabel *iconLabel = new QLabel(mainWidget); 56 | iconLabel->setPixmap(icon); 57 | iconLabel->setFixedSize(iconLabel->sizeHint()); 58 | QLabel *label = new QLabel("

" + titleMessage + "

" + message + "

", mainWidget); 59 | if (!icon.isNull()) 60 | layout->addWidget(iconLabel); 61 | layout->addWidget(label); 62 | } 63 | 64 | DiskErrorDialog::~DiskErrorDialog() 65 | { 66 | } 67 | 68 | void DiskErrorDialog::closeEvent(QCloseEvent *event) 69 | { 70 | event->ignore(); 71 | } 72 | 73 | void DiskErrorDialog::keyPressEvent(QKeyEvent*) 74 | { 75 | // Escape should not close the window... 76 | } 77 | -------------------------------------------------------------------------------- /src/diskerrordialog.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 DISKERRORDIALOG_H 22 | #define DISKERRORDIALOG_H 23 | 24 | #include 25 | 26 | class QCloseEvent; 27 | class QKeyEvent; 28 | 29 | /** Provide a dialog to avert the user the disk is full. 30 | * This dialog is modal and is shown until the user has made space on the disk. 31 | * @author Sébastien Laoût 32 | */ 33 | class DiskErrorDialog : public QDialog 34 | { 35 | Q_OBJECT 36 | public: 37 | DiskErrorDialog(const QString &titleMessage, const QString &message, QWidget *parent = 0); 38 | ~DiskErrorDialog(); 39 | protected: 40 | void closeEvent(QCloseEvent *event); 41 | void keyPressEvent(QKeyEvent*); 42 | }; 43 | 44 | #endif // DISKERRORDIALOG_H 45 | -------------------------------------------------------------------------------- /src/file_metadata.cpp: -------------------------------------------------------------------------------- 1 | #include "file_metadata.h" 2 | #include 3 | 4 | using namespace KFileMetaData::Property; 5 | 6 | void MetaDataExtractionResult::add(Property property, const QVariant& value) 7 | { 8 | m_groups[property] = value; 9 | } 10 | 11 | QList> MetaDataExtractionResult::preferredGroups() 12 | { 13 | //Text captions for some properties. Unspecified properties will get empty captions 14 | static const QMap PROPERTY_TRANSLATIONS = { 15 | { Property::BitRate, i18n("Bit rate") }, 16 | { Property::Channels, i18n("Channels") }, 17 | { Property::Duration, i18n("Duration") }, 18 | { Property::Genre, i18n("Genre") }, 19 | { Property::SampleRate, i18n("Sample rate") }, 20 | { Property::TrackNumber, i18n("Track number") }, 21 | { Property::Comment, i18n("Comment") }, 22 | { Property::Artist, i18n("Artist") }, 23 | { Property::Album, i18n("Album") }, 24 | { Property::Title, i18n("Title") }, 25 | { Property::WordCount, i18n("Word count") }, 26 | { Property::LineCount, i18n("Line count") }, 27 | { Property::Copyright, i18n("Copyright") }, 28 | { Property::CreationDate, i18n("Date") }, 29 | { Property::FrameRate, i18n("Frame rate") } 30 | }; 31 | 32 | static QList preferredItems; 33 | if (preferredItems.count() == 0) { 34 | //According to KDE 3 services/kfile_*.desktop 35 | 36 | //audio 37 | preferredItems << Property::Title << Property::Artist << Property::Album << Property::TrackNumber << 38 | Property::Genre << Property::BitRate << Property::Duration << Property::CreationDate << Property::Comment << 39 | Property::SampleRate << Property::Channels << Property::Copyright; 40 | //video 41 | preferredItems /*<< Property::Duration*/ << Property::FrameRate; 42 | //text 43 | preferredItems << Property::LineCount << Property::WordCount; 44 | } 45 | 46 | 47 | QList> result; 48 | if (m_groups.count() == 0) 49 | return result; 50 | 51 | KFileMetaData::PropertyMap groups = m_groups; 52 | 53 | for (int i = 0; i < preferredItems.count(); i++) { 54 | QVariant value = groups.take(preferredItems[i]); 55 | if (value.isValid()) 56 | result.append( {PROPERTY_TRANSLATIONS[preferredItems[i]], value.toString()} ); 57 | } 58 | 59 | //Remaining groups 60 | for (auto it = groups.begin(); it != groups.end(); it++) { 61 | result.append( {PROPERTY_TRANSLATIONS[it.key()], it.value().toString()} ); 62 | } 63 | 64 | return result; 65 | } 66 | -------------------------------------------------------------------------------- /src/file_metadata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 by Gleb Baryshev 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef FILE_METADATA_H 21 | #define FILE_METADATA_H 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | /// Store and retrieve metadata extraction results 29 | class MetaDataExtractionResult : public KFileMetaData::ExtractionResult 30 | { 31 | public: 32 | MetaDataExtractionResult(const QString& url, const QString& mimetype) : 33 | KFileMetaData::ExtractionResult(url, mimetype, KFileMetaData::ExtractionResult::ExtractMetaData) { } 34 | 35 | void append(const QString&) override { } //not used 36 | void add(KFileMetaData::Property::Property property, const QVariant& value) override; 37 | void addType(KFileMetaData::Type::Type) override { } //not used 38 | 39 | /// Get preferred metadata as "property-value" pairs 40 | QList > preferredGroups(); 41 | 42 | private: 43 | KFileMetaData::PropertyMap m_groups; 44 | }; 45 | 46 | #endif // FILE_METADATA_H 47 | -------------------------------------------------------------------------------- /src/file_mimetypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 by Gleb Baryshev 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef FILE_MIMETYPES_H 21 | #define FILE_MIMETYPES_H 22 | 23 | namespace MimeTypes 24 | { 25 | #define StrRes static const char* const 26 | 27 | StrRes LAUNCHER = "application/x-desktop"; 28 | StrRes HTML = "text/html"; 29 | StrRes TEXT = "text/plain"; 30 | 31 | StrRes ANIMATION = "image/gif"; 32 | StrRes ANIMATION_MNG = "movie/x-mng"; 33 | 34 | StrRes IMAGE = "image/"; 35 | StrRes AUDIO = "audio/"; 36 | 37 | #undef StrRes 38 | } 39 | 40 | #endif // FILE_MIMETYPES_H 41 | -------------------------------------------------------------------------------- /src/filter.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 FILTER_H 22 | #define FILTER_H 23 | 24 | #include 25 | #include 26 | 27 | class QToolButton; 28 | 29 | class QLineEdit; 30 | class KComboBox; 31 | 32 | class Tag; 33 | class State; 34 | 35 | /** The structure that contain all filter terms 36 | * @author Sébastien Laoût 37 | */ 38 | struct FilterData 39 | { 40 | public: 41 | // Useful Enum for tagFilterType: 42 | enum TagFilterType { DontCareTagsFilter = 0, NotTaggedFilter, TaggedFilter, TagFilter, StateFilter }; 43 | // Constructor and Destructor: 44 | FilterData() { 45 | isFiltering = false; tagFilterType = DontCareTagsFilter; tag = 0; state = 0; 46 | } 47 | ~FilterData() {} 48 | // Filter data: 49 | QString string; 50 | int tagFilterType; 51 | Tag *tag; 52 | State *state; 53 | bool isFiltering; 54 | }; 55 | 56 | /** A QWidget that allow user to enter terms to filter in a Basket. 57 | * @author Sébastien Laoût 58 | */ 59 | class FilterBar : public QWidget 60 | { 61 | Q_OBJECT 62 | public: 63 | FilterBar(QWidget *parent = 0); 64 | ~FilterBar(); 65 | const FilterData& filterData(); 66 | signals: 67 | void newFilter(const FilterData &data); 68 | public slots: 69 | void repopulateTagsCombo(); 70 | void reset(); 71 | void inAllBaskets(); 72 | void setEditFocus(); 73 | void filterTag(Tag *tag); 74 | void filterState(State *state); 75 | void setFilterData(const FilterData &data); 76 | public: 77 | bool hasEditFocus(); 78 | QLineEdit* lineEdit() { 79 | return m_lineEdit; 80 | } 81 | private slots: 82 | void changeFilter(); 83 | void tagChanged(int index); 84 | private: 85 | FilterData m_data; 86 | QLineEdit *m_lineEdit; 87 | QToolButton *m_resetButton; 88 | KComboBox *m_tagsBox; 89 | QToolButton *m_inAllBasketsButton; 90 | 91 | QMap m_tagsMap; 92 | QMap m_statesMap; 93 | }; 94 | 95 | #endif // FILTER_H 96 | -------------------------------------------------------------------------------- /src/focusedwidgets.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 FOCUSEDWIDGETS_H 22 | #define FOCUSEDWIDGETS_H 23 | 24 | #include 25 | #include 26 | 27 | class QEvent; 28 | class QKeyEvent; 29 | class QWheelEvent; 30 | 31 | class QMenu; 32 | 33 | class FocusedTextEdit : public KTextEdit 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit FocusedTextEdit(bool disableUpdatesOnKeyPress, QWidget *parent = 0); 38 | ~FocusedTextEdit(); 39 | void paste(QClipboard::Mode mode); 40 | public slots: 41 | void onSelectionChanged(); //!< Put selected text into the global mouse selection 42 | protected: 43 | void keyPressEvent(QKeyEvent *event); 44 | void wheelEvent(QWheelEvent *event); 45 | void enterEvent(QEvent *event); 46 | void insertFromMimeData (const QMimeData *source); 47 | signals: 48 | void escapePressed(); 49 | void mouseEntered(); 50 | private: 51 | bool m_disableUpdatesOnKeyPress; 52 | }; 53 | 54 | 55 | /** class FocusWidgetFilter 56 | * @author Kelvie Wong 57 | * 58 | * A very simple event filter that returns when escape and return are pressed, 59 | * and as well, to emit a signal for the mouse event. 60 | * 61 | * This allows us to create our own focus model with widgets inside baskets 62 | * (although I'm not sure how useful this will all be after we port Basket to be 63 | * use QGraphicsView). 64 | * 65 | * Keypresses are filtered (i.e. the widget will not get the key press events), 66 | * but the enterEvent is not (for backwards compatibility). 67 | */ 68 | class FocusWidgetFilter : public QObject 69 | { 70 | Q_OBJECT 71 | public: 72 | /** Constructor 73 | * @param watched The widget to install the event filter on; also becomes 74 | * the parent of this object. */ 75 | FocusWidgetFilter(QWidget *watched = 0); 76 | ~FocusWidgetFilter() {} 77 | 78 | protected: 79 | bool eventFilter(QObject *object, QEvent *event); 80 | 81 | signals: 82 | void escapePressed(); 83 | void returnPressed(); 84 | void mouseEntered(); 85 | }; 86 | 87 | #endif // FOCUSEDWIDGETS_H 88 | -------------------------------------------------------------------------------- /src/formatimporter.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 FORMATIMPORTER_H 22 | #define FORMATIMPORTER_H 23 | 24 | #include 25 | 26 | class QDomElement; 27 | 28 | namespace KIO 29 | { 30 | class Job; 31 | } 32 | 33 | /** 34 | * @author Sébastien Laoût 35 | */ 36 | class FormatImporter : public QObject 37 | { 38 | Q_OBJECT 39 | public: 40 | static bool shouldImportBaskets(); 41 | static void importBaskets(); 42 | static QDomElement importBasket(const QString &folderName); 43 | 44 | void copyFolder(const QString &folder, const QString &newFolder); 45 | void moveFolder(const QString &folder, const QString &newFolder); 46 | private slots: 47 | void slotCopyingDone(KIO::Job*); 48 | private: 49 | bool copyFinished; 50 | }; 51 | 52 | #endif // FORMATIMPORTER_H 53 | -------------------------------------------------------------------------------- /src/gitwrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef GITWRAPPER_H 2 | #define GITWRAPPER_H 3 | 4 | #include 5 | 6 | class git_repository; 7 | class git_index; 8 | class BasketScene; 9 | 10 | /* Static class to encapsulate git operations 11 | * 12 | * the commit* operations check if the file or subfolder is newer than the git directory 13 | **/ 14 | class GitWrapper 15 | { 16 | public: 17 | static QMutex gitMutex; 18 | static void initializeGitRepository(QString folder); 19 | static void commitBasketView(); //commits the whole directory 20 | static void commitCreateBasket(); //commits and checks baskets/baskets.xml 21 | static void commitDeleteBasket(QString basketFolderName); //deletes a basket directory 22 | static void commitBasket(BasketScene *basket); //commits and checks baskets/$BASKETNAME 23 | static void commitTagsXml(); //commits and checks baskets.xml 24 | 25 | private: 26 | static bool commitPattern(git_repository *repo, QString pattern = "*", QString message = "AutoCommit"); 27 | static bool commitIndex(git_repository *repo, git_index* index, QString message = "AutoCommit"); 28 | static void removeDeletedFromIndex(git_repository *repo, git_index* index); 29 | static git_repository* openRepository(); 30 | static QDateTime getLastCommitDate(git_repository *repo); 31 | static void gitErrorHandling(); 32 | }; 33 | 34 | #endif // GITWRAPPER_H 35 | -------------------------------------------------------------------------------- /src/global.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 GLOBAL_H 22 | #define GLOBAL_H 23 | 24 | #include "basket_export.h" 25 | #include 26 | 27 | class QString; 28 | 29 | class KMainWindow; 30 | 31 | class LikeBack; 32 | class DebugWindow; 33 | class BackgroundManager; 34 | class SystemTray; 35 | class BNPView; 36 | class QCommandLineParser; 37 | 38 | class MainWindow; 39 | 40 | 41 | /** Handle all global variables of the application. 42 | * This file only declare classes : developer should include 43 | * the .h files of variables he use. 44 | * @author Sébastien Laoût 45 | */ 46 | class BASKET_EXPORT Global 47 | { 48 | private: 49 | static QString s_customSavesFolder; 50 | 51 | static void initializeGitRepository(QString folder); 52 | public: 53 | // Global Variables: 54 | static LikeBack *likeBack; 55 | static DebugWindow *debugWindow; 56 | static BackgroundManager *backgroundManager; 57 | static SystemTray *systemTray; 58 | static BNPView *bnpView; 59 | static KSharedConfig::Ptr basketConfig; 60 | static QCommandLineParser* commandLineOpts; 61 | static MainWindow* mainWnd; 62 | 63 | 64 | 65 | // Application Folders: 66 | static void setCustomSavesFolder(const QString &folder); 67 | static QString savesFolder(); /// << @return e.g. "/home/username/.local/share/basket/". 68 | static QString basketsFolder(); /// << @return e.g. "/home/username/.local/share/basket/baskets/". 69 | static QString backgroundsFolder(); /// << @return e.g. "/home/username/.local/share/basket/backgrounds/". 70 | static QString templatesFolder(); /// << @return e.g. "/home/username/.local/share/basket/templates/". 71 | static QString tempCutFolder(); /// << @return e.g. "/home/username/.local/share/basket/temp-cut/". (was ".tmp/") 72 | static QString gitFolder(); /// << @return e.g. "/home/username/.local/share/basket/.git/". 73 | 74 | // Various Things: 75 | /** Initialize git repository if Version sync is enabled 76 | @param savesFolder Path returned by savesFolder() */ 77 | static void initializeGitIfNeeded(QString savesFolder); 78 | static QString openNoteIcon(); /// << @return the icon used for the "Open" action on notes. 79 | static KMainWindow* activeMainWindow(); /// << @returns Main window if it has focus (is active), otherwise NULL 80 | static MainWindow* mainWindow(); /// << @returns Main window (always not NULL after it has been actually created) 81 | static KConfig* config(); 82 | }; 83 | 84 | #endif // GLOBAL_H 85 | -------------------------------------------------------------------------------- /src/history.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 Brian C. Milco * 3 | * bcmilco@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 "history.h" 22 | #include "global.h" 23 | 24 | #include "bnpview.h" 25 | #include "basketscene.h" 26 | 27 | #include 28 | #include 29 | 30 | HistorySetBasket::HistorySetBasket(BasketScene *basket, QUndoCommand *parent) 31 | :QUndoCommand(parent) 32 | { 33 | setText(i18n("Set current basket to %1", basket->basketName())); 34 | m_folderNameOld = Global::bnpView->currentBasket()->folderName(); 35 | m_folderNameNew = basket->folderName(); 36 | } 37 | 38 | void HistorySetBasket::undo() 39 | { 40 | BasketScene *oldBasket = Global::bnpView->basketForFolderName(m_folderNameOld); 41 | Global::bnpView->setCurrentBasket(oldBasket); 42 | } 43 | 44 | void HistorySetBasket::redo() 45 | { 46 | BasketScene *curBasket = Global::bnpView->basketForFolderName(m_folderNameNew); 47 | Global::bnpView->setCurrentBasket(curBasket); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/history.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2010 Brian C. Milco * 3 | * bcmilco@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 HISTORY_H 22 | #define HISTORY_H 23 | 24 | #include 25 | 26 | class BasketScene; 27 | 28 | class HistorySetBasket : public QUndoCommand 29 | { 30 | public: 31 | explicit HistorySetBasket(BasketScene *basket, QUndoCommand *parent = 0); 32 | void undo(); 33 | void redo(); 34 | 35 | private: 36 | QString m_folderNameOld; 37 | QString m_folderNameNew; 38 | }; 39 | 40 | 41 | #endif // HISTORY_H 42 | -------------------------------------------------------------------------------- /src/htmlexporter.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 HTMLEXPORTER_H 22 | #define HTMLEXPORTER_H 23 | 24 | #include 25 | #include 26 | 27 | class QProgressDialog; 28 | 29 | class BasketScene; 30 | class Note; 31 | 32 | /** 33 | * @author Sébastien Laoût 34 | */ 35 | class HTMLExporter 36 | { 37 | public: 38 | HTMLExporter(BasketScene *basket); 39 | ~HTMLExporter(); 40 | private: 41 | void prepareExport(BasketScene *basket, const QString &fullPath); 42 | void exportBasket(BasketScene *basket, bool isSubBasket); 43 | void exportNote(Note *note, int indent); 44 | void writeBasketTree(BasketScene *currentBasket); 45 | void writeBasketTree(BasketScene *currentBasket, BasketScene *basket, int indent); 46 | void saveToFile(const QString& fullPath, const QByteArray& array); 47 | 48 | public: 49 | QString copyIcon(const QString &iconName, int size); 50 | QString copyFile(const QString &srcPath, bool createIt); 51 | 52 | public: //TODO: make private? 53 | // Absolute path of the file name the user chozen: 54 | QString filePath; // eg.: "/home/seb/foo.html" 55 | QString fileName; // eg.: "foo.html" 56 | 57 | // Absolute & relative paths for the current basket to be exported: 58 | QString basketFilePath; // eg.: "/home/seb/foo.html" or "/home/seb/foo.html_files/baskets/basketN.html" 59 | QString filesFolderPath; // eg.: "/home/seb/foo.html_files/" 60 | QString filesFolderName; // eg.: "foo.html_files/" or "../" 61 | QString iconsFolderPath; // eg.: "/home/seb/foo.html_files/icons/" 62 | QString iconsFolderName; // eg.: "foo.html_files/icons/" or "../icons/" 63 | QString imagesFolderPath; // eg.: "/home/seb/foo.html_files/images/" 64 | QString imagesFolderName; // eg.: "foo.html_files/images/" or "../images/" 65 | QString dataFolderPath; // eg.: "/home/seb/foo.html_files/data/" or "/home/seb/foo.html_files/baskets/basketN-data/" 66 | QString dataFolderName; // eg.: "foo.html_files/data/" or "basketN-data/" 67 | QString basketsFolderPath; // eg.: "/home/seb/foo.html_files/baskets/" 68 | QString basketsFolderName; // eg.: "foo.html_files/baskets/" or "" 69 | 70 | // Various properties of the currently exporting basket: 71 | QString backgroundColorName; 72 | 73 | // Variables used by every export methods: 74 | QTextStream stream; 75 | BasketScene *exportedBasket; 76 | BasketScene *currentBasket; 77 | bool withBasketTree; 78 | QScopedPointer dialog; 79 | }; 80 | 81 | #endif // HTMLEXPORTER_H 82 | -------------------------------------------------------------------------------- /src/icon_names.h: -------------------------------------------------------------------------------- 1 | #ifndef ICON_NAMES_H 2 | #define ICON_NAMES_H 3 | 4 | #pragma GCC diagnostic push 5 | #pragma GCC diagnostic ignored "-Wunused-variable" 6 | 7 | /** @namespace IconNames 8 | * @brief Icon names for KIconLoader used by BasKet */ 9 | namespace IconNames 10 | { 11 | #define StrRes static const char* const 12 | 13 | StrRes LOADING = "process-idle"; 14 | StrRes LOCKED = "object-locked"; 15 | 16 | // Insert stuff 17 | StrRes LINK = "insert-link"; 18 | StrRes CROSS_REF = LINK; 19 | StrRes IMAGE = "insert-image"; 20 | StrRes COLOR = "fill-color"; 21 | StrRes LAUNCH = "system-run"; 22 | StrRes KMENU = "kde"; 23 | StrRes ICONS = "preferences-desktop-icons"; 24 | 25 | StrRes DOCUMENT_IMPORT = "document-import"; 26 | 27 | // Import from 28 | StrRes TOMBOY = "tomboy"; 29 | 30 | #undef StrRes 31 | } 32 | 33 | #pragma GCC diagnostic pop 34 | 35 | #endif // ICON_NAMES_H 36 | -------------------------------------------------------------------------------- /src/kcm_basket.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2006 by Petri Damsten * 3 | * damu@iki.fi * 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 | // This must be first 22 | #include 23 | #include "settings.h" //For GeneralPage, etc. 24 | #include "settings_versionsync.h" 25 | #include 26 | 27 | //---------------------------- 28 | // KCM stuff 29 | //---------------------------- 30 | extern "C" { 31 | Q_DECL_EXPORT KCModule *create_basket_config_general(QWidget *parent, const char *) { 32 | GeneralPage *page = new GeneralPage(parent, "kcmbasket_config_general"); 33 | return page; 34 | } 35 | } 36 | 37 | extern "C" { 38 | Q_DECL_EXPORT KCModule *create_basket_config_baskets(QWidget *parent, const char *) { 39 | BasketsPage *page = new BasketsPage(parent, "kcmbasket_config_baskets"); 40 | return page; 41 | } 42 | } 43 | 44 | extern "C" { 45 | Q_DECL_EXPORT KCModule *create_basket_config_new_notes(QWidget *parent, const char *) { 46 | NewNotesPage *page = new NewNotesPage(parent, "kcmbasket_config_new_notes"); 47 | return page; 48 | } 49 | } 50 | 51 | extern "C" { 52 | Q_DECL_EXPORT KCModule *create_basket_config_notes_appearance(QWidget *parent, const char *) { 53 | NotesAppearancePage *page = new NotesAppearancePage(parent, "kcmbasket_config_notes_appearance"); 54 | return page; 55 | } 56 | } 57 | 58 | extern "C" { 59 | Q_DECL_EXPORT KCModule *create_basket_config_apps(QWidget *parent, const char *) { 60 | ApplicationsPage *page = new ApplicationsPage(parent, "kcmbasket_config_apps"); 61 | return page; 62 | } 63 | } 64 | 65 | extern "C" { 66 | Q_DECL_EXPORT KCModule *create_basket_config_version_sync(QWidget *parent, const char *) { 67 | VersionSyncPage *page = new VersionSyncPage(parent, "kcmbasket_config_version_sync"); 68 | return page; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/kgpgme.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2006 by Petri Damsten * 3 | * damu@iki.fi * 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 | #ifndef KGPGME_H 21 | #define KGPGME_H 22 | 23 | #include 24 | 25 | #ifdef HAVE_LIBGPGME 26 | 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | /** 33 | @author Petri Damsten 34 | */ 35 | 36 | class KGpgKey 37 | { 38 | public: 39 | QString id; 40 | QString name; 41 | QString email; 42 | }; 43 | 44 | typedef QList< KGpgKey > KGpgKeyList; 45 | 46 | class KGpgMe 47 | { 48 | public: 49 | KGpgMe(); 50 | ~KGpgMe(); 51 | 52 | QString selectKey(QString previous = QString::null); 53 | KGpgKeyList keys(bool privateKeys = false) const; 54 | void setText(QString text, bool saving) { 55 | m_text = text; m_saving = saving; 56 | }; 57 | void setUseGnuPGAgent(bool use) { 58 | m_useGnuPGAgent = use; setPassphraseCb(); 59 | }; 60 | QString text() const { 61 | return m_text; 62 | }; 63 | bool saving() const { 64 | return m_saving; 65 | }; 66 | void clearCache(); 67 | 68 | bool encrypt(const QByteArray& inBuffer, unsigned long length, 69 | QByteArray* outBuffer, QString keyid = QString::null); 70 | bool decrypt(const QByteArray& inBuffer, QByteArray* outBuffer); 71 | 72 | static QString checkForUtf8(QString txt); 73 | static bool isGnuPGAgentAvailable(); 74 | 75 | private: 76 | gpgme_ctx_t m_ctx; 77 | QString m_text; 78 | bool m_saving; 79 | bool m_useGnuPGAgent; 80 | QString m_cache; 81 | 82 | void init(gpgme_protocol_t proto); 83 | gpgme_error_t readToBuffer(gpgme_data_t in, QByteArray* outBuffer) const; 84 | void setPassphraseCb(); 85 | static gpgme_error_t passphraseCb(void *hook, const char *uid_hint, 86 | const char *passphrase_info, 87 | int last_was_bad, int fd); 88 | gpgme_error_t passphrase(const char *uid_hint, 89 | const char *passphrase_info, 90 | int last_was_bad, int fd); 91 | }; 92 | #endif // HAVE_LIBGPGME 93 | #endif // KGPGME_H 94 | -------------------------------------------------------------------------------- /src/ksystemtrayicon2.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2008 by Kelvie Wong * 3 | * kelvie@ieee.org * 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 K_SYSTEM_TRAY_ICON 22 | #define K_SYSTEM_TRAY_ICON 23 | 24 | #include 25 | #include 26 | 27 | /** Convenient class to develop the displayCloseMessage() dialog 28 | * hopefuly integrated in KDE 3.4 29 | * @author Sébastien Laoût 30 | */ 31 | class KSystemTray2 : public KSystemTrayIcon, public QWidget 32 | { 33 | Q_OBJECT 34 | public: 35 | explicit KSystemTray2(QWidget *parent = 0, const char *name = 0); 36 | ~KSystemTray2(); 37 | /** 38 | * Call this method when the user clicked the close button of the window 39 | * (the [x]) to inform him that the application sit in the system tray 40 | * and willn't be closed (as he is used to). 41 | * 42 | * You usually call it from reimplemented KMainWindow::queryClose() 43 | * 44 | * @since 3.4 45 | */ 46 | void displayCloseMessage(QString fileMenu = ""); 47 | }; 48 | 49 | 50 | #endif // K_SYSTEM_TRAY_ICON 51 | -------------------------------------------------------------------------------- /src/likeback_p.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2006 by Sebastien Laout * 3 | * slaout@linux62.org * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU Library General Public License as * 7 | * published by the Free Software Foundation; either version 2 of the * 8 | * License, or (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 Library General Public * 16 | * License along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 19 | ***************************************************************************/ 20 | 21 | #ifndef LIKEBACK_PRIVATE_H 22 | #define LIKEBACK_PRIVATE_H 23 | 24 | #include "likeback.h" 25 | 26 | #include 27 | 28 | #include 29 | 30 | class QToolButton; 31 | class KTextEdit; 32 | class QRadioButton; 33 | class QCheckBox; 34 | class QGroupBox; 35 | class QNetworkReply; 36 | 37 | class Kaction; 38 | 39 | class LikeBackBar; 40 | 41 | class LikeBackPrivate 42 | { 43 | public: 44 | LikeBackPrivate(); 45 | ~LikeBackPrivate(); 46 | LikeBackBar *bar; 47 | KConfig *config; 48 | const KAboutData *aboutData; 49 | LikeBack::Button buttons; 50 | QString hostName; 51 | QString remotePath; 52 | quint16 hostPort; 53 | QStringList acceptedLocales; 54 | QString acceptedLanguagesMessage; 55 | LikeBack::WindowListing windowListing; 56 | bool showBarByDefault; 57 | bool showBar; 58 | int disabledCount; 59 | QString fetchedEmail; 60 | QAction *action; 61 | }; 62 | 63 | class LikeBackBar : public QWidget 64 | { 65 | Q_OBJECT 66 | public: 67 | LikeBackBar(LikeBack *likeBack); 68 | ~LikeBackBar(); 69 | public slots: 70 | void startTimer(); 71 | void stopTimer(); 72 | private slots: 73 | void autoMove(); 74 | void clickedLike(); 75 | void clickedDislike(); 76 | void clickedBug(); 77 | void clickedFeature(); 78 | private: 79 | LikeBack *m_likeBack; 80 | QTimer m_timer; 81 | QToolButton *m_likeButton; 82 | QToolButton *m_dislikeButton; 83 | QToolButton *m_bugButton; 84 | QToolButton *m_featureButton; 85 | }; 86 | 87 | class LikeBackDialog : public QDialog 88 | { 89 | Q_OBJECT 90 | public: 91 | LikeBackDialog(LikeBack::Button reason, const QString &initialComment, const QString &windowPath, const QString &context, LikeBack *likeBack); 92 | ~LikeBackDialog(); 93 | private: 94 | LikeBack *m_likeBack; 95 | QString m_windowPath; 96 | QString m_context; 97 | KTextEdit *m_comment; 98 | QRadioButton *likeButton; 99 | QRadioButton *dislikeButton; 100 | QRadioButton *bugButton; 101 | QRadioButton *featureButton; 102 | QCheckBox *m_showButtons; 103 | QDialogButtonBox *buttonBox; 104 | QString introductionText(); 105 | private slots: 106 | void ensurePolished(); 107 | void slotDefault(); 108 | void slotOk(); 109 | void changeButtonBarVisible(); 110 | void commentChanged(); 111 | void send(); 112 | void requestFinished(QNetworkReply* reply); 113 | }; 114 | 115 | #endif // LIKEBACK_PRIVATE_H 116 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 // TMP IN ALPHA 1 23 | #include 24 | #include 25 | #include 26 | #include "basket_options.h" 27 | 28 | #include "application.h" 29 | #include "mainwindow.h" 30 | #include "settings.h" 31 | #include "global.h" 32 | #include "backup.h" 33 | #include "kde4_migration.h" 34 | 35 | int main(int argc, char *argv[]) 36 | { 37 | const char *argv0 = (argc >= 1 ? argv[0] : ""); 38 | 39 | Global::commandLineOpts = new QCommandLineParser(); 40 | Application app(argc, argv); 41 | 42 | QCommandLineParser* opts = Global::commandLineOpts; 43 | KAboutData::applicationData().setupCommandLine(opts); //--author, --license 44 | setupCmdLineOptions(opts); 45 | opts->process(app); 46 | KAboutData::applicationData().processCommandLine(opts); //show author, license information and exit 47 | 48 | { 49 | Kde4Migrator migrator; 50 | if (migrator.migrateKde4Data()) 51 | migrator.showPostMigrationDialog(); 52 | } 53 | 54 | app.tryLoadFile(opts->positionalArguments(), QDir::currentPath()); 55 | 56 | 57 | // Initialize the config file 58 | Global::basketConfig = KSharedConfig::openConfig("basketrc"); 59 | 60 | Backup::figureOutBinaryPath(argv0, app); 61 | 62 | /* Main Window */ 63 | MainWindow* win = new MainWindow(); 64 | Global::mainWnd = win; 65 | Global::bnpView->handleCommandLine(); 66 | app.setActiveWindow(win); 67 | 68 | if (Settings::useSystray()) { 69 | // The user wanted to not show the window (but it is already hidden by default, so we do nothing): 70 | if (opts->isSet(QCommandLineOption("start-hidden"))) 71 | ; 72 | // When the application is restored by the desktop session, restore its state: 73 | else if (app.isSessionRestored()){ 74 | if (!Settings::startDocked()) 75 | win->show(); 76 | } 77 | // Else, the application has been launched explicitly by the user (QMenu, keyboard shortcut...), so he need it, we show it: 78 | else 79 | win->show(); 80 | } else 81 | // No system tray icon: always show: 82 | win->show(); 83 | 84 | // Self-test of the presence of basketui.rc (the only requiered file after basket executable) 85 | if (Global::bnpView->popupMenu("basket") == 0L) 86 | // An error message will be show by BNPView::popupMenu() 87 | return 1; 88 | 89 | /* Go */ 90 | int result = app.exec(); 91 | exit(result); // Do not clean up memory to not crash while deleting the QApplication, or do not hang up on session exit 92 | } 93 | -------------------------------------------------------------------------------- /src/mainwindow.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 CONTAINER_H 22 | #define CONTAINER_H 23 | 24 | #include 25 | 26 | class QResizeEvent; 27 | class QVBoxLayout; 28 | class QMoveEvent; 29 | class QWidget; 30 | class QAction; 31 | class KToggleAction; 32 | class BNPView; 33 | 34 | namespace KSettings 35 | { 36 | class Dialog; 37 | }; 38 | 39 | 40 | /** The window that contain baskets, organized by tabs. 41 | * @author Sébastien Laoût 42 | */ 43 | class MainWindow : public KXmlGuiWindow 44 | { 45 | Q_OBJECT 46 | public: 47 | /** Construtor, initializer and destructor */ 48 | MainWindow(QWidget *parent = 0); 49 | ~MainWindow(); 50 | private: 51 | void setupActions(); 52 | public slots: 53 | bool askForQuit(); 54 | /** Settings **/ 55 | // void toggleToolBar(); 56 | void toggleStatusBar(); 57 | void showShortcutsSettingsDialog(); 58 | void configureToolbars(); 59 | void configureNotifications(); 60 | void showSettingsDialog(); 61 | void minimizeRestore(); 62 | void quit(); 63 | void slotNewToolbarConfig(); 64 | 65 | protected: 66 | bool queryExit(); 67 | bool queryClose(); 68 | virtual void resizeEvent(QResizeEvent*); 69 | virtual void moveEvent(QMoveEvent*); 70 | 71 | public: 72 | void ensurePolished(); 73 | 74 | private: 75 | // Settings actions : 76 | // KToggleAction *m_actShowToolbar; 77 | KToggleAction *m_actShowStatusbar; 78 | QAction *actQuit; 79 | QAction *actAppConfig; 80 | QList actBasketsList; 81 | 82 | private: 83 | QVBoxLayout *m_layout; 84 | BNPView *m_baskets; 85 | bool m_startDocked; 86 | KSettings::Dialog *m_settings; 87 | bool m_quit; 88 | }; 89 | 90 | #endif // CONTAINER_H 91 | -------------------------------------------------------------------------------- /src/nepomukintegration.h: -------------------------------------------------------------------------------- 1 | #ifndef NEPOMUKINTEGRATION_H 2 | #define NEPOMUKINTEGRATION_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | //For DEBUG_WIN: 9 | #include "global.h" 10 | #include "debugwindow.h" 11 | 12 | class QString; 13 | class QUrl; 14 | class BasketScene; 15 | 16 | class nepomukIntegration : public QObject 17 | { 18 | Q_OBJECT 19 | public: 20 | static void updateMetadata(BasketScene * basket); 21 | static void deleteMetadata(const QString &fullPath); 22 | static bool doDelete(const QString &fullPath); 23 | private: 24 | static nepomukIntegration *instance; 25 | static QMutex instanceMutex; 26 | 27 | nepomukIntegration(BasketScene * basket, int idleTime); 28 | ~nepomukIntegration() { 29 | //I hope deletion is handled automatically 30 | //delete workerThread; 31 | //delete cleanupIdle; 32 | DEBUG_WIN << "nepomukUpdater object destructed"; 33 | } 34 | 35 | int idleTime; 36 | QThread workerThread; 37 | QTimer cleanupTimer; 38 | QMutex mutex; 39 | QList basketList; 40 | bool isDoingUpdate; 41 | QList requestedIndexList; 42 | bool isCleaningupRequestedIndexes; 43 | void queueBasket(BasketScene * basket); 44 | void queueIndexRequest(KUrl file); 45 | signals: 46 | void updateCompleted(QString basketFolderName, bool successful); 47 | //void indexCleanupCompleted(KUrl file); 48 | private slots: 49 | void doUpdate(); 50 | void checkQueue(); 51 | void cleanupRequestedIndexes(); 52 | void cleanup(); 53 | 54 | }; 55 | 56 | #endif // NEPOMUKINTEGRATION_H 57 | -------------------------------------------------------------------------------- /src/noteselection.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 NOTESELECTION_H 22 | #define NOTESELECTION_H 23 | 24 | #include 25 | #include 26 | 27 | class Note; 28 | 29 | /** This represent a hierarchy of the selected classes. 30 | * If this is null, then there is no selected note. 31 | */ 32 | class NoteSelection 33 | { 34 | public: 35 | NoteSelection() : note(0), parent(0), firstChild(0), next(0), fullPath() {} 36 | NoteSelection(Note *n) : note(n), parent(0), firstChild(0), next(0), fullPath() {} 37 | 38 | Note *note; 39 | NoteSelection *parent; 40 | NoteSelection *firstChild; 41 | NoteSelection *next; 42 | QString fullPath; // Needeed for 'Cut' code to store temporary path of the cut note. 43 | 44 | NoteSelection* firstStacked(); 45 | NoteSelection* nextStacked(); 46 | void append(NoteSelection *node); 47 | int count(); 48 | 49 | QList parentGroups(); 50 | }; 51 | 52 | #endif // NOTESELECTION_H 53 | -------------------------------------------------------------------------------- /src/org.basket.BNPView.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/password.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2006 by Petri Damsten * 3 | * damu@iki.fi * 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 | #ifndef PASSWORD_H 21 | #define PASSWORD_H 22 | 23 | #include 24 | 25 | #ifdef HAVE_LIBGPGME 26 | 27 | #include "ui_passwordlayout.h" 28 | #include 29 | 30 | /** 31 | @author Petri Damsten 32 | */ 33 | class Password : public QWidget, public Ui::PasswordLayout 34 | { 35 | Q_OBJECT 36 | public: 37 | Password(QWidget *parent = 0); 38 | ~Password(); 39 | }; 40 | 41 | class PasswordDlg : public QDialog 42 | { 43 | Q_OBJECT 44 | public: 45 | PasswordDlg(QWidget *parent = 0); 46 | ~PasswordDlg(); 47 | 48 | QString key() const; 49 | int type() const; 50 | void setKey(const QString& key); 51 | void setType(int type); 52 | 53 | /** Reimplemented from {K,Q}Dialog 54 | */ 55 | void accept(); 56 | 57 | private: 58 | Password* w; 59 | }; 60 | 61 | #endif // HAVE_LIBGPGME 62 | 63 | #endif // PASSWORD_H 64 | 65 | -------------------------------------------------------------------------------- /src/passwordlayout.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | PasswordLayout 4 | 5 | 6 | 7 | 0 8 | 0 9 | 377 10 | 103 11 | 12 | 13 | 14 | Password Protection 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 0 25 | 26 | 27 | 28 | 29 | &No protection 30 | 31 | 32 | 33 | 34 | 35 | 36 | Protect basket with a &password 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 0 48 | 49 | 50 | 51 | Protect basket with private &key: 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | Qt::Vertical 67 | 68 | 69 | 70 | 20 71 | 40 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | qPixmapFromMimeSource 80 | 81 | 82 | KComboBox 83 | QComboBox 84 |
kcombobox.h
85 |
86 |
87 | 88 | 89 |
90 | -------------------------------------------------------------------------------- /src/regiongrabber.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Luca Gugelmann 3 | * 4 | * This program is free software; you can redistribute it and/or modify it 5 | * under the terms of the GNU Library General Public License version 2 as 6 | * published by the Free Software Foundation 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details 12 | * 13 | * You should have received a copy of the GNU Library General Public 14 | * License along with this program; if not, write to the 15 | * Free Software Foundation, Inc., 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | 19 | #ifndef REGIONGRABBER_H 20 | #define REGIONGRABBER_H 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | class QPoint; 27 | class QRect; 28 | class QRegion; 29 | class QPaintEvent; 30 | class QResizeEvent; 31 | class QMouseEvent; 32 | 33 | class RegionGrabber : public QWidget 34 | { 35 | Q_OBJECT 36 | public: 37 | RegionGrabber(); 38 | ~RegionGrabber(); 39 | 40 | protected slots: 41 | void init(); 42 | void displayHelp(); 43 | 44 | signals: 45 | void regionGrabbed(const QPixmap &); 46 | 47 | protected: 48 | void paintEvent(QPaintEvent* e); 49 | void resizeEvent(QResizeEvent* e); 50 | void mousePressEvent(QMouseEvent* e); 51 | void mouseMoveEvent(QMouseEvent* e); 52 | void mouseReleaseEvent(QMouseEvent* e); 53 | void mouseDoubleClickEvent(QMouseEvent*); 54 | void keyPressEvent(QKeyEvent* e); 55 | void updateHandles(); 56 | QRegion handleMask() const; 57 | QPoint limitPointToRect(const QPoint &p, const QRect &r) const; 58 | void grabRect(); 59 | 60 | QRect selection; 61 | bool mouseDown; 62 | bool newSelection; 63 | const int handleSize; 64 | QRect* mouseOverHandle; 65 | QPoint dragStartPoint; 66 | QRect selectionBeforeDrag; 67 | QTimer idleTimer; 68 | bool showHelp; 69 | bool grabbing; 70 | 71 | // naming convention for handles 72 | // T top, B bottom, R Right, L left 73 | // 2 letters: a corner 74 | // 1 letter: the handle on the middle of the corresponding side 75 | QRect TLHandle, TRHandle, BLHandle, BRHandle; 76 | QRect LHandle, THandle, RHandle, BHandle; 77 | 78 | QVector handles; 79 | QPixmap pixmap; 80 | }; 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /src/settings_versionsync.cpp: -------------------------------------------------------------------------------- 1 | #include "settings_versionsync.h" 2 | #include "ui_settings_versionsync.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "aboutdata.h" 10 | #include "settings.h" 11 | #include "tools.h" 12 | 13 | 14 | //! Compute size of .git folder and invoke VersionSyncPage::setHistorySize 15 | void showHistorySize(QPointer versionSyncPage) 16 | { 17 | QString git = Global::gitFolder(); 18 | qint64 size = QDir(git).exists() ? Tools::computeSizeRecursively(git) : 0; 19 | if (!versionSyncPage.isNull()) 20 | QMetaObject::invokeMethod(versionSyncPage.data(), "setHistorySize", Qt::QueuedConnection, Q_ARG(qint64, size)); 21 | } 22 | 23 | VersionSyncPage::VersionSyncPage(QWidget* parent, const char* name) : 24 | KCModule(parent), 25 | ui(new Ui::VersionSyncPage) 26 | { 27 | KAboutData* about = new AboutData(); 28 | about->setComponentName(name); 29 | setAboutData(about); 30 | 31 | ui->setupUi(this); 32 | 33 | #ifdef WITH_LIBGIT2 34 | ui->labelWithoutVersionControlSupport->setVisible(false); 35 | QtConcurrent::run(showHistorySize, this); 36 | #else 37 | ui->checkBoxEnable->setEnabled(false); 38 | ui->groupBoxControl->setVisible(false); 39 | #endif 40 | 41 | connect(ui->checkBoxEnable, SIGNAL(toggled(bool)), this, SLOT(changed())); 42 | load(); 43 | } 44 | 45 | VersionSyncPage::~VersionSyncPage() 46 | { 47 | delete ui; 48 | } 49 | 50 | void VersionSyncPage::load() 51 | { 52 | ui->checkBoxEnable->setChecked(Settings::versionSyncEnabled()); 53 | #ifdef WITH_LIBGIT2 54 | on_checkBoxEnable_clicked(); 55 | #endif 56 | } 57 | 58 | void VersionSyncPage::save() 59 | { 60 | Settings::setVersionSyncEnabled(ui->checkBoxEnable->isChecked()); 61 | } 62 | 63 | void VersionSyncPage::defaults() 64 | { 65 | ui->checkBoxEnable->setChecked(false); 66 | } 67 | 68 | void VersionSyncPage::on_checkBoxEnable_clicked() 69 | { 70 | ui->groupBoxControl->setEnabled(ui->checkBoxEnable->isChecked()); 71 | } 72 | 73 | void VersionSyncPage::on_buttonClearHistory_clicked() 74 | { 75 | if (KMessageBox::questionYesNo(this, i18n("Do you really want to remove old versions for all baskets?"), 76 | i18n("Version Sync")) == KMessageBox::Yes) { 77 | Tools::deleteRecursively(Global::gitFolder()); 78 | ui->buttonClearHistory->setEnabled(false); 79 | setHistorySize(0); 80 | Global::initializeGitIfNeeded(Global::savesFolder()); //restore .git 81 | } 82 | } 83 | 84 | void VersionSyncPage::setHistorySize(qint64 size_bytes) 85 | { 86 | QString size_mb = QLocale().toString((float)size_bytes / 1024 / 1024, 'f', 2); 87 | ui->labelHistorySize->setText(i18n("This will free %1 MB", size_mb)); 88 | } 89 | -------------------------------------------------------------------------------- /src/settings_versionsync.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 by Gleb Baryshev 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef SETTINGS_VERSIONSYNC_H 21 | #define SETTINGS_VERSIONSYNC_H 22 | 23 | #include 24 | #include "basket_export.h" 25 | 26 | namespace Ui { 27 | class VersionSyncPage; 28 | } 29 | 30 | class BASKET_EXPORT VersionSyncPage : public KCModule 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit VersionSyncPage(QWidget * parent = 0, const char * name = 0); 36 | ~VersionSyncPage(); 37 | 38 | virtual void load() override; 39 | virtual void save() override; 40 | virtual void defaults() override; 41 | 42 | public slots: 43 | void setHistorySize(qint64 size_bytes); 44 | 45 | private slots: 46 | void on_checkBoxEnable_clicked(); 47 | void on_buttonClearHistory_clicked(); 48 | 49 | private: 50 | Ui::VersionSyncPage *ui; 51 | }; 52 | 53 | #endif // SETTINGS_VERSIONSYNC_H 54 | -------------------------------------------------------------------------------- /src/settings_versionsync.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | VersionSyncPage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 393 10 | 269 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | Enable distributed version control 21 | 22 | 23 | 24 | 25 | 26 | 27 | BasKet is built without version control (libgit2) support 28 | 29 | 30 | 31 | 32 | 33 | 34 | false 35 | 36 | 37 | Control 38 | 39 | 40 | 41 | 42 | 43 | 12 44 | 45 | 46 | 47 | 48 | Clear version history 49 | 50 | 51 | 52 | 53 | 54 | 55 | TextLabel 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | Qt::Vertical 65 | 66 | 67 | 68 | 20 69 | 40 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | KCModule 82 | QWidget 83 |
kcmodule.h
84 | 1 85 |
86 |
87 | 88 | 89 |
90 | -------------------------------------------------------------------------------- /src/softwareimporters.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 SOFTWAREIMPORTERS_H 22 | #define SOFTWAREIMPORTERS_H 23 | 24 | #include 25 | 26 | class QString; 27 | class QGroupBox; 28 | class QDomElement; 29 | class QRadioButton; 30 | class KTextEdit; 31 | class QVBoxLayout; 32 | 33 | class BasketScene; 34 | class Note; 35 | 36 | /** The dialog to ask how to import hierarchical data. 37 | * @author Sébastien Laoût 38 | */ 39 | class TreeImportDialog : public QDialog 40 | { 41 | Q_OBJECT 42 | public: 43 | TreeImportDialog(QWidget *parent = 0); 44 | ~TreeImportDialog(); 45 | int choice(); 46 | private: 47 | QGroupBox *m_choices; 48 | QVBoxLayout* m_choiceLayout; 49 | QRadioButton *m_hierarchy_choice; 50 | QRadioButton *m_separate_baskets_choice; 51 | QRadioButton *m_one_basket_choice; 52 | }; 53 | 54 | /** The dialog to ask how to import text files. 55 | * @author Sébastien Laoût 56 | */ 57 | class TextFileImportDialog : public QDialog 58 | { 59 | Q_OBJECT 60 | public: 61 | TextFileImportDialog(QWidget *parent = 0); 62 | ~TextFileImportDialog(); 63 | QString separator(); 64 | protected slots: 65 | void customSeparatorChanged(); 66 | private: 67 | QGroupBox *m_choices; 68 | QVBoxLayout* m_choiceLayout; 69 | QRadioButton *m_emptyline_choice; 70 | QRadioButton *m_newline_choice; 71 | QRadioButton *m_dash_choice; 72 | QRadioButton *m_star_choice; 73 | QRadioButton *m_all_in_one_choice; 74 | QRadioButton *m_anotherSeparator; 75 | KTextEdit *m_customSeparator; 76 | }; 77 | 78 | /** Functions that import data from other softwares. 79 | * @author Sébastien Laoût 80 | */ 81 | namespace SoftwareImporters 82 | { 83 | // Useful methods to design importers: 84 | QString fromICS(const QString &ics); 85 | QString fromTomboy(QString tomboy); 86 | //! Get first of the to be used as basket name. Strip 'system:notebook:' part 87 | QString getFirstTomboyTag(const QDomElement& docElem); 88 | Note* insertTitledNote(BasketScene *parent, const QString &title, const QString &content, Qt::TextFormat format = Qt::PlainText, Note *parentNote = 0); 89 | void finishImport(BasketScene *basket); 90 | 91 | // The importers in themselves: 92 | void importKNotes(); 93 | void importKJots(); 94 | void importKnowIt(); 95 | void importTuxCards(); 96 | void importStickyNotes(); 97 | void importTomboy(); 98 | void importJreepadFile(); 99 | void importTextFile(); 100 | 101 | // 102 | void importTuxCardsNode(const QDomElement &element, BasketScene *parentBasket, Note *parentNote, int remainingHierarchy); 103 | } 104 | 105 | #endif // SOFTWAREIMPORTERS_H 106 | -------------------------------------------------------------------------------- /src/systemtray.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 SYSTEMTRAY_H 22 | #define SYSTEMTRAY_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | /** A thin wrapper around KSystemTrayIcon until the old SystemTray is ported. 29 | * As things are ported, items should 30 | * @author Kelvie Wong 31 | */ 32 | class SystemTray : public KStatusNotifierItem 33 | { 34 | Q_OBJECT 35 | Q_DISABLE_COPY(SystemTray); 36 | 37 | public: 38 | SystemTray(QWidget *parent = 0); 39 | ~SystemTray(); 40 | 41 | public slots: 42 | void updateDisplay(); 43 | 44 | signals: 45 | void showPart(); 46 | }; 47 | 48 | #ifdef USE_OLD_SYSTRAY 49 | 50 | /** This class provide a personalized system tray icon. 51 | * @author Sébastien Laoût 52 | */ 53 | class SystemTray2 : public SystemTray 54 | { 55 | Q_OBJECT 56 | public: 57 | explicit SystemTray2(QWidget *parent = 0, const char *name = 0); 58 | ~SystemTray2(); 59 | protected: 60 | void mousePressEvent(QMouseEvent *event); 61 | void mouseMoveEvent(QMouseEvent *event); 62 | void mouseReleaseEvent(QMouseEvent *event); 63 | virtual void dragEnterEvent(QDragEnterEvent *event); 64 | virtual void dragMoveEvent(QDragMoveEvent* event); 65 | virtual void dragLeaveEvent(QDragLeaveEvent*); 66 | virtual void dropEvent(QDropEvent *event); 67 | void wheelEvent(QWheelEvent *event); 68 | void enterEvent(QEvent*); 69 | void leaveEvent(QEvent*); 70 | 71 | private: 72 | QTimer *m_showTimer; 73 | QTimer *m_autoShowTimer; 74 | bool m_canDrag; 75 | QPoint m_pressPos; 76 | }; 77 | #endif // USE_OLD_SYSTRAY 78 | 79 | #endif // SYSTEMTRAY_H 80 | -------------------------------------------------------------------------------- /src/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(ECMMarkAsTest) 2 | 3 | set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) 4 | 5 | find_package(Qt5Test REQUIRED) 6 | 7 | add_custom_target(tests) 8 | 9 | include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src 10 | ${CMAKE_BINARY_DIR}/src) 11 | 12 | link_directories(${CMAKE_BINARY_DIR}/lib) 13 | 14 | 15 | macro(basket_standalone_unit_test _testname) 16 | add_executable(${_testname} ${_testname}.cpp ${_extra_sources} ${ARGN}) 17 | ecm_mark_as_test(${_testname}) 18 | add_dependencies(tests ${_testname}) #include into "tests" build target 19 | target_link_libraries(${_testname} basketcommon Qt5::Test) 20 | endmacro(basket_standalone_unit_test) 21 | 22 | 23 | macro(basket_full_unit_test _testname) 24 | include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${SOPRANO_INCLUDE_DIR}) 25 | 26 | #set(baskettest_SRCS " ") 27 | foreach (cpp ${basketcommon_LIB_SRCS}) 28 | set(IS_GENERATED (${cpp} MATCHES "(^/)")) # Generated files contain full path (start with '/') 29 | if(${IS_GENERATED}) 30 | # Not used now (included via basketcommon target) 31 | #list(APPEND baskettest_SRCS ${cpp}) 32 | else(${IS_GENERATED}) 33 | list(APPEND baskettest_SRCS "${CMAKE_SOURCE_DIR}/src/${cpp}") 34 | endif(${IS_GENERATED}) 35 | endforeach () 36 | 37 | add_executable(${_testname} ${_testname}.cpp ${baskettest_SRCS}) 38 | ecm_mark_as_test(${_testname}) 39 | add_dependencies(tests ${_testname}) 40 | 41 | target_link_libraries(${_testname} basketcommon ${GPGME_VANILLA_LIBRARIES} Qt5::Test) 42 | endmacro(basket_full_unit_test) 43 | 44 | 45 | basket_standalone_unit_test(notetest) 46 | basket_standalone_unit_test(basketviewtest) 47 | basket_full_unit_test(toolstest) 48 | -------------------------------------------------------------------------------- /src/tests/basketviewtest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 by Matt Rogers 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "note.h" 24 | #include "basketview.h" 25 | 26 | class BasketViewTest: public QObject 27 | { 28 | Q_OBJECT 29 | private Q_SLOTS: 30 | void testCreation(); 31 | }; 32 | 33 | QTEST_MAIN(BasketViewTest) 34 | 35 | void BasketViewTest::testCreation() 36 | { 37 | 38 | } 39 | #include "basketviewtest.moc" 40 | /* vim: set et sts=4 sw=4 ts=8 tw=0 : */ 41 | -------------------------------------------------------------------------------- /src/tests/htmltotext/1.html: -------------------------------------------------------------------------------- 1 | 2 | 5 |

Hello world

6 | -------------------------------------------------------------------------------- /src/tests/htmltotext/1.txt: -------------------------------------------------------------------------------- 1 | Hello world -------------------------------------------------------------------------------- /src/tests/htmltotext/2.html: -------------------------------------------------------------------------------- 1 | 2 | 5 |

all fonts are here

6 | -------------------------------------------------------------------------------- /src/tests/htmltotext/2.txt: -------------------------------------------------------------------------------- 1 | all fonts are here -------------------------------------------------------------------------------- /src/tests/htmltotext/3.html: -------------------------------------------------------------------------------- 1 | 2 | 5 |

yes

6 |

!!!

7 | -------------------------------------------------------------------------------- /src/tests/htmltotext/3.txt: -------------------------------------------------------------------------------- 1 | yes 2 | !!! -------------------------------------------------------------------------------- /src/tests/htmltotext/4.html: -------------------------------------------------------------------------------- 1 | 2 | 5 |

6 | -------------------------------------------------------------------------------- /src/tests/htmltotext/4.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/src/tests/htmltotext/4.txt -------------------------------------------------------------------------------- /src/tests/htmltotext/5.html: -------------------------------------------------------------------------------- 1 | 2 | 5 |

eerreéwewe

6 | -------------------------------------------------------------------------------- /src/tests/htmltotext/5.txt: -------------------------------------------------------------------------------- 1 | eerreéwewe -------------------------------------------------------------------------------- /src/tests/notetest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 by Matt Rogers 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "note.h" 24 | #include "basketview.h" 25 | 26 | class NoteTest: public QObject 27 | { 28 | Q_OBJECT 29 | private Q_SLOTS: 30 | void testCreation(); 31 | }; 32 | 33 | QTEST_MAIN(NoteTest) 34 | 35 | void NoteTest::testCreation() 36 | { 37 | Note* n = new Note(0); 38 | QVERIFY(n->basket() == 0); 39 | QVERIFY(n->next() == 0); 40 | QVERIFY(n->prev() == 0); 41 | QVERIFY(n->content() == 0); 42 | QCOMPARE(n->x(), 0.0); 43 | QCOMPARE(n->y(), 0.0); 44 | QCOMPARE(n->width(), Note::GROUP_WIDTH); 45 | QCOMPARE(n->height(), Note::MIN_HEIGHT); 46 | delete n; 47 | } 48 | 49 | #include "notetest.moc" 50 | /* vim: set et sts=4 sw=4 ts=8 tw=0 : */ 51 | -------------------------------------------------------------------------------- /src/tests/toolstest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 by Gleb Baryshev 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "tools.h" 24 | 25 | class ToolsTest: public QObject 26 | { 27 | Q_OBJECT 28 | private Q_SLOTS: 29 | void testHtmlToText(); 30 | 31 | private: 32 | bool readAll(QString fileName, QString& text); 33 | }; 34 | 35 | QTEST_MAIN(ToolsTest) 36 | 37 | void ToolsTest::testHtmlToText() 38 | { 39 | //Test the function on files from htmltotext/ 40 | 41 | for (int i = 1; i <= 5; i++) { 42 | QString html, text; 43 | QString basename = QFINDTESTDATA("htmltotext/"); 44 | QVERIFY2(QDir(basename).exists(), "Test data file not found"); 45 | basename += QString::number(i); 46 | 47 | if (readAll(basename + ".html", html) && readAll(basename + ".txt", text)) 48 | QCOMPARE(Tools::htmlToText(html), text); 49 | } 50 | } 51 | 52 | bool ToolsTest::readAll(QString fileName, QString& text) 53 | { 54 | QFile f(fileName); 55 | if (!f.open(QFile::ReadOnly | QFile::Text)) { 56 | QWARN(QString("Failed to open data file %1 - skipping").arg(fileName).toUtf8()); 57 | return false; 58 | } 59 | QTextStream filestream(&f); 60 | text = filestream.readAll(); 61 | return true; 62 | } 63 | 64 | #include "toolstest.moc" 65 | 66 | -------------------------------------------------------------------------------- /src/transparentwidget.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 "basketscene.h" 22 | #include "transparentwidget.h" 23 | #include "basketview.h" 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | /** Class TransparentWidget */ 31 | 32 | //TODO: Why was Qt::WNoAutoErase used here? 33 | TransparentWidget::TransparentWidget(BasketScene *basket) 34 | : QWidget(basket->graphicsView()->viewport()), m_basket(basket) 35 | { 36 | setFocusPolicy(Qt::NoFocus); 37 | setMouseTracking(true); // To receive mouseMoveEvents 38 | 39 | basket->graphicsView()->viewport()->installEventFilter(this); 40 | } 41 | 42 | /*void TransparentWidget::reparent(QWidget *parent, Qt::WFlags f, const QPoint &p, bool showIt) 43 | { 44 | QWidget::reparent(parent, Qt::WNoAutoErase, p, showIt); 45 | }*/ 46 | 47 | void TransparentWidget::setPosition(int x, int y) 48 | { 49 | m_x = x; 50 | m_y = y; 51 | } 52 | 53 | void TransparentWidget::paintEvent(QPaintEvent*event) 54 | { 55 | QWidget::paintEvent(event); 56 | QPainter painter(this); 57 | 58 | // painter.save(); 59 | painter.translate(-m_x, -m_y); 60 | //m_basket->drawContents(&painter, m_x, m_y, width(), height()); 61 | 62 | // painter.restore(); 63 | // painter.setPen(Qt::blue); 64 | // painter.drawRect(0, 0, width(), height()); 65 | } 66 | 67 | void TransparentWidget::mouseMoveEvent(QMouseEvent *event) 68 | { 69 | // QMouseEvent *translated = new QMouseEvent(QEvent::MouseMove, event->pos() + QPoint(m_x, m_y), event->button(), event->buttons(), event->modifiers()); 70 | // m_basket->contentsMouseMoveEvent(translated); 71 | // delete translated; 72 | } 73 | 74 | bool TransparentWidget::eventFilter(QObject */*object*/, QEvent *event) 75 | { 76 | // If the parent basket viewport has changed, we should change too: 77 | if (event->type() == QEvent::Paint) 78 | update(); 79 | 80 | return false; // Event not consumed, in every cases (because it's only a notification)! 81 | } 82 | -------------------------------------------------------------------------------- /src/transparentwidget.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 TRANSPARENTWIDGET_H 22 | #define TRANSPARENTWIDGET_H 23 | 24 | #include 25 | 26 | class BasketScene; 27 | class QPaintEvent; 28 | class QMouseEvent; 29 | class QObject; 30 | 31 | class TransparentWidget : public QWidget 32 | { 33 | Q_OBJECT 34 | public: 35 | TransparentWidget(BasketScene *basket); 36 | void setPosition(int x, int y); 37 | //void reparent(QWidget *parent, Qt::WFlags f, const QPoint &p, bool showIt = FALSE); 38 | protected: 39 | void paintEvent(QPaintEvent*); 40 | void mouseMoveEvent(QMouseEvent *event); 41 | bool eventFilter(QObject *object, QEvent *event); 42 | private: 43 | BasketScene *m_basket; 44 | int m_x; 45 | int m_y; 46 | }; 47 | 48 | #endif // TRANSPARENTWIDGET_H 49 | -------------------------------------------------------------------------------- /src/xmlwork.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2003 by Sébastien Laoût * 3 | * slaout@linux62.org * 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 XMLWORKXMLWORK_H 22 | #define XMLWORKXMLWORK_H 23 | 24 | #include 25 | #include 26 | 27 | class QDomDocument; 28 | class QDomElement; 29 | 30 | /** All related functions to manage XML files and trees 31 | * @author Sébastien Laoût 32 | */ 33 | namespace XMLWork 34 | { 35 | // Manage XML files : 36 | QDomDocument* openFile(const QString &name, const QString &filePath); 37 | // Manage XML trees : 38 | QDomElement getElement(const QDomElement &startElement, const QString &elementPath); 39 | QString getElementText(const QDomElement &startElement, const QString &elementPath, const QString &defaultTxt = ""); 40 | void addElement(QDomDocument &document, QDomElement &parent, const QString &name, const QString &text); 41 | QString innerXml(QDomElement &element); 42 | void setupXmlStream(QXmlStreamWriter& stream, QString startElement); ///< Set XML options and write document start 43 | // Not directly related to XML : 44 | bool trueOrFalse(const QString &value, bool defaultValue = true); 45 | QString trueOrFalse(bool value); 46 | } 47 | 48 | #endif // XMLWORKXMLWORK_H 49 | -------------------------------------------------------------------------------- /tags/16-actions-tag_checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_checkbox.png -------------------------------------------------------------------------------- /tags/16-actions-tag_checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_checkbox_checked.png -------------------------------------------------------------------------------- /tags/16-actions-tag_for_later.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_for_later.png -------------------------------------------------------------------------------- /tags/16-actions-tag_fun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_fun.png -------------------------------------------------------------------------------- /tags/16-actions-tag_important.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_important.png -------------------------------------------------------------------------------- /tags/16-actions-tag_preference_bad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_preference_bad.png -------------------------------------------------------------------------------- /tags/16-actions-tag_preference_excellent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_preference_excellent.png -------------------------------------------------------------------------------- /tags/16-actions-tag_preference_good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_preference_good.png -------------------------------------------------------------------------------- /tags/16-actions-tag_priority_high.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_priority_high.png -------------------------------------------------------------------------------- /tags/16-actions-tag_priority_low.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_priority_low.png -------------------------------------------------------------------------------- /tags/16-actions-tag_priority_medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_priority_medium.png -------------------------------------------------------------------------------- /tags/16-actions-tag_progress_000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_progress_000.png -------------------------------------------------------------------------------- /tags/16-actions-tag_progress_025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_progress_025.png -------------------------------------------------------------------------------- /tags/16-actions-tag_progress_050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_progress_050.png -------------------------------------------------------------------------------- /tags/16-actions-tag_progress_075.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_progress_075.png -------------------------------------------------------------------------------- /tags/16-actions-tag_progress_100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/tags/16-actions-tag_progress_100.png -------------------------------------------------------------------------------- /tags/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ecm_install_icons(ICONS 2 | 16-actions-tag_checkbox.png 3 | 16-actions-tag_checkbox_checked.png 4 | 16-actions-tag_for_later.png 5 | 16-actions-tag_fun.png 6 | 16-actions-tag_important.png 7 | 16-actions-tag_preference_bad.png 8 | 16-actions-tag_preference_excellent.png 9 | 16-actions-tag_preference_good.png 10 | 16-actions-tag_priority_high.png 11 | 16-actions-tag_priority_low.png 12 | 16-actions-tag_priority_medium.png 13 | 16-actions-tag_progress_000.png 14 | 16-actions-tag_progress_025.png 15 | 16-actions-tag_progress_050.png 16 | 16-actions-tag_progress_075.png 17 | 16-actions-tag_progress_100.png 18 | DESTINATION ${ICON_INSTALL_DIR} 19 | THEME hicolor 20 | ) 21 | -------------------------------------------------------------------------------- /welcome/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE (GLOB BASKETS_FILES *.baskets) 2 | 3 | install(FILES ${BASKETS_FILES} DESTINATION ${DATA_INSTALL_DIR}/basket/welcome) 4 | 5 | -------------------------------------------------------------------------------- /welcome/Welcome_de.baskets: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/welcome/Welcome_de.baskets -------------------------------------------------------------------------------- /welcome/Welcome_en_US.baskets: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/welcome/Welcome_en_US.baskets -------------------------------------------------------------------------------- /welcome/Welcome_fr.baskets: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/welcome/Welcome_fr.baskets -------------------------------------------------------------------------------- /welcome/Welcome_it.baskets: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/welcome/Welcome_it.baskets -------------------------------------------------------------------------------- /welcome/Welcome_ja.baskets: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/welcome/Welcome_ja.baskets -------------------------------------------------------------------------------- /welcome/Welcome_nn.baskets: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/welcome/Welcome_nn.baskets -------------------------------------------------------------------------------- /welcome/Welcome_pt.baskets: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/welcome/Welcome_pt.baskets -------------------------------------------------------------------------------- /welcome/Welcome_ru.baskets: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basket-notepads/basket/00e1d089d5d8b956f6dd46d9bfaa5f1979794b31/welcome/Welcome_ru.baskets --------------------------------------------------------------------------------