diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 3b6421f..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR) - -project(kdeexamples) - -find_package(KDE4 REQUIRED) - -include(KDE4Defaults) - -add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) - -install(FILES README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples) - -add_subdirectory(attica) -add_subdirectory(authorization) -add_subdirectory(kconfigxt) -add_subdirectory(kcontrolmodules) -add_subdirectory(kdedemo) -add_subdirectory(kdeui) -add_subdirectory(kidletime) -add_subdirectory(kio) -add_subdirectory(knewstuff) -add_subdirectory(kross) -add_subdirectory(nepomuk) -add_subdirectory(phonon) -add_subdirectory(plasma) -add_subdirectory(solid) -add_subdirectory(sonnet) diff --git a/CTestConfig.cmake b/CTestConfig.cmake deleted file mode 100644 index 97953c1..0000000 --- a/CTestConfig.cmake +++ /dev/null @@ -1,13 +0,0 @@ -## This file should be placed in the root directory of your project. -## Then modify the CMakeLists.txt file in the root directory of your -## project to incorporate the testing dashboard. -## # The following are required to uses Dart and the Cdash dashboard -## ENABLE_TESTING() -## INCLUDE(CTest) -set(CTEST_PROJECT_NAME "kdeexamples") -set(CTEST_NIGHTLY_START_TIME "20:00:00 CET") - -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "my.cdash.org") -set(CTEST_DROP_LOCATION "/submit.php?project=kdeexamples") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/KDEExamplesNightly.cmake b/KDEExamplesNightly.cmake deleted file mode 100644 index 3d78767..0000000 --- a/KDEExamplesNightly.cmake +++ /dev/null @@ -1,87 +0,0 @@ -# This is a script for running a Nightly build of kdeexamples. -# It is ready for testing. -# To adapt it for other projects, basically only the KDE_CTEST_VCS_REPOSITORY variable -# has to be changed. -# -# It uses the file KDECTestNightly.cmake, which is in KDE svn in kdesdk/cmake/modules/. -# You need to have this file on some location on your system and then point the environment variable -# KDECTESTNIGHTLY_DIR to the directory containing this file when running this script. -# -# At the bottom of this file you can find (commented out) a simple shell script which -# I use to drive the Nightly builds on my machine. You have to adapt this to the -# conditions on your system, then you can run it e.g. via cron. -# -# Alex - -# The VCS of KDE is "svn", also specify the repository -set(KDE_CTEST_VCS svn) -set(KDE_CTEST_VCS_REPOSITORY https://svn.kde.org/home/kde/trunk/KDE/kdeexamples) - -# for now hardcode the generator to "Unix Makefiles" -set(CTEST_CMAKE_GENERATOR "Unix Makefiles" ) - - -# generic support code, provides the kde_ctest_setup() macro, which sets up everything required: -file(TO_CMAKE_PATH $ENV{KDECTESTNIGHTLY_DIR} KDECTESTNIGHTLY_DIR) -include( "${KDECTESTNIGHTLY_DIR}/KDECTestNightly.cmake" OPTIONAL RESULT_VARIABLE fileIncluded) - -if(NOT fileIncluded) - message(FATAL_ERROR "Did not find file ${KDECTESTNIGHTLY_DIR}/KDECTestNightly.cmake . Set the environment variable KDECTESTNIGHTLY_DIR to the directory where this file is located. In KDE svn it is in kdesdk/cmake/modules/ ") -endif(NOT fileIncluded) - -# set up binary dir, source dir, etc. -kde_ctest_setup("${CMAKE_CURRENT_LIST_FILE}") - -# now actually do the Nightly -ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}") -ctest_start(Nightly) -ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}" ) - -# read some settings -include("${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake") -include("${CTEST_SOURCE_DIRECTORY}/CTestCustom.cmake" OPTIONAL) - -# if CMAKE_INSTALL_PREFIX and BUILD_experimental were defined on the command line, put them -# in the initial cache, so cmake gets them -kde_ctest_write_initial_cache("${CTEST_BINARY_DIRECTORY}" CMAKE_INSTALL_PREFIX) - -# configure, build, test, submit -ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" ) -ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" ) -ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" ) -ctest_submit() - -# optionally install afterwards, so additional nightly builds can use this current install -# (e.g. kdepimlibs could use this kdelibs install) -if(DO_INSTALL) - kde_ctest_install("${CTEST_BINARY_DIRECTORY}" ) -endif(DO_INSTALL) - - -############################################################################################ -# -# ------------8<-----------------8<---------------------8<---------------------8<----------- -# #!/bin/sh -# -# # point to the directory where KDECTestNightly.cmake is located (in svn: kdesvn/cmake/modules/ ) -# export KDECTESTNIGHTLY_DIR=/home/alex/src/kde4-svn/KDE\ dir/kdesdk/cmake/modules/ -# -# -# # Set which ctest will be used, where the results should be installed to, and which suffix the -# CTEST=/opt/cmake-2.6.2-Linux-i386/bin/ctest -# INSTALL_ROOT=/home/alex/Dashboards/installs/2.6.2 -# SUFFIX=cmake-2.6.2 -# -# # set CMAKE_PREFIX_PATH so that everything necessary for building automoc4 will be found: -# export CMAKE_PREFIX_PATH=/opt/qt-4.5/qt/ -# -# $CTEST -V -VV -S ~/src/kde4-svn/kdesupport/automoc/Automoc4Nightly.cmake,KDE_CTEST_BUILD_SUFFIX=$SUFFIX,CMAKE_INSTALL_PREFIX=$INSTALL_ROOT/automoc4,DO_INSTALL=TRUE -# -# # For building kdelibs we need more stuff in CMAKE_PREFIX_PATH: -# export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$INSTALL_ROOT/automoc4 -# export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/opt/shared-mime-info -# export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/opt/kdesupport/ -# -# $CTEST -V -VV -S ~/src/kde4-svn/KDE\ dir/kdelibs/KDELibsNightly.cmake,KDE_CTEST_BUILD_SUFFIX=$SUFFIX,CMAKE_INSTALL_PREFIX=$INSTALL_ROOT/kdelibs,DO_INSTALL=TRUE -# -# ------------8<-----------------8<---------------------8<---------------------8<----------- diff --git a/README b/README deleted file mode 100644 index 825a0b8..0000000 --- a/README +++ /dev/null @@ -1,11 +0,0 @@ -This module contains code snippets and examples for various KDE technologies. - -Each set of examples is grouped by topic into a subdirectory of this module. Note -that some of the examples may be augmented by tutorials on Techbase, the KDE -technical wiki found at http://techbase.kde.org. If they are, this will be noted in -a README file with the code. - -All examples are licensed under one of the Free Software licenses listed on this -page: http://techbase.kde.org/Policies/Licensing_Policy and maybe used accordingly. - -Share and enjoy! diff --git a/README.unmaintained b/README.unmaintained new file mode 100644 index 0000000..d991371 --- /dev/null +++ b/README.unmaintained @@ -0,0 +1,5 @@ +This repository is no longer maintained. + +Checkout 1ac56ed708a27e9f37e16bb435bc7be077dd7747 if you want to access +the old code. + diff --git a/attica/CMakeLists.txt b/attica/CMakeLists.txt deleted file mode 100644 index 8e1427d..0000000 --- a/attica/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -project(Attica) - -find_package(LibAttica REQUIRED) - -install(FILES README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/attica) - -include(MacroLibrary) -include(MacroOptionalAddSubdirectory) -include_directories(${LIBATTICA_INCLUDE_DIR}) - -add_subdirectory(opencollaborationexample) diff --git a/attica/README b/attica/README deleted file mode 100644 index 4ccf80a..0000000 --- a/attica/README +++ /dev/null @@ -1,3 +0,0 @@ -The Open Collaboration Service (OCS) providers such as openDesktop.org can be easily accessed through Attica. - -Attica is a Qt library that implements the freedesktop.org specification for the Open Collaboration Services API. diff --git a/attica/opencollaborationexample/CMakeLists.txt b/attica/opencollaborationexample/CMakeLists.txt deleted file mode 100644 index ac56a32..0000000 --- a/attica/opencollaborationexample/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -project(opencollaborationexample) - -include_directories(${KDE4_INCLUDES} ${LIBATTICA_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) - -set(opencollaborationexample_SRCS - main.cpp - mainwindow.cpp - person.cpp - contentdownload.cpp - contentcreation.cpp - privatedata.cpp - ) - -set(opencollaborationexample_HEADERS - contentcreation.h - contentdownload.h - mainwindow.h - person.h - privatedata.h - ) - -set(opencollaborationexample_UI - person.ui - contentdownload.ui - contentcreation.ui - privatedata.ui - ) - -install(FILES ${opencollaborationexample_SRCS} ${opencollaborationexample_HEADERS} ${opencollaborationexample_UI} - DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/attica/opencollaborationexample) - -kde4_add_ui_files(opencollaborationexample_SRCS ${opencollaborationexample_UI}) - -kde4_add_executable(opencollaborationexample ${opencollaborationexample_SRCS}) -target_link_libraries(opencollaborationexample ${LIBATTICA_LIBRARIES} ${KDE4_KIO_LIBS} ${KDE4_KDEUI_LIBS}) -install(TARGETS opencollaborationexample ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/attica/opencollaborationexample/contentcreation.cpp b/attica/opencollaborationexample/contentcreation.cpp deleted file mode 100644 index 27a7386..0000000 --- a/attica/opencollaborationexample/contentcreation.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2009 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#include "contentcreation.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -using namespace Attica; - -ContentCreation::ContentCreation(Attica::Provider provider, QWidget* parent) - : QWidget(parent) - , m_provider(provider) - , m_editMode(false) -{ - ui.setupUi(this); - - connect(ui.category, SIGNAL(currentIndexChanged(int)), SLOT(categoryChanged())); - connect(ui.submitButton, SIGNAL(clicked()), SLOT(submit())); - - connect(ui.upload, SIGNAL(clicked()), SLOT(uploadFile())); - connect(ui.uploadPreview1Button, SIGNAL(clicked()), SLOT(uploadPreview1())); - connect(ui.uploadPreview2Button, SIGNAL(clicked()), SLOT(uploadPreview2())); - connect(ui.uploadPreview3Button, SIGNAL(clicked()), SLOT(uploadPreview3())); - - connect(ui.deleteFile, SIGNAL(clicked()), SLOT(deleteFile())); - connect(ui.deletePreview1, SIGNAL(clicked()), SLOT(deletePreview1())); - - // get the available categories from the server - ListJob* job = m_provider.requestCategories(); - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(categoriesLoaded(Attica::BaseJob*))); - job->start(); -} - -void ContentCreation::categoriesLoaded(Attica::BaseJob* job) -{ - ListJob* listJob = static_cast*>(job); - Category::List categories = listJob->itemList(); - - Q_FOREACH(Category category, categories) { - ui.category->addItem(category.name(), category.id()); - } - ui.category->model()->sort(0); -} - -void ContentCreation::categoryChanged() -{ -} - -void ContentCreation::submit() -{ - // get the currently selected category - Category category; - category.setId(ui.category->itemData(ui.category->currentIndex()).toString()); - - // fill in the content object - Content content; - content.setName(ui.name->text()); - - content.addAttribute("description", ui.description->text()); - content.addAttribute("changelog", ui.changelog->text()); - content.addAttribute("version", ui.version->text()); - content.addAttribute("downloadlink1", ui.link1->text()); - content.addAttribute("downloadlink2", ui.link2->text()); - content.addAttribute("homepage1", ui.homepage->text()); - content.addAttribute("blog1", ui.blog->text()); - - if (!m_editMode) { - ItemPostJob* job = m_provider.addNewContent(category, content); - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(contentAdded(Attica::BaseJob*))); - job->start(); - } else { - ItemPostJob* job = m_provider.editContent(category, m_contentId, content); - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(contentAdded(Attica::BaseJob*))); - job->start(); - } -} - -void ContentCreation::contentAdded(Attica::BaseJob* baseJob) -{ - ItemPostJob * job = static_cast *>(baseJob); - QString id = job->result().id(); - QMessageBox::information(0, "Content Added", id); - - if (!id.isEmpty()) { - ui.addFileGroup->setEnabled(true); - } - - m_contentId = id; - ui.contentId->setText(m_contentId); - - m_editMode = true; -} - -void ContentCreation::uploadFile() -{ - doUpload(QString(), ui.uploadFile->url().toLocalFile()); -} - -void ContentCreation::uploadPreview1() -{ - doUpload("1", ui.uploadPreview1->url().toLocalFile()); -} - -void ContentCreation::uploadPreview2() -{ - doUpload("2", ui.uploadPreview2->url().toLocalFile()); -} - -void ContentCreation::uploadPreview3() -{ - doUpload("3", ui.uploadPreview3->url().toLocalFile()); -} - -void ContentCreation::doUpload(const QString& index, const QString& path) -{ - QFile file(path); - if (!file.open(QIODevice::ReadOnly)) { - QMessageBox::warning(this, "Upload", QString("File not found: %1").arg(ui.uploadFile->text())); - return; - } - - QByteArray fileContents; - fileContents.append(file.readAll()); - file.close(); - - QString fileName = QFileInfo(path).fileName(); - - PostJob* job; - if (index.isEmpty()) { - job = m_provider.setDownloadFile(m_contentId, fileName, fileContents); - } else { - job = m_provider.setPreviewImage(m_contentId, index, fileName, fileContents); - } - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(fileUploadFinished(Attica::BaseJob*))); - job->start(); - -} - -void ContentCreation::deleteFile() -{ - m_provider.deleteDownloadFile(m_contentId); -} - -void ContentCreation::deletePreview1() -{ - m_provider.deletePreviewImage(m_contentId, "1"); -} - - -void ContentCreation::fileUploadFinished(BaseJob* ) -{ - QMessageBox::information(0, "Content Added", "File Uploaded"); -} - -#include "contentcreation.moc" - diff --git a/attica/opencollaborationexample/contentcreation.h b/attica/opencollaborationexample/contentcreation.h deleted file mode 100644 index e028e29..0000000 --- a/attica/opencollaborationexample/contentcreation.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2009 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#ifndef CONTENTCREATION_H -#define CONTENTCREATION_H - -#include - -#include -#include - -#include "ui_contentcreation.h" - -class ContentCreation : public QWidget -{ - Q_OBJECT -public: - ContentCreation(Attica::Provider provider, QWidget* parent = 0); - -public Q_SLOTS: - void categoriesLoaded(Attica::BaseJob *job); - void categoryChanged(); - void contentAdded(Attica::BaseJob*); - - void submit(); - void uploadFile(); - void uploadPreview1(); - void uploadPreview2(); - void uploadPreview3(); - - void deleteFile(); - void deletePreview1(); - - void fileUploadFinished(Attica::BaseJob*); - -private: - void doUpload(const QString& index, const QString& filePath); - - Attica::Provider m_provider; - Ui::ContentCreation ui; - - bool m_editMode; - QString m_contentId; - QByteArray m_byteArray; -}; - -#endif - diff --git a/attica/opencollaborationexample/contentcreation.ui b/attica/opencollaborationexample/contentcreation.ui deleted file mode 100644 index 745bb58..0000000 --- a/attica/opencollaborationexample/contentcreation.ui +++ /dev/null @@ -1,283 +0,0 @@ - - - ContentCreation - - - - 0 - 0 - 515 - 572 - - - - Form - - - - - - Select the category of the new content: - - - - - - - - - - Details - - - - - - - - Name of the content: - - - - - - - - - - Description: - - - - - - - - - - Changelog: - - - - - - - - - - Version: - - - - - - - - - - Download link 1: - - - - - - - - - - - - - Download link 2: - - - - - - - - - - - - - - - - License: - - - - - - - Homepage: - - - - - - - - - - - - - Blog: - - - - - - - Accept Donations - - - - - - - New Content - - - - - - - Current Item: - - - - - - - - - - - - I ensure that this content does not violate any existing copyright, law or trademark. I agree that my IP address is logged. Distributing content where you don't have the permission from the copyright holder is illegal! - - - true - - - - - - - Submit - - - - - - - - - - true - - - Add File and Previews - - - - - - Upload - - - - - - - File - - - - - - - Upload - - - - - - - Preview 1 - - - - - - - Preview 2 - - - - - - - Preview 3 - - - - - - - Upload - - - - - - - Upload - - - - - - - Delete - - - - - - - Delete - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - KUrlRequester - QFrame -
kurlrequester.h
-
-
- - -
diff --git a/attica/opencollaborationexample/contentdownload.cpp b/attica/opencollaborationexample/contentdownload.cpp deleted file mode 100644 index 905459a..0000000 --- a/attica/opencollaborationexample/contentdownload.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2009 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#include "contentdownload.h" - -#include -#include - -#include - -#include -#include -#include -#include -#include - -using namespace Attica; - -ContentDownload::ContentDownload(Attica::Provider provider, QWidget* parent) - : QWidget(parent) - , m_provider(provider) -{ - ui.setupUi(this); - - connect(ui.category, SIGNAL(currentIndexChanged(int)), SLOT(categoryChanged())); - connect(ui.search, SIGNAL(returnPressed()), SLOT(categoryChanged())); - connect(ui.nextButton, SIGNAL(clicked()), SLOT(nextPage())); - connect(ui.voteGood, SIGNAL(clicked()), SLOT(voteGood())); - connect(ui.voteBad, SIGNAL(clicked()), SLOT(voteBad())); - - connect(ui.downloadButton, SIGNAL(clicked()), SLOT(download())); - - connect(ui.contentList, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(selectedContentChanged(QTreeWidgetItem*,QTreeWidgetItem*))); - - // get the available categories from the server - ListJob* job = m_provider.requestCategories(); - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(categoriesLoaded(Attica::BaseJob*))); - job->start(); -} - -void ContentDownload::categoriesLoaded(Attica::BaseJob* job) -{ - ListJob* listJob = static_cast*>(job); - Category::List categories = listJob->itemList(); - - Q_FOREACH(Category category, categories) { - ui.category->addItem(category.name(), category.id()); - } - ui.category->model()->sort(0); -} - -void ContentDownload::categoryChanged() -{ - m_page = 0; - updateContentsList(); -} - -void ContentDownload::nextPage() -{ - ++m_page; - updateContentsList(); -} - -void ContentDownload::updateContentsList() -{ - ui.contentList->clear(); - - QString name = ui.category->currentText(); - QString id = ui.category->itemData(ui.category->currentIndex()).toString(); - ui.currentCategoryLabel->setText(name); - ui.currentCategoryIdLabel->setText("Category Id: " + id); - - Category cat; - cat.setId(id); - Category::List catList; - catList << cat; - - QString searchString(ui.search->text()); - ListJob* job = m_provider.searchContents(catList, searchString, Provider::Rating, m_page, 20); - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(categoryContentsLoaded(Attica::BaseJob*))); - job->start(); -} - -Q_DECLARE_METATYPE(Content) - -void ContentDownload::categoryContentsLoaded(BaseJob* job) -{ - ListJob* listJob = static_cast*>(job); - Content::List contents = listJob->itemList(); - - Q_FOREACH(Content content, contents) { - QTreeWidgetItem* item = new QTreeWidgetItem; - item->setText(0, content.name()); - item->setText(1, QString("%1%").arg(content.rating())); - item->setData(0, Qt::UserRole, qVariantFromValue(content)); - ui.contentList->addTopLevelItem(item); - } - ui.countLabel->setText(tr("Total items: %1").arg(listJob->metadata().totalItems())); -} - -void ContentDownload::selectedContentChanged(QTreeWidgetItem* , QTreeWidgetItem* selectedItem) -{ - kDebug() << "selection changed"; - if (selectedItem && qVariantCanConvert(selectedItem->data(0, Qt::UserRole))) { - Content c = qvariant_cast(selectedItem->data(0, Qt::UserRole)); - ui.person->setText(c.attribute("personid")); - ui.score->setText(QString::number(c.rating())); - ui.numberDownloads->setText(QString::number(c.downloads())); - } -} - -void ContentDownload::voteGood() -{ - vote(true); -} - -void ContentDownload::voteBad() -{ - vote(false); -} - -void ContentDownload::vote(bool positive) -{ - QTreeWidgetItem* selectedItem = ui.contentList->currentItem(); - if (selectedItem && qVariantCanConvert(selectedItem->data(0, Qt::UserRole))) { - Content c = qvariant_cast(selectedItem->data(0, Qt::UserRole)); - PostJob * job = m_provider.voteForContent(c.id(), positive); - job->start(); - } -} - -void ContentDownload::download() -{ - qDebug() << "download"; - QTreeWidgetItem* selectedItem = ui.contentList->currentItem(); - if (selectedItem && qVariantCanConvert(selectedItem->data(0, Qt::UserRole))) { - Content c = qvariant_cast(selectedItem->data(0, Qt::UserRole)); - ItemJob* job = m_provider.downloadLink(c.id()); - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(downloadLinkLoaded(Attica::BaseJob*))); - job->start(); - } -} - -void ContentDownload::downloadLinkLoaded(BaseJob* baseJob) -{ - qDebug() << "downloadLinkLoaded"; - ItemJob* job = static_cast*>(baseJob); - DownloadItem item = job->result(); - QMessageBox::information(0, "Download from: ", item.url().toString()); -} - - - -#include "contentdownload.moc" diff --git a/attica/opencollaborationexample/contentdownload.h b/attica/opencollaborationexample/contentdownload.h deleted file mode 100644 index 8d76579..0000000 --- a/attica/opencollaborationexample/contentdownload.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2009 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#ifndef CONTENTDOWNLOAD_H -#define CONTENTDOWNLOAD_H - -#include - -#include - -#include "ui_contentdownload.h" - -class ContentDownload : public QWidget -{ - Q_OBJECT -public: - ContentDownload(Attica::Provider provider, QWidget* parent = 0); - -public Q_SLOTS: - void categoriesLoaded(Attica::BaseJob *job); - void categoryChanged(); - void updateContentsList(); - void nextPage(); - void categoryContentsLoaded(Attica::BaseJob*); - void selectedContentChanged(QTreeWidgetItem*,QTreeWidgetItem*); - void download(); - void downloadLinkLoaded(Attica::BaseJob*); - - void voteGood(); - void voteBad(); - -private: - void vote(bool positive); - - Attica::Provider m_provider; - Ui::ContentDownload ui; - - int m_page; -}; - -#endif // CONTENTDOWNLOAD_H diff --git a/attica/opencollaborationexample/contentdownload.ui b/attica/opencollaborationexample/contentdownload.ui deleted file mode 100644 index a1d4e50..0000000 --- a/attica/opencollaborationexample/contentdownload.ui +++ /dev/null @@ -1,164 +0,0 @@ - - - ContentDownload - - - - 0 - 0 - 612 - 492 - - - - Form - - - - - - - - - - - Category - - - - - - - Id - - - - - - - - - - - - - - total - - - - - - - &Next Page - - - - - - - - - - Name - - - - - Rating - - - - - - - - GroupBox - - - - - - - - Uploaded by: - - - - - - - person - - - - - - - Downloads: - - - - - - - number - - - - - - - Score: - - - - - - - score - - - - - - - - - - - Vote: - - - - - - - Good - - - - - - - Bad - - - - - - - - - Download - - - - - - - - - - - diff --git a/attica/opencollaborationexample/main.cpp b/attica/opencollaborationexample/main.cpp deleted file mode 100644 index af18396..0000000 --- a/attica/opencollaborationexample/main.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2009 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#include -#include -#include -#include - -#include "mainwindow.h" - -// There is really nothing new in this file, you should look at more basic tutorial if you don't understand this. - -int main (int argc, char *argv[]) -{ - KAboutData aboutData( "opencollaborationexample", 0, - ki18n("Open Collaboration Services Demo"), "1.0", - ki18n("Show how to use libattica to access the Open Collaboration Services"), - KAboutData::License_GPL, - ki18n("Copyright (c) 2009 Frederik Gladhorn") ); - KCmdLineArgs::init( argc, argv, &aboutData ); - - KApplication app; - - MainWindow* window = new MainWindow(); - window->show(); - - return app.exec(); -} - diff --git a/attica/opencollaborationexample/mainwindow.cpp b/attica/opencollaborationexample/mainwindow.cpp deleted file mode 100644 index 4829074..0000000 --- a/attica/opencollaborationexample/mainwindow.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2009 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#include "mainwindow.h" - -#include -#include - -#include - -#include "person.h" -#include "contentdownload.h" -#include "contentcreation.h" -#include "privatedata.h" - -MainWindow::MainWindow(QWidget *parent) : KMainWindow(parent) -{ - m_manager = new Attica::ProviderManager; - - connect(m_manager, SIGNAL(defaultProvidersLoaded()), SLOT(providersLoaded())); - m_manager->loadDefaultProviders(); -} - -MainWindow::~MainWindow() -{ - delete m_manager; -} - -void MainWindow::providersLoaded() -{ - if (!m_manager->providers().isEmpty()) { - m_provider = m_manager->providerByUrl(QUrl("https://api.opendesktop.org/v1/")); - if (!m_provider.isValid()) { - kDebug() << "Could not find opendesktop.org provider."; - return; - } - - QTabWidget* mainWidget = new QTabWidget(this); - setCentralWidget(mainWidget); - - SimplePersonRequest* personWidget = new SimplePersonRequest(m_provider, this); - mainWidget->addTab(personWidget, tr("Person Search")); - - ContentDownload* contentWidget = new ContentDownload(m_provider, this); - mainWidget->addTab(contentWidget, tr("Content")); - - ContentCreation* contentCreationWidget = new ContentCreation(m_provider, this); - mainWidget->addTab(contentCreationWidget, tr("Add Content")); - - PrivateDataView* privateDataView = new PrivateDataView(m_manager, this); - mainWidget->addTab(privateDataView, tr("View private data")); - } -} - -#include "mainwindow.moc" - diff --git a/attica/opencollaborationexample/mainwindow.h b/attica/opencollaborationexample/mainwindow.h deleted file mode 100644 index b1de2c6..0000000 --- a/attica/opencollaborationexample/mainwindow.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2009 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -#include -#include - -#include -#include - - -class MainWindow : public KMainWindow -{ - Q_OBJECT - -public: - MainWindow(QWidget *parent=0); - ~MainWindow(); - -public Q_SLOTS: - void providersLoaded(); - -private: - Attica::Provider m_provider; - Attica::ProviderManager* m_manager; -}; - -#endif - diff --git a/attica/opencollaborationexample/person.cpp b/attica/opencollaborationexample/person.cpp deleted file mode 100644 index 721debe..0000000 --- a/attica/opencollaborationexample/person.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2009 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#include "person.h" - -#include -#include -#include - -#include -#include - -#include "ui_person.h" - -SimplePersonRequest::SimplePersonRequest(Attica::Provider provider, QWidget* parent) - : QWidget(parent) - , m_provider(provider) -{ - m_ui = new Ui::PersonWidget; - m_ui->setupUi(this); - - mNick = "frank"; - m_ui->nick->setText(mNick); - connect(m_ui->nick, SIGNAL(returnPressed(QString)), SLOT(nickChanged(QString))); - nickChanged(mNick); -} - -SimplePersonRequest::~SimplePersonRequest() -{ - delete m_ui; -} - -void SimplePersonRequest::nickChanged(const QString& nick) -{ - mNick = nick; - Attica::ItemJob* job = m_provider.requestPerson(mNick); - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(personJobFinished(Attica::BaseJob*))); - job->start(); -} - -void SimplePersonRequest::personJobFinished( Attica::BaseJob *job ) -{ - kDebug() << "onJobFinished"; - Attica::ItemJob *personJob = static_cast< Attica::ItemJob * >( job ); - if( personJob->metadata().error() == Attica::Metadata::NoError ) { - Attica::Person p(personJob->result()); - m_ui->name->setText(p.firstName() + ' ' + p.lastName()); - m_ui->city->setText(p.city()); - m_ui->country->setText(p.country()); - m_ui->messenger->setText(p.extendedAttribute("messenger1") + " (" + p.extendedAttribute("messengertype1") + ')'); - m_ui->homepage->setText(p.homepage()); - m_ui->project->setText(p.extendedAttribute("communityrole")); - m_ui->languages->setText(p.extendedAttribute("languages")); - } else { - m_ui->name->setText(i18n("Could not find person.")); - } -} - -#include "person.moc" - diff --git a/attica/opencollaborationexample/person.h b/attica/opencollaborationexample/person.h deleted file mode 100644 index 036ba2f..0000000 --- a/attica/opencollaborationexample/person.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2009 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#ifndef SIMPLEPERSONREQUEST_H -#define SIMPLEPERSONREQUEST_H - -#include -#include -#include - -namespace Ui { - class PersonWidget; -} - -class SimplePersonRequest :public QWidget -{ - Q_OBJECT - -public: - SimplePersonRequest(Attica::Provider provider, QWidget* parent = 0); - ~SimplePersonRequest(); - -public Q_SLOTS: - void nickChanged(const QString& nick); - void personJobFinished( Attica::BaseJob *job ); - -private: - QString mNick; - Attica::Provider m_provider; - Ui::PersonWidget* m_ui; -}; - -#endif // SIMPLEPERSONREQUEST_H diff --git a/attica/opencollaborationexample/person.ui b/attica/opencollaborationexample/person.ui deleted file mode 100644 index 7e3b3e6..0000000 --- a/attica/opencollaborationexample/person.ui +++ /dev/null @@ -1,173 +0,0 @@ - - - PersonWidget - - - - 0 - 0 - 344 - 263 - - - - Form - - - - - - Name: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - City: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - Country: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - Messenger: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - Homepage: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - Project: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Languages: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - Nick: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - KLineEdit - QLineEdit -
klineedit.h
-
-
- - -
diff --git a/attica/opencollaborationexample/privatedata.cpp b/attica/opencollaborationexample/privatedata.cpp deleted file mode 100644 index b25ca8c..0000000 --- a/attica/opencollaborationexample/privatedata.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2009 Frederik Gladhorn - Copyright (c) 2010 Martin Sandsmark - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#include "privatedata.h" - -#include -#include -#include - -#include -#include - -#include "ui_privatedata.h" - -PrivateDataView::PrivateDataView(Attica::ProviderManager *manager, QWidget* parent) - : QWidget(parent), m_ui(0) -{ - m_provider = manager->providerByUrl(QUrl("http://localhost/ocs/v1.php/")); - if (!m_provider.isValid()) { - setLayout(new QVBoxLayout); - layout()->addWidget(new QLabel("Please add an OCS-compliant provider for localhost in System Settings.")); - return; - } - - m_ui = new Ui::PrivateDataWidget; - m_ui->setupUi(this); - - QString username, password; - if (m_provider.loadCredentials(username, password)) { - m_ui->nick->setText(username); - m_ui->password->setText(password); - } - - connect(m_ui->fetchButton, SIGNAL(clicked()), SLOT(fetch())); - connect(m_ui->submitButton, SIGNAL(clicked()), SLOT(submit())); -} - -PrivateDataView::~PrivateDataView() -{ - delete m_ui; -} - -void PrivateDataView::fetch() -{ - if (!m_provider.isValid()) return; - - if (!m_ui->nick->text().isEmpty() && !m_ui->nick->text().isEmpty()) - m_provider.saveCredentials(m_ui->nick->text(), m_ui->password->text()); - - m_ui->keyValueView->clear(); - - Attica::ItemJob* job = m_provider.requestPrivateData(); - connect(job, SIGNAL(finished(Attica::BaseJob*)), SLOT(fetchJobFinished(Attica::BaseJob*))); - job->start(); -} - -void PrivateDataView::submit() -{ - if (!m_provider.isValid()) return; - - if (m_ui->key->text().isEmpty() || m_ui->value->text().isEmpty()) - return; - - Attica::PostJob *job = m_provider.setPrivateData("exampleapplication", m_ui->key->text(), m_ui->value->text()); - m_ui->key->clear(); - m_ui->value->clear(); - job->start(); -} - -void PrivateDataView::fetchJobFinished(Attica::BaseJob *job) -{ - kDebug() << Q_FUNC_INFO; - Attica::ItemJob *dataJob = static_cast< Attica::ItemJob * >( job ); - if( dataJob->metadata().error() == Attica::Metadata::NoError ) { - Attica::PrivateData p(dataJob->result()); - const QStringList &keys = p.keys(); - if (keys.isEmpty()) { - m_ui->keyValueView->addItem("[empty]"); - return; - } - Q_FOREACH(const QString &key, keys) { - m_ui->keyValueView->addItem(key + " : " + p.attribute(key) + " (" + p.timestamp(key).toString() + ")"); - } - } else { - m_ui->keyValueView->clear(); - m_ui->keyValueView->addItem("Error while fetching private data!"); - if (dataJob->metadata().error() == Attica::Metadata::OcsError) { - m_ui->keyValueView->addItem("Server-side OCS error!"); - } else { - m_ui->keyValueView->addItem("Network error!"); - } - m_ui->keyValueView->addItem("Status message: " + dataJob->metadata().message()); - } -} - -void PrivateDataView::submitJobFinished(Attica::BaseJob *job) -{ - kDebug() << Q_FUNC_INFO; - Attica::PostJob *postJob = static_cast(job); - - if (postJob->metadata().error() != Attica::Metadata::NoError) { - m_ui->keyValueView->clear(); - m_ui->keyValueView->addItem("Error while setting private data!"); - if (postJob->metadata().error() == Attica::Metadata::OcsError) { - m_ui->keyValueView->addItem("Server-side OCS error!"); - } else { - m_ui->keyValueView->addItem("Network error!"); - } - m_ui->keyValueView->addItem("Status message: " + postJob->metadata().message()); - } - -} - diff --git a/attica/opencollaborationexample/privatedata.h b/attica/opencollaborationexample/privatedata.h deleted file mode 100644 index 656b89b..0000000 --- a/attica/opencollaborationexample/privatedata.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2009 Frederik Gladhorn - Copyright (c) 2010 Martin Sandsmark - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#ifndef PRIVATEDATA_H -#define PRIVATEDATA_H - -#include -#include -#include -#include -#include - -namespace Ui { - class PrivateDataWidget; -} - -class PrivateDataView : public QWidget -{ - Q_OBJECT - -public: - PrivateDataView(Attica::ProviderManager* manager, QWidget* parent = 0); - ~PrivateDataView(); - -public Q_SLOTS: - void fetch(); - void submit(); - void fetchJobFinished(Attica::BaseJob *job); - void submitJobFinished(Attica::BaseJob *job); - -private: - Attica::Provider m_provider; - Ui::PrivateDataWidget * m_ui; -}; - -#endif // PRIVATEDATA_H diff --git a/attica/opencollaborationexample/privatedata.ui b/attica/opencollaborationexample/privatedata.ui deleted file mode 100644 index bb47c1d..0000000 --- a/attica/opencollaborationexample/privatedata.ui +++ /dev/null @@ -1,112 +0,0 @@ - - - PrivateDataWidget - - - - 0 - 0 - 456 - 417 - - - - Form - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Nick: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - Password: - - - - - - - QLineEdit::Password - - - - - - - Fetch... - - - - - - - Qt::Horizontal - - - - - - - Key: - - - - - - - Value: - - - - - - - - - - - - - Submit - - - - - - - - KLineEdit - QLineEdit -
klineedit.h
-
-
- - -
diff --git a/authorization/CMakeLists.txt b/authorization/CMakeLists.txt deleted file mode 100644 index 8832257..0000000 --- a/authorization/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(kauth_example) -add_subdirectory(kwalletdemo) diff --git a/authorization/kauth_example/CMakeLists.txt b/authorization/kauth_example/CMakeLists.txt deleted file mode 100644 index b7a35d6..0000000 --- a/authorization/kauth_example/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -project(kauthorization_example) - -include(MacroLibrary) - -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include_directories(${KDE4_INCLUDES}) - - -set( kauth_example_sources - main.cpp - mainwindow.cpp ) - -qt4_wrap_ui(kauth_example_uis mainwindow.ui) - -kde4_add_executable(kauth_example ${kauth_example_sources} ${kauth_example_uis}) -target_link_libraries(kauth_example ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS}) -install(TARGETS kauth_example ${INSTALL_TARGETS_DEFAULT_ARGS}) - -# Auth example helper -kde4_add_executable(kauth_example_helper helper/helper.cpp) -target_link_libraries(kauth_example_helper ${KDE4_KDECORE_LIBS}) -install(TARGETS kauth_example_helper DESTINATION ${LIBEXEC_INSTALL_DIR}) - -kde4_install_auth_helper_files(kauth_example_helper org.kde.auth.example root) -kde4_install_auth_actions(org.kde.auth.example actions.actions) diff --git a/authorization/kauth_example/actions.actions b/authorization/kauth_example/actions.actions deleted file mode 100644 index 074823a..0000000 --- a/authorization/kauth_example/actions.actions +++ /dev/null @@ -1,173 +0,0 @@ -[org.kde.auth.example.read] -Name=Read action -Name[bg]=Четене на действие -Name[ca]=Acció de lectura -Name[en_GB]=Read action -Name[es]=Acción de lectura -Name[et]=Lugemistoiming -Name[gl]=Acción de lectura -Name[id]=Aksi baca -Name[ko]=읽기 동작 -Name[nb]=Les handling -Name[nds]=Leesakschoon -Name[nl]=Leesactie -Name[pt]=Acção da leitura -Name[pt_BR]=Ação de leitura -Name[ro]=Acțiune de citire -Name[sv]=Läsåtgärd -Name[tr]=Okuma eylemi -Name[uk]=Дія з читання -Name[x-test]=xxRead actionxx -Name[zh_TW]=讀取動作 -Description=Read action description -Description[bg]=Четене описанието на действие -Description[ca]=Descripció de l'acció de lectura -Description[en_GB]=Read action description -Description[es]=Descripción de la acción de lectura -Description[et]=Lugemistoimingu kirjeldus -Description[gl]=Descrición da acción de lectura -Description[id]=Deskripsi aksi baca -Description[ko]=읽기 동작 설명 -Description[nb]=Les handlingsbeskrivelse -Description[nds]=Beschrieven för Leesakschoon -Description[nl]=Beschrijving van leesactie -Description[pt]=Descrição da acção de leitura -Description[pt_BR]=Descrição da ação de leitura -Description[ro]=Descrierea acțiunii de citire -Description[sv]=Beskrivning av läsåtgärd -Description[tr]=Okuma eylemi açıklaması -Description[uk]=Опис дії з читання -Description[x-test]=xxRead action descriptionxx -Description[zh_TW]=讀取動作描述 -Policy=auth_admin -Persistence=session - -[org.kde.auth.example.write] -Name=Write action -Name[bg]=Запис на действие -Name[ca]=Acció d'escriptura -Name[en_GB]=Write action -Name[es]=Acción de escritura -Name[et]=Kirjutamistoiming -Name[gl]=Acción de escrita -Name[id]=Aksi tulis -Name[ko]=쓰기 동작 -Name[nb]=Skriv handling -Name[nds]=Schrievakschoon -Name[nl]=Schrijfactie -Name[pt]=Acção de escrita -Name[pt_BR]=Ação de gravação -Name[ro]=Acțiune de scriere -Name[sv]=Skrivåtgärd -Name[tr]=Yazma eylemi -Name[uk]=Дія з запису -Name[x-test]=xxWrite actionxx -Name[zh_TW]=寫入動作 -Description=Write action description -Description[bg]=Запис описанието на дейстиве -Description[ca]=Descripció de l'acció d'escriptura -Description[en_GB]=Write action description -Description[es]=Descripción de la acción de escritura -Description[et]=Kirjutamistoimingu kirjeldus -Description[gl]=Descrición da acción de escrita -Description[id]=Deskripsi aksi tulis -Description[ko]=쓰기 동작 설명 -Description[nb]=Skriv handlingsbeskrivelse -Description[nds]=Beschrieven för Schrievakschoon -Description[nl]=Beschrijving van schrijfactie -Description[pt]=Descrição da acção de escrita -Description[pt_BR]=Descrição da ação de gravação -Description[ro]=Descrierea acțiunii de scriere -Description[sv]=Beskrivning av skrivåtgärd -Description[tr]=Yazma eylemi açıklaması -Description[uk]=Опис дії з запису -Description[x-test]=xxWrite action descriptionxx -Description[zh_TW]=寫入動作描述 -Policy=auth_admin - -[org.kde.auth.example.longaction] -Name=Long action -Name[bg]=Подробно действие -Name[ca]=Acció llarga -Name[en_GB]=Long action -Name[es]=Acción lenta -Name[et]=Pikk toiming -Name[gl]=Acción longa -Name[id]=Aksi panjang -Name[ko]=긴 동작 -Name[ms]=Tindakan panjang -Name[nb]=Lang handling -Name[nds]=Langakschoon -Name[nl]=Lange actie -Name[pt]=Acção longa -Name[pt_BR]=Ação longa -Name[ro]=Acțiune lungă -Name[sv]=Lång åtgärd -Name[tr]=Uzun eylem -Name[uk]=Віддалена дія -Name[x-test]=xxLong actionxx -Name[zh_TW]=長動作 -Description=Long action description -Description[bg]=Подробно описание на действие -Description[ca]=Descripció de l'acció llarga -Description[en_GB]=Long action description -Description[es]=Descripción de acción lenta -Description[et]=Pika toimingu kirjeldus -Description[gl]=Descrición da acción longa -Description[id]=Deskripsi aksi panjang -Description[ko]=긴 동작 설명 -Description[nb]=Beskrivelse av lang handling -Description[nds]=Beschrieven för Langakschoon -Description[nl]=Beschrijving van lange actie -Description[pt]=Descrição da acção longa -Description[pt_BR]=Descrição da ação longa -Description[ro]=Descrierea acțiunii lungi -Description[sv]=Beskrivning av lång åtgärd -Description[tr]=Uzun eylem açıklaması -Description[uk]=Опис віддаленої дії -Description[x-test]=xxLong action descriptionxx -Description[zh_TW]=長動作描述 -Policy=auth_admin - -[org.kde.auth.example.kactionaction] -Name=Action KAction -Name[bg]=Действия (KAction) -Name[ca]=Acció del KAction -Name[en_GB]=Action KAction -Name[es]=Acción KAction -Name[et]=Toiming KAction -Name[gl]=Acción de KAction -Name[id]=Aksi KAction -Name[ko]=KAction 동작 -Name[nb]=Handling KAction -Name[nds]=Akschoon KAction -Name[nl]=Actie KAction -Name[pt]=Acção do KAction -Name[pt_BR]=Ação KAction -Name[ro]=Acțiune KAction -Name[sv]=Åtgärd KAction -Name[tr]=KAction Eylemi -Name[uk]=Дія KAction -Name[x-test]=xxAction KActionxx -Name[zh_TW]=動作 KAction -Description=Long action description -Description[bg]=Подробно описание на действие -Description[ca]=Descripció de l'acció llarga -Description[en_GB]=Long action description -Description[es]=Descripción de acción lenta -Description[et]=Pika toimingu kirjeldus -Description[gl]=Descrición da acción longa -Description[id]=Deskripsi aksi panjang -Description[ko]=긴 동작 설명 -Description[nb]=Beskrivelse av lang handling -Description[nds]=Beschrieven för Langakschoon -Description[nl]=Beschrijving van lange actie -Description[pt]=Descrição da acção longa -Description[pt_BR]=Descrição da ação longa -Description[ro]=Descrierea acțiunii lungi -Description[sv]=Beskrivning av lång åtgärd -Description[tr]=Uzun eylem açıklaması -Description[uk]=Опис віддаленої дії -Description[x-test]=xxLong action descriptionxx -Description[zh_TW]=長動作描述 -Policy=auth_admin diff --git a/authorization/kauth_example/helper/helper.cpp b/authorization/kauth_example/helper/helper.cpp deleted file mode 100644 index e366976..0000000 --- a/authorization/kauth_example/helper/helper.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* -* Copyright (C) 2008 Nicola Gigante -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation; either version 2.1 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License -* along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . -*/ - -#include "helper.h" - -#include -#include -#include -#include -#include - - -ActionReply MyHelper::read(QVariantMap args) -{ - ActionReply reply; - QString filename = args["filename"].toString(); - QFile file(filename); - if (!file.open(QIODevice::ReadOnly)) { - reply = ActionReply::HelperErrorReply; - reply.setErrorCode(file.error()); - - return reply; - } - - QTextStream stream(&file); - QString contents; - contents = stream.readAll(); - reply.addData("contents", contents); - - return reply; -} - -ActionReply MyHelper::write(QVariantMap args) -{ - QString filename = args["filename"].toString(); - QFile file(filename); - if (!file.open(QIODevice::WriteOnly)) { - ActionReply reply = ActionReply::HelperErrorReply; - reply.setErrorCode(file.error()); - - return reply; - } - - QTextStream stream(&file); - stream << args["contents"].toString(); - - return ActionReply::SuccessReply; -} - -ActionReply MyHelper::longaction(QVariantMap args) -{ - Q_UNUSED(args); - qDebug() << "hello"; - - for (int i = 1; i <= 100; i++) { - if (HelperSupport::isStopped()) - break; - HelperSupport::progressStep(i); - usleep(1000000); - } - - return ActionReply::SuccessReply; -} - -KDE4_AUTH_HELPER_MAIN("org.kde.auth.example", MyHelper) diff --git a/authorization/kauth_example/helper/helper.h b/authorization/kauth_example/helper/helper.h deleted file mode 100644 index 17750d3..0000000 --- a/authorization/kauth_example/helper/helper.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (C) 2008 Nicola Gigante -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation; either version 2.1 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License -* along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . -*/ - -#ifndef HELPER_CLASS_H -#define HELPER_CLASS_H - -#include - -#include - -using namespace KAuth; - -class MyHelper : public QObject -{ - Q_OBJECT - -public Q_SLOTS: - ActionReply read(QVariantMap args); - ActionReply write(QVariantMap args); - ActionReply longaction(QVariantMap args); -}; - -#endif diff --git a/authorization/kauth_example/main.cpp b/authorization/kauth_example/main.cpp deleted file mode 100644 index a7db98f..0000000 --- a/authorization/kauth_example/main.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* -* Copyright (C) 2008 Nicola Gigante -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation; either version 2.1 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License -* along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . -*/ - -#include -#include -#include -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - MainWindow w; - w.show(); - - return a.exec(); -} diff --git a/authorization/kauth_example/mainwindow.cpp b/authorization/kauth_example/mainwindow.cpp deleted file mode 100644 index 369738b..0000000 --- a/authorization/kauth_example/mainwindow.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* -* Copyright (C) 2008 Nicola Gigante -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation; either version 2.1 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License -* along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . -*/ - -//krazy:excludeall=qclasses - -#include "mainwindow.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ui_mainwindow.h" - -MainWindow::MainWindow(QWidget *parent) - : QMainWindow(parent), ui(new Ui::MainWindowClass) -{ - ui->setupUi(this); - progressBar = new QProgressBar(); - pushButton = new QPushButton(); - pushButton->setText("Stop"); - connect(pushButton, SIGNAL(clicked()), this, SLOT(stopLongAction())); - progressBar->setRange(0, 100); - statusBar()->addPermanentWidget(progressBar); - statusBar()->addPermanentWidget(pushButton); - pushButton->hide(); - progressBar->hide(); - KAction *action = new KAction(this); - ui->menuFile->addAction(action); - action->setIcon(KIcon("dialog-ok-apply")); - action->setText(i18n("KAction Integration")); - action->setAuthAction("org.kde.auth.example.kactionaction"); - connect(action, SIGNAL(authorized(KAuth::Action*)), this, SLOT(kactionTriggered())); - ui->openButton->setAuthAction("org.kde.auth.example.read"); - connect(ui->openButton, SIGNAL(authorized(KAuth::Action*)), this, SLOT(on_actionOpen_triggered())); - ui->saveButton->setAuthAction("org.kde.auth.example.write"); - connect(ui->saveButton, SIGNAL(authorized(KAuth::Action*)), this, SLOT(on_actionSave_triggered())); - ui->longButton->setAuthAction("org.kde.auth.example.longaction"); - connect(ui->longButton, SIGNAL(authorized(KAuth::Action*)), this, SLOT(on_longAction_triggered())); -} - -MainWindow::~MainWindow() -{ - delete ui; -} - -void MainWindow::on_actionOpen_triggered() -{ - QString filename = KFileDialog::getOpenFileName(KUrl("/"), i18n("All Files (*)"), this); - - QFile file(filename); - QTextStream stream(&file); - QString contents; - - if (!file.open(QIODevice::ReadOnly)) { - if (file.error() & QFile::PermissionsError) { - Action readAction("org.kde.auth.example.read"); - readAction.addArgument("filename", filename); - - ActionReply reply = readAction.execute("org.kde.auth.example"); - if (reply.failed()) { - KMessageBox::information(this, "Error", i18n("KAuth returned an error code: %1", reply.errorCode())); - } else { - contents = reply.data()["contents"].toString(); - } - } else { - KMessageBox::information(this, "Error", i18n("Unable to open file: %1", file.error())); - } - } else { - contents = stream.readAll(); - } - - ui->plainTextEdit->setPlainText(contents); - - file.close(); -} - -void MainWindow::on_actionSave_triggered() -{ - QString filename = KFileDialog::getSaveFileName(KUrl("/"), i18n("All Files (*)"), this); - QFile file(filename); - QTextStream stream(&file); - - if (!file.open(QIODevice::WriteOnly)) { - if (file.error() & QFile::PermissionsError) { - Action writeAction("org.kde.auth.example.write"); - writeAction.addArgument("filename", filename); - writeAction.addArgument("contents", ui->plainTextEdit->toPlainText()); - - ActionReply reply = writeAction.execute("org.kde.auth.example"); - if (reply.failed()) - KMessageBox::information(this, i18n("Error"), i18n("KAuth returned an error code: %1", reply.errorCode())); - } else { - KMessageBox::information(this, i18n("Error"), i18n("Unable to open file: %1", file.error())); - } - } else { - stream << ui->plainTextEdit->toPlainText(); - } - - file.close(); -} - -void MainWindow::on_longAction_triggered() -{ - Action longAction("org.kde.auth.example.longaction"); - longAction.setExecutesAsync(true); - connect(longAction.watcher(), SIGNAL(progressStep(int)), progressBar, SLOT(setValue(int))); - connect(longAction.watcher(), SIGNAL(actionPerformed(ActionReply)), this, SLOT(longActionPerformed(ActionReply))); - - if (longAction.execute("org.kde.auth.example") != ActionReply::SuccessReply) { - this->statusBar()->showMessage("Could not execute the long action"); - } else { - pushButton->show(); - progressBar->show(); - } -} - -void MainWindow::stopLongAction() -{ - Action act("org.kde.auth.example.longaction"); - act.stop("org.kde.auth.example"); -} - -void MainWindow::longActionPerformed(ActionReply reply) -{ - progressBar->hide(); - pushButton->hide(); - progressBar->setValue(0); - - if (reply.succeeded()) { - statusBar()->showMessage("Action succeeded", 10000); - } else { - statusBar()->showMessage(QString("Could not execute the long action: %1").arg(reply.errorCode()), 10000); - } -} - -void MainWindow::kactionTriggered() -{ - kDebug() << "Action triggered!"; - KMessageBox::information(this, "Error", i18n("Action triggered!")); -} - diff --git a/authorization/kauth_example/mainwindow.h b/authorization/kauth_example/mainwindow.h deleted file mode 100644 index 6811906..0000000 --- a/authorization/kauth_example/mainwindow.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (C) 2008 Nicola Gigante -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation; either version 2.1 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License -* along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . -*/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include - -#include - -using namespace KAuth; - -namespace Ui -{ -class MainWindowClass; -} - -class MainWindow : public QMainWindow -{ - Q_OBJECT - - QProgressBar *progressBar; - QPushButton *pushButton; - -public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); - -private: - Ui::MainWindowClass *ui; - -private Q_SLOTS: - void on_actionOpen_triggered(); - void on_actionSave_triggered(); - void on_longAction_triggered(); - void kactionTriggered(); - void stopLongAction(); - void longActionPerformed(ActionReply reply); -}; - -#endif // MAINWINDOW_H diff --git a/authorization/kauth_example/mainwindow.ui b/authorization/kauth_example/mainwindow.ui deleted file mode 100644 index 7b06c0c..0000000 --- a/authorization/kauth_example/mainwindow.ui +++ /dev/null @@ -1,107 +0,0 @@ - - - MainWindowClass - - - - 0 - 0 - 759 - 571 - - - - MainWindow - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Open - - - - - - - Save - - - - - - - Long Action - - - - - - - - - - - 0 - 0 - 759 - 26 - - - - - File - - - - - - - - - - - Open - - - - - Save - - - - - Long Action - - - - - - - KPushButton - QPushButton -
kpushbutton.h
-
-
- - -
diff --git a/authorization/kwalletdemo/CMakeLists.txt b/authorization/kwalletdemo/CMakeLists.txt deleted file mode 100644 index d8f4cf7..0000000 --- a/authorization/kwalletdemo/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -# This code is released into the public domain by the author Martin T. Sandsmark - -project(KWalletDemo) - -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include(MacroLibrary) -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES}) - -set(SRCS main.cpp dialog.cpp) - -kde4_add_executable(kwalletdemo ${SRCS}) -target_link_libraries(kwalletdemo ${KDE4_KDECORE_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KDEUI_LIBS}) -install(TARGETS kwalletdemo ${INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES ${SRCS} dialog.h README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/authorization/kwalletdemo) diff --git a/authorization/kwalletdemo/README b/authorization/kwalletdemo/README deleted file mode 100644 index ce23b69..0000000 --- a/authorization/kwalletdemo/README +++ /dev/null @@ -1 +0,0 @@ -This is a simple example using the KWallet API (a secure storage framework) to store and retrieve a password. diff --git a/authorization/kwalletdemo/dialog.cpp b/authorization/kwalletdemo/dialog.cpp deleted file mode 100644 index 36f60f3..0000000 --- a/authorization/kwalletdemo/dialog.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// This code is released into the public domain by the author Martin T. Sandsmark - -#include "dialog.h" - -#include -#include -#include -#include - -#include -#include - -using KWallet::Wallet; - -Dialog::Dialog(QWidget *parent) : - QDialog(parent) -{ - m_wallet = Wallet::openWallet(Wallet::LocalWallet(), - winId(), - Wallet::Asynchronous); - connect(m_wallet, SIGNAL(walletOpened(bool)), SLOT(walletOpened(bool))); - - QLabel *explanation = new QLabel(i18n("HELLO!
" - "Please type in something to save in the wallet.
" - "It will be saved in the form data folder, under
" - "the entry http://test.com/#form."), this); - m_statusLabel = new QLabel(i18n("Opening wallet..."), this); - m_statusLabel->setAlignment(Qt::AlignCenter); - m_keyInput = new QLineEdit(this); - m_keyOutput = new QLineEdit(this); - m_keyOutput->setDisabled(true); - m_valueInput = new QLineEdit(this); - m_valueOutput = new QLineEdit(this); - m_valueOutput->setDisabled(true); - m_launchButton = new QPushButton(i18n("Save"), this); - m_launchButton->setDisabled(true); - m_retrieveButton = new QPushButton(i18n("Retrieve"), this); - m_retrieveButton->setDisabled(true); - - setLayout(new QVBoxLayout(this)); - layout()->addWidget(explanation); - qobject_cast(layout())->addStretch(); - layout()->addWidget(m_statusLabel); - - QHBoxLayout *hLayout = new QHBoxLayout(this); - QVBoxLayout *vLayout; - - vLayout = new QVBoxLayout(this); - vLayout->addWidget(new QLabel(i18n("Key:"), this)); - vLayout->addWidget(m_keyInput); - vLayout->addWidget(new QLabel(i18n("Value:"), this)); - vLayout->addWidget(m_valueInput); - vLayout->addWidget(m_launchButton); - hLayout->addLayout(vLayout); - - vLayout = new QVBoxLayout(this); - vLayout->addWidget(new QLabel(i18n("Key:"), this)); - vLayout->addWidget(m_keyOutput); - vLayout->addWidget(new QLabel(i18n("Value:"), this)); - vLayout->addWidget(m_valueOutput); - vLayout->addWidget(m_retrieveButton); - hLayout->addLayout(vLayout); - - layout()->addItem(hLayout); - - connect(m_launchButton, SIGNAL(clicked()), SLOT(doSave())); - connect(m_retrieveButton, SIGNAL(clicked()), SLOT(doRetrieve())); - - setMinimumSize(500, 200); -} - -void Dialog::walletOpened(bool ok) -{ - - if (ok) { - if (!m_wallet->hasFolder(KWallet::Wallet::FormDataFolder())) - m_wallet->createFolder(KWallet::Wallet::FormDataFolder()); - - m_wallet->setFolder(KWallet::Wallet::FormDataFolder()); - m_statusLabel->setText(i18n("Wallet opened.")); - m_launchButton->setDisabled(false); - m_retrieveButton->setDisabled(false); - } else { - m_statusLabel->setText(i18n("Error opening wallet!")); - } -} - -void Dialog::doSave() -{ - if (m_keyInput->text().isEmpty() || m_valueInput->text().isEmpty()) { - m_statusLabel->setText(i18n("Empty field!")); - return; - } - - m_launchButton->setDisabled(true); - m_retrieveButton->setDisabled(true); - - m_statusLabel->setText(i18n("Saving ...")); - - QMap map; - map[m_keyInput->text()] = m_valueInput->text(); - if (m_wallet->writeMap("http://test.com/#form", map)) { - m_statusLabel->setText(i18n("Something went wrong!")); - } else { - m_statusLabel->setText(i18n("Saved!")); - m_keyInput->clear(); - m_valueInput->clear(); - } - - m_launchButton->setDisabled(false); - m_retrieveButton->setDisabled(false); -} - -void Dialog::doRetrieve() -{ - m_launchButton->setDisabled(true); - m_retrieveButton->setDisabled(true); - - m_statusLabel->setText(i18n("Retrieving ...")); - - QMap map; - if (m_wallet->readMap("http://test.com/#form", map)) { - m_statusLabel->setText(i18n("Something went wrong!")); - } else { - m_statusLabel->setText(i18n("Retrieved!")); - QMapIterator i(map); - if (i.hasNext()) - { - i.next(); - m_keyOutput->setText(i.key()); - m_valueOutput->setText(i.value()); - } - } - - m_launchButton->setDisabled(false); - m_retrieveButton->setDisabled(false); -} diff --git a/authorization/kwalletdemo/dialog.h b/authorization/kwalletdemo/dialog.h deleted file mode 100644 index 669372d..0000000 --- a/authorization/kwalletdemo/dialog.h +++ /dev/null @@ -1,37 +0,0 @@ -// This code is released into the public domain by the author Martin T. Sandsmark - -#ifndef DIALOG_H -#define DIALOG_H - -#include - -class QLabel; -class QLineEdit; - -namespace KWallet { -class Wallet; -} - -class Dialog : public QDialog -{ -Q_OBJECT - -public: - explicit Dialog(QWidget *parent = 0); - -private Q_SLOTS: - void doSave(); - void doRetrieve(); - - void walletOpened(bool ok); - -private: - KWallet::Wallet *m_wallet; - - QLabel *m_statusLabel; - QLineEdit *m_keyInput, *m_keyOutput; - QLineEdit *m_valueInput, *m_valueOutput; - QPushButton *m_launchButton, *m_retrieveButton; -}; - -#endif // DIALOG_H diff --git a/authorization/kwalletdemo/main.cpp b/authorization/kwalletdemo/main.cpp deleted file mode 100644 index 086719e..0000000 --- a/authorization/kwalletdemo/main.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// This code is released into the public domain by the author Martin T. Sandsmark - -#include "dialog.h" - -#include -#include -#include - -static KAboutData about( - "KWalletDemoApplication", - "", - ki18n("KWalletDemoApplication"), - "1.0", - ki18n("Demonstrates basic KWallet usage."), - KAboutData::License_LGPL, - ki18n("(C) 2010 Martin Sandsmark"), - KLocalizedString(), - "http://www.mts.ms/"); - -int main(int argc, char *argv[]) -{ - about.addAuthor(ki18n("Martin Sandsmark"), ki18n("Maintainer"), "martin.sandsmark@kde.org", "http://iskrembilen.com/"); - - KCmdLineArgs::init(argc, argv, &about); - KApplication app; - - Dialog dialog; - dialog.show(); - return app.exec(); -} diff --git a/bindings/csharp/qmainwindow/AssemblyInfo.cs b/bindings/csharp/qmainwindow/AssemblyInfo.cs deleted file mode 100644 index 72538dc..0000000 --- a/bindings/csharp/qmainwindow/AssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("qyoto_example")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/bindings/csharp/qmainwindow/Main.cs b/bindings/csharp/qmainwindow/Main.cs deleted file mode 100644 index fccb489..0000000 --- a/bindings/csharp/qmainwindow/Main.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using Qyoto; -namespace qyoto_example -{ - - class MainClass - { - public static int Main (string[] args) - { - QApplication app = new QApplication(args); - MainWindow w = new MainWindow(); - w.Show(); - - return QApplication.Exec(); - } - } -} diff --git a/bindings/csharp/qmainwindow/MainWindow.cs b/bindings/csharp/qmainwindow/MainWindow.cs deleted file mode 100644 index 5d2c2a9..0000000 --- a/bindings/csharp/qmainwindow/MainWindow.cs +++ /dev/null @@ -1,27 +0,0 @@ - -using System; -using Qyoto; - -namespace qyoto_example -{ - - - public class MainWindow : QMainWindow - { - public MainWindow () - { - m_layout = new QHBoxLayout(); - m_label = new QLabel("Hello Qyoto!"); - m_widget = new QWidget(this); - - m_layout.AddWidget(m_label); - m_widget.SetLayout(m_layout); - - SetCentralWidget(m_widget); - } - - private QHBoxLayout m_layout; - private QLabel m_label; - private QWidget m_widget; - } -} diff --git a/bindings/csharp/qmainwindow/Makefile b/bindings/csharp/qmainwindow/Makefile deleted file mode 100644 index 74b4423..0000000 --- a/bindings/csharp/qmainwindow/Makefile +++ /dev/null @@ -1,122 +0,0 @@ - -EXTRA_DIST = Makefile - -# Warning: This is an automatically generated file, do not edit! - -srcdir=. -top_srcdir=.. - -include $(top_srcdir)/config.make - -ifeq ($(CONFIG),DEBUG_X86) -ASSEMBLY_COMPILER_COMMAND = gmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" -ASSEMBLY = bin/Debug/qyoto_example.exe -ASSEMBLY_MDB = $(ASSEMBLY).mdb -COMPILE_TARGET = exe -PROJECT_REFERENCES = -BUILD_DIR = bin/Debug - -QYOTO_EXAMPLE_EXE_MDB_SOURCE=bin/Debug/qyoto_example.exe.mdb -QYOTO_EXAMPLE_EXE_MDB=$(BUILD_DIR)/qyoto_example.exe.mdb - -endif - -ifeq ($(CONFIG),RELEASE_X86) -ASSEMBLY_COMPILER_COMMAND = gmcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -ASSEMBLY = bin/Release/qyoto_example.exe -ASSEMBLY_MDB = -COMPILE_TARGET = exe -PROJECT_REFERENCES = -BUILD_DIR = bin/Release - -QYOTO_EXAMPLE_EXE_MDB= - -endif - -AL=al2 -SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll - -PROGRAMFILES = \ - $(QYOTO_EXAMPLE_EXE_MDB) - -BINARIES = \ - $(QYOTO_EXAMPLE) - - -RESGEN=resgen2 - -QYOTO_EXAMPLE = $(BUILD_DIR)/qyoto_example - -FILES = \ - AssemblyInfo.cs \ - Main.cs \ - MainWindow.cs - -DATA_FILES = - -RESOURCES = - -EXTRAS = \ - app.desktop \ - qyoto_example.in - -REFERENCES = \ - -pkg:qyoto-4.5 \ - System - -DLL_REFERENCES = - -CLEANFILES = $(PROGRAMFILES) $(BINARIES) - -#Targets -all: $(ASSEMBLY) $(PROGRAMFILES) $(BINARIES) $(top_srcdir)/config.make - -include $(top_srcdir)/Makefile.include -#include $(srcdir)/custom-hooks.make - - - -$(eval $(call emit-deploy-wrapper,QYOTO_EXAMPLE,qyoto_example,x)) - - -$(eval $(call emit_resgen_targets)) -$(build_xamlg_list): %.xaml.g.cs: %.xaml - xamlg '$<' - - -$(ASSEMBLY_MDB): $(ASSEMBLY) -$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) - make pre-all-local-hook prefix=$(prefix) - mkdir -p $(shell dirname $(ASSEMBLY)) - make $(CONFIG)_BeforeBuild - $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) - make $(CONFIG)_AfterBuild - make post-all-local-hook prefix=$(prefix) - -install-local: $(ASSEMBLY) $(ASSEMBLY_MDB) - make pre-install-local-hook prefix=$(prefix) - make install-satellite-assemblies prefix=$(prefix) - mkdir -p '$(DESTDIR)$(libdir)/$(PACKAGE)' - $(call cp,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE)) - $(call cp,$(ASSEMBLY_MDB),$(DESTDIR)$(libdir)/$(PACKAGE)) - $(call cp,$(QYOTO_EXAMPLE_EXE_MDB),$(DESTDIR)$(libdir)/$(PACKAGE)) - mkdir -p '$(DESTDIR)$(bindir)' - $(call cp,$(QYOTO_EXAMPLE),$(DESTDIR)$(bindir)) - make post-install-local-hook prefix=$(prefix) - -uninstall-local: $(ASSEMBLY) $(ASSEMBLY_MDB) - make pre-uninstall-local-hook prefix=$(prefix) - make uninstall-satellite-assemblies prefix=$(prefix) - $(call rm,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE)) - $(call rm,$(ASSEMBLY_MDB),$(DESTDIR)$(libdir)/$(PACKAGE)) - $(call rm,$(QYOTO_EXAMPLE_EXE_MDB),$(DESTDIR)$(libdir)/$(PACKAGE)) - $(call rm,$(QYOTO_EXAMPLE),$(DESTDIR)$(bindir)) - make post-uninstall-local-hook prefix=$(prefix) - -install: install-local -uninstall: uninstall-local -clean: clean-local - -include $(top_srcdir)/rules.make diff --git a/bindings/csharp/qmainwindow/README b/bindings/csharp/qmainwindow/README deleted file mode 100644 index 6cc5141..0000000 --- a/bindings/csharp/qmainwindow/README +++ /dev/null @@ -1,12 +0,0 @@ -DESCRIPTiON - -This example shows how to create a simple Qyoto application with a QMainWindow -that contains a QLayout. - -AUTHOR - -Andreas Marschke - -LICENSE - -?? \ No newline at end of file diff --git a/bindings/csharp/qmainwindow/app.desktop b/bindings/csharp/qmainwindow/app.desktop deleted file mode 100755 index 0ae8a2e..0000000 --- a/bindings/csharp/qmainwindow/app.desktop +++ /dev/null @@ -1,6 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Type=Application -Name=qyoto_example -Exec=qyoto_example -Terminal=false diff --git a/bindings/csharp/qmainwindow/qyoto_example.in b/bindings/csharp/qmainwindow/qyoto_example.in deleted file mode 100644 index 0e98c41..0000000 --- a/bindings/csharp/qmainwindow/qyoto_example.in +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec mono "@expanded_libdir@/@PACKAGE@/qyoto_example.exe" "$@" diff --git a/bindings/csharp/qmainwindow/qyoto_example.mdp b/bindings/csharp/qmainwindow/qyoto_example.mdp deleted file mode 100644 index 00d16eb..0000000 --- a/bindings/csharp/qmainwindow/qyoto_example.mdp +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bindings/csharp/qmainwindow/qyoto_example.pidb b/bindings/csharp/qmainwindow/qyoto_example.pidb deleted file mode 100644 index f74abbc..0000000 Binary files a/bindings/csharp/qmainwindow/qyoto_example.pidb and /dev/null differ diff --git a/bindings/python/kconfigxt/generalpage.ui b/bindings/python/kconfigxt/generalpage.ui deleted file mode 100644 index 94b9e23..0000000 --- a/bindings/python/kconfigxt/generalpage.ui +++ /dev/null @@ -1,57 +0,0 @@ - - - GeneralPage - - - - 0 - 0 - 199 - 60 - - - - - - - - - - Server name: - - - - - - - - - - Port number: - - - - - - - 65536 - - - - - - - - KIntSpinBox - QSpinBox -
knuminput.h
-
- - KLineEdit - QLineEdit -
klineedit.h
-
-
- - -
diff --git a/bindings/python/kconfigxt/kconfigxtexample.py b/bindings/python/kconfigxt/kconfigxtexample.py deleted file mode 100644 index 46f1efb..0000000 --- a/bindings/python/kconfigxt/kconfigxtexample.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Copyright 2010 Luca Beltrame -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -"Module that calls the KConfigXT objects and displays them." - -import sys - -from PyQt4 import QtCore -from PyKDE4 import kdecore, kdeui - -import preferences - - -def main(): - - app_name = "kconfigxtexample" - program_name = kdecore.ki18n("Example KConfigXT application (PyKDE4)") - about_data = kdecore.KAboutData(QtCore.QByteArray(app_name), "", - program_name, QtCore.QByteArray("0.1")) - kdecore.KCmdLineArgs.init(sys.argv, about_data) - app = kdeui.KApplication() - - settings = preferences.Preferences() - dialog = preferences.ConfigDialog(None, "settings", settings) - - dialog.show() - app.exec_() - -if __name__ == '__main__': - main() diff --git a/bindings/python/kconfigxt/preferences.py b/bindings/python/kconfigxt/preferences.py deleted file mode 100644 index 11c02e3..0000000 --- a/bindings/python/kconfigxt/preferences.py +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Copyright 2010 Luca Beltrame -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -""" -This module implements an example configuration using KConfigXT. If you have -read the C++ tutorial (URL) you will notice that there is no way to generate -Python code from .kcfg files (yet). The solution is to implement the -configuration skeleton itself in code, as this example shows. - -This example creates a KConfigSkeleton subclass which stores two values, a -server name and a port number (inspired by the original tutorial on KDE's -Techbase).It will also create a proper KConfigDialog. -""" - -from PyQt4 import QtGui, QtCore -from PyKDE4 import kdecore, kdeui - -from ui_generalpage import Ui_GeneralPage - - -class Preferences(kdeui.KConfigSkeleton): - - "Example implementation of a KConfigSkeleton subclass." - - def __init__(self, *args): - - """Initialize the instance. Once it has been created, you need to set a - current group (with setCurrentGroup) and add items with the various - addItem* functions (addItemString and addItemInt are shown here - check - the API docs for more information. - - The C++ addItem* functions want a pointer to the type of the object - you're storing. As Python does not have pointer, you need to pass a - reference to the object type. They MUST be bound to the class (i.e., - instance attributes) or they will be garbage collected, causing - unexpected behaviors (even crashes). To prevent access, make the - items hidden (self._*) or mangled (self.__*). - - Once you have set everything, call readConfig().""" - - kdeui.KConfigSkeleton.__init__(self, *args) - - self.setCurrentGroup("General") - - # Using "" here won't work, we need an actual instance of QString or we - # may get unexpected behavior (like values not being written) - self._url_data = QtCore.QString() - predefined_url = QtCore.QString("http://www.kde.org") - self._url = self.addItemString("serverName", self._url_data, - predefined_url) - self._port_number = self.addItemInt("portNumber", 0, 80) - self.readConfig() - - # A Pythonic approach to access values stored in a KConfigSkeleton instance - # is to use properties by appropriately decorating functions, as the - # examples below show. - - @property - def url(self): - return self._url.value() - - @property - def port(self): - return self._port_number.value() - - -class ConfigDialog(kdeui.KConfigDialog): - - "Example implementation of a KConfigDialog subclass." - - def __init__(self, parent=None, name=None, preferences=None): - - """Initialize the dialog. First of all, we set the buttons, using - KDialog.ButtonCode. Then we add a GeneralPage instance, subsequently - added with the addPage and we connect the settingsChanged signal to a - slot which will pop up a message box every time the settings change.""" - - super(ConfigDialog, self).__init__(parent, name, preferences) - self.setButtons(kdeui.KDialog.ButtonCode( - kdeui.KDialog.Ok|kdeui.KDialog.Apply|kdeui.KDialog.Cancel) - ) - - self.general_page = GeneralPage(self, preferences) - self.preferences = preferences - self.general_page_item = self.addPage(self.general_page, - kdecore.i18n("General")) - - # The following adds a nice icon to the configuration page - self.general_page_item.setIcon(kdeui.KIcon("network-server")) - # Show the results every time the settings change - self.settingsChanged.connect(self.show_values) - - def show_values(self): - - "Shows a dialog with the settings." - - server_name = kdecore.i18n("Server name: %1", - self.preferences.url) - port_number = kdecore.i18n("Port number: %1", - self.preferences.port) - - text = server_name + "\n" + port_number - kdeui.KMessageBox.information(self, text, - kdecore.i18n("Settings changed")) - - -class GeneralPage(QtGui.QWidget, Ui_GeneralPage): - - "Example widget to be embedded in the KConfigDialog." - - def __init__(self, parent=None, preferences=None): - - super(GeneralPage, self).__init__(parent) - self.setupUi(self) - - self.kcfg_serverName.setText(preferences.url) - self.kcfg_portNumber.setValue(preferences.port) diff --git a/bindings/python/kconfigxt/ui_generalpage.py b/bindings/python/kconfigxt/ui_generalpage.py deleted file mode 100644 index 99a12ff..0000000 --- a/bindings/python/kconfigxt/ui_generalpage.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -# coding=UTF-8 -# -# Generated by pykdeuic4 from generalpage.ui on Wed Jan 13 22:26:39 2010 -# -# WARNING! All changes to this file will be lost. -from PyKDE4 import kdecore -from PyKDE4 import kdeui -from PyQt4 import QtCore, QtGui - -class Ui_GeneralPage(object): - def setupUi(self, GeneralPage): - GeneralPage.setObjectName("GeneralPage") - GeneralPage.resize(199, 60) - self.formLayout = QtGui.QFormLayout(GeneralPage) - self.formLayout.setObjectName("formLayout") - self.label = QtGui.QLabel(GeneralPage) - self.label.setObjectName("label") - self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label) - self.kcfg_serverName = KLineEdit(GeneralPage) - self.kcfg_serverName.setObjectName("kcfg_serverName") - self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.kcfg_serverName) - self.label_2 = QtGui.QLabel(GeneralPage) - self.label_2.setObjectName("label_2") - self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_2) - self.kcfg_portNumber = KIntSpinBox(GeneralPage) - self.kcfg_portNumber.setMaximum(65536) - self.kcfg_portNumber.setObjectName("kcfg_portNumber") - self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.kcfg_portNumber) - - self.retranslateUi(GeneralPage) - QtCore.QMetaObject.connectSlotsByName(GeneralPage) - - def retranslateUi(self, GeneralPage): - self.label.setText(kdecore.i18n("Server name:")) - self.label_2.setText(kdecore.i18n("Port number:")) - -from PyKDE4.kdeui import KLineEdit, KIntSpinBox diff --git a/bindings/python/kio/kio_storedget_example.py b/bindings/python/kio/kio_storedget_example.py deleted file mode 100755 index 48c71f7..0000000 --- a/bindings/python/kio/kio_storedget_example.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Copyright 2010 Luca Beltrame -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -"""Module that shows how to download data using KIO.storedGet. - -storedGet, like the name says, allows KIO to get a single URL into a QByteArray, -which than can be accessed through the data() function. Unlike KIO.get, the data -is kept entirely in memory. - -This module shows an example by downloading HTML from www.kde.org and displaying -it in a text edit widget. The operation is done asynchronously, without blocking -the GUI. - -""" - -import sys - -import PyQt4.QtCore as QtCore -import PyQt4.QtGui as QtGui -import PyKDE4.kdecore as kdecore -import PyKDE4.kdeui as kdeui -from PyKDE4.kio import KIO - -# This is the compiled file from textbrowser.ui, using pykdeuic4. - -from ui_textbrowser import Ui_Form - -class TextArea(QtGui.QWidget, Ui_Form): - - """Example class used to show how KIO works.""" - - def __init__(self, parent=None): - - super(TextArea, self).__init__(parent) - self.setupUi(self) - - # Basic signal/slot connections - # The first connects the clicked signal from the download button to the - # start of the download, the second is used to clear the textedit - - self.downloadButton.clicked.connect(self.start_download) - self.clearButton.clicked.connect(self.textWidget.clear) - - def start_download(self): - - """Slot invoked from clicking on downloadButton. - - It first shows a messagebox informing what will be done, then downloads - the data using KIO, connecting the result signal to the handle_download - slot.""" - - kdeui.KMessageBox.information(self.parent(), - "Now data will be retrieved from " - "www.kde.org using KIO") - - # KIO wants KUrls - data_url = kdecore.KUrl("http://www.kde.org") - - # Here we set some basic job properties. In particular the call is made - # by indicating the url, then the LoadType (usually NoReload), then the - # JobFlags. In case we use a single flag, we can specify directly the - # flag, like we did here by suppressing the progress information. - # Otherwise, we have to use a binary OR (|) to put also the other types - # in. - # KIO.storedGet returns the job handling the operation. - - retrieve_job = KIO.storedGet(data_url, KIO.NoReload, KIO.HideProgressInfo) - - # To actually obtain the data, we connect the result signal, which is - # emitted at the end of the operation. Notice that KIO.storedGet keeps - # the result in memory. - - retrieve_job.result.connect(self.handle_download) - - def handle_download(self, job): - - """Slot called from the retrieval job. - - It sets the data of the job (text) in the textwidget of the UI.""" - - # Bail out in case of errors - if job.error(): - return - - print "This slot has been called. The job has finished its operation." - - # The job's data, stored as a QByteArray, is kept in the data() - # function. - - data = job.data() - - # To set the data, we convert it to a QString and we set it as plain - # text in the text widget. - - self.textWidget.setPlainText(QtCore.QString(data)) - - -class ExampleWindow(kdeui.KMainWindow): - - """Example main window used to showcase KIO.""" - - def __init__(self, *args): - - super(ExampleWindow, self).__init__(*args) - - self.textbrowser = TextArea(self) - self.setCentralWidget(self.textbrowser) - - -def main(): - - app_name = "kio_storedget_example" - program_name = kdecore.ki18n("Example KIO usage (PyKDE4)") - about_data = kdecore.KAboutData(QtCore.QByteArray(app_name), "", - program_name, QtCore.QByteArray("0.1")) - kdecore.KCmdLineArgs.init(sys.argv, about_data) - app = kdeui.KApplication() - - mainwindow = ExampleWindow() - mainwindow.show() - app.exec_() - -if __name__ == '__main__': - main() diff --git a/bindings/python/kio/textbrowser.ui b/bindings/python/kio/textbrowser.ui deleted file mode 100644 index be3de37..0000000 --- a/bindings/python/kio/textbrowser.ui +++ /dev/null @@ -1,60 +0,0 @@ - - - Form - - - - 0 - 0 - 400 - 300 - - - - Form - - - - - - true - - - true - - - false - - - - - - - Start example - - - - - - - Clear - - - - - - - - KPushButton - QPushButton -
kpushbutton.h
-
- - KTextEdit - QTextEdit -
ktextedit.h
-
-
- - -
diff --git a/bindings/python/kio/ui_textbrowser.py b/bindings/python/kio/ui_textbrowser.py deleted file mode 100644 index e73fb34..0000000 --- a/bindings/python/kio/ui_textbrowser.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -# coding=UTF-8 -# -# Generated by pykdeuic4 from textbrowser.ui on Sat Jan 1 21:06:43 2011 -# -# WARNING! All changes to this file will be lost. -from PyKDE4 import kdecore -from PyKDE4 import kdeui -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - -class Ui_Form(object): - def setupUi(self, Form): - Form.setObjectName(_fromUtf8("Form")) - Form.resize(400, 300) - self.verticalLayout = QtGui.QVBoxLayout(Form) - self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) - self.textWidget = KTextEdit(Form) - self.textWidget.setEnabled(True) - self.textWidget.setReadOnly(True) - self.textWidget.setAcceptRichText(False) - self.textWidget.setObjectName(_fromUtf8("textWidget")) - self.verticalLayout.addWidget(self.textWidget) - self.downloadButton = KPushButton(Form) - self.downloadButton.setObjectName(_fromUtf8("downloadButton")) - self.verticalLayout.addWidget(self.downloadButton) - self.clearButton = KPushButton(Form) - self.clearButton.setObjectName(_fromUtf8("clearButton")) - self.verticalLayout.addWidget(self.clearButton) - - self.retranslateUi(Form) - QtCore.QMetaObject.connectSlotsByName(Form) - - def retranslateUi(self, Form): - Form.setWindowTitle(kdecore.i18n(_fromUtf8("Form"))) - self.downloadButton.setText(kdecore.i18n(_fromUtf8("Start example"))) - self.clearButton.setText(kdecore.i18n(_fromUtf8("Clear"))) - -from PyKDE4.kdeui import KTextEdit, KPushButton diff --git a/bindings/python/nepomuk/nepomuk_tag_example.py b/bindings/python/nepomuk/nepomuk_tag_example.py deleted file mode 100644 index ff7d30f..0000000 --- a/bindings/python/nepomuk/nepomuk_tag_example.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Copyright 2010 Luca Beltrame -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -"Module that shows how to tag files." - -import sys - -from PyQt4 import QtCore -from PyKDE4 import kdecore -from PyKDE4 import kdeui -from PyKDE4.nepomuk import Nepomuk - -def nepomuk_examples(): - - # Create a fake file to be tagged - - dummy_file = open("dummy.txt", "w") - dummy_file.write("Some text\n") - dummy_file.close() - - # Initialize Nepomuk - - result = Nepomuk.ResourceManager.instance().init() - - # 0 means that we have access to Nepomuk - bail out otherwise - - if result != 0: - print "Nepomuk not running. Bailing out." - return - - # Next, we create a Nepomuk.Resource for our file. This is required for all - # Nepomuk related operations. To construct it, we need an absolute path: - # relative paths or file names won't work. - - file_info = QtCore.QFileInfo("dummy.txt") - absolute_path = file_info.absoluteFilePath() - - print "Creating Nepomuk resource..." - resource = Nepomuk.Resource(kdecore.KUrl(absolute_path)) - - print "Nepomuk resource created.\n" - # To tag a file, we create an instance of Nepomuk.Tag. We define it with an - # identifier that is the name of our tag. If the tag already exists, it is - # transparently re-used. - - print "Creating tag 'test_example'..." - - tag = Nepomuk.Tag("test_example") - - # A tag needs a label too, to be displayed. So we add the label using - # setLabel() - - tag.setLabel("test_example") - - # Then we tag the file with the addTag method of the resource. - # All tags in the resource can be accessed with the tags() method, which - # returns a list of Tag instances. - - print "Adding tag..." - resource.addTag(tag) - - print "We now have this tag:'%s'\n" % unicode(resource.tags()[0].label()) - - # We can add comments directly to the resource using setDescription(). - - print "Adding description..." - resource.setDescription("This is an example comment.") - print "The file has the description: '%s'\n" % unicode(resource.description()) - - - # To strip a resource of everything, we use the remove() method. - # resource.remove() - # To remove specific properties, you can access the URI of the property, - # such as descriptionUri() or tagUri() and remove them using - # removeProperty(): - - # resource.removeProperty(resource.descriptionUri()) # remove comment - # resource.removeProperty(resource.tagUri()) # remove tags - - # Changes should be immediately visible in file managers such as Dolphin. - - print "Press a key to display the results in Dolphin." - print "Check the 'dummy.txt' file.\n" - raw_input() - - res = kdecore.KUrl(file_info.absolutePath()).prettyUrl() - kdecore.KToolInvocation.startServiceByDesktopName("dolphin", - res) - -def main(): - - app_name = "nepomuk_tag_example" - program_name = kdecore.ki18n("Example Nepomuk application (PyKDE4)") - about_data = kdecore.KAboutData(QtCore.QByteArray(app_name), "", - program_name, QtCore.QByteArray("0.1")) - kdecore.KCmdLineArgs.init(sys.argv, about_data) - app = kdeui.KApplication() - - nepomuk_examples() - QtCore.QTimer.singleShot(3000, app.quit) - app.exec_() - -if __name__ == '__main__': - main() diff --git a/bindings/python/nepomuk/nepomuk_tag_query_example.py b/bindings/python/nepomuk/nepomuk_tag_query_example.py deleted file mode 100755 index 62bf039..0000000 --- a/bindings/python/nepomuk/nepomuk_tag_query_example.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2011 Luca Beltrame -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import sys - -import PyQt4.QtCore as QtCore - -import PyKDE4.kdecore as kdecore -import PyKDE4.kdeui as kdeui -from PyKDE4.kio import KIO -from PyKDE4.nepomuk import Nepomuk -from PyKDE4.soprano import Soprano - - -class NepomukTagQueryExample(QtCore.QObject): - - def __init__(self, parent=None): - - super(NepomukTagQueryExample, self).__init__(parent) - self.results = list() - self.service_client = Nepomuk.Query.QueryServiceClient() - - # Gather results as they are found - self.service_client.newEntries.connect(self.query_client_slot) - - # Ensure we disconnect after we're done - #self.service_client.finishedListing.connect( - #self.service_client.newEntries.disconnect) - - # Once the query is over, we'll display the results - self.service_client.finishedListing.connect(self.display_results) - - def display_results(self): - - # get rid of duplicate items - results = set(self.results) - - print "Displaying search results" - print - - for item in results: - print item - - print - print "End results" - - def query_client_slot(self, data): - - # Instead of displaying results, we add them to an - # internal list, because this slot is called for both - # the initial search and when results are added. - - if not data: - return - - for item in data: - # Get the file name - result = item.resource().genericLabel() - self.results.append(result) - - def query_tag(self, tag): - - tag = Nepomuk.Tag(tag) - - soprano_term_uri = Soprano.Vocabulary.NAO.hasTag() - - # The API documentation on api.kde.org uses the URI directly, but - # under PyKDE4 generates an error, hence we wrap it in - # Nepomuk.Types.Property - - nepomuk_property = Nepomuk.Types.Property(soprano_term_uri) - - # The actual term for the query, in this case a ComparisonTerm, - # because we compare our hasTag() with the actual tag - # The tag is wrapped in a ResourceTerm - - comparison_term = Nepomuk.Query.ComparisonTerm(nepomuk_property, - Nepomuk.Query.ResourceTerm(tag)) - - # Now we make a query. We use a FileQuery since we're interested in - # files, but if we want more generic results we can use - # Nepomuk.Query.Query. - - query = Nepomuk.Query.FileQuery(comparison_term) - - # We call now the Nepomuk Query Service to execute our query - # asynchronously - self.service_client.query(query) - - def query_desktop_query(self, tag): - - # A simple query using Desktop Query instead of building a query - # For tags it's very acceptable - - query = "hasTag:%s" % tag - - self.service_client.desktopQuery(query) - -def main(): - - app_name = "nepomuk_tag_query_example" - program_name = kdecore.ki18n("Example Nepomuk tag query" - " application (PyKDE4)") - about_data = kdecore.KAboutData(QtCore.QByteArray(app_name), "", - program_name, QtCore.QByteArray("0.1")) - kdecore.KCmdLineArgs.init(sys.argv, about_data) - app = kdeui.KApplication() - - first_test = NepomukTagQueryExample() - first_test.query_tag("test_query") - - second_test = NepomukTagQueryExample() - second_test.query_desktop_query("test_query") - - QtCore.QTimer.singleShot(5000, app.quit) - app.exec_() - -if __name__ == '__main__': - main() diff --git a/buildsystem/HowToInstallALibrary/BarConfig.cmake.in b/buildsystem/HowToInstallALibrary/BarConfig.cmake.in deleted file mode 100644 index ff4af1b..0000000 --- a/buildsystem/HowToInstallALibrary/BarConfig.cmake.in +++ /dev/null @@ -1,17 +0,0 @@ -get_filename_component(myDir ${CMAKE_CURRENT_LIST_FILE} PATH) # get the directory where I myself am -get_filename_component(rootDir ${myDir}/@relInstallDir@ ABSOLUTE) # get the chosen install prefix - -# set the version of myself -set(BAR_VERSION_MAJOR @BAR_VERSION_MAJOR@) -set(BAR_VERSION_MINOR @BAR_VERSION_MINOR@) -set(BAR_VERSION_PATCH @BAR_VERSION_PATCH@) -set(BAR_VERSION ${BAR_VERSION_MAJOR}.${BAR_VERSION_MINOR}.${BAR_VERSION_PATCH} ) - -# what is my include directory -set(BAR_INCLUDES "${rootDir}/@INCLUDE_INSTALL_DIR@") - -# import the exported targets -include(${myDir}/BarTargets.cmake) - -# set the expected library variable -set(BAR_LIBRARIES bar ) diff --git a/buildsystem/HowToInstallALibrary/BarConfigVersion.cmake.in b/buildsystem/HowToInstallALibrary/BarConfigVersion.cmake.in deleted file mode 100644 index 5dacf0a..0000000 --- a/buildsystem/HowToInstallALibrary/BarConfigVersion.cmake.in +++ /dev/null @@ -1,25 +0,0 @@ -# This is a very basic file for the new style find_package() search mode, -# i.e. Config-mode. -# In this mode find_package() searches for a Config.cmake -# file and an associated Version.cmake file, which it loads to check -# the version number. -# This file can be used with configure_file() to generate such a file for a project -# with very basic logic. -# It sets PACKAGE_VERSION_EXACT if the current version string and the requested -# version string are exactly the same and it sets PACKAGE_VERSION_COMPATIBLE -# if the current version is >= requested version. -# If this is not good enough for your project, you need to write your own -# improved Version.cmake file. - - -set(PACKAGE_VERSION @BAR_VERSION_MAJOR@.@BAR_VERSION_MINOR@.@BAR_VERSION_PATCH@) - -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) - set(PACKAGE_VERSION_COMPATIBLE FALSE) -else("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") - set(PACKAGE_VERSION_EXACT TRUE) - endif( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") -endif("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) - diff --git a/buildsystem/HowToInstallALibrary/CMakeLists.txt b/buildsystem/HowToInstallALibrary/CMakeLists.txt deleted file mode 100644 index 439797d..0000000 --- a/buildsystem/HowToInstallALibrary/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -cmake_minimum_required(VERSION 2.6.4) -project(Bar) - -# the version number, needed for -# - the library version -# - version detection by cmake -set(BAR_VERSION_MAJOR 1) -set(BAR_VERSION_MINOR 2) -set(BAR_VERSION_PATCH 3) -set(BAR_VERSION ${BAR_VERSION_MAJOR}.${BAR_VERSION_MINOR}.${BAR_VERSION_PATCH} ) - -# set up install directories. INCLUDE_INSTALL_DIR and LIB_INSTALL_DIR must not be absolute paths -set(LIB_INSTALL_DIR_SUFFIX "" CACHE STRING "The directories where to install libraries to") -set(LIB_INSTALL_DIR lib${LIB_INSTALL_DIR_SUFFIX} ) -set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/Bar ) - -# Use a versioned install directory for the headers so multiple versions can be installed in parallel -set(INCLUDE_INSTALL_DIR include ) - -# not changable, but we set a variable anyway for consistency -set(BIN_INSTALL_DIR bin) - -# actually add the directory where the library is built -add_subdirectory(src) - -# This "exports" all targets which have been put into the export set "BarExport". -# This means that cmake generates a file with the given filename, which can later on be loaded -# by projects using this package. -# This file contains add_library(bar IMPORTED) statements for each target in the export set, so -# when loaded later on cmake will create "imported" library targets from these, which can be used -# in many ways in the same way as a normal library target created via a normal add_library(). -install(EXPORT BarExport DESTINATION ${CMAKECONFIG_INSTALL_DIR} FILE BarTargets.cmake ) - -# figure out the relative path from the installed Config.cmake file to the install prefix (which may be at -# runtime different from the chosen CMAKE_INSTALL_PREFIX if under Windows the package was installed anywhere) -# This relative path will be configured into the BarConfig.cmake -file(RELATIVE_PATH relInstallDir ${CMAKE_INSTALL_PREFIX}/${CMAKECONFIG_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX} ) - -# Create a BarConfig.cmake file. Config.cmake files are searched by find_package() -# automatically. We configure that file so that we can put any information we want in it, -# e.g. version numbers, include directories, etc. -configure_file(BarConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/BarConfig.cmake @ONLY ) - -# Additionally, when cmake has found a BarConfig.cmake, it can check for a BarConfigVersion.cmake -# in the same directory when figuring out the version of the package when a version -# has been specified in the find_package() call, e.g. find_package(Bar 1.0) -configure_file(BarConfigVersion.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/BarConfigVersion.cmake @ONLY ) - -# Install these two files into the same directory as the generated exports-file. -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/BarConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/BarConfigVersion.cmake - DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) - - diff --git a/buildsystem/HowToInstallALibrary/README b/buildsystem/HowToInstallALibrary/README deleted file mode 100644 index 1fd2b92..0000000 --- a/buildsystem/HowToInstallALibrary/README +++ /dev/null @@ -1,9 +0,0 @@ -This directory contains an example which shows how to install a shared -library built with cmake properly. - -It builds a tiny shared library libbar, and installs that along with a -matching BarConfig.cmake file. -In example/ there is a usage example of the installed library (i.e. it is -intentionally not part of the build) - -Alex diff --git a/buildsystem/HowToInstallALibrary/example/CMakeLists.txt b/buildsystem/HowToInstallALibrary/example/CMakeLists.txt deleted file mode 100644 index 6df2ad9..0000000 --- a/buildsystem/HowToInstallALibrary/example/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 2.6.4) - -find_package(Bar 1.2.0 REQUIRED) - -include(FindPackageHandleStandardArgs) -#find_package_handle_standard_args(Bar CONFIG_MODE) - -include_directories(${BAR_INCLUDES}) - -add_executable(hello main.c) -target_link_libraries(hello ${BAR_LIBRARIES} ) - -message(STATUS "version: ${BAR_VERSION}") diff --git a/buildsystem/HowToInstallALibrary/example/main.c b/buildsystem/HowToInstallALibrary/example/main.c deleted file mode 100644 index 3f253e6..0000000 --- a/buildsystem/HowToInstallALibrary/example/main.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main() -{ - printf("bar: %d\n", bar()); - return 0; -} diff --git a/buildsystem/HowToInstallALibrary/src/CMakeLists.txt b/buildsystem/HowToInstallALibrary/src/CMakeLists.txt deleted file mode 100644 index 0ffde0d..0000000 --- a/buildsystem/HowToInstallALibrary/src/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# for the point of this example it doesn't matter whether this is a C or C++ library -# and whether add_library() or kde4_add_library() is used. So we use the most basic one: -add_library(bar SHARED bar.c) - -# set version of the shared library -set_target_properties(bar PROPERTIES VERSION ${BAR_VERSION} - SOVERSION ${BAR_VERSION_MAJOR} ) - -# install the headers -install(FILES bar.h DESTINATION ${INCLUDE_INSTALL_DIR} ) - -# install the library(s). -# The EXPORT keyword puts the target "bar" into a set of targets. In C++ this would look like -# std::set targetsToBeExported; -# targetsToBeExported.insert(bar); -# This "export set" is then used in the toplevel CMakeLists.txt -# The three different destinations are mostly interesting for Windows: -# the dll must go into bin/ (needed at RUNTIME), while the lib-file is considered -# ARCHIVE and should go into lib/ -install(TARGETS bar EXPORT BarExport LIBRARY DESTINATION ${LIB_INSTALL_DIR} - ARCHIVE DESTINATION ${LIB_INSTALL_DIR} - RUNTIME DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/buildsystem/HowToInstallALibrary/src/bar.c b/buildsystem/HowToInstallALibrary/src/bar.c deleted file mode 100644 index 0761c8c..0000000 --- a/buildsystem/HowToInstallALibrary/src/bar.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "bar.h" - -int bar() -{ - return 43; -} diff --git a/buildsystem/HowToInstallALibrary/src/bar.h b/buildsystem/HowToInstallALibrary/src/bar.h deleted file mode 100644 index 44bada8..0000000 --- a/buildsystem/HowToInstallALibrary/src/bar.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef BAR_H -#define BAR_H - -extern int bar(void); - -#endif diff --git a/buildsystem/README b/buildsystem/README deleted file mode 100644 index 3cd6046..0000000 --- a/buildsystem/README +++ /dev/null @@ -1,3 +0,0 @@ -This directory contains several (currently only one) examples which show -different aspects of how to use cmake in the recommended way. - diff --git a/desktop-files/CMakeLists.txt b/desktop-files/CMakeLists.txt deleted file mode 100644 index 57eceba..0000000 --- a/desktop-files/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -project(tutorial-kicon) - -find_package(KDE4 REQUIRED) -include_directories(${KDE4_INCLUDES}) - -set(tutorial-source - main.cpp - mainwindow.cpp -) - -kde4_add_executable(tutorial-kicon ${tutorial-source}) - -target_link_libraries(tutorial-kicon ${KDE4_KDEUI_LIBS}) - -install(TARGETS tutorial-kicon DESTINATION ${BIN_INSTALL_DIR}) -install(FILES tutorial-kiconui.rc - DESTINATION ${DATA_INSTALL_DIR}/tutorial-kicon) -kde4_install_icons(${ICON_INSTALL_DIR}) -kde4_update_iconcache() diff --git a/desktop-files/main.cpp b/desktop-files/main.cpp deleted file mode 100644 index d0f188f..0000000 --- a/desktop-files/main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include -#include - -#include "mainwindow.h" - -int main (int argc, char *argv[]) -{ - KAboutData aboutData( "tutorial-kicon", "tutorial-kicon", - ki18n("Tutorial KIcon"), "1.0", - ki18n("A simple text area using KIcons, KAction etc."), - KAboutData::License_GPL, - ki18n("Copyright (c) 2011 Developer") ); - KCmdLineArgs::init( argc, argv, &aboutData ); - KApplication app; - - MainWindow* window = new MainWindow(); - window->show(); - return app.exec(); -} diff --git a/desktop-files/mainwindow.cpp b/desktop-files/mainwindow.cpp deleted file mode 100644 index 928c4c2..0000000 --- a/desktop-files/mainwindow.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "mainwindow.h" - -#include -#include -#include -#include -#include - -MainWindow::MainWindow(QWidget *parent) - : KXmlGuiWindow(parent) -{ - textArea = new KTextEdit; - setCentralWidget(textArea); - - setupActions(); -} - -void MainWindow::setupActions() -{ - KAction* clearAction = new KAction(this); - clearAction->setText(i18n("&Clear")); - clearAction->setIcon(KIcon("tutorial-kicon")); - clearAction->setShortcut(Qt::CTRL + Qt::Key_W); - actionCollection()->addAction("clear", clearAction); - connect(clearAction, SIGNAL(triggered(bool)), - textArea, SLOT(clear())); - - KStandardAction::quit(kapp, SLOT(quit()), - actionCollection()); - - setupGUI(); -} - - diff --git a/desktop-files/mainwindow.h b/desktop-files/mainwindow.h deleted file mode 100644 index d787505..0000000 --- a/desktop-files/mainwindow.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include - -class MainWindow : public KXmlGuiWindow -{ - public: - MainWindow(QWidget *parent=0); - - private: - KTextEdit* textArea; - void setupActions(); -}; - -#endif diff --git a/desktop-files/tutorial-desktop-files.desktop b/desktop-files/tutorial-desktop-files.desktop deleted file mode 100644 index 69e2e8a..0000000 --- a/desktop-files/tutorial-desktop-files.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Version=1.0 -Name=tutorial-desktop-files -GenericName=tutorial-desktop-files -Comment=A tutorial application categorized as graphics -Type=Application -Icon=tutorial-desktop-files -Terminal=false -Exec=/usr/local/bin/tutorial-desktop-files -Categories=Graphics; diff --git a/desktop-files/tutorial-kiconui.rc b/desktop-files/tutorial-kiconui.rc deleted file mode 100644 index 42a8d20..0000000 --- a/desktop-files/tutorial-kiconui.rc +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - Main Toolbar - - - - diff --git a/desktop-files/world.svg b/desktop-files/world.svg deleted file mode 100644 index 3468661..0000000 --- a/desktop-files/world.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/framework-template/CMakeLists.txt b/framework-template/CMakeLists.txt deleted file mode 100644 index 5730244..0000000 --- a/framework-template/CMakeLists.txt +++ /dev/null @@ -1,87 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) - -project(FooBar) - -# ECM setup -find_package(ECM 0.0.10 REQUIRED NO_MODULE) -set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) - -include(FeatureSummary) -include(GenerateExportHeader) -include(ECMSetupVersion) -include(ECMGenerateHeaders) -include(ECMPackageConfigHelpers) -include(KDEInstallDirs) -include(KDEFrameworkCompilerSettings) -include(KDECMakeSettings) - -set(KF5_VERSION "4.96.0") # Update this - -ecm_setup_version(${KF5_VERSION} - VARIABLE_PREFIX FOOBAR - VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/foobar_version.h" - PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5FooBarConfigVersion.cmake" -) - -# Dependencies -set(REQUIRED_QT_VERSION "5.2.0") - -# Required Qt5 components to build this framework -find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Core) - -# TODO: Add all required find_package() calls here. For example: -# find_package(KF5CoreAddons ${KF5_VERSION} REQUIRED) - -# TODO-i18n: Uncomment if your framework is translated using KI18n -# find_package(KF5I18n ${KF5_VERSION} REQUIRED) - -# TODO-docbook: Uncomment if you want to provide docbook-based documentation -# find_package(KF5DocTools ${KF5_VERSION} REQUIRED) - -# TODO-qt: Uncomment if your framework is translated using Qt -# include(ECMPoQmTools) - -# Translations -# TODO-i18n: Uncomment if your framework is translated using KI18n -# add_definitions(-DTRANSLATION_DOMAIN=\"foobar5\") -if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") - # TODO-i18n: Uncomment if your framework is translated using KI18n - # ki18n_install(po) - - # TODO-qt: Uncomment if your framework is translated using Qt - # ecm_install_po_files_as_qm(po) - - # TODO-docbook: Uncomment if you want to provide docbook-based documentation - # kdoctools_install(po) -endif() - -# Subdirectories -add_subdirectory(src) -add_subdirectory(autotests) -add_subdirectory(tests) - -# Create a Config.cmake and a ConfigVersion.cmake file and install them -set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5FooBar") - -ecm_configure_package_config_file( - "${CMAKE_CURRENT_SOURCE_DIR}/KF5FooBarConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/KF5FooBarConfig.cmake" - INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}" -) - -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/KF5FooBarConfig.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/KF5FooBarConfigVersion.cmake" - DESTINATION "${CMAKECONFIG_INSTALL_DIR}" - COMPONENT Devel) - -install(EXPORT KF5FooBarTargets - DESTINATION "${CMAKECONFIG_INSTALL_DIR}" - FILE KF5FooBarTargets.cmake - NAMESPACE KF5::) - -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/foobar_version.h" - DESTINATION "${INCLUDE_INSTALL_DIR}" - COMPONENT Devel) - -feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/framework-template/KF5FooBarConfig.cmake.in b/framework-template/KF5FooBarConfig.cmake.in deleted file mode 100644 index 3527a93..0000000 --- a/framework-template/KF5FooBarConfig.cmake.in +++ /dev/null @@ -1,9 +0,0 @@ -@PACKAGE_INIT@ - -# Required components to use this framework -# For example: -# find_dependency(Qt5Widgets "@REQUIRED_QT_VERSION@") -# find_dependency(KF5CoreAddons "@KF5_VERSION@") - -include("${CMAKE_CURRENT_LIST_DIR}/KF5FooBarTargets.cmake") - diff --git a/framework-template/README.md b/framework-template/README.md deleted file mode 100644 index e9a7e24..0000000 --- a/framework-template/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# What are these files? - -These template files can be used to create a new framework. - -You can do so by running - - ./setup.sh - -Where is either "qt", "i18n" or "none. - -This command copies the template files to `/destdir/myframework` and perform the -appropriate renames. - -For this to be useful it has to be kept updated, I am going to do my best there, -but if you spot anything strange or outdated in there, please notify the -kde-frameworks-devel mailing list and/or fix it. - -Note that the templates themselves are "buildable": you can create a build -directory, point cmake to the "template" directory and run "make install" to -build and install a `libFooBar.so`. diff --git a/framework-template/autotests/CMakeLists.txt b/framework-template/autotests/CMakeLists.txt deleted file mode 100644 index d622ffd..0000000 --- a/framework-template/autotests/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test) - -include(ECMMarkAsTest) - -macro(foobar_tests) - foreach(_testname ${ARGN}) - add_executable(${_testname} ${_testname}.cpp) - target_link_libraries(${_testname} Qt5::Test KF5FooBar) - add_test(foobar-${_testname} ${_testname}) - ecm_mark_as_test(${_testname}) - endforeach(_testname) -endmacro() - -#foobar_tests( -# foobartest -#) diff --git a/framework-template/setup.sh b/framework-template/setup.sh deleted file mode 100755 index 5ebf977..0000000 --- a/framework-template/setup.sh +++ /dev/null @@ -1,260 +0,0 @@ -#!/bin/sh -set -e - -CMAKELISTS_FILES="CMakeLists.txt src/CMakeLists.txt" - -die() { - echo Error: $* 1>&2 - exit 1 -} - -usage() { - cat < - -Copies template files to destination-dir, using the correct file names. Replaces -all references to the template framework name with framework-name. - -framework-name must be in CamelCase. - -destination-dir must not exist already. - -Options: - -h, --help Display this usage message and exit - --docbook Add docbook support - --tr SYSTEM Select translation system to use - SYSTEM must be one of: - - ki18n: Use KI18n translation system (default) - - qt: Use Qt translation system - - none: Do not use any translation system -EOF - exit 1 -} - -# When called as "uncomment foo file1", this function turn blocks like this: -# -# # foo: Uncomment to launch space rocket -# # /bin/launch -# -# /bin/land -# -# Into: -# -# /bin/launch -# -# /bin/land -uncomment() { - local marker="$1:" - local file="$2" - sed -i "/^ *# *$marker/,+1 { - # Delete the line which contain the comment with the marker - /^ *# $marker*/d - # Uncomment the next line, keeping indentation intact - s/^\( *\)# */\1/ - }" $file -} - -# When called as "rmcomment foo file1", this function turn blocks like this: -# -# # foo: Uncomment to launch space rocket -# # /bin/launch -# -# /bin/land -# -# Into: -# -# /bin/land -rmcomments() { - local marker="$1:" - local file="$2" - sed -i "/^ *# *$marker/,+1d" $file -} - -setup_translation_system() { - case "$tr" in - qt) - echo "Setup Qt translation system" - rm src/Messages-i18n.sh - mv src/Messages-qt.sh src/Messages.sh - for file in $CMAKELISTS_FILES ; do - uncomment TODO-qt $file - rmcomments TODO-i18n $file - done - ;; - ki18n) - echo "Setup KI18n translation system" - rm src/Messages-qt.sh - mv src/Messages-i18n.sh src/Messages.sh - for file in $CMAKELISTS_FILES ; do - uncomment TODO-i18n $file - rmcomments TODO-qt $file - done - ;; - none) - echo "Removing translation system templates" - rm src/Messages-*.sh - for file in $CMAKELISTS_FILES ; do - rmcomments TODO-i18n $file - rmcomments TODO-qt $file - done - ;; - esac -} - -replace_template_names() { - echo "Replacing template names" - find -type f | while read file ; do - sed -i \ - -e "s/KF5FooBar/$kf5name/g" \ - -e "s/FooBar/$name/g" \ - -e "s/foobar/$lowercase_name/g" \ - -e "s/FOOBAR/$uppercase_name/g" \ - $file - - # Rename files matching *FooBar* - case "$file" in - *FooBar*) - mv $file $(echo $file | sed -e "s/KF5FooBar/$kf5name/" -e "s/FooBar/$name/") - ;; - *) - ;; - esac - done -} - -create_top_level_files() { - echo "Creating README.md" - cat > README.md < -- IRC channel: #kde-devel on Freenode -- Git repository: -EOF - - echo "Creating metainfo.yaml" - echo "tier: \"unknown\"" > metainfo.yaml - - echo "Creating .reviewboardrc" - cat > .reviewboardrc <") - -target_link_libraries(KF5FooBar - PUBLIC - Qt5::Core -# PRIVATE -# KF5::CoreAddons - # Other private libs -# TODO-i18n: Uncomment if your framework is translated using KI18n -# KF5::I18n -) - -set_target_properties(KF5FooBar - PROPERTIES VERSION ${FOOBAR_VERSION_STRING} - SOVERSION ${FOOBAR_SOVERSION} - EXPORT_NAME "FooBar" -) - -ecm_generate_headers(FooBar_HEADERS - HEADER_NAMES - MyClass - # other classes - - REQUIRED_HEADERS FooBar_HEADERS -) - -# Install files -install(TARGETS KF5FooBar - EXPORT KF5FooBarTargets - ${INSTALL_TARGETS_DEFAULT_ARGS}) - -install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/foobar_export.h - ${FooBar_HEADERS} - DESTINATION ${INCLUDE_INSTALL_DIR}/FooBar - COMPONENT Devel) - -include(ECMGeneratePriFile) -ecm_generate_pri_file( - BASE_NAME FooBar - LIB_NAME KF5FooBar - DEPS "core" - FILENAME_VAR PRI_FILENAME -) -install(FILES ${PRI_FILENAME} - DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) diff --git a/framework-template/src/Messages-i18n.sh b/framework-template/src/Messages-i18n.sh deleted file mode 100755 index 53d674d..0000000 --- a/framework-template/src/Messages-i18n.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -# Invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources. -# The results are stored in a pseudo .cpp file to be picked up by xgettext. -lst=`find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` -if [ -n "$lst" ] ; then - $EXTRACTRC $lst >> rc.cpp -fi - -# If your framework contains tips-of-the-day, call preparetips as well. -if [ -f "data/tips" ] ; then - ( cd data && $PREPARETIPS > ../tips.cpp ) -fi - -# Run xgettext to extract strings from all source files. -$XGETTEXT `find . -name \*.cpp -o -name \*.h -o -name \*.qml` -o $podir/foobar5.pot diff --git a/framework-template/src/Messages-qt.sh b/framework-template/src/Messages-qt.sh deleted file mode 100755 index ac04b62..0000000 --- a/framework-template/src/Messages-qt.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Extract strings from all source files. -# EXTRACT_TR_STRINGS extracts strings with lupdate and convert them to .pot with -# lconvert. -$EXTRACT_TR_STRINGS `find . -name \*.cpp -o -name \*.h -o -name \*.ui -o -name \*.qml` -o $podir/foobar5_qt.pot diff --git a/framework-template/src/myclass.cpp b/framework-template/src/myclass.cpp deleted file mode 100644 index ce5d1bf..0000000 --- a/framework-template/src/myclass.cpp +++ /dev/null @@ -1,6 +0,0 @@ -/* Insert license header here */ -#include "myclass.h" - -MyClass::MyClass() -{ -} diff --git a/framework-template/src/myclass.h b/framework-template/src/myclass.h deleted file mode 100644 index ec29b45..0000000 --- a/framework-template/src/myclass.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Insert license header here */ -#ifndef MYCLASS_H -#define MYCLASS_H - -#include - -#include - -class FOOBAR_EXPORT MyClass : public QObject -{ - Q_OBJECT -public: - MyClass(); -}; - -#endif /* MYCLASS_H */ diff --git a/framework-template/test-setup.sh b/framework-template/test-setup.sh deleted file mode 100755 index 073d280..0000000 --- a/framework-template/test-setup.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -set -e -DST_DIR=/tmp/rocket -for tr in "none" "qt" "ki18n" ; do - dst=$DST_DIR-$tr - rm -rf $dst - ./setup.sh --tr $tr Rocket $dst - mkdir $dst/build - ( - cd $dst/build - cmake .. - make - make install DESTDIR=$dst/install - ) -done diff --git a/framework-template/tests/CMakeLists.txt b/framework-template/tests/CMakeLists.txt deleted file mode 100644 index 26f2638..0000000 --- a/framework-template/tests/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test) - -include(ECMMarkAsTest) - -macro(foobar_executable_tests) - foreach(_testname ${ARGN}) - add_executable(${_testname} ${_testname}.cpp) - target_link_libraries(${_testname} Qt5::Test KF5FooBar) - ecm_mark_as_test(${_testname}) - endforeach(_testname) -endmacro() - -#foobar_executable_tests( -# anothertest -#) diff --git a/ical/CMakeLists.txt b/ical/CMakeLists.txt deleted file mode 100644 index 2dab67e..0000000 --- a/ical/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -PROJECT( kde4start ) -FIND_PACKAGE(KDE4 REQUIRED) -INCLUDE_DIRECTORIES( ${KDE4_INCLUDES} . ) - - -SET(kde4startSources main.cpp ) - -KDE4_ADD_EXECUTABLE(kde4start ${kde4startSources} ) - -TARGET_LINK_LIBRARIES(kde4start ${KDE4_KDEUI_LIBS} ${KDE4_KCAL_LIBS} ${KDE4_KPARTS_LIBS} kdepim kcal_resourceremote ) diff --git a/ical/README b/ical/README deleted file mode 100644 index a05509a..0000000 --- a/ical/README +++ /dev/null @@ -1 +0,0 @@ -This folder is here as support for the tutorials at http://techbase.kde.org/Development/Tutorials/PIM/ical diff --git a/ical/event/CMakeLists.txt b/ical/event/CMakeLists.txt deleted file mode 100644 index 2dab67e..0000000 --- a/ical/event/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -PROJECT( kde4start ) -FIND_PACKAGE(KDE4 REQUIRED) -INCLUDE_DIRECTORIES( ${KDE4_INCLUDES} . ) - - -SET(kde4startSources main.cpp ) - -KDE4_ADD_EXECUTABLE(kde4start ${kde4startSources} ) - -TARGET_LINK_LIBRARIES(kde4start ${KDE4_KDEUI_LIBS} ${KDE4_KCAL_LIBS} ${KDE4_KPARTS_LIBS} kdepim kcal_resourceremote ) diff --git a/ical/event/main.cpp b/ical/event/main.cpp deleted file mode 100644 index 777eb3d..0000000 --- a/ical/event/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* -This is a test case for KDE's iCalendar functionality. -(c) 2008 by Thorsten Staerk -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -int main (int argc, char *argv[]) -{ - const QByteArray& ba=QByteArray("test"); - delete (void *)0; - const KLocalizedString name=ki18n("myName"); - KAboutData aboutData( ba, ba, name, ba, name); - KCmdLineArgs::init( argc, argv, &aboutData ); - KApplication khello; - KCal::ResourceCalendar* cal; - KCal::ResourceCached* resource; - resource=new KCal::ResourceLocal("/tmp/test.ics"); - cal=resource; - cal->load(); - KCal::Todo* todo1 = new KCal::Todo(); - todo1->setSummary("test todo"); - cal->addTodo(todo1); - KCal::Event* event1 = new KCal::Event(); - event1->setRelatedTo(todo1); - event1->setDtStart(KDateTime::currentLocalDateTime()); - event1->setDtEnd(KDateTime::currentLocalDateTime()); - cal->addEvent(event1); - KABC::Lock *lock = cal->lock(); - cal->save(); - lock->unlock(); -} diff --git a/ical/main.cpp b/ical/main.cpp deleted file mode 100644 index b46a73d..0000000 --- a/ical/main.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* -This is a test case for KDE's iCalendar functionality. -(c) 2008 by Thorsten Staerk -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -int main (int argc, char *argv[]) -{ - const QByteArray& ba=QByteArray("test"); - const KLocalizedString name=ki18n("myName"); - KAboutData aboutData( ba, ba, name, ba, name); - KCmdLineArgs::init( argc, argv, &aboutData ); - KApplication khello; - KCal::ResourceCalendar* cal; - KCal::ResourceCached* resource; - resource=new KCal::ResourceLocal("/tmp/test.ics"); - cal=resource; - cal->load(); - KCal::Todo* todo1 = new KCal::Todo(); - todo1->setSummary("test todo"); - cal->addTodo(todo1); - KABC::Lock *lock = cal->lock(); - cal->save(); - lock->unlock(); -} diff --git a/kconfigxt/CMakeLists.txt b/kconfigxt/CMakeLists.txt deleted file mode 100644 index bb6c719..0000000 --- a/kconfigxt/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -project(kconfigxt_example) - -include(MacroLibrary) - -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include_directories(${KDE4_INCLUDES}) - -set(kconfigxt_example_SRCS example.cpp) -kde4_add_kcfg_files(kconfigxt_example_SRCS exampleprefs_base.kcfgc) - -kde4_add_executable(kconfigxt_example ${kconfigxt_example_SRCS}) -target_link_libraries(kconfigxt_example ${KDE4_KDEUI_LIBS}) - -install(TARGETS kconfigxt_example ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/kconfigxt/Messages.sh b/kconfigxt/Messages.sh deleted file mode 100644 index 46ca859..0000000 --- a/kconfigxt/Messages.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env bash - -# The example's messages should not go into kdelibs.po -true diff --git a/kconfigxt/autoexample.cpp b/kconfigxt/autoexample.cpp deleted file mode 100644 index 0396c9b..0000000 --- a/kconfigxt/autoexample.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2003 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "general_base.h" -#include "myoptions_base.h" - -#include "exampleprefs_base.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -int main( int argc, char **argv ) -{ - KAboutData aboutData( "example", 0, ki18n("autoconfig example"), "0.1" ); - aboutData.addAuthor(ki18n("Cornelius Schumacher"), KLocalizedString(), "schumacher@kde.org"); - - KCmdLineArgs::init( argc, argv, &aboutData ); - - KApplication app; - - ExamplePrefsBase configSkeleton( "dummy1", "dummy2" ); - configSkeleton.readConfig(); - - KConfigDialog *dialog = new KConfigDialog( 0, "settings", &configSkeleton ); - - GeneralBase *general = new GeneralBase( 0 ); - dialog->addPage( general, i18n("General"), "General", "" ); - - MyOptionsBase *myOptions = new MyOptionsBase( 0 ); - dialog->addPage( myOptions, i18n("MyOptions"), "MyOptions", "" ); - - app.setMainWidget( dialog ); - - dialog->show(); - - return app.exec(); -} diff --git a/kconfigxt/example.cpp b/kconfigxt/example.cpp deleted file mode 100644 index 3e0700b..0000000 --- a/kconfigxt/example.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - This file is part of KDE. - - Copyright (c) 2003 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "exampleprefs_base.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -int main( int argc, char **argv ) -{ - KAboutData aboutData( "example", 0, ki18n("cfgc example"), "0.1" ); - aboutData.addAuthor(ki18n("Cornelius Schumacher"), KLocalizedString(), "schumacher@kde.org"); - - KCmdLineArgs::init( argc, argv, &aboutData ); - - KApplication app; - - ExamplePrefsBase *prefs = new ExamplePrefsBase("Trans1", "Folder2"); - - prefs->readConfig(); - - prefs->setAnotherOption(17); - - kWarning() << "Another Option = " << prefs->anotherOption(); - kWarning() << "Another Option2 = " << prefs->anotherOption2(); - kWarning() << "MyPaths = " << prefs->myPaths(); - kWarning() << "MyPaths2 = " << prefs->myPaths2(); -} diff --git a/kconfigxt/example.kcfg b/kconfigxt/example.kcfg deleted file mode 100644 index 13f3212..0000000 --- a/kconfigxt/example.kcfg +++ /dev/null @@ -1,64 +0,0 @@ - - - qdir.h - - - - - - - - true - - - - 5 - - - - The funky option is used to set some option - And this is a longer description of this option. Just wondering, how will the translations of those be handled? - - - - - - One - - - - - - Default String - - - - QDir::homePath()+QString::fromLatin1(".hidden_file") - - - - /home,~ - - - - QStringList(QDir::homePath()) - - - - 10 - - - up,down - - - - - 1 - - - diff --git a/kconfigxt/exampleprefs_base.kcfgc b/kconfigxt/exampleprefs_base.kcfgc deleted file mode 100644 index c687add..0000000 --- a/kconfigxt/exampleprefs_base.kcfgc +++ /dev/null @@ -1,20 +0,0 @@ -# The file containing the XML description of the settings -File=example.kcfg -# Code generation options for kconfig_compiler -ClassName=ExamplePrefsBase -# -# Singleton=false -# -# Inherits=KConfigSkeleton -# -# IncludeFiles=libkdepim/kpimprefs.h -# -# MemberVariables=public -# -### The following line includes the file exampleprefs_base_addon.h -### It can be used to add extra functions and variables to the -### class. -# CustomAdditions=true -# -### Provide setFooBar(int) style functions -Mutators=true diff --git a/kconfigxt/general_base.ui b/kconfigxt/general_base.ui deleted file mode 100644 index 2474b0d..0000000 --- a/kconfigxt/general_base.ui +++ /dev/null @@ -1,52 +0,0 @@ - -GeneralBase - - - GeneralBase - - - - 0 - 0 - 600 - 486 - - - - AutoExampleDialog - - - - unnamed - - - - kcfg_OneOption - - - OneOption - - - - - kcfg_AnotherOption2 - - - - - textLabel1 - - - AnotherOption: - - - - - - - KComboBox - QComboBox -
kcombobox.h
-
-
-
diff --git a/kconfigxt/myoptions_base.ui b/kconfigxt/myoptions_base.ui deleted file mode 100644 index d17e159..0000000 --- a/kconfigxt/myoptions_base.ui +++ /dev/null @@ -1,34 +0,0 @@ - -MyOptionsBase - - - MyOptionsBase - - - - 0 - 0 - 600 - 486 - - - - - unnamed - - - - textLabel1 - - - MyString: - - - - - kcfg_MyString - - - - - diff --git a/kcontrolmodules/CMakeLists.txt b/kcontrolmodules/CMakeLists.txt deleted file mode 100644 index cc6865d..0000000 --- a/kcontrolmodules/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -project(kcontrolmoduleexamples) - -include_directories(${KDE4_INCLUDES}) - -set(kcontrolmoduleSources kcontrolmodule_example.cpp) - -kde4_add_plugin(kcontrolmoduleexample ${kcontrolmoduleSources}) -target_link_libraries(kcontrolmoduleexample ${KDE4_KIO_LIBS} ${KDE4_SOLID_LIBS}) - -install(TARGETS kcontrolmoduleexample DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES kinfocenterexample.desktop DESTINATION ${SERVICES_INSTALL_DIR}) -install(FILES systemsettingsexample.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/kcontrolmodules/kcontrolmodule_example.cpp b/kcontrolmodules/kcontrolmodule_example.cpp deleted file mode 100644 index ccfb23d..0000000 --- a/kcontrolmodules/kcontrolmodule_example.cpp +++ /dev/null @@ -1,80 +0,0 @@ - -/* -* kcontrolmodule_example.cpp -* -* Copyright (C) 2010 David Hubner -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -*/ - -#include "kcontrolmodule_example.h" - -/* -Register and Export the plugin -*/ -K_PLUGIN_FACTORY(KControlModuleExampleFactory, registerPlugin();) -K_EXPORT_PLUGIN(KControlModuleExampleFactory("kcontrolmoduleexample")) - -KControlModuleExample::KControlModuleExample(QWidget *parent, const QVariantList &args) : - KCModule(KControlModuleExampleFactory::componentData(),parent) -{ - - // We do not use args in this example, so set unused so compiler does not display warning. - Q_UNUSED(args); - - // Set KInfoCenter About Data - const KAboutData *about = - new KAboutData(I18N_NOOP("KInfoCenterExample"), 0, ki18n("KInfoCenter Example"),"0.01", - KLocalizedString(), KAboutData::License_GPL, ki18n("(c) 2010 David Hubner")); - - setAboutData(about); - - // Create display - createDisplay(this); - - // Set Buttons - // There are NoAdditionalButton, Help, Default, Apply and Export - // - // NoAdditionalButton - No buttons - // Help - Display Help Button - // Default - Help and Apply are displayed - // Apply - Display Apply button, Not used in KInfoCenter - // Export - Display Export button, Not used in System Settings - setButtons(Help); -} - -/* -Create a label at the top the KCM -*/ -void KControlModuleExample::createDisplay(QWidget *parent) -{ - QWidget *maindisplay = new QWidget(parent); - QVBoxLayout *layout = new QVBoxLayout(maindisplay); - - m_exampleLabel = new QLabel(i18nc("Example Label","Here is the Label")); - layout->addWidget(m_exampleLabel); -} - -/* -Set the export of information, this sets the information returned -when the export button is pressed. Only in KInfoCenter, Needs KDE 4.5 -*/ -void KControlModuleExample::exportInformation() -{ - setExportText(m_exampleLabel->text()); -} - - diff --git a/kcontrolmodules/kcontrolmodule_example.h b/kcontrolmodules/kcontrolmodule_example.h deleted file mode 100644 index 4359db0..0000000 --- a/kcontrolmodules/kcontrolmodule_example.h +++ /dev/null @@ -1,63 +0,0 @@ - -/* -* kcontrolmodule_example.h -* -* Copyright (C) 2010 David Hubner -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -* -*/ - -#ifndef KCONTROLMODULEEXAMPLE -#define KCONTROLMODULEEXAMPLE - -// Include to register and export your KCM plugin -#include -#include - -// Include KCModule, the class your need to inherit from -#include - -// Include to set about data -#include -#include - -// Widgets and labels used for display -#include -#include -#include - -/* -Create the class, the KCM has to inherit KCModule -Check http://api.kde.org/4.x-api/kdelibs/kdeui/classKCModule.html -for reference. -*/ - -class KControlModuleExample : public KCModule -{ - Q_OBJECT - - public: - KControlModuleExample(QWidget *, const QVariantList &); - - private: - void createDisplay(QWidget *); - void exportInformation(); - - QLabel *m_exampleLabel; -}; - -#endif //KCONTROLMODULEEXAMPLE - diff --git a/kcontrolmodules/kinfocenterexample.desktop b/kcontrolmodules/kinfocenterexample.desktop deleted file mode 100644 index 8cdb869..0000000 --- a/kcontrolmodules/kinfocenterexample.desktop +++ /dev/null @@ -1,26 +0,0 @@ -[Desktop Entry] - -Exec=kcmshell4 devinfo -Icon=device-notifier -Type=Service - -# Set the type of module to a KCModule -X-KDE-ServiceTypes=KCModule - -# Sets the priority of the KCModule, the priority sets where the module shall -# appear in KInfoCenter tree view -X-KDE-Weight=10 - -# Adds a category, if the category does not exist a new one shall be created. -# Needs KDE 4.5 -X-KDE-KInfoCenter-Category=Examples - -X-KDE-Library=kcontrolmoduleexample -X-KDE-ParentApp=kinfocenter -X-DocPath=kinfocenter/kinfocenterexample.html - -Name=KInfoCenter Example -Comment=A KInfoCenter Example - -X-KDE-Keywords=example,kdeexamples -Categories=Qt;KDE;X-KDE-information; diff --git a/kcontrolmodules/systemsettingsexample.desktop b/kcontrolmodules/systemsettingsexample.desktop deleted file mode 100644 index 84e30d0..0000000 --- a/kcontrolmodules/systemsettingsexample.desktop +++ /dev/null @@ -1,23 +0,0 @@ -[Desktop Entry] - -Exec=kcmshell4 devinfo -Icon=device-notifier -Type=Service - -# Set the type of module to a KCModule -X-KDE-ServiceTypes=KCModule - -X-KDE-Weight=10 - -# Adds the kcontrol module to the personal category -X-KDE-System-Settings-Parent-Category=personal - -X-KDE-Library=kcontrolmoduleexample -X-KDE-ParentApp=kcontrol -X-DocPath=kcontrol/kcontrolmoduleexample.html - -Name=System Settings Example -Comment=A System Settings Example - -X-KDE-Keywords=example,kdeexamples -Categories=Qt;KDE;X-KDE-information; diff --git a/kdedemo/CMakeLists.txt b/kdedemo/CMakeLists.txt deleted file mode 100644 index 3c074c3..0000000 --- a/kdedemo/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Project Needs a name ofcourse -project(kdedemo) - -# Find the required Libaries -find_package(KDE4 REQUIRED) -include(KDE4Defaults) - -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include_directories( - ${CMAKE_SOURCE_DIR} - ${CMAKE_BINARY_DIR} - ${KDE4_INCLUDES} - ) - -# We add our source code here -set(SRCS kdedemo.cpp xmlhandler.cpp) - -# Now make sure all files get to the right place -kde4_add_plugin(plasma_applet_kdedemo ${SRCS}) -target_link_libraries(plasma_applet_kdedemo ${QT_QTXML_LIBRARY} ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS}) - -install(TARGETS plasma_applet_kdedemo DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES plasma-applet-kdedemo.desktop DESTINATION ${SERVICES_INSTALL_DIR}) -install(FILES examples.xml DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kdedemo) diff --git a/kdedemo/examples.xml b/kdedemo/examples.xml deleted file mode 100644 index ef0bad0..0000000 --- a/kdedemo/examples.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/kdedemo/kdedemo.cpp b/kdedemo/kdedemo.cpp deleted file mode 100644 index 9c17c59..0000000 --- a/kdedemo/kdedemo.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "kdedemo.h" - -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include "xmlhandler.h" - -// This is the command that links your applet to the .desktop file -K_EXPORT_PLASMA_APPLET(kdedemo, KdeDemo) - -KdeDemo::KdeDemo(QObject *parent, const QVariantList &args) - : Plasma::Applet(parent, args) - , m_back_button(new Plasma::PushButton) - , m_quit_launch_button(new Plasma::PushButton) - , m_show_source_button(new Plasma::PushButton) - , m_text(new Plasma::Label) - , m_tittle(new Plasma::Label) - , m_layout(new QGraphicsGridLayout) - , m_current_category(new Category) - , m_current_example(new Example) -{ - setBackgroundHints(DefaultBackground); -} - -KdeDemo::~KdeDemo() -{ -} - -void KdeDemo::init() -{ - m_layout->setColumnFixedWidth(0, 200); - m_layout->setColumnFixedWidth(2, 0); - m_layout->setColumnMinimumWidth(1, 300); - m_layout->setRowMaximumHeight(1, 30); - m_layout->setHorizontalSpacing(35); - m_layout->setVerticalSpacing(30); - - m_tittle->setAlignment(Qt::AlignCenter); - - m_text->setAlignment(Qt::AlignJustify); - loadTextFromFile("KDE Examples and Demos", KStandardDirs::locate("data", "kdeexamples/README")); - m_layout->addItem(m_text, 0, 1, Qt::AlignCenter); - - QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); - m_back_button->setText("Back"); - m_back_button->hide(); - connect(m_back_button, SIGNAL(clicked()), this, SLOT(backToCategories())); - layout->addItem(m_back_button); - m_layout->addItem(layout, 1, 0); - - layout = new QGraphicsLinearLayout(Qt::Horizontal); - layout->addStretch(); - m_show_source_button->setText("Show Source Code"); - m_show_source_button->hide(); - connect(m_show_source_button, SIGNAL(clicked()), this, SLOT(openSourceCode())); - layout->addItem(m_show_source_button); - m_quit_launch_button->setText("Quit"); - connect(m_quit_launch_button, SIGNAL(clicked()), this, SLOT(destroy())); - layout->addItem(m_quit_launch_button); - m_layout->addItem(layout, 1, 1); - - setLayout(m_layout); - - loadConfig(); - if (hasFailedToLaunch()) - return; - - foreach (Category c, m_categories) { - Plasma::PushButton *button = new Plasma::PushButton; - button->setText(c.name); - connect(button, SIGNAL(clicked()), this, SLOT(loadExampleList())); - m_category_buttons.push_back(button); - - QList x; - m_example_buttons.push_back(x); - - foreach (Example e, c.examples) { - Plasma::PushButton *button = new Plasma::PushButton; - button->setText(e.name); - connect(button, SIGNAL(clicked()), this, SLOT(loadExample())); - m_example_buttons.back().push_back(button); - } - } - loadButtons(m_category_buttons, "Categories"); -} - -void KdeDemo::loadExampleList() -{ - Plasma::PushButton *button = qobject_cast(sender()); - if (!button) - return; - - foreach (Plasma::PushButton *b, m_category_buttons) - b->hide(); - m_back_button->show(); - - int index = m_category_buttons.indexOf(button); - *m_current_category = m_categories.at(index); - QString file("kdeexamples/" + m_current_category->dirName + "/README"); - loadTextFromFile(m_current_category->name, KStandardDirs::locate("data", file)); - loadButtons(m_example_buttons.at(index), button->text()); -} - -void KdeDemo::loadExample() -{ - Plasma::PushButton *button = qobject_cast(sender()); - if (!button) - return; - - m_show_source_button->show(); - m_quit_launch_button->disconnect(); - m_quit_launch_button->setText("Launch"); - connect(m_quit_launch_button, SIGNAL(clicked()), this, SLOT(launchExample())); - - int i = m_categories.indexOf(*m_current_category); - int j = m_example_buttons.at(i).indexOf(button); - - *m_current_example = m_current_category->examples.at(j); - QString file("kdeexamples/" + m_current_category->dirName + "/" + m_current_example->fileName + "/README"); - loadTextFromFile(m_current_example->name, KStandardDirs::locate("data", file)); -} - -void KdeDemo::backToCategories() -{ - foreach (Plasma::PushButton *b, m_current_buttons) - b->hide(); - m_back_button->hide(); - m_show_source_button->hide(); - loadButtons(m_category_buttons, "Categories"); - loadTextFromFile("KDE Examples and Demos", KStandardDirs::locate("data", "kdeexamples/README")); - m_quit_launch_button->disconnect(); - m_quit_launch_button->setText("Quit"); - connect(m_quit_launch_button, SIGNAL(clicked()), this, SLOT(destroy())); -} - -void KdeDemo::openSourceCode() -{ - QString dir(KStandardDirs::locate("data", "kdeexamples/" + m_current_category->dirName + "/" + m_current_example->fileName + "/")); - if (dir.isEmpty()) { - KMessageBox::information(0, "Sorry, no source code available for this example."); - return; - } - - QProcess *process = new QProcess(this); - process->setWorkingDirectory(dir); - process->start("ls"); - process->waitForFinished(-1); - QString files = process->readAll(); - files.remove("README"); - - QStringList source_code = files.split("\n", QString::SkipEmptyParts); - - if (source_code.empty()) - return; - - process = new QProcess(this); - process->setWorkingDirectory(dir); - process->start(KStandardDirs::locate("exe", "kate"), QStringList() << "-n" << source_code); -} - -void KdeDemo::launchExample() -{ - QProcess *process = new QProcess(this); - QString f = m_current_example->fileName; - if (!m_current_example->plasmoid) { - process->start(KStandardDirs::locate("exe", f)); - } else { - process->start(KStandardDirs::locate("exe", "plasmoidviewer"), QStringList() << f); - } -} - -void KdeDemo::loadButtons(QList list, QString text) -{ - m_current_buttons = list; - foreach (Plasma::PushButton *b, m_current_buttons) - b->show(); - QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); - m_tittle->setText("

"+text+"

"); - layout->addItem(m_tittle); - foreach (Plasma::PushButton *b, list) - layout->addItem(b); - layout->addStretch(); - - m_layout->addItem(layout, 0, 0); -} - -void KdeDemo::loadConfig() -{ - QString file_name = KStandardDirs::locate("data", "kdeexamples/kdedemo/"); - if (file_name.isEmpty()) { - setFailedToLaunch(true, "No config file"); - return; - } - - QXmlSimpleReader xmlReader; - XmlHandler handler; - xmlReader.setContentHandler(&handler); - QXmlInputSource *source = new QXmlInputSource(new QFile(file_name + "examples.xml")); - if (xmlReader.parse(source)) - m_categories = handler.getCategories(); -} - -void KdeDemo::loadTextFromFile(QString tittle, QString file_name) -{ - QString text_string("

" + tittle + "

"); - QFile file(file_name); - if (file.open(QIODevice::ReadOnly)) { - QTextStream in(&file); - text_string += "

"; - while (!in.atEnd()) { - QString line = in.readLine(); - if (line.isEmpty()) { - text_string += "

"; - } else { - text_string += line; - text_string += " "; - } - } - text_string += "

"; - } else { - text_string += "

No description available

"; - } - m_text->setText(text_string); -} diff --git a/kdedemo/kdedemo.h b/kdedemo/kdedemo.h deleted file mode 100644 index 6bca973..0000000 --- a/kdedemo/kdedemo.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef KDEDEMO_H -#define KDEDEMO_H - -#include -#include - -class QGraphicsGridLayout; - -namespace Plasma { -class Label; -class PushButton; -} - -struct Category; -struct Example; - -class KdeDemo : public Plasma::Applet -{ - Q_OBJECT - - public: - KdeDemo(QObject *parent, const QVariantList &args); - ~KdeDemo(); - - void init(); - - Q_SIGNALS: - void hideCategories(); - void showCategories(); - - private Q_SLOTS: - void loadExampleList(); - void loadExample(); - void backToCategories(); - void openSourceCode(); - void launchExample(); - - private: - void loadButtons(QList list, QString m_text); - void loadConfig(); - void loadTextFromFile(QString tittle, QString file_name); - - QList m_categories; - QList m_category_buttons, m_current_buttons; - QList< QList > m_example_buttons; - Plasma::PushButton *m_back_button, *m_quit_launch_button, *m_show_source_button; - Plasma::Label *m_text, *m_tittle; - QGraphicsGridLayout *m_layout; - Category *m_current_category; - Example *m_current_example; -}; - -#endif // KDEDEMO_H diff --git a/kdedemo/plasma-applet-kdedemo.desktop b/kdedemo/plasma-applet-kdedemo.desktop deleted file mode 100644 index f1c9b17..0000000 --- a/kdedemo/plasma-applet-kdedemo.desktop +++ /dev/null @@ -1,16 +0,0 @@ -[Desktop Entry] -Name=KDE Demo -Comment=KDE Demo -Type=Service -ServiceTypes=Plasma/Applet - -X-KDE-Library=plasma_applet_kdedemo -X-KDE-PluginInfo-Name=kdedemo -X-KDE-PluginInfo-Category=Date and Time -X-KDE-PluginInfo-Author=Jon Ander Peñalba -X-KDE-PluginInfo-Email=jonan88@gmail.com -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website=http://www.kde.org/ -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/kdedemo/xmlhandler.cpp b/kdedemo/xmlhandler.cpp deleted file mode 100644 index 9805d09..0000000 --- a/kdedemo/xmlhandler.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "xmlhandler.h" - -bool XmlHandler::startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &atts) -{ - Q_UNUSED(namespaceURI) - Q_UNUSED(qName) - - if (localName == "category") { - Category x; - x.name = atts.value("name"); - x.dirName = atts.value("dirname"); - m_categories.push_back(x); - } else if (localName == "example") { - Example x; - x.name = atts.value("name"); - x.fileName = atts.value("filename"); - x.plasmoid = (atts.value("plasmoid") == "true"); - m_categories.back().examples.push_back(x); - } - - return true; -} diff --git a/kdedemo/xmlhandler.h b/kdedemo/xmlhandler.h deleted file mode 100644 index b02365a..0000000 --- a/kdedemo/xmlhandler.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef XMLHANDLER_H -#define XMLHANDLER_H - -#include - -struct Example -{ - QString name, fileName; - bool plasmoid; - - bool operator == (const Example &e) const - {return name == e.name;} -}; - -struct Category -{ - QString name, dirName; - QList examples; - - bool operator == (const Category &c) const - {return name == c.name;} -}; - -class XmlHandler : public QXmlContentHandler -{ - public: - QList getCategories() {return m_categories;} - - virtual bool startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &atts); - - // Not needed - virtual bool startDocument() {return true;} - virtual bool endDocument() {return true;} - virtual void setDocumentLocator(QXmlLocator* /*locator*/) {} - virtual bool startPrefixMapping(const QString& /*prefix*/, - const QString& /*uri*/) {return true;} - virtual bool endPrefixMapping(const QString& /*prefix*/) {return true;} - virtual bool endElement(const QString& /*namespaceURI*/, - const QString& /*localName*/, - const QString& /*qName*/) {return true;} - virtual bool characters(const QString& /*ch*/) {return true;} - virtual bool ignorableWhitespace(const QString& /*ch*/) {return true;} - virtual bool processingInstruction(const QString& /*target*/, - const QString& /*data*/) {return true;} - virtual bool skippedEntity(const QString& /*name*/) {return true;} - virtual QString errorString() const {return "true";} - - private: - QList m_categories; -}; - -#endif // XMLHANDLER_H diff --git a/kdegames/libpala/CMakeLists.txt b/kdegames/libpala/CMakeLists.txt deleted file mode 100644 index 45b5270..0000000 --- a/kdegames/libpala/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -project(myslicer) -find_package(KDE4 REQUIRED) -find_package(LibPala REQUIRED) - -include(KDE4Defaults) -include_directories(${KDE4_INCLUDES} ${pala_INCLUDE_DIRS}) - -kde4_add_plugin(myslicer myslicer.cpp) -target_link_libraries(myslicer pala ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS}) - -install(TARGETS myslicer DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES myslicer.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/kdegames/libpala/README b/kdegames/libpala/README deleted file mode 100644 index bd562f1..0000000 --- a/kdegames/libpala/README +++ /dev/null @@ -1,3 +0,0 @@ -This is an example of how to write an external slicer plugin for libpala. For documentation, see: - -http://techbase.kde.org/Development/Tutorials/Games/Palapeli_Slicers diff --git a/kdegames/libpala/myslicer.cpp b/kdegames/libpala/myslicer.cpp deleted file mode 100644 index d734788..0000000 --- a/kdegames/libpala/myslicer.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/*************************************************************************** - * Copyright 2009 Stefan Majewsky - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - ***************************************************************************/ - -#include "myslicer.h" - -#include -#include -#include - -K_PLUGIN_FACTORY(MySlicerFactory, registerPlugin();) -K_EXPORT_PLUGIN(MySlicerFactory("myslicer")) - -MySlicer::MySlicer(QObject* parent, const QVariantList& args) - : Pala::Slicer(parent, args) -{ - Pala::IntegerProperty* prop; - prop = new Pala::IntegerProperty(i18n("Piece count in horizontal direction")); - prop->setRange(3, 100); - prop->setDefaultValue(10); - addProperty("XCount", prop); - prop = new Pala::IntegerProperty(i18n("Piece count in vertical direction")); - prop->setRange(3, 100); - prop->setDefaultValue(10); - addProperty("YCount", prop); -} - -bool MySlicer::run(Pala::SlicerJob* job) -{ - //read job - const int xCount = job->argument("XCount").toInt(); - const int yCount = job->argument("YCount").toInt(); - const QImage image = job->image(); - //calculate some metrics - const int pieceWidth = image.width() / xCount; - const int pieceHeight = image.height() / yCount; - const QSize pieceSize(pieceWidth, pieceHeight); - //create pieces - for (int x = 0; x < xCount; ++x) - { - for (int y = 0; y < yCount; ++y) - { - //calculate more metrics - const QPoint offset(x * pieceWidth, y * pieceHeight); - const QRect pieceBounds(offset, pieceSize); - //copy image part to piece - const QImage pieceImage = image.copy(pieceBounds); - job->addPiece(x + y * xCount, pieceImage, offset); - } - } - //create relations - for (int x = 0; x < xCount; ++x) - { - for (int y = 0; y < yCount; ++y) - { - //along X axis (pointing left) - if (x != 0) - job->addRelation(x + y * xCount, (x - 1) + y * xCount); - //along Y axis (pointing up) - if (y != 0) - job->addRelation(x + y * xCount, x + (y - 1) * xCount); - } - } - return true; -} - -#include "myslicer.moc" diff --git a/kdegames/libpala/myslicer.desktop b/kdegames/libpala/myslicer.desktop deleted file mode 100644 index 17dd2e4..0000000 --- a/kdegames/libpala/myslicer.desktop +++ /dev/null @@ -1,34 +0,0 @@ -[Desktop Entry] -Name=My very first slicer -Name[ca]=El meu primer tallador -Name[en_GB]=My very first slicer -Name[et]=Minu esimene tükeldaja -Name[pt]=O meu primeiro divisor -Name[pt_BR]=Meu primeiro fatiador -Name[sv]=Mitt allra första delningsprogram -Name[uk]=Мій найперший інструмент розрізання -Name[x-test]=xxMy very first slicerxx -Name[zh_TW]=我的第一個切割器 -Comment=It is quite simple, actually. -Comment[ca]=És molt simple, actual. -Comment[en_GB]=It is quite simple, actually. -Comment[et]=See on tegelikult päris lihtne. -Comment[pt]=É muito simples, de facto. -Comment[pt_BR]=Ele é muito simples, realmente. -Comment[sv]=Det är faktiskt ganska enkelt. -Comment[uk]=Насправді, дуже простий. -Comment[x-test]=xxIt is quite simple, actually.xx -Comment[zh_TW]=真的是很簡單的。 -Type=Service -Icon=myslicer -X-KDE-Library=myslicer -X-KDE-ServiceTypes=Libpala/SlicerPlugin -X-KDE-PluginInfo-Author=Kandalf -X-KDE-PluginInfo-Email=kandalf@kde-hackers.example.org -X-KDE-PluginInfo-Name=myslicer -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://kde-hackers.example.org/myslicer -X-KDE-PluginInfo-Category= -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/kdegames/libpala/myslicer.h b/kdegames/libpala/myslicer.h deleted file mode 100644 index f3cd825..0000000 --- a/kdegames/libpala/myslicer.h +++ /dev/null @@ -1,38 +0,0 @@ -/*************************************************************************** - * Copyright 2009 Stefan Majewsky - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - ***************************************************************************/ - -#ifndef MYSLICER_H -#define MYSLICER_H - -#include -#include -#include - -class MySlicer : public Pala::Slicer -{ - Q_OBJECT - public: - explicit MySlicer(QObject* parent = 0, const QVariantList& args = QVariantList()); - virtual bool run(Pala::SlicerJob* job); -}; - -#endif // MYSLICER_H diff --git a/kdeui/CMakeLists.txt b/kdeui/CMakeLists.txt deleted file mode 100644 index 57ac0e5..0000000 --- a/kdeui/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(kdeui) - -include_directories(${KDE4_INCLUDES}) - -install(FILES README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kdeui) - -add_subdirectory(kmessagewidgetdemo) -add_subdirectory(kdeuiwidgets) -add_subdirectory(kpartbasic) -add_subdirectory(kxmlguibasic) diff --git a/kdeui/README b/kdeui/README deleted file mode 100644 index 492cf75..0000000 --- a/kdeui/README +++ /dev/null @@ -1 +0,0 @@ -The widgets provided by KDE add lots of extra functionality and features to the ones Qt provides. diff --git a/kdeui/kdeuiwidgets/CMakeLists.txt b/kdeui/kdeuiwidgets/CMakeLists.txt deleted file mode 100644 index 452defa..0000000 --- a/kdeui/kdeuiwidgets/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -project(kdeuiwidgets) - -set(SRCS main.cpp mainwindow.cpp) - -kde4_add_executable(kdeuiwidgets ${SRCS}) -target_link_libraries(kdeuiwidgets ${KDE4_KDEUI_LIBS}) -install(TARGETS kdeuiwidgets ${INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES ${SRCS} mainwindow.h README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kdeui/kdeuiwidgets) diff --git a/kdeui/kdeuiwidgets/README b/kdeui/kdeuiwidgets/README deleted file mode 100644 index 50386d9..0000000 --- a/kdeui/kdeuiwidgets/README +++ /dev/null @@ -1 +0,0 @@ -This example shows a few of KDE's specialized widgets. diff --git a/kdeui/kdeuiwidgets/main.cpp b/kdeui/kdeuiwidgets/main.cpp deleted file mode 100644 index 10fa098..0000000 --- a/kdeui/kdeuiwidgets/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("kdeuiwidgets", 0, - ki18n("KDE Widgets Demo"), "1.0", - ki18n("Demo with all the widgets available in KDE."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/kdeui/kdeuiwidgets/mainwindow.cpp b/kdeui/kdeuiwidgets/mainwindow.cpp deleted file mode 100644 index d9e56a5..0000000 --- a/kdeui/kdeuiwidgets/mainwindow.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mainwindow.h" - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -MainWindow::MainWindow(QWidget *parent) - : KMainWindow(parent) -{ - tabWidget = new KTabWidget(this); - - createInputTab(); - createDateTimeTab(); - createFontTab(); - createColorTab(); - - setCentralWidget(tabWidget); -} - -void MainWindow::createWidget(QString name, QWidget *widget, KVBox *parent) -{ - QGroupBox *groupBox = new QGroupBox(name, parent); - QVBoxLayout *layout = new QVBoxLayout(this); - layout->addWidget(widget); - groupBox->setLayout(layout); -} - -void MainWindow::createInputTab() -{ - KHBox *tab = new KHBox(this); - KVBox *column; - - // *** Column 1 *** - column = new KVBox(tab); - createWidget("KLineEdit", new KLineEdit(this), column); - createWidget("KIntNumInput", new KIntNumInput(this), column); - createWidget("KDoubleNumInput", new KDoubleNumInput(this), column); - createWidget("KRatingWidget", new KRatingWidget(this), column); - createWidget("KKeySequenceWidget", new KKeySequenceWidget(this), column); - createWidget("KShortcutWidget", new KShortcutWidget(this), column); - - // *** Column 2 *** - column = new KVBox(tab); - createWidget("KEditListWidget", new KEditListWidget(this), column); - createWidget("KPlotWidget", new KPlotWidget(this), column); - - tabWidget->addTab(tab, i18n("Input")); -} - -void MainWindow::createDateTimeTab() -{ - KHBox *tab = new KHBox(this); - KVBox *column; - - // *** Column 1 *** - column = new KVBox(tab); - createWidget("KDateComboBox", new KDateComboBox(this), column); - createWidget("KTimeComboBox", new KTimeComboBox(this), column); - createWidget("KDateTable", new KDateTable(this), column); - createWidget("KDatePicker", new KDatePicker(this), column); - createWidget("KDateWidget", new KDateWidget(this), column); - createWidget("KDateTimeWidget", new KDateTimeWidget(this), column); - - // *** Column 2 *** - column = new KVBox(tab); - createWidget("KDateTimeEdit", new KDateTimeEdit(this), column); - createWidget("KTimeZoneWidget", new KTimeZoneWidget(this), column); - - tabWidget->addTab(tab, i18n("Date && Time")); -} - -void MainWindow::createFontTab() -{ - KHBox *tab = new KHBox(this); - KVBox *column; - - // *** Column 1 *** - column = new KVBox(tab); - createWidget("KFontComboBox", new KFontComboBox(this), column); - createWidget("KFontChooser", new KFontChooser(this), column); - - // *** Column 2 *** - column = new KVBox(tab); - createWidget("KCharSelect", new KCharSelect(this,NULL), column); - - tabWidget->addTab(tab, i18n("Font")); -} - -void MainWindow::createColorTab() -{ - KHBox *tab = new KHBox(this); - KVBox *column; - - // *** Column 1 *** - column = new KVBox(tab); - createWidget("KColorButton", new KColorButton(this), column); - createWidget("KColorCombo", new KColorCombo(this), column); - createWidget("KColorPatch", new KColorPatch(this), column); - - // *** Column 2 *** - column = new KVBox(tab); - createWidget("KGradientSelector", new KGradientSelector(this), column); - createWidget("KHueSaturationSelector", new KHueSaturationSelector(this), column); - - tabWidget->addTab(tab, i18n("Color")); -} diff --git a/kdeui/kdeuiwidgets/mainwindow.h b/kdeui/kdeuiwidgets/mainwindow.h deleted file mode 100644 index 8992f93..0000000 --- a/kdeui/kdeuiwidgets/mainwindow.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class KTabWidget; -class KVBox; - -class MainWindow : public KMainWindow -{ - public: - explicit MainWindow(QWidget *parent=0); - - private: - void createWidget(QString name, QWidget *widget, KVBox *parent); - - void createInputTab(); - void createDateTimeTab(); - void createFontTab(); - void createColorTab(); - - KTabWidget *tabWidget; -}; - -#endif // MAINWINDOW_H diff --git a/kdeui/kmessagewidgetdemo/CMakeLists.txt b/kdeui/kmessagewidgetdemo/CMakeLists.txt deleted file mode 100644 index 12ef4ac..0000000 --- a/kdeui/kmessagewidgetdemo/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -project(kmessagewidgetdemo) - -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include(MacroLibrary) -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES}) - -set(SRCS main.cpp window.cpp) - -kde4_add_executable(kmessagewidgetdemo ${SRCS}) -target_link_libraries(kmessagewidgetdemo ${KDE4_KDECORE_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KDEUI_LIBS}) -install(TARGETS kmessagewidgetdemo ${INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES ${SRCS} window.h README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kdeui/kmessagewidgetdemo) diff --git a/kdeui/kmessagewidgetdemo/README b/kdeui/kmessagewidgetdemo/README deleted file mode 100644 index 50ecd6c..0000000 --- a/kdeui/kmessagewidgetdemo/README +++ /dev/null @@ -1,5 +0,0 @@ -A widget to provide feedback or propose opportunistic interactions. - -KMessageWidget can be used to provide inline positive or negative feedback, or to implement opportunistic interactions. - -As a feedback widget, KMessageWidget provides a less intrusive alternative to "OK Only" message boxes. diff --git a/kdeui/kmessagewidgetdemo/main.cpp b/kdeui/kmessagewidgetdemo/main.cpp deleted file mode 100644 index d3a5bf0..0000000 --- a/kdeui/kmessagewidgetdemo/main.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* This file is part of the KDE libraries - * - * Copyright (c) 2011 Aurélien Gâteau - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ -#include "window.h" - -#include -#include -#include - -static KAboutData about( - "KMessageWidgetDemoApplication", - "", - ki18n("KMessageWidgetDemoApplication"), - "1.0", - ki18n("Demonstrates basic KMessageWidget usage."), - KAboutData::License_LGPL, - ki18n("(C) 2011 Aurélien Gâteau") - ); - -int main(int argc, char *argv[]) -{ - KCmdLineArgs::init(argc, argv, &about); - KApplication app; - - Window* window = new Window; - window->show(); - return app.exec(); -} - diff --git a/kdeui/kmessagewidgetdemo/window.cpp b/kdeui/kmessagewidgetdemo/window.cpp deleted file mode 100644 index 9786da6..0000000 --- a/kdeui/kmessagewidgetdemo/window.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/* This file is part of the KDE libraries - * - * Copyright (c) 2011 Aurélien Gâteau - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ -#include - -// KDE -#include -#include -#include -#include -#include -#include - -// Qt -#include -#include -#include -#include -#include -#include -#include - -Window::Window(QWidget *parent) - : KMainWindow(parent) -{ - QWidget* widget = new QWidget; - setCentralWidget(widget); - resize(500, 400); - - m_actions - << new QAction(KIcon("document-save"), i18n("Save"), this) - << new QAction(i18n("Discard"), this) - ; - - QVBoxLayout* mainLayout = new QVBoxLayout(widget); - - // KMessageWidget - m_messageWidget = new KMessageWidget(this); - m_messageWidget->hide(); - mainLayout->addWidget(m_messageWidget); - - // Message buttons - { - QGroupBox* groupBox = new QGroupBox(); - groupBox->setTitle(i18n("Show/hide message widget")); - mainLayout->addWidget(groupBox); - QVBoxLayout* layout = new QVBoxLayout(groupBox); - - createMessageButton(layout, i18n("Error"), SLOT(showErrorMessage())); - createMessageButton(layout, i18n("Warning"), SLOT(showWarningMessage())); - createMessageButton(layout, i18n("Information"), SLOT(showInformationMessage())); - createMessageButton(layout, i18n("Positive"), SLOT(showPositiveMessage())); - } - - // Text - { - QGroupBox* groupBox = new QGroupBox(); - groupBox->setTitle(i18n("Text")); - mainLayout->addWidget(groupBox); - QVBoxLayout* layout = new QVBoxLayout(groupBox); - - m_edit = new KTextEdit; - m_edit->setClickMessage(i18n("Use default text")); - layout->addWidget(m_edit); - } - - // Options - { - QGroupBox* groupBox = new QGroupBox(); - groupBox->setTitle(i18n("Options")); - mainLayout->addWidget(groupBox); - QVBoxLayout* layout = new QVBoxLayout(groupBox); - - QCheckBox* wordwrapCheckBox = new QCheckBox(i18n("Word wrap")); - layout->addWidget(wordwrapCheckBox); - connect(wordwrapCheckBox, SIGNAL(toggled(bool)), m_messageWidget, SLOT(setWordWrap(bool))); - - QCheckBox* showActionsCheckBox = new QCheckBox(i18n("Show action buttons")); - layout->addWidget(showActionsCheckBox); - connect(showActionsCheckBox, SIGNAL(toggled(bool)), SLOT(showActions(bool))); - - QCheckBox* showCloseButtonCheckBox = new QCheckBox(i18n("Show close button")); - showCloseButtonCheckBox->setChecked(true); - layout->addWidget(showCloseButtonCheckBox); - connect(showCloseButtonCheckBox, SIGNAL(toggled(bool)),m_messageWidget, SLOT(setCloseButtonVisible(bool))); - - m_animatedShowCheckBox = new QCheckBox(i18n("Animated")); - m_animatedShowCheckBox->setChecked(true); - layout->addWidget(m_animatedShowCheckBox); - - QLabel* iconLabel = new QLabel("Icon:"); - layout->addWidget(iconLabel); - - m_iconComboBox = new QComboBox; - iconLabel->setBuddy(m_iconComboBox); - QStringList names = QStringList() << QString() << "preferences-system-network" << "document-save" << "system-users"; - Q_FOREACH(const QString &name, names) { - QIcon icon = QIcon::fromTheme(name); - m_iconComboBox->addItem(icon, name.isEmpty() ? "none" : name); - } - connect(m_iconComboBox, SIGNAL(activated(int)), SLOT(setIconFromComboBox(int))); - layout->addWidget(m_iconComboBox); - } - - addAction(KStandardAction::quit(qApp, SLOT(quit()), this)); -} - -void Window::createMessageButton(QLayout* layout, const QString& label, const char* slot) -{ - QPushButton* button = new QPushButton(label); - connect(button, SIGNAL(clicked(bool)), slot); - layout->addWidget(button); -} - -void Window::showErrorMessage() -{ - if (m_messageWidget->isVisible() && m_messageWidget->messageType() == KMessageWidget::Error) { - hideMessage(); - } else { - m_messageWidget->setText(messageText(i18n("Sorry, wrong password"))); - m_messageWidget->setMessageType(KMessageWidget::Error); - showMessage(); - } -} - -void Window::showWarningMessage() -{ - if (m_messageWidget->isVisible() && m_messageWidget->messageType() == KMessageWidget::Warning) { - hideMessage(); - } else { - m_messageWidget->setText(messageText(i18n("You have some unsaved changes"))); - m_messageWidget->setMessageType(KMessageWidget::Warning); - showMessage(); - } -} - -void Window::showInformationMessage() -{ - if (m_messageWidget->isVisible() && m_messageWidget->messageType() == KMessageWidget::Information) { - hideMessage(); - } else { - m_messageWidget->setText(messageText(i18n("The weather is great!"))); - m_messageWidget->setMessageType(KMessageWidget::Information); - showMessage(); - } -} - -void Window::showPositiveMessage() -{ - if (m_messageWidget->isVisible() && m_messageWidget->messageType() == KMessageWidget::Positive) { - hideMessage(); - } else { - m_messageWidget->setText(messageText(i18n("All your files have been backed up"))); - m_messageWidget->setMessageType(KMessageWidget::Positive); - showMessage(); - } -} - -QString Window::messageText(const QString& defaultText) const -{ - QString text = m_edit->toPlainText().trimmed(); - return text.isEmpty() ? defaultText : text; -} - -void Window::showMessage() -{ - if (m_animatedShowCheckBox->isChecked()) { - m_messageWidget->animatedShow(); - } else { - m_messageWidget->show(); - } -} - -void Window::hideMessage() -{ - if (m_animatedShowCheckBox->isChecked()) { - m_messageWidget->animatedHide(); - } else { - m_messageWidget->hide(); - } -} - -void Window::showActions(bool show) -{ - if (show) { - Q_FOREACH(QAction* action, m_actions) { - m_messageWidget->addAction(action); - } - } else { - Q_FOREACH(QAction* action, m_actions) { - m_messageWidget->removeAction(action); - } - } -} - -void Window::setIconFromComboBox(int index) -{ - // KMessageWidget::setIcon() requires KDE >= 4.11 -#if KDE_VERSION >= KDE_MAKE_VERSION(4,10,60) - QIcon icon = m_iconComboBox->itemIcon(index); - m_messageWidget->setIcon(icon); -#endif -} diff --git a/kdeui/kmessagewidgetdemo/window.h b/kdeui/kmessagewidgetdemo/window.h deleted file mode 100644 index d3a67c8..0000000 --- a/kdeui/kmessagewidgetdemo/window.h +++ /dev/null @@ -1,63 +0,0 @@ -/* This file is part of the KDE libraries - * - * Copyright (c) 2011 Aurélien Gâteau - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA - */ -#ifndef WINDOW_H -#define WINDOW_H - -// KDE -#include - -class QCheckBox; -class QComboBox; -class QGroupBox; - -class KMessageWidget; -class KTextEdit; - -class Window : public KMainWindow -{ - Q_OBJECT -public: - explicit Window(QWidget* parent = 0); - -private Q_SLOTS: - void showErrorMessage(); - void showWarningMessage(); - void showInformationMessage(); - void showPositiveMessage(); - - void showActions(bool show); - - void setIconFromComboBox(int index); - -private: - KMessageWidget* m_messageWidget; - QList m_actions; - QCheckBox* m_animatedShowCheckBox; - KTextEdit* m_edit; - QComboBox* m_iconComboBox; - - void createMessageButton(QLayout* layout, const QString& label, const char* slot); - void showMessage(); - void hideMessage(); - - QString messageText(const QString& defaultText) const; -}; - -#endif // WINDOW_H diff --git a/kdeui/kpartbasic/CMakeLists.txt b/kdeui/kpartbasic/CMakeLists.txt deleted file mode 100644 index db2183a..0000000 --- a/kdeui/kpartbasic/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(kpartbasic) - -set(SRCS main.cpp mainwindow.cpp) - -include_directories(${KDE4_INCLUDES}) - -kde4_add_executable(kpartbasic ${SRCS}) -target_link_libraries(kpartbasic ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS}) -install(TARGETS kpartbasic ${INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES ${SRCS} mainwindow.h README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kdeui/kpartbasic) diff --git a/kdeui/kpartbasic/README b/kdeui/kpartbasic/README deleted file mode 100644 index 544389b..0000000 --- a/kdeui/kpartbasic/README +++ /dev/null @@ -1,6 +0,0 @@ -KPart technology is used in KDE to reuse GUI components. The advantage that a KPart presents -is that it comes with predefined toolbar actions. By using kparts in applications developers -can spend less time implementing text editor or command line features, for example and just -use a katepart or a konsolepart instead. - -This example is a simple editor done by loading a KatePart. diff --git a/kdeui/kpartbasic/main.cpp b/kdeui/kpartbasic/main.cpp deleted file mode 100644 index 3d8f520..0000000 --- a/kdeui/kpartbasic/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("kpartbasic", 0, - ki18n("KPart Basic Demo"), "1.0", - ki18n("Very basic example that loads a KatePart."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/kdeui/kpartbasic/mainwindow.cpp b/kdeui/kpartbasic/mainwindow.cpp deleted file mode 100644 index c4b1b5b..0000000 --- a/kdeui/kpartbasic/mainwindow.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mainwindow.h" - -#include -#include -#include -#include -#include -#include - -#include - -MainWindow::MainWindow() - : KParts::MainWindow() -{ - setupActions(); - setMinimumSize(370,200); - - KService::Ptr service = KService::serviceByStorageId("katepart"); - - if (service) - { - m_part = service->createInstance(0); - - if (m_part) - { - setCentralWidget(m_part->widget()); - createGUI(m_part); - setupGUI(QSize(600,475), ToolBar|Keys|StatusBar|Save); - } - } - else - { - KMessageBox::error(this, i18n("katepart.desktop not found")); - kapp->quit(); - } -} - -void MainWindow::load(const KUrl& url) -{ - m_part->openUrl(url); -} - -void MainWindow::load() -{ - load(KFileDialog::getOpenUrl()); -} - -void MainWindow::setupActions() -{ - KStandardAction::open(this, SLOT(load()), actionCollection()); - KStandardAction::quit(kapp, SLOT(closeAllWindows()), actionCollection()); -} diff --git a/kdeui/kpartbasic/mainwindow.h b/kdeui/kpartbasic/mainwindow.h deleted file mode 100644 index 579edea..0000000 --- a/kdeui/kpartbasic/mainwindow.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class MainWindow : public KParts::MainWindow -{ - Q_OBJECT - - public: - MainWindow(); - - public Q_SLOTS: - void load(const KUrl &url); - void load(); - - private: - void setupActions(); - - KParts::ReadWritePart *m_part; -}; - -#endif // MAINWINDOW_H diff --git a/kdeui/kxmlguibasic/CMakeLists.txt b/kdeui/kxmlguibasic/CMakeLists.txt deleted file mode 100644 index 1568974..0000000 --- a/kdeui/kxmlguibasic/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -project(kxmlguibasic) - -set(SRCS main.cpp mainwindow.cpp) - -kde4_add_executable(kxmlguibasic ${SRCS}) -target_link_libraries(kxmlguibasic ${KDE4_KDEUI_LIBS}) -install(TARGETS kxmlguibasic ${INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES ${SRCS} mainwindow.h README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kdeui/kxmlguibasic) diff --git a/kdeui/kxmlguibasic/README b/kdeui/kxmlguibasic/README deleted file mode 100644 index c20e173..0000000 --- a/kdeui/kxmlguibasic/README +++ /dev/null @@ -1,5 +0,0 @@ -KXmlGui provides an easy way of creating a full main window view with menubars, toolbars, -a statusbar and a main area in the centre for a large widget. Most KDE applications will -derive from this class. - -This example defines an application with standard actions. diff --git a/kdeui/kxmlguibasic/main.cpp b/kdeui/kxmlguibasic/main.cpp deleted file mode 100644 index ed29283..0000000 --- a/kdeui/kxmlguibasic/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("kxmlguibasic", 0, - ki18n("KXMLGUI Basic Demo"), "1.0", - ki18n("Basic menu and toolbar example using KXMLGUI."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/kdeui/kxmlguibasic/mainwindow.cpp b/kdeui/kxmlguibasic/mainwindow.cpp deleted file mode 100644 index b4b49b1..0000000 --- a/kdeui/kxmlguibasic/mainwindow.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mainwindow.h" - -#include -#include -#include -#include - -MainWindow::MainWindow(QWidget *parent) - : KXmlGuiWindow(parent) -{ - textArea = new KTextEdit; - textArea->setReadOnly(true); - setCentralWidget(textArea); - - textArea->setText(i18n("This is a simple example showing KXMLGUI with standard actions.\n" - "Notice you can edit and configure the toolbar and your changes will be saved.")); - - setupActions(); -} - -void MainWindow::setupActions() -{ - KStandardAction::openNew(this, SLOT(openNew()), actionCollection()); - KStandardAction::open(this, SLOT(open()), actionCollection()); - KStandardAction::save(this, SLOT(save()), actionCollection()); - KStandardAction::close(this, SLOT(close()), actionCollection()); - - KStandardAction::back(this, SLOT(back()), actionCollection()); - KStandardAction::forward(this, SLOT(forward()), actionCollection()); - - KStandardAction::cut(this, SLOT(cut()), actionCollection()); - KStandardAction::copy(this, SLOT(copy()), actionCollection()); - KStandardAction::paste(this, SLOT(paste()), actionCollection()); - - KStandardAction::quit(kapp, SLOT(quit()), actionCollection()); - - setupGUI(); -} - -void MainWindow::openNew() -{ - textArea->setText(i18n("New signal emitted")); -} - -void MainWindow::open() -{ - textArea->setText(i18n("Open signal emitted")); -} - -void MainWindow::save() -{ - textArea->setText(i18n("Save signal emitted")); -} - -void MainWindow::close() -{ - textArea->setText(i18n("Close signal emitted")); -} - -void MainWindow::back() -{ - textArea->setText(i18n("Back signal emitted")); -} - -void MainWindow::forward() -{ - textArea->setText(i18n("Forward signal emitted")); -} - -void MainWindow::cut() -{ - textArea->setText(i18n("Cut signal emitted")); -} - -void MainWindow::copy() -{ - textArea->setText(i18n("Copy signal emitted")); -} - -void MainWindow::paste() -{ - textArea->setText(i18n("Paste signal emitted")); -} diff --git a/kdeui/kxmlguibasic/mainwindow.h b/kdeui/kxmlguibasic/mainwindow.h deleted file mode 100644 index 28b7928..0000000 --- a/kdeui/kxmlguibasic/mainwindow.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class KTextEdit; - -class MainWindow : public KXmlGuiWindow -{ - Q_OBJECT - - public: - explicit MainWindow(QWidget *parent=0); - - private: - KTextEdit *textArea; - - void setupActions(); - - private Q_SLOTS: - void openNew(); - void open(); - void save(); - void close(); - - void back(); - void forward(); - - void cut(); - void copy(); - void paste(); -}; - -#endif // MAINWINDOW_H diff --git a/kicons/CMakeLists.txt b/kicons/CMakeLists.txt deleted file mode 100644 index 57eceba..0000000 --- a/kicons/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -project(tutorial-kicon) - -find_package(KDE4 REQUIRED) -include_directories(${KDE4_INCLUDES}) - -set(tutorial-source - main.cpp - mainwindow.cpp -) - -kde4_add_executable(tutorial-kicon ${tutorial-source}) - -target_link_libraries(tutorial-kicon ${KDE4_KDEUI_LIBS}) - -install(TARGETS tutorial-kicon DESTINATION ${BIN_INSTALL_DIR}) -install(FILES tutorial-kiconui.rc - DESTINATION ${DATA_INSTALL_DIR}/tutorial-kicon) -kde4_install_icons(${ICON_INSTALL_DIR}) -kde4_update_iconcache() diff --git a/kicons/README b/kicons/README deleted file mode 100644 index 2a54a98..0000000 --- a/kicons/README +++ /dev/null @@ -1 +0,0 @@ -This is an example application for the tutorial at http://techbase.kde.org/Development/Tutorials/Icons diff --git a/kicons/hisc-apps-tutorial-kicon.svgz b/kicons/hisc-apps-tutorial-kicon.svgz deleted file mode 100644 index a3907a5..0000000 Binary files a/kicons/hisc-apps-tutorial-kicon.svgz and /dev/null differ diff --git a/kicons/main.cpp b/kicons/main.cpp deleted file mode 100644 index d0f188f..0000000 --- a/kicons/main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include -#include - -#include "mainwindow.h" - -int main (int argc, char *argv[]) -{ - KAboutData aboutData( "tutorial-kicon", "tutorial-kicon", - ki18n("Tutorial KIcon"), "1.0", - ki18n("A simple text area using KIcons, KAction etc."), - KAboutData::License_GPL, - ki18n("Copyright (c) 2011 Developer") ); - KCmdLineArgs::init( argc, argv, &aboutData ); - KApplication app; - - MainWindow* window = new MainWindow(); - window->show(); - return app.exec(); -} diff --git a/kicons/mainwindow.cpp b/kicons/mainwindow.cpp deleted file mode 100644 index 928c4c2..0000000 --- a/kicons/mainwindow.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "mainwindow.h" - -#include -#include -#include -#include -#include - -MainWindow::MainWindow(QWidget *parent) - : KXmlGuiWindow(parent) -{ - textArea = new KTextEdit; - setCentralWidget(textArea); - - setupActions(); -} - -void MainWindow::setupActions() -{ - KAction* clearAction = new KAction(this); - clearAction->setText(i18n("&Clear")); - clearAction->setIcon(KIcon("tutorial-kicon")); - clearAction->setShortcut(Qt::CTRL + Qt::Key_W); - actionCollection()->addAction("clear", clearAction); - connect(clearAction, SIGNAL(triggered(bool)), - textArea, SLOT(clear())); - - KStandardAction::quit(kapp, SLOT(quit()), - actionCollection()); - - setupGUI(); -} - - diff --git a/kicons/mainwindow.h b/kicons/mainwindow.h deleted file mode 100644 index 91ae79e..0000000 --- a/kicons/mainwindow.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include - -class MainWindow : public KXmlGuiWindow -{ - public: - MainWindow(QWidget *parent=0); - - private: - KTextEdit* textArea; - void setupActions(); - QString testint(); -}; - -#endif diff --git a/kicons/tutorial-kiconui.rc b/kicons/tutorial-kiconui.rc deleted file mode 100644 index 42a8d20..0000000 --- a/kicons/tutorial-kiconui.rc +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - Main Toolbar - - - - diff --git a/kicons/world.svg b/kicons/world.svg deleted file mode 100644 index 3468661..0000000 --- a/kicons/world.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/kidletime/CMakeLists.txt b/kidletime/CMakeLists.txt deleted file mode 100644 index f66a9ad..0000000 --- a/kidletime/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -project(kidletime_example) - -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include_directories(${KDE4_INCLUDES}) - -set(kidletime_example_SRCS main.cpp KIdleTest.cpp) - -kde4_add_executable(kidletime_example ${kidletime_example_SRCS}) -target_link_libraries(kidletime_example ${KDE4_KIDLETIME_LIBS}) - -install(TARGETS kidletime_example ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/kidletime/KIdleTest.cpp b/kidletime/KIdleTest.cpp deleted file mode 100644 index 4c6f452..0000000 --- a/kidletime/KIdleTest.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Dario Freddi * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -#include "KIdleTest.h" -#include - -#include "../kidletime.h" - -KIdleTest::KIdleTest() -{ - connect(KIdleTime::instance(), SIGNAL(resumingFromIdle()), this, SLOT(resumeEvent())); - connect(KIdleTime::instance(), SIGNAL(timeoutReached(int,int)), this, SLOT(timeoutReached(int,int))); - - KIdleTime::instance()->catchNextResumeEvent(); - - printf("Your idle time is %d\n", KIdleTime::instance()->idleTime()); - printf("Welcome!! Move your mouse or do something to start...\n"); -} - -KIdleTest::~KIdleTest() -{ -} - -void KIdleTest::resumeEvent() -{ - KIdleTime::instance()->removeAllIdleTimeouts(); - - printf("Great! Now stay idle for 5 seconds to get a nice message. From 10 seconds on, you can move your mouse to get back here.\n"); - printf("If you will stay idle for too long, I will simulate your activity after 25 seconds, and make everything start back\n"); - - KIdleTime::instance()->addIdleTimeout(5000); - KIdleTime::instance()->addIdleTimeout(10000); - KIdleTime::instance()->addIdleTimeout(25000); -} - -void KIdleTest::timeoutReached(int id, int timeout) -{ - Q_UNUSED(id) - - if (timeout == 5000) { - printf("5 seconds passed, stay still some more...\n"); - } else if (timeout == 10000) { - KIdleTime::instance()->catchNextResumeEvent(); - printf("Cool. You can move your mouse to start over\n"); - } else if (timeout == 25000) { - printf("Uff, you're annoying me. Let's start again. I'm simulating your activity now\n"); - KIdleTime::instance()->simulateUserActivity(); - } else { - qDebug() << "OUCH"; - } -} diff --git a/kidletime/KIdleTest.h b/kidletime/KIdleTest.h deleted file mode 100644 index ef81842..0000000 --- a/kidletime/KIdleTest.h +++ /dev/null @@ -1,38 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Dario Freddi * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -#ifndef KIDLETEST_H -#define KIDLETEST_H - -#include - -class KIdleTest : public QObject -{ - Q_OBJECT - -public: - KIdleTest(); - virtual ~KIdleTest(); - -public Q_SLOTS: - void timeoutReached(int id, int timeout); - void resumeEvent(); -}; - -#endif /* KIDLETEST_H */ diff --git a/kidletime/main.cpp b/kidletime/main.cpp deleted file mode 100644 index 8a60ae8..0000000 --- a/kidletime/main.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Dario Freddi * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -#include -#include -#include -#include "KIdleTest.h" - -int main(int argc, char **argv) -{ - KAboutData *data = new KAboutData("KIdleTest", "KIdleTest", ki18n("KIdleTest"), "1.0", - ki18n("A small application to test KIdleTime functionality"), - KAboutData::License_GPL , ki18n("2009 Dario Freddi")); - data->addAuthor(ki18n("Dario Freddi"), ki18n("Maintainer"), "drf@kde.org", "http://drfav.wordpress.com"); - - KCmdLineArgs::init(argc, argv, data); - KApplication app; - - KIdleTest t; - - return app.exec(); -} diff --git a/kio/CMakeLists.txt b/kio/CMakeLists.txt deleted file mode 100644 index 7b6832c..0000000 --- a/kio/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -project(kio) - -include_directories(${KDE4_INCLUDES}) - -install(FILES README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kio) - -add_subdirectory(simple-ftp-browser) diff --git a/kio/README b/kio/README deleted file mode 100644 index 399eb1b..0000000 --- a/kio/README +++ /dev/null @@ -1,7 +0,0 @@ -KIO (KDE Input/Output) provides access to files, web sites and other resources through a single consistent API. -Applications, such as Konqueror which are written using this framework can operate on files stored on remote servers in exactly the same way as they operate on those stored locally. -This allows for a file browser like Konqueror to be both a highly versatile and powerful file manager as well as a web browser. - -KIO slaves are programs that provide support for individual protocols (e.g. HTTP, FTP, SMB, SSH, FISH, SFTP, SVN, TAR). - -The protocols page in KInfoCenter provides a list of protocols available on the machine. diff --git a/kio/simple-ftp-browser/CMakeLists.txt b/kio/simple-ftp-browser/CMakeLists.txt deleted file mode 100644 index b12d587..0000000 --- a/kio/simple-ftp-browser/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -project(simple-ftp-browser) - -include_directories(${KDE4_INCLUDES}) - -set(SRCS main.cpp browser.cpp) - - -kde4_add_executable(simple-ftp-browser ${SRCS}) -target_link_libraries(simple-ftp-browser ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS}) -install(TARGETS simple-ftp-browser ${INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES ${SRCS} browser.h README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kio/simple-ftp-browser) diff --git a/kio/simple-ftp-browser/README b/kio/simple-ftp-browser/README deleted file mode 100644 index 300b4b6..0000000 --- a/kio/simple-ftp-browser/README +++ /dev/null @@ -1 +0,0 @@ -Simple FTP browser that lists the files and directories in KDE's main FTP server. diff --git a/kio/simple-ftp-browser/browser.cpp b/kio/simple-ftp-browser/browser.cpp deleted file mode 100644 index 72ad4ec..0000000 --- a/kio/simple-ftp-browser/browser.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "browser.h" - -#include - -#include -#include -#include - -Browser::Browser() : QWidget(NULL) -{ - QVBoxLayout *layout = new QVBoxLayout(this); - list_widget = new KListWidget(this); - layout->addWidget(list_widget); - // Create a job that lists the contents of the FTP server - KIO::ListJob *job = KIO::listDir(KUrl("ftp://ftp.kde.org/pub/kde/")); - connect(job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), this, SLOT(showEntries(KIO::Job*,KIO::UDSEntryList))); -} - -void Browser::showEntries(KIO::Job *job, const KIO::UDSEntryList &list) -{ - Q_UNUSED(job); - bool dir; - QString name; - foreach (const KIO::UDSEntry& entry, list) { - // Get the info of every entry - name = entry.stringValue(KIO::UDSEntry::UDS_NAME); - dir = entry.isDir(); - // Add the entry to the list - QListWidgetItem *item = new QListWidgetItem(name, list_widget); - if (dir) - item->setForeground(QBrush(QColor(0, 0, 255))); - list_widget->addItem(item); - } -} diff --git a/kio/simple-ftp-browser/browser.h b/kio/simple-ftp-browser/browser.h deleted file mode 100644 index cfe1182..0000000 --- a/kio/simple-ftp-browser/browser.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef BROWSER_H -#define BROWSER_H - -#include - -#include - -class KListWidget; - -class Browser : public QWidget -{ - Q_OBJECT - -public: - Browser(); - -private Q_SLOTS: - void showEntries(KIO::Job *job, const KIO::UDSEntryList &list); - -private: - KListWidget *list_widget; -}; - -#endif // BROWSER_H diff --git a/kio/simple-ftp-browser/main.cpp b/kio/simple-ftp-browser/main.cpp deleted file mode 100644 index 9dccf0f..0000000 --- a/kio/simple-ftp-browser/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "browser.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("kdeuiwidgets", 0, - ki18n("KDE Widgets Demo"), "1.0", - ki18n("Demo with all the widgets available in KDE."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - Browser mw; - mw.show(); - - app.exec(); -} diff --git a/knewstuff/CMakeLists.txt b/knewstuff/CMakeLists.txt deleted file mode 100644 index ba8cbe1..0000000 --- a/knewstuff/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(updatechecker) - -install(FILES README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/knewstuff) diff --git a/knewstuff/README b/knewstuff/README deleted file mode 100644 index a92c918..0000000 --- a/knewstuff/README +++ /dev/null @@ -1,5 +0,0 @@ -The KNewStuff library adds data sharing capabilities to KDE applications. -Technically, it implements the Get Hot New Stuff (GHNS) and DXS specifications. - -There are standalone applications for Get Hot New Stuff in kdebase/runtime/knewstuff. -These should get you started together with techbase.kde.org where tutorials can be found. diff --git a/knewstuff/updatechecker/CMakeLists.txt b/knewstuff/updatechecker/CMakeLists.txt deleted file mode 100644 index e57ac13..0000000 --- a/knewstuff/updatechecker/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -project(updatechecker) - -include_directories(${KDE4_INCLUDES} ${QT_INCLUDES}) - -set(updatechecker_SRCS updatechecker.cpp main.cpp) - -kde4_add_executable(updatechecker ${updatechecker_SRCS}) -target_link_libraries(updatechecker ${KDE4_KDEUI_LIBS} ${KDE4_KNEWSTUFF3_LIBS}) - -install(TARGETS updatechecker ${INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES ${updatechecker_SRCS} updatechecker.h README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/knewstuff/updatechecker) diff --git a/knewstuff/updatechecker/README b/knewstuff/updatechecker/README deleted file mode 100644 index 2b098fa..0000000 --- a/knewstuff/updatechecker/README +++ /dev/null @@ -1,4 +0,0 @@ -Simple test application to demonstrage how apps can check for updates using Get Hot New Stuff. - -In order to fake an updateable file, change the date of a plasma applet in your config (after installing a plasma applet with KNewStuff). -$HOME/.kde/share/apps/knewstuff3/plasmoids.knsregistry diff --git a/knewstuff/updatechecker/main.cpp b/knewstuff/updatechecker/main.cpp deleted file mode 100644 index 642a2e8..0000000 --- a/knewstuff/updatechecker/main.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright (c) 2010 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#include "updatechecker.h" -#include -#include -#include -#include - -static const char description[] = - I18N_NOOP("A KDE 4 Application"); - -static const char version[] = "0.1"; - -int main(int argc, char **argv) -{ - KAboutData about("updatechecker", 0, ki18n("UpdateChecker"), version, ki18n(description), - KAboutData::License_GPL, ki18n("(C) 2007 Frederik Gladhorn"), KLocalizedString(), 0, "gladhorn@kde.org"); - about.addAuthor( ki18n("Frederik Gladhorn"), KLocalizedString(), "gladhorn@kde.org" ); - KCmdLineArgs::init(argc, argv, &about); - - KCmdLineOptions options; - options.add("+[URL]", ki18n( "Document to open" )); - KCmdLineArgs::addCmdLineOptions(options); - KApplication app; - - UpdateChecker *widget = new UpdateChecker; - - // see if we are starting with session management - if (app.isSessionRestored()) - { - RESTORE(UpdateChecker); - } - else - { - // no session.. just start up normally - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - if (args->count() == 0) - { - //updatechecker *widget = new updatechecker; - widget->show(); - } - else - { - int i = 0; - for (; i < args->count(); i++) - { - //updatechecker *widget = new updatechecker; - widget->show(); - } - } - args->clear(); - } - - return app.exec(); -} diff --git a/knewstuff/updatechecker/updatechecker.cpp b/knewstuff/updatechecker/updatechecker.cpp deleted file mode 100644 index e2653c4..0000000 --- a/knewstuff/updatechecker/updatechecker.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - Copyright (c) 2010 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#include "updatechecker.h" - -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include - -UpdateChecker::UpdateChecker() - : KMainWindow() -{ - setCaption(i18n("Plasma Applet Update Check Example")); - - QWidget* centralWidget = new QWidget(this); - setCentralWidget(centralWidget); - QVBoxLayout* layout = new QVBoxLayout(centralWidget); - - - KPushButton* newestButton = new KPushButton(i18n("Show Newest Plasmoids"), this); - connect(newestButton, SIGNAL(clicked()), this, SLOT(showNewest())); - layout->addWidget(newestButton); - - m_label = new QLabel(i18n("Updates for installed applets:"), this); - layout->addWidget(m_label); - - m_list = new QListWidget(this); - layout->addWidget(m_list); - - KPushButton* updateButton = new KPushButton(i18n("Install"), this); - connect(updateButton, SIGNAL(clicked()), this, SLOT(installUpdate())); - layout->addWidget(updateButton); - - m_downloadManager = new KNS3::DownloadManager("plasmoids.knsrc", this); - connect(m_downloadManager, SIGNAL(searchResult(KNS3::Entry::List)), this, SLOT(updatesFound(KNS3::Entry::List))); - connect(m_downloadManager, SIGNAL(entryStatusChanged(KNS3::Entry)), this, SLOT(entryStatusChanged(KNS3::Entry))); - m_downloadManager->checkForUpdates(); -} - -void UpdateChecker::updatesFound(const KNS3::Entry::List& updates) -{ - m_updates = updates; - foreach (const KNS3::Entry& entry, updates) { - new QListWidgetItem(entry.name(), m_list); - } -} - -void UpdateChecker::installUpdate() -{ - int row = m_list->currentRow(); - if (row >= 0) { - m_downloadManager->installEntry(m_updates.at(row)); - } -} - -void UpdateChecker::entryStatusChanged(const KNS3::Entry& entry) -{ - kDebug() << "Status changed: " << entry.name(); - if (entry.status() == KNS3::Entry::Installed) { - m_label->setText(i18n("Updated/Installed: \"%1\"", entry.name())); - } -} - -void UpdateChecker::showNewest() -{ - m_list->clear(); - m_downloadManager->setSearchOrder(KNS3::DownloadManager::Newest); - m_downloadManager->search(); - m_label->setText(i18n("Newest plasma applets:")); -} - -#include "updatechecker.moc" diff --git a/knewstuff/updatechecker/updatechecker.h b/knewstuff/updatechecker/updatechecker.h deleted file mode 100644 index eacfaf7..0000000 --- a/knewstuff/updatechecker/updatechecker.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (c) 2010 Frederik Gladhorn - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#ifndef UPDATECHECKER_H -#define UPDATECHECKER_H - -#include -#include - -class QLabel; -class QListWidget; - -namespace KNS3 { - class DownloadManager; -} - -/** - * This class serves as the main window for UpdateChecker. It handles the - * menus, toolbars, and status bars. - * - * @short Main window class - * @author Frederik Gladhorn - * @version 0.1 - */ -class UpdateChecker : public KMainWindow -{ - Q_OBJECT -public: - /** - * Default Constructor - */ - UpdateChecker(); - -private Q_SLOTS: - - void updatesFound(const KNS3::Entry::List& updates); - void entryStatusChanged(const KNS3::Entry& entry); - void installUpdate(); - void showNewest(); - -private: - QListWidget* m_list; - QLabel* m_label; - KNS3::DownloadManager* m_downloadManager; - KNS3::Entry::List m_updates; -}; - -#endif diff --git a/kross/CMakeLists.txt b/kross/CMakeLists.txt deleted file mode 100644 index c923338..0000000 --- a/kross/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(krosshello) -add_subdirectory(krosssignalslot) - -install(FILES README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kross) diff --git a/kross/README b/kross/README deleted file mode 100644 index 2ba6a7b..0000000 --- a/kross/README +++ /dev/null @@ -1,3 +0,0 @@ -Kross is a modular scripting framework that provides a complete framework to embed scripting interpreters like Python, Ruby and JavaScript transparently into native applications to bridge the static and dynamic worlds together. - -Scripting interpreters are plugins that are loaded dynamicly on demand at runtime by the Kross framework. The application that uses Kross to provide scripting functionality to the user does not need to know anything about the interpreter itself or any other backend-details. All the application needs to know is, that there exists scripting code that should be executed. Kross will then take care of it. diff --git a/kross/krosshello/CMakeLists.txt b/kross/krosshello/CMakeLists.txt deleted file mode 100644 index cca3ad0..0000000 --- a/kross/krosshello/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -project(krosshello) - -include_directories(${KDE4_INCLUDES}) - -set(krosshello_SRCS main.cpp mainwindow.cpp) -set(SCRIPTS hello.js hello.py hello.rb) - -kde4_add_executable(krosshello ${krosshello_SRCS}) -target_link_libraries(krosshello ${KDE4_KDEUI_LIBS} ${KDE4_KROSSUI_LIBS} ${KDE4_KROSSCORE_LIBS}) -install(TARGETS krosshello ${INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES ${SCRIPTS} DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kross/krosshello) -install(FILES ${krosshello_SRCS} mainwindow.h README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kross/krosshello) diff --git a/kross/krosshello/README b/kross/krosshello/README deleted file mode 100644 index 973022e..0000000 --- a/kross/krosshello/README +++ /dev/null @@ -1,3 +0,0 @@ -In this tutorial a simple dialog is created which contains a drop-down list and a label. -When an interpreter is selected from the list, some scripting code is executed and the -label text is updated in the script. diff --git a/kross/krosshello/hello.js b/kross/krosshello/hello.js deleted file mode 100644 index 5b0b09b..0000000 --- a/kross/krosshello/hello.js +++ /dev/null @@ -1 +0,0 @@ -MyLabel.setText('Hello from javascript!') diff --git a/kross/krosshello/hello.py b/kross/krosshello/hello.py deleted file mode 100644 index 31de744..0000000 --- a/kross/krosshello/hello.py +++ /dev/null @@ -1,3 +0,0 @@ -import MyLabel - -MyLabel.text = 'Hello from python!' diff --git a/kross/krosshello/hello.rb b/kross/krosshello/hello.rb deleted file mode 100644 index 255e2c2..0000000 --- a/kross/krosshello/hello.rb +++ /dev/null @@ -1,3 +0,0 @@ - require 'MyLabel' - MyLabel.text = 'Hello from ruby!' - \ No newline at end of file diff --git a/kross/krosshello/main.cpp b/kross/krosshello/main.cpp deleted file mode 100644 index 4bae159..0000000 --- a/kross/krosshello/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("krossbasic", 0, - ki18n("Kross basic example"), "1.0", - ki18n("This example shows the basic functionality of Kross."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/kross/krosshello/mainwindow.cpp b/kross/krosshello/mainwindow.cpp deleted file mode 100644 index 289b754..0000000 --- a/kross/krosshello/mainwindow.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mainwindow.h" - -#include -#include -#include - -#include - -#include -#include - -MainWindow::MainWindow(QWidget *parent) : KMainWindow(parent) -{ - QWidget *central = new QWidget(this); - // Create the combobox where we display a list of - // available interpreters. - m_interpreters = new QComboBox(central); - m_interpreters->addItem("Interpreters"); - // Now let's add the interpreters. Please note, that all - // interpreters that are installed are displayed in the list. - // Per default JavaScript will be always - // available while Python, Ruby or other interpreters - // may need to be installed. - foreach(QString s, Kross::Manager::self().interpreters()) - m_interpreters->addItem(s); - - // Connect the combobox signal with our slot to be able to - // do something if the active item in the combobox changed. - connect(m_interpreters, SIGNAL(activated(const QString &)), - this, SLOT(interpreterActivated(const QString &))); - - // The label we want to manipulate from within scripting code. - m_text = new QLabel("Select an interpreter", this); - - // Put everything into a layout to have it shown in a nice way. - QVBoxLayout *layout = new QVBoxLayout(central); - layout->addWidget(m_interpreters); - layout->addWidget(m_text); - central->setLayout(layout); - setCentralWidget(central); - - // Now let's create a Kross::Action instance which will act - // as container for our script. - script = new Kross::Action(this, "MyScript"); -} - -// This slot is called when the active item of the combobox changes -void MainWindow::interpreterActivated(const QString &selected_interpreter) -{ - // Now let's set the scripts that should be executed - // depending on the choosen interpreter. - if(selected_interpreter == "python") { - script->setFile(KStandardDirs::locate("data", "kdeexamples/kross/krosshello/hello.py")); - } else if(selected_interpreter == "ruby") { - script->setFile(KStandardDirs::locate("data", "kdeexamples/kross/krosshello/hello.rb")); - } else if(selected_interpreter == "javascript") { - script->setFile(KStandardDirs::locate("data", "kdeexamples/kross/krosshello/hello.js")); - } else { - m_text->setText("No script"); - return; - } - - // Now let's add the QLabel instance to let the scripting code access it. - script->addObject(m_text, "MyLabel"); - - // Finally execute the scripting code. - script->trigger(); -} diff --git a/kross/krosshello/mainwindow.h b/kross/krosshello/mainwindow.h deleted file mode 100644 index 7028e1a..0000000 --- a/kross/krosshello/mainwindow.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class QComboBox; -class QLabel; - -namespace Kross { -class Action; -} - -class MainWindow : public KMainWindow -{ - Q_OBJECT - - public: - MainWindow(QWidget *parent=0); - - private Q_SLOTS: - void interpreterActivated(const QString &selected_interpreter); - - private: - Kross::Action *script; - QLabel *m_text; - QComboBox *m_interpreters; -}; - -#endif diff --git a/kross/krosssignalslot/CMakeLists.txt b/kross/krosssignalslot/CMakeLists.txt deleted file mode 100644 index 8d495e3..0000000 --- a/kross/krosssignalslot/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -project(krosssignalslot) - -include_directories(${KDE4_INCLUDES}) - -set(SRCS main.cpp mainwindow.cpp) -set(SCRIPTS emitsignal.js onclick.js) - -kde4_add_executable(krosssignalslot ${SRCS}) -target_link_libraries(krosssignalslot ${KDE4_KDEUI_LIBS} ${KDE4_KROSSUI_LIBS} ${KDE4_KROSSCORE_LIBS}) -install(TARGETS krosssignalslot ${INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES ${SCRIPTS} DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kross/krosssignalslot) -install(FILES ${SRCS} mainwindow.h README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/kross/krosssignalslot) diff --git a/kross/krosssignalslot/README b/kross/krosssignalslot/README deleted file mode 100644 index 5a78f80..0000000 --- a/kross/krosssignalslot/README +++ /dev/null @@ -1 +0,0 @@ -This tutorial shows how to use a system of signals and slots to provide a scripting interface for a KDE application. diff --git a/kross/krosssignalslot/emitsignal.js b/kross/krosssignalslot/emitsignal.js deleted file mode 100644 index bee0286..0000000 --- a/kross/krosssignalslot/emitsignal.js +++ /dev/null @@ -1,8 +0,0 @@ -function emitSignal() { - if (!Button1.enabled) { - Button1.clicked(); - Button2.setEnabled(false); - } -} - -connect(Button2, "clicked()", this, "emitSignal()"); diff --git a/kross/krosssignalslot/main.cpp b/kross/krosssignalslot/main.cpp deleted file mode 100644 index 8ffc854..0000000 --- a/kross/krosssignalslot/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("krosssignalslot", 0, - ki18n("Kross example using signals and slots"), "1.0", - ki18n("This example shows the basic usage of signals and slots inside Kross."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/kross/krosssignalslot/mainwindow.cpp b/kross/krosssignalslot/mainwindow.cpp deleted file mode 100644 index 7e7bf79..0000000 --- a/kross/krosssignalslot/mainwindow.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mainwindow.h" - -#include -#include - -#include -#include - -#include - -MainWindow::MainWindow(QWidget *parent) : KMainWindow(parent) -{ - QWidget *central = new QWidget(this); - - // Create the widgets - KPushButton *button1 = new KPushButton("Change text on click", this); - KPushButton *button2 = new KPushButton("Emit signal", this); - QLabel *text = new QLabel("Press a button", this); - - // Put everything into a layout to have it shown in a nice way. - QHBoxLayout *h_layout = new QHBoxLayout(this); - QVBoxLayout *v_layout = new QVBoxLayout(this); - h_layout->addWidget(button1); - h_layout->addWidget(button2); - v_layout->addLayout(h_layout); - v_layout->addWidget(text); - central->setLayout(v_layout); - setCentralWidget(central); - - // Now let's load and execute the scripts - Kross::Action *script = new Kross::Action(this, "OnClick"); - script->addObject(button1, "Button"); - script->addObject(text, "Label"); - script->setFile(KStandardDirs::locate("data", "kdeexamples/kross/krosssignalslot/onclick.js")); - script->trigger(); - script = new Kross::Action(this, "EmitSignal"); - script->addObject(button1, "Button1"); - script->addObject(button2, "Button2"); - script->setFile(KStandardDirs::locate("data", "kdeexamples/kross/krosssignalslot/emitsignal.js")); - script->trigger(); -} diff --git a/kross/krosssignalslot/mainwindow.h b/kross/krosssignalslot/mainwindow.h deleted file mode 100644 index cd2dead..0000000 --- a/kross/krosssignalslot/mainwindow.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class MainWindow : public KMainWindow -{ - public: - MainWindow(QWidget *parent=0); -}; - -#endif diff --git a/kross/krosssignalslot/onclick.js b/kross/krosssignalslot/onclick.js deleted file mode 100644 index 926037b..0000000 --- a/kross/krosssignalslot/onclick.js +++ /dev/null @@ -1,10 +0,0 @@ -function changeText() { - if (Button.enabled) { - Label.setText('Script is connected to this button'); - } else { - Label.setText('Button is disabled, this must have been a script!'); - } - Button.setEnabled(false); -} - -connect(Button, "clicked()", this, "changeText()"); diff --git a/kwin/scripts/README b/kwin/scripts/README deleted file mode 100644 index 3f850e8..0000000 --- a/kwin/scripts/README +++ /dev/null @@ -1,35 +0,0 @@ -*keepAboveRestored* - -See http://techbase.kde.org/Development/Tutorials/KWin/Scripting for more information on this script. - -*kopete.kwinscript* - -What is it? -KDE Window Manager, KWin, supports scripting now. It means that you can write -special rules in order to do something you want with windows when an event occurs. -For example, when a new Kopete window opens, this script adds it to the same group as -the previous opened one. - - -How do I install it? -At first, make sure that your KWin installation supports scripting. Then, copy this -script to $HOME/.kde/local/apps/kwin/scripts/ (on some systems it will be ".kde4") and make executable (chmod a+x kopete.kwinscript). Then you should set environment variable KWINSCRIPTS to that folder. Assuming, you are using Bourne-Again Shell, execute: - -echo "export KWINSCRIPTS=$HOME/.kde/local/apps/kwin/scripts/" >> $HOME/.bashrc -source $HOME/.bashrc - -And then restart KWin with "kwin --replace &" command. - - -Script idea -We define two variables at lines 18 and 19: first one (kopeteGroupCount) is used to -count Kopete windows that are present in the group; second one defines the window group itself. Variable c (line 22) stores all windows (possibly including Kopete' ones). Then -(line 24) we loop over it to find those which window class is equal to "Kopete" (line 27). If it's so, we check, if there are any windows in group (line 28). -If there is no, we create a new group and add Kopete's window to it (lines 28-29). If there are some windows in the group, we add the window to the same group (lines 30-31). Then we increase the windows' counter (line 33). -There are also two events: adding a new window and removing an existent one. Adding (lines 39-49) window event's response is implemented in the same way as the first initialization. On Kopete's window removing (lines 52-57), we just decrease the counter (line 55). - - -Where can I get more information on scripting? -You can study the API here(http://rohanprabhu.com/files/kwsapi.html) or -have a look at tutorial (http://rohanprabhu.com/?p=116). Of course, you -can also take a look at kwin's sources ("scripting" dir). diff --git a/kwin/scripts/blockcompositingfullscreen/contents/code/main.js b/kwin/scripts/blockcompositingfullscreen/contents/code/main.js deleted file mode 100644 index 29b4f1e..0000000 --- a/kwin/scripts/blockcompositingfullscreen/contents/code/main.js +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2012 Martin Gräßlin - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ -var blockCompositingFullscreen = function (client, fullscreen) { - if (fullscreen) { - client.blocksCompositing = true; - } else { - client.blocksCompositing = false; - } -}; -workspace.clientFullScreenSet.connect(blockCompositingFullscreen); diff --git a/kwin/scripts/blockcompositingfullscreen/metadata.desktop b/kwin/scripts/blockcompositingfullscreen/metadata.desktop deleted file mode 100644 index 2af9755..0000000 --- a/kwin/scripts/blockcompositingfullscreen/metadata.desktop +++ /dev/null @@ -1,17 +0,0 @@ -[Desktop Entry] -Name=Blocks Compositing for Fullscreen Windows -Comment=If a window switches to fullscreen Compositing is blocked till there are no windows which block compositing, that is all windows are not fullscreen. -Icon=preferences-system-windows-script-blockcompositingfullscreen - -X-Plasma-API=javascript -X-Plasma-MainScript=code/main.js - -X-KDE-PluginInfo-Author=Martin Gräßlin -X-KDE-PluginInfo-Email=mgraesslin@kde.org -X-KDE-PluginInfo-Name=blockcompositingfullscreen -X-KDE-PluginInfo-Version=1.0 - -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-ServiceTypes=KWin/Script -Type=Service diff --git a/kwin/scripts/demandsattentioncurrentdesktop/contents/code/main.js b/kwin/scripts/demandsattentioncurrentdesktop/contents/code/main.js deleted file mode 100644 index 12b7a59..0000000 --- a/kwin/scripts/demandsattentioncurrentdesktop/contents/code/main.js +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2012 Martin Gräßlin - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ - -var demandsAttention = new Array(); - -var containsClient = function(client) { - for (var i=0; i -* Copyright (c) 2012 Martin Gräßlin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by -* the Free Software Foundation; either version 2.1 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public License -* along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . -*/ - -var keepAboveMaximized = new Array(); - -function manageKeepAbove(client, h, v) { - if (h && v) { - // maximized - if (client.keepAbove) { - keepAboveMaximized[keepAboveMaximized.length] = client; - client.keepAbove = false; - } - } else { - // no longer maximized - var found = keepAboveMaximized.indexOf(client); - if (found != -1) { - client.keepAbove = true; - keepAboveMaximized.splice(found, 1); - } - } -} - -workspace.clientMaximizeSet.connect(manageKeepAbove); diff --git a/kwin/scripts/keepaboverestored/metadata.desktop b/kwin/scripts/keepaboverestored/metadata.desktop deleted file mode 100644 index 0f05f85..0000000 --- a/kwin/scripts/keepaboverestored/metadata.desktop +++ /dev/null @@ -1,17 +0,0 @@ -[Desktop Entry] -Name=Keep Above Restored -Comment=Keep Above only for restored windows, maximized windows are not kept above -Icon=preferences-system-windows-script-keepaboverestored - -X-Plasma-API=javascript -X-Plasma-MainScript=code/main.js - -X-KDE-PluginInfo-Author=Martin Gräßlin -X-KDE-PluginInfo-Email=mgraesslin@kde.org -X-KDE-PluginInfo-Name=keepaboverestored -X-KDE-PluginInfo-Version=1.0 - -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-ServiceTypes=KWin/Script -Type=Service diff --git a/kwin/scripts/kopete.kwinscript b/kwin/scripts/kopete.kwinscript deleted file mode 100755 index b8c6a35..0000000 --- a/kwin/scripts/kopete.kwinscript +++ /dev/null @@ -1,61 +0,0 @@ -/* - -An example script for KWin: grouping Kopete windows -Copyright (C) 2011 Max Vorob'jov - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -*/ - - -var kopeteGroupCount = 0; /* counting windows present in group */ -var windowGroup; /* kopete windows' group */ - - -var c = workspace.getAllClients(); - -for (var i = 0; i < c.length; i++) { - var z = c[i].getWindowInfo(); - - if (z.windowClassClass == "Kopete") { - if (0 == kopeteGroupCount) { - windowGroup = new ClientGroup(c[i]); - } else { - windowGroup.add(c[i]); - } - kopeteGroupCount++; - } -} - - -/* on client adding */ -workspace.clientAdded.connect (function(client) { - var z = client.getWindowInfo(); - if (z.windowClassClass == "Kopete") { - if ( 0 == kopeteGroupCount) { - windowGroup = new ClientGroup(client); - } else { - windowGroup.add(client); - } - kopeteGroupCount++; - } -}) - -/* on client removal */ -workspace.clientRemoved.connect (function(client) { - var z = client.getWindowInfo(); - if (z.windowClassClass == "Kopete") { - kopeteGroupCount--; - } -}) diff --git a/nepomuk/CMakeLists.txt b/nepomuk/CMakeLists.txt deleted file mode 100644 index 5a3e00f..0000000 --- a/nepomuk/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -find_package(NepomukCore REQUIRED) -find_package(Soprano REQUIRED) - -install(FILES README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/nepomuk) - -add_subdirectory(metadata) -add_subdirectory(ontology) -add_subdirectory(query) -add_subdirectory(service) -add_subdirectory(test) diff --git a/nepomuk/README b/nepomuk/README deleted file mode 100644 index 9e9b2ff..0000000 --- a/nepomuk/README +++ /dev/null @@ -1,3 +0,0 @@ -The Social Semantic Desktop at it's most basic level consists in relating machine readable metadata to files. - -Nepomuk is the technology that brings this behavior and much more, to the KDE Desktop. diff --git a/nepomuk/metadata/CMakeLists.txt b/nepomuk/metadata/CMakeLists.txt deleted file mode 100644 index 08055ea..0000000 --- a/nepomuk/metadata/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(metadatademo) - -set(SRCS main.cpp mainwindow.cpp) - -include_directories(${KDE4_INCLUDES} ${QT_INCLUDES} ${SOPRANO_INCLUDE_DIR} ${NEPOMUK_CORE_INCLUDE_DIR}) -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) - -kde4_add_executable(metadatademo ${SRCS}) -target_link_libraries(metadatademo ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${NEPOMUK_CORE_LIBRARY}) -install(TARGETS metadatademo ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/nepomuk/metadata/main.cpp b/nepomuk/metadata/main.cpp deleted file mode 100644 index 1431822..0000000 --- a/nepomuk/metadata/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("metadatademo", 0, - ki18n("Basic Metadata Demo"), "1.0", - ki18n("This application shows the metadata from a file an allows you to add tags to it."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/nepomuk/metadata/mainwindow.cpp b/nepomuk/metadata/mainwindow.cpp deleted file mode 100644 index 70f1c7e..0000000 --- a/nepomuk/metadata/mainwindow.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mainwindow.h" - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -MainWindow::MainWindow(QWidget *parent) - : KMainWindow(parent) -{ - QWidget *central_widget = new QWidget(this); - QVBoxLayout *central_layout = new QVBoxLayout(central_widget); - - QHBoxLayout *h_layout = new QHBoxLayout(central_widget); - - QVBoxLayout *layout = new QVBoxLayout(central_widget); - file = new KLineEdit(central_widget); - file->setText(i18n("No file selected")); - file->setEnabled(false); - tag = new KLineEdit(central_widget); - layout->addWidget(file); - layout->addWidget(tag); - h_layout->addLayout(layout); - - layout = new QVBoxLayout(central_widget); - KPushButton *button = new KPushButton(i18n("Choose File"), central_widget); - connect(button, SIGNAL(clicked()), this, SLOT(chooseFile())); - layout->addWidget(button); - button = new KPushButton(i18n("Add Tag"), central_widget); - connect(button, SIGNAL(clicked()), this, SLOT(addTag())); - layout->addWidget(button); - h_layout->addLayout(layout); - - central_layout->addLayout(h_layout); - - data = new KTextBrowser(central_widget); - central_layout->addWidget(data); - - central_widget->setLayout(central_layout); - setCentralWidget(central_widget); - - setMinimumSize(500,300); - - if (Nepomuk2::ResourceManager::instance()->init()) - button->setEnabled(false); -} - -void MainWindow::chooseFile() -{ - QString file_name = KFileDialog::getOpenFileName(); - if (!file_name.isEmpty()) - { - file->setText(file_name); - retrieveMetadata(); - } - else - { - file->setText(i18n("No file selected")); - data->setText(""); - } -} - -void MainWindow::retrieveMetadata() -{ - QString data_text; - Nepomuk2::Resource res(file->text()); - QHash properties = res.properties(); - - QUrl key; - foreach (key, properties.keys()) - { - Nepomuk2::Types::Class property_type(key); - data_text += "" + property_type.label() + ": "; - data_text += properties[key].toString() + "
"; - } - - data->setText(data_text); -} - -void MainWindow::addTag() -{ - Nepomuk2::Tag new_tag(tag->text()); - Nepomuk2::Resource res(file->text()); - res.addTag(new_tag); - retrieveMetadata(); -} diff --git a/nepomuk/metadata/mainwindow.h b/nepomuk/metadata/mainwindow.h deleted file mode 100644 index 39581db..0000000 --- a/nepomuk/metadata/mainwindow.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class KLineEdit; -class KTextBrowser; - -class MainWindow : public KMainWindow -{ - Q_OBJECT - - public: - MainWindow(QWidget *parent = 0); - - private Q_SLOTS: - void chooseFile(); - void addTag(); - - private: - void retrieveMetadata(); - - KLineEdit *file, *tag; - KTextBrowser *data; -}; - -#endif // MAINWINDOW_H diff --git a/nepomuk/ontology/CMakeLists.txt b/nepomuk/ontology/CMakeLists.txt deleted file mode 100644 index 5453597..0000000 --- a/nepomuk/ontology/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# required by cmake -cmake_minimum_required(VERSION 2.6) - -project(template-ontology) - -macro(INSTALL_ONTOLOGY _name _group) - set(ONTO_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/ontology/${_group}) - configure_file("${_name}.ontology.in" "${CMAKE_CURRENT_BINARY_DIR}/${_name}.ontology") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${_name}.ontology" DESTINATION ${ONTO_INSTALL_DIR}) - install(FILES "${_name}.trig" DESTINATION ${ONTO_INSTALL_DIR}) -endmacro(INSTALL_ONTOLOGY) - - -# Install the "template" Ontology in the "nepomuk" group -install_ontology(template nepomuk) - diff --git a/nepomuk/ontology/template.ontology.in b/nepomuk/ontology/template.ontology.in deleted file mode 100644 index 832ddf3..0000000 --- a/nepomuk/ontology/template.ontology.in +++ /dev/null @@ -1,8 +0,0 @@ -[Ontology] -Version=1.0 -Name=Nepomuk Template Ontology -Comment=This is just a template -Namespace=http://www.nepomuk.kde.org/ontologies/2010/06/16/template# -Path=${ONTO_INSTALL_DIR}/template.trig -MimeType=application/x-trig -Type=Data diff --git a/nepomuk/ontology/template.trig b/nepomuk/ontology/template.trig deleted file mode 100644 index 7663e8d..0000000 --- a/nepomuk/ontology/template.trig +++ /dev/null @@ -1,40 +0,0 @@ -@prefix nao: . -@prefix nfo: . -@prefix nie: . -@prefix ncal: . -@prefix nco: . -@prefix rdfs: . -@prefix pimo: . -@prefix nmo: . -@prefix nmm: . -@prefix nrl: . -@prefix rdf: . -@prefix xsd: . - -@prefix temp: . - -temp: { - temp:randomProperty - a rdf:Property ; - rdfs:comment "A random property shown for the sake of an example" ; - rdfs:label "randomProperty" . -} - - { - - temp: a nrl:Ontology ; - nao:creator ; - nao:hasDefaultNamespace - "http://www.nepomuk.kde.org/ontologies/2010/06/16/template#" ; - nao:hasDefaultNamespaceAbbreviation - "temp" ; - nao:lastModified "2011-02-16T11:45:58Z" ; - nao:status "Unstable" ; - nao:updatable "0 " ; - nao:version "Revision-1" . - - - a nrl:GraphMetadata ; - nrl:coreGraphMetadataFor - temp: . -} diff --git a/nepomuk/query/CMakeLists.txt b/nepomuk/query/CMakeLists.txt deleted file mode 100644 index 483e106..0000000 --- a/nepomuk/query/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(nepomukquerydemo) - -set(SRCS main.cpp mainwindow.cpp) - -include_directories(${KDE4_INCLUDES} ${QT_INCLUDES} ${SOPRANO_INCLUDE_DIR} ${NEPOMUK_CORE_INCLUDE_DIR}) -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) - -kde4_add_executable(nepomukquerydemo ${SRCS}) -target_link_libraries(nepomukquerydemo ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${NEPOMUK_CORE_LIBRARY}) -install(TARGETS nepomukquerydemo ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/nepomuk/query/main.cpp b/nepomuk/query/main.cpp deleted file mode 100644 index 8c8e47f..0000000 --- a/nepomuk/query/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("nepomukquerydemo", 0, - ki18n("Nepomuk Query Demo"), "1.0", - ki18n("This application shows how to build Nepomuk queries."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/nepomuk/query/mainwindow.cpp b/nepomuk/query/mainwindow.cpp deleted file mode 100644 index 20eff02..0000000 --- a/nepomuk/query/mainwindow.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mainwindow.h" - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -MainWindow::MainWindow(QWidget *parent) - : KMainWindow(parent) -{ - QWidget *central_widget = new QWidget(this); - QVBoxLayout *central_layout = new QVBoxLayout(this); - - QHBoxLayout *h_layout = new QHBoxLayout(this); - - QVBoxLayout *v_layout = new QVBoxLayout(this); - QHBoxLayout *layout = new QHBoxLayout(this); - layout->addWidget(new QLabel(i18n("tag:"), this)); - layout->addWidget(tag = new KLineEdit(this)); - v_layout->addLayout(layout); - - layout = new QHBoxLayout(this); - layout->addWidget(new QLabel(i18n("text:"), this)); - layout->addWidget(text = new KTextEdit(this)); - text->setMaximumHeight(100); - v_layout->addLayout(layout); - h_layout->addLayout(v_layout); - - KPushButton *button = new KPushButton(i18n("Search"), this); - connect(button, SIGNAL(clicked()), this, SLOT(query())); - h_layout->addWidget(button); - - central_layout->addLayout(h_layout); - central_layout->addWidget(new QLabel(i18n("Result:"), this)); - central_layout->addWidget(result = new KTextBrowser(this)); - central_layout->addWidget(new QLabel(i18n("Url:"), this)); - central_layout->addWidget(url = new KTextBrowser(this)); - - central_widget->setLayout(central_layout); - setCentralWidget(central_widget); - - setMinimumSize(650,485); - - if (Nepomuk2::ResourceManager::instance()->init()) - button->setEnabled(false); -} - -void MainWindow::query() -{ - if (tag->text().isEmpty() && text->toPlainText().isEmpty()) - return; - - static Soprano::Model *model = Nepomuk2::ResourceManager::instance()->mainModel(); - - Nepomuk2::Query::ComparisonTerm tag_term; - Nepomuk2::Query::LiteralTerm text_term; - if (!tag->text().isEmpty()) - tag_term = Nepomuk2::Query::ComparisonTerm(Soprano::Vocabulary::NAO::hasTag(), Nepomuk2::Query::LiteralTerm(tag->text())); - if (!text->toPlainText().isEmpty()) - text_term = Nepomuk2::Query::LiteralTerm(text->toPlainText()); - - Nepomuk2::Query::Query query(Nepomuk2::Query::AndTerm(tag_term, text_term)); - url->setText(query.toSearchUrl().url()); - - Soprano::QueryResultIterator it = model->executeQuery(query.toSparqlQuery(), Soprano::Query::QueryLanguageSparql); - QString text_result; - while(it.next()) - { - for (int i=0; i< it.bindingCount(); ++i) - { - text_result += it.binding(i).toString(); - text_result += "
"; - } - } - - result->setText(text_result); -} diff --git a/nepomuk/query/mainwindow.h b/nepomuk/query/mainwindow.h deleted file mode 100644 index f179278..0000000 --- a/nepomuk/query/mainwindow.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class KLineEdit; -class KTextBrowser; -class KTextEdit; - -class MainWindow : public KMainWindow -{ - Q_OBJECT - - public: - MainWindow(QWidget *parent = 0); - - private Q_SLOTS: - void query(); - - private: - KLineEdit *tag; - KTextEdit *text; - KTextBrowser *result, *url; -}; - -#endif // MAINWINDOW_H diff --git a/nepomuk/service/CMakeLists.txt b/nepomuk/service/CMakeLists.txt deleted file mode 100644 index 20944f5..0000000 --- a/nepomuk/service/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -project(nepomukexampleservice) - -include_directories( - ${QT_INCLUDES} - ${KDE4_INCLUDES} - ${SOPRANO_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR} - ${SOPRANO_INCLUDE_DIR} - ${NEPOMUK_CORE_INCLUDE_DIR} - ) - -set( SRCS - exampleservice.cpp -) - -kde4_add_plugin(nepomukexampleservice ${SRCS}) - -target_link_libraries(nepomukexampleservice - ${KDE4_KDEUI_LIBS} - ${KDE4_KIO_LIBS} - ${NEPOMUK_CORE_LIBRARY} - ${SOPRANO_LIBRARIES} - ) - -install( - FILES nepomukexampleservice.desktop - DESTINATION ${SERVICES_INSTALL_DIR}) - -install( - TARGETS nepomukexampleservice - DESTINATION ${PLUGIN_INSTALL_DIR}) -# ----------------------------- diff --git a/nepomuk/service/exampleservice.cpp b/nepomuk/service/exampleservice.cpp deleted file mode 100644 index bac1a4c..0000000 --- a/nepomuk/service/exampleservice.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - - Copyright (C) 2011 Vishesh Handa - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -*/ - -#include "exampleservice.h" - -#include - -Nepomuk2::ExampleService::ExampleService( QObject* parent, const QList< QVariant >& ) - : Service(parent) -{ - kDebug(); -} - -Nepomuk2::ExampleService::~ExampleService() -{ -} - -void Nepomuk2::ExampleService::test() -{ - kDebug(); -} - -#include -#include - -NEPOMUK_EXPORT_SERVICE( Nepomuk2::ExampleService, "nepomukexampleservice" ) - -#include "exampleservice.moc" diff --git a/nepomuk/service/exampleservice.h b/nepomuk/service/exampleservice.h deleted file mode 100644 index 9862cad..0000000 --- a/nepomuk/service/exampleservice.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - - Copyright (C) 2011 Vishesh Handa - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -*/ - -#ifndef NEPOMUKEXAMPLESERVICE_H -#define NEPOMUKEXAMPLESERVICE_H - -#include - -namespace Nepomuk2 { - - class ExampleService : public Service - { - Q_OBJECT - public: - ExampleService( QObject * parent = 0, const QList& args = QList() ); - ~ExampleService(); - - public Q_SLOTS: - Q_SCRIPTABLE void test(); - }; - -} - -#endif // NEPOMUKEXAMPLESERVICE_H diff --git a/nepomuk/service/nepomukexampleservice.desktop b/nepomuk/service/nepomukexampleservice.desktop deleted file mode 100644 index 8e2252f..0000000 --- a/nepomuk/service/nepomukexampleservice.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Type=Service -X-KDE-ServiceTypes=NepomukService -X-KDE-Library=nepomukexampleservice -X-KDE-Nepomuk-autostart=false -X-KDE-Nepomuk-start-on-demand=false -X-KDE-Nepomuk-dependencies=nepomukstorage -Name=Nepomuk Example Service -Comment=Nepomuk Service which serves as an example. \ No newline at end of file diff --git a/nepomuk/test/CMakeLists.txt b/nepomuk/test/CMakeLists.txt deleted file mode 100644 index a40f80d..0000000 --- a/nepomuk/test/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -project(nepomuk-test) - -#find_package(KDE4 REQUIRED) -#find_package(NepomukCore REQUIRED) -#find_package(Soprano) -#find_package(SharedDesktopOntologies) - -#include(SopranoAddOntology) -include(KDE4Defaults) - -include_directories( - ${QT_INCLUDES} - ${KDE4_INCLUDES} - ${SOPRANO_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR} - ${SOPRANO_INCLUDE_DIR} - ${NEPOMUK_CORE_INCLUDE_DIR} - ) - -set( SRCS - main.cpp -) - -#nepomuk2_add_ontology_classes (SRCS -# ONTOLOGIES -# ${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nie.trig -# ${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nco.trig -# ${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/pimo/pimo.trig -# # ${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nfo.trig -# # ${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nmo.trig -#) - -kde4_add_executable(nepomuk-test ${SRCS}) - -target_link_libraries( nepomuk-test - ${KDE4_KDEUI_LIBS} - ${KDE4_KIO_LIBS} - ${NEPOMUK_CORE_LIBRARY} - ${SOPRANO_LIBRARIES} - ) - -install(TARGETS nepomuk-test - DESTINATION ${BIN_INSTALL_DIR}) diff --git a/nepomuk/test/main.cpp b/nepomuk/test/main.cpp deleted file mode 100644 index ea02b25..0000000 --- a/nepomuk/test/main.cpp +++ /dev/null @@ -1,76 +0,0 @@ -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -// Vocabularies -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - -using namespace Soprano::Vocabulary; -using namespace Nepomuk2::Vocabulary; - -class TestObject : public QObject { - Q_OBJECT - -public Q_SLOTS: - void main(); -public: - TestObject() { - QTimer::singleShot( 0, this, SLOT(main()) ); - //QTimer::singleShot( 5000, QCoreApplication::instance(), SLOT(quit()) ); - } - - virtual ~TestObject() { - } -}; - -int main( int argc, char ** argv ) { - KComponentData component( QByteArray("nepomuk-test") ); - QCoreApplication app( argc, argv ); - - TestObject a; - app.exec(); -} - -void TestObject::main() -{ - // Code goes here -} - - -#include "main.moc" diff --git a/phonon/CMakeLists.txt b/phonon/CMakeLists.txt deleted file mode 100644 index f88b765..0000000 --- a/phonon/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ - -include(MacroLibrary) - -install(FILES README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/phonon) - -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include_directories(${KDE4_INCLUDES}) - -find_package(Phonon REQUIRED) -include_directories(${PHONON_INCLUDES} ${QT_INCLUDES}) - -macro(PHONON_DECLARE_EXAMPLES) - foreach(_examplename ${ARGN}) - set(_SRCS ${_examplename}.cpp) - automoc4_add_executable(${_examplename} ${_SRCS}) - target_link_libraries(${_examplename} ${PHONON_LIBS} ${QT_QTXML_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}) - endforeach(_examplename) -endmacro(PHONON_DECLARE_EXAMPLES) - -phonon_declare_examples( - #videoplayer - #crossfade - #videoplayandforget - #pcmoutput - #videoplayback - ) - -add_subdirectory(basicaudioplayer) -add_subdirectory(outputselectordemo) diff --git a/phonon/README b/phonon/README deleted file mode 100644 index 85b466b..0000000 --- a/phonon/README +++ /dev/null @@ -1 +0,0 @@ -Phonon is a multimedia, multi-platform sound framework for the application developer. Phonon also provides several features and benefits for the end user. diff --git a/phonon/basicaudioplayer/CMakeLists.txt b/phonon/basicaudioplayer/CMakeLists.txt deleted file mode 100644 index b8aba06..0000000 --- a/phonon/basicaudioplayer/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set(SRCS main.cpp mainwindow.cpp) - -kde4_add_executable(basicaudioplayer ${SRCS}) -target_link_libraries(basicaudioplayer ${PHONON_LIBS} ${KDE4_KIO_LIBS}) -install(TARGETS basicaudioplayer ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/phonon/basicaudioplayer/main.cpp b/phonon/basicaudioplayer/main.cpp deleted file mode 100644 index 16a1d1d..0000000 --- a/phonon/basicaudioplayer/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("basicaudioplayer", 0, - ki18n("Basic Audio Player"), "1.0", - ki18n("A basic audio player using Phonon."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/phonon/basicaudioplayer/mainwindow.cpp b/phonon/basicaudioplayer/mainwindow.cpp deleted file mode 100644 index acb82f1..0000000 --- a/phonon/basicaudioplayer/mainwindow.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mainwindow.h" - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -MainWindow::MainWindow(QWidget *parent) - : KMainWindow(parent) -{ - // Create the widgets - - // File selector - file_name = new KLineEdit("Open an audio file", this); - file_button = new KPushButton("Open", this); - file_name->setEnabled(false); - connect(file_button, SIGNAL(clicked()), this, SLOT(openFile())); - - // Audio control - Phonon::SeekSlider *seek = new Phonon::SeekSlider(this); - KPushButton *play_button = new KPushButton("Play", this); - KPushButton *stop_button = new KPushButton("Stop", this); - Phonon::VolumeSlider *volume = new Phonon::VolumeSlider(this); - volume->setOrientation(Qt::Vertical); - - // Define the layout - QHBoxLayout *file_layout = new QHBoxLayout(this); - file_layout->addWidget(file_name); - file_layout->addWidget(file_button); - QHBoxLayout *button_layout = new QHBoxLayout(this); - button_layout->addWidget(play_button); - button_layout->addWidget(stop_button); - QVBoxLayout *left_layout = new QVBoxLayout(this); - left_layout->addWidget(seek); - left_layout->addLayout(button_layout); - QHBoxLayout *audio_layout = new QHBoxLayout(this); - audio_layout->addLayout(left_layout); - audio_layout->addWidget(volume); - - QWidget *central_widget = new QWidget(this); - QVBoxLayout *central_layout = new QVBoxLayout(this); - central_layout->addLayout(file_layout); - central_layout->addLayout(audio_layout); - central_widget->setLayout(central_layout); - setCentralWidget(central_widget); - - // Create the media and define the output - media = new Phonon::MediaObject(this); - Phonon::AudioOutput *output = new Phonon::AudioOutput(Phonon::MusicCategory, this); - Phonon::createPath(media, output); - - // Connect the widgets to the audio - seek->setMediaObject(media); - volume->setAudioOutput(output); - connect(play_button, SIGNAL(clicked()), media, SLOT(play())); - connect(stop_button, SIGNAL(clicked()), media, SLOT(stop())); -} - -void MainWindow::openFile() -{ - QString file = KFileDialog::getOpenFileName(); - file_name->setText(file); - media->setCurrentSource(file); - media->play(); -} diff --git a/phonon/basicaudioplayer/mainwindow.h b/phonon/basicaudioplayer/mainwindow.h deleted file mode 100644 index dd78af2..0000000 --- a/phonon/basicaudioplayer/mainwindow.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class KLineEdit; -class KPushButton; - -namespace Phonon { -class MediaObject; -} - -class MainWindow : public KMainWindow -{ - Q_OBJECT - - public: - MainWindow(QWidget *parent=0); - - private Q_SLOTS: - void openFile(); - - private: - Phonon::MediaObject *media; - - KLineEdit *file_name; - KPushButton *file_button; -}; - -#endif // MAINWINDOW_H diff --git a/phonon/crossfade.cpp b/phonon/crossfade.cpp deleted file mode 100644 index 0b1c4a5..0000000 --- a/phonon/crossfade.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2006 Matthias Kretz - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), Nokia Corporation - (or its successors, if any) and the KDE Free Qt Foundation, which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#include "crossfade.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -Crossfader::Crossfader(const KUrl &url1, const KUrl &url2, QObject *parent) - : QObject(parent) - , media(new MediaQueue(this)) - , path(new AudioPath(this)) - , output(new AudioOutput(Phonon::MusicCategory, this)) -{ - media->addAudioPath(path); - path->addOutput(output); - media->setUrl(url1); - media->setNextUrl(url2); - connect(media, SIGNAL(finished()), SLOT(finished())); - SeekSlider *slider = new SeekSlider(); - slider->setMediaProducer(media); - slider->resize(1000, 50); - slider->show(); - media->play(); - media->seek(media->totalTime() * 97 / 100); - //QTimer::singleShot(0, media, SLOT(play())); -} - -void Crossfader::finished() -{ - static int count = 0; - ++count; - if (count == 2) - { - qApp->quit(); - } -} - -int main(int argc, char ** argv) -{ - KCmdLineOptions options; - options.add("+URL1", ki18n("The first URL to play")); - options.add("+URL2", ki18n("The second URL to play")); - - KAboutData about("crossfade", 0, ki18n("Phonon Crossfade Example"), - "1.0", KLocalizedString(), - KAboutData::License_LGPL); - about.addAuthor(ki18n("Matthias Kretz"), KLocalizedString(), "kretz@kde.org"); - KCmdLineArgs::init(argc, argv, &about); - KCmdLineArgs::addCmdLineOptions(options); - KApplication app; - KUrl url1; - KUrl url2; - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - if (args->count() == 2) - { - url1 = args->url(0); - url2 = args->url(1); - if (url1.isValid() && url2.isValid()) - { - Crossfader xfader(url1, url2); - return app.exec(); - } - } - return 1; -} - -#include "crossfade.moc" diff --git a/phonon/crossfade.h b/phonon/crossfade.h deleted file mode 100644 index 97330af..0000000 --- a/phonon/crossfade.h +++ /dev/null @@ -1,50 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2006 Matthias Kretz - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), Nokia Corporation - (or its successors, if any) and the KDE Free Qt Foundation, which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef CROSSFADE_H -#define CROSSFADE_H - -#include - -namespace Phonon { - class MediaQueue; - class AudioPath; - class AudioOutput; -} -class KUrl; -using namespace Phonon; - -class Crossfader : public QObject -{ - Q_OBJECT - public: - Crossfader(const KUrl &url1, const KUrl &url2, QObject *parent = 0); - - private Q_SLOTS: - void finished(); - - private: - MediaQueue *media; - AudioPath *path; - AudioOutput *output; -}; -#endif // CROSSFADE_H diff --git a/phonon/outputselectordemo/CMakeLists.txt b/phonon/outputselectordemo/CMakeLists.txt deleted file mode 100644 index 7fd6b10..0000000 --- a/phonon/outputselectordemo/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set(SRCS outputselector.cpp) - -automoc4_add_executable(outputselectordemo ${SRCS}) -target_link_libraries(outputselectordemo ${PHONON_LIBS} ${KDE4_KIO_LIBS}) -install(TARGETS outputselectordemo ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/phonon/outputselectordemo/outputselector.cpp b/phonon/outputselectordemo/outputselector.cpp deleted file mode 100644 index 2ecd7ad..0000000 --- a/phonon/outputselectordemo/outputselector.cpp +++ /dev/null @@ -1,391 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2008 Matthias Kretz - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. - -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class OrgKdePhononAudioOutputInterface: public QDBusAbstractInterface -{ - Q_OBJECT -public: - static inline const char *staticInterfaceName() - { return "org.kde.Phonon.AudioOutput"; } - -public: - OrgKdePhononAudioOutputInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); - - ~OrgKdePhononAudioOutputInterface(); - - Q_PROPERTY(bool muted READ muted WRITE setMuted) - inline bool muted() const - { return qvariant_cast< bool >(internalPropGet("muted")); } - inline void setMuted(bool value) - { internalPropSet("muted", qVariantFromValue(value)); } - - Q_PROPERTY(int outputDeviceIndex READ outputDeviceIndex WRITE setOutputDeviceIndex) - inline int outputDeviceIndex() const - { return qvariant_cast< int >(internalPropGet("outputDeviceIndex")); } - inline void setOutputDeviceIndex(int value) - { internalPropSet("outputDeviceIndex", qVariantFromValue(value)); } - - Q_PROPERTY(double volume READ volume WRITE setVolume) - inline double volume() const - { return qvariant_cast< double >(internalPropGet("volume")); } - inline void setVolume(double value) - { internalPropSet("volume", qVariantFromValue(value)); } - -public Q_SLOTS: // METHODS - inline QDBusReply category() - { - QList argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("category"), argumentList); - } - - inline QDBusReply name() - { - QList argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("name"), argumentList); - } - -Q_SIGNALS: // SIGNALS - void mutedChanged(bool in0); - void nameChanged(const QString &newName); - void newOutputAvailable(const QString &service, const QString &path); - void outputDestroyed(); - void outputDeviceIndexChanged(int in0); - void volumeChanged(double in0); -}; - -namespace org { - namespace kde { - namespace Phonon { - typedef ::OrgKdePhononAudioOutputInterface AudioOutput; - } - } -} - -OrgKdePhononAudioOutputInterface::OrgKdePhononAudioOutputInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) - : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) -{ -} - -OrgKdePhononAudioOutputInterface::~OrgKdePhononAudioOutputInterface() -{ -} - -using Phonon::AudioOutputDevice; -using Phonon::AudioOutputDeviceModel; - -class RemoteAudioOutput : public QWidget -{ - Q_OBJECT - public: - RemoteAudioOutput(const QList &m, - const QString &service, const QString &path, QDBusConnection &connection, QWidget *parent); - ~RemoteAudioOutput() - { - delete nameLabel; - delete muteButton; - delete volumeSlider; - delete deviceCombo; - } - - inline QString name() const { return m_name; } - inline QString category() const { return m_category; } - inline Phonon::AudioOutputDevice device() const { return m_device; } - inline double volume() const { return m_volume; } - inline bool muted() const { return m_muted; } - - inline void setDevice(const Phonon::AudioOutputDevice &d) { iface->setOutputDeviceIndex(d.index()); } - inline void setVolume(double v) { iface->setVolume(v); } - inline void setMuted(bool m) { iface->setMuted(m); } - - Q_SIGNALS: - void changed(); - - private Q_SLOTS: - void nameChanged(const QString &newName); - void volumeChanged(double v); - void mutedChanged(bool m); - void outputDeviceIndexChanged(int i); - void toggleMute(bool m); - void sliderValue(int v); - void deviceSelected(int i); - - private: - const QList &m_modelData; - QString m_name; - QString m_category; - Phonon::AudioOutputDevice m_device; - double m_volume; - bool m_muted; - org::kde::Phonon::AudioOutput *iface; - - public: - QLabel *nameLabel; - QToolButton *muteButton; - QSlider *volumeSlider; - QComboBox *deviceCombo; -}; - -void RemoteAudioOutput::nameChanged(const QString &newName) -{ - m_name = newName; - nameLabel->setText(m_name); - emit changed(); -} - -void RemoteAudioOutput::volumeChanged(double v) -{ - m_volume = v; - volumeSlider->setValue(static_cast(m_volume * 1000)); - emit changed(); -} - -void RemoteAudioOutput::mutedChanged(bool m) -{ - m_muted = m; - muteButton->setChecked(m_muted); - emit changed(); -} - -void RemoteAudioOutput::outputDeviceIndexChanged(int i) -{ - m_device = Phonon::AudioOutputDevice::fromIndex(i); - QAbstractItemModel *model = deviceCombo->model(); - deviceCombo->setCurrentIndex(model->index(m_modelData.indexOf(m_device), 0).row()); - emit changed(); -} - -RemoteAudioOutput::RemoteAudioOutput(const QList &m, - const QString &service, const QString &path, - QDBusConnection &connection, QWidget *parent) - : QWidget(parent), - m_modelData(m), - iface(new org::kde::Phonon::AudioOutput(service, path, connection, this)) -{ - connect(iface, SIGNAL(nameChanged(QString)), SLOT(nameChanged(QString))); - connect(iface, SIGNAL(volumeChanged(double)), SLOT(volumeChanged(double))); - connect(iface, SIGNAL(mutedChanged(bool)), SLOT(mutedChanged(bool))); - connect(iface, SIGNAL(outputDeviceIndexChanged(int)), SLOT(outputDeviceIndexChanged(int))); - connect(iface, SIGNAL(outputDestroyed()), SLOT(deleteLater())); - m_name = iface->name(); - m_category = iface->category(); - m_device = Phonon::AudioOutputDevice::fromIndex(iface->outputDeviceIndex()); - m_volume = iface->volume(); - m_muted = iface->muted(); - - nameLabel = new QLabel(m_name, parent); - - muteButton = new QToolButton(parent); - muteButton->setCheckable(true); - muteButton->setChecked(m_muted); - connect(muteButton, SIGNAL(toggled(bool)), SLOT(toggleMute(bool))); - - volumeSlider = new QSlider(Qt::Horizontal, parent); - volumeSlider->setMinimumSize(100, 10); - volumeSlider->setRange(0, 1000); - volumeSlider->setValue(static_cast(m_volume * 1000)); - connect(volumeSlider, SIGNAL(valueChanged(int)), SLOT(sliderValue(int))); - - deviceCombo = new QComboBox(parent); - AudioOutputDeviceModel *model = new AudioOutputDeviceModel(deviceCombo); - model->setModelData(m_modelData); - deviceCombo->setModel(model); - deviceCombo->setCurrentIndex(model->index(m_modelData.indexOf(m_device), 0).row()); - connect(deviceCombo, SIGNAL(activated(int)), SLOT(deviceSelected(int))); -} - -void RemoteAudioOutput::toggleMute(bool m) -{ - iface->setMuted(m); -} - -void RemoteAudioOutput::sliderValue(int v) -{ - iface->setVolume(v * 0.001); -} - -void RemoteAudioOutput::deviceSelected(int i) -{ - iface->setOutputDeviceIndex(m_modelData.at(i).index()); -} - -class OutputSelector : public QWidget -{ - Q_OBJECT - public: - OutputSelector(); - - private Q_SLOTS: - void newOutputAvailable(const QString &service, const QString &path); - void introspectDone(const QDBusMessage &msg); - void cleanupOutput(QObject *o); - void updateModel(); - - private: - void addOutput(RemoteAudioOutput *); - QDBusConnection connection; - QList m_outputs; - QList m_modelData; - QGridLayout *layout; -}; - -void OutputSelector::updateModel() -{ - m_modelData = Phonon::BackendCapabilities::availableAudioOutputDevices(); -} - -OutputSelector::OutputSelector() - : connection(QDBusConnection::sessionBus()), - layout(new QGridLayout(this)) -{ - if (!connection.isConnected()) { - QMessageBox::information(0, "D-Bus Connection Failed", - QString("Could not connect to D-Bus server %1: %1") - .arg(connection.lastError().name()) - .arg(connection.lastError().message())); - exit(1); - } - - layout->addWidget(new QLabel("Audio Output", this), 0, 0, Qt::AlignCenter); - layout->addWidget(new QLabel("Mute", this), 0, 1, Qt::AlignCenter); - layout->addWidget(new QLabel("Loudness", this), 0, 2, Qt::AlignCenter); - layout->addWidget(new QLabel("Device", this), 0, 3, Qt::AlignCenter); - - m_modelData = Phonon::BackendCapabilities::availableAudioOutputDevices(); - connect(Phonon::BackendCapabilities::notifier(), SIGNAL(availableAudioOutputDevicesChanged()), - SLOT(updateModel())); - - connection.connect(QString(), QString(), QLatin1String(org::kde::Phonon::AudioOutput::staticInterfaceName()), - QLatin1String("newOutputAvailable"), this, SLOT(newOutputAvailable(QString, QString))); - - QDBusConnectionInterface *bus = connection.interface(); - QMap serviceNameForPid; - { - const QStringList &services = bus->registeredServiceNames(); - foreach (const QString &serviceName, services) { - QDBusReply reply = bus->servicePid(serviceName); - if (!reply.isValid()) { - continue; - } - const uint pid = reply; - if (!serviceNameForPid.value(pid).isEmpty()) { - continue; - } - const QString &s = bus->serviceOwner(serviceName); - if (s != connection.baseService()) { - serviceNameForPid[pid] = s; - } - } - } - - for (QMapIterator it(serviceNameForPid); it.hasNext();) { - it.next(); - connection.callWithCallback(QDBusMessage::createMethodCall(it.value(), - QLatin1String("/AudioOutputs"), - QLatin1String("org.freedesktop.DBus.Introspectable"), - QLatin1String("Introspect")), - this, SLOT(introspectDone(QDBusMessage)), 0, -1); - } -} - -void OutputSelector::introspectDone(const QDBusMessage &msg) -{ - if (msg.arguments().size() != 1 || msg.arguments().first().type() != QVariant::String) { - return; - } - const QString &xml = msg.arguments().first().toString(); - - QDomDocument doc; - doc.setContent(xml); - QDomElement node = doc.documentElement(); - for (QDomElement child = node.firstChildElement(); !child.isNull(); - child = child.nextSiblingElement()) { - if (child.tagName() == QLatin1String("node")) { - const QString &path = QLatin1String("/AudioOutputs/") + child.attribute(QLatin1String("name")); - addOutput(new RemoteAudioOutput(m_modelData, msg.service(), path, connection, this)); - } - } -} - -void OutputSelector::newOutputAvailable(const QString &service, const QString &path) -{ - addOutput(new RemoteAudioOutput(m_modelData, service, path, connection, this)); -} - -void OutputSelector::addOutput(RemoteAudioOutput *r) -{ - layout->addWidget(r->nameLabel, 1 + m_outputs.size(), 0); - layout->addWidget(r->muteButton, 1 + m_outputs.size(), 1); - layout->addWidget(r->volumeSlider, 1 + m_outputs.size(), 2); - layout->addWidget(r->deviceCombo, 1 + m_outputs.size(), 3); - connect(r, SIGNAL(destroyed(QObject*)), SLOT(cleanupOutput(QObject*))); - m_outputs << r; - qDebug() << m_outputs.size(); -} - -void OutputSelector::cleanupOutput(QObject *o) -{ - RemoteAudioOutput *r = static_cast(o); - const int row = m_outputs.indexOf(r); - for (int i = row; i < layout->rowCount() - 1; ++i) { - for (int j = 0; j < 4; ++j) { - QLayoutItem *item = layout->itemAtPosition(i + 2, j); - if (item) { - layout->addItem(item, i + 1, j); - } - } - for (int j = 0; j < 4; ++j) { - QLayoutItem *item = layout->itemAtPosition(i + 2, j); - if (item) { - layout->removeItem(item); - } - } - } - m_outputs.removeAt(row); -} - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - OutputSelector s; - s.show(); - - return app.exec(); -} - -#include "outputselector.moc" diff --git a/phonon/pcmoutput.cpp b/phonon/pcmoutput.cpp deleted file mode 100644 index 9955f48..0000000 --- a/phonon/pcmoutput.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2006 Matthias Kretz - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), Nokia Corporation - (or its successors, if any) and the KDE Free Qt Foundation, which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - - -#include "pcmoutput.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static const int SAMPLE_RATE = 48000; - -PcmPlayer::PcmPlayer(QWidget *parent) - : QWidget(parent), - m_frequency(440) -{ - Phonon::AudioOutput *m_output = new Phonon::AudioOutput(Phonon::MusicCategory, this); - Phonon::AudioPath *m_path = new Phonon::AudioPath(this); - m_path->addOutput(m_output); - m_stream = new Phonon::ByteStream(this); - m_stream->addAudioPath(m_path); - m_stream->setStreamSeekable(false); - m_stream->setStreamSize(0x7FFFFFFF); - - QTimer *m_timer = new QTimer(this); - m_timer->setInterval(0); - connect(m_timer, SIGNAL(timeout()), SLOT(sendData())); - - connect(m_stream, SIGNAL(needData()), m_timer, SLOT(start())); - connect(m_stream, SIGNAL(enoughData()), m_timer, SLOT(stop())); - - m_stream->writeData(wavHeader()); - - setLayout(new QHBoxLayout); - QSlider *slider = new QSlider(this); - layout()->addWidget(slider); - slider->setRange(200, 4000); - slider->setValue(m_frequency); - connect(slider, SIGNAL(valueChanged(int)), SLOT(setFrequency(int))); - - QTimer::singleShot(0, m_timer, SLOT(start())); - QTimer::singleShot(0, m_stream, SLOT(play())); - - m_fLabel = new QLabel(this); - layout()->addWidget(m_fLabel); - m_fLabel->setText(QString::number(m_frequency)); -} - -void PcmPlayer::setFrequency(int f) -{ - m_frequency = f; - m_fLabel->setText(QString::number(m_frequency)); -} - -void PcmPlayer::sendData() -{ - m_stream->writeData(pcmBlock(m_frequency)); -} - -QByteArray PcmPlayer::wavHeader() const -{ - QByteArray data; - QDataStream stream(&data, QIODevice::WriteOnly); - stream.setByteOrder(QDataStream::LittleEndian); - stream - << 0x46464952 //"RIFF" - << static_cast(0x7FFFFFFF) - << 0x45564157 //"WAVE" - << 0x20746D66 //"fmt " //Subchunk1ID - << static_cast(16) //Subchunk1Size - << static_cast(1) //AudioFormat - << static_cast(2) //NumChannels - << static_cast(SAMPLE_RATE) //SampleRate - << static_cast(2 *2 *SAMPLE_RATE)//ByteRate - << static_cast(2 *2) //BlockAlign - << static_cast(16) //BitsPerSample - << 0x61746164 //"data" //Subchunk2ID - << static_cast(0x7FFFFFFF-36)//Subchunk2Size - ; - return data; -} - -QByteArray PcmPlayer::pcmBlock(int freq) const -{ - QByteArray data; - QDataStream stream(&data, QIODevice::WriteOnly); - stream.setByteOrder(QDataStream::LittleEndian); - - const int samplesPerHalfWave = SAMPLE_RATE / (2 *freq); - const int sampleDiff = (1 << 16) / samplesPerHalfWave; - const int samplesPerQuarterWave = samplesPerHalfWave / 2; - - for (int i = 0; i < samplesPerQuarterWave; ++i) - stream << static_cast(i * sampleDiff) - << static_cast(-i * sampleDiff); - for (int i = 0; i < samplesPerHalfWave; ++i) - stream << static_cast(32767 - i * sampleDiff) - << static_cast(-32768 + i * sampleDiff); - for (int i = 0; i < samplesPerQuarterWave; ++i) - stream << static_cast(-32768 + i * sampleDiff) - << static_cast(32767 - i * sampleDiff); - - return data; -} - -int main(int argc, char ** argv) -{ - KAboutData about("videoplayandforget", 0, ki18n("Phonon VideoPlayer Example"), - "1.0", KLocalizedString(), - KAboutData::License_LGPL); - about.addAuthor(ki18n("Matthias Kretz"), KLocalizedString(), "kretz@kde.org"); - KCmdLineArgs::init(argc, argv, &about); - KApplication app; - PcmPlayer player; - player.show(); - app.exec(); -} - -#include "pcmoutput.moc" diff --git a/phonon/pcmoutput.h b/phonon/pcmoutput.h deleted file mode 100644 index 34413a4..0000000 --- a/phonon/pcmoutput.h +++ /dev/null @@ -1,50 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2006 Matthias Kretz - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), Nokia Corporation - (or its successors, if any) and the KDE Free Qt Foundation, which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#ifndef PCMOUTPUT_H -#define PCMOUTPUT_H - -#include - -class QByteArray; -class QLabel; -namespace Phonon { class ByteStream; } - -class PcmPlayer : public QWidget -{ - Q_OBJECT - public: - PcmPlayer(QWidget *parent = 0); - - private Q_SLOTS: - void setFrequency(int f); - void sendData(); - - private: - QByteArray wavHeader() const; - QByteArray pcmBlock(int freq) const; - int m_frequency; - Phonon::ByteStream *m_stream; - QLabel *m_fLabel; -}; - -#endif // PCMOUTPUT_H diff --git a/phonon/playback.cpp b/phonon/playback.cpp deleted file mode 100644 index 0eb54cd..0000000 --- a/phonon/playback.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Matthias Kretz - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. - -*/ - -MediaObject *media = new MediaObject; -media->setUrl(url); -media->play(); -connect(media, SIGNAL(finished()), media, SLOT(deleteLater())); diff --git a/phonon/simpleplay.cpp b/phonon/simpleplay.cpp deleted file mode 100644 index d9f89e8..0000000 --- a/phonon/simpleplay.cpp +++ /dev/null @@ -1,3 +0,0 @@ -SimplePlayer *player = new SimplePlayer; -player->play(url); -connect(player, SIGNAL(finished()), player, SLOT(deleteLater())); diff --git a/phonon/videoplayandforget.cpp b/phonon/videoplayandforget.cpp deleted file mode 100644 index 33dac72..0000000 --- a/phonon/videoplayandforget.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2006 Matthias Kretz - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), Nokia Corporation - (or its successors, if any) and the KDE Free Qt Foundation, which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . - -*/ - -#include -#include -#include -#include -#include -#include - -using namespace Phonon; - -int main(int argc, char ** argv) -{ - KCmdLineOptions options; - options.add("+URL", ki18n("An URL to a video")); - - KAboutData about("videoplayandforget", 0, ki18n("Phonon VideoPlayer Example"), - "1.0", KLocalizedString(), - KAboutData::License_LGPL); - about.addAuthor(ki18n("Matthias Kretz"), KLocalizedString(), "kretz@kde.org"); - KCmdLineArgs::init(argc, argv, &about); - KCmdLineArgs::addCmdLineOptions(options); - KApplication app; - KUrl url; - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - if (args->count() == 1) - { - url = args->url(0); - if (url.isValid()) - { - VideoPlayer player(Phonon::VideoCategory); - QObject::connect(&player, SIGNAL(finished()), &app, SLOT(quit())); - player.show(); - player.resize(640, 480); - player.play(url); - player.seek(player.totalTime() * 9 / 10); - return app.exec(); - } - } - return 1; -} diff --git a/phonon/videoplayback.cpp b/phonon/videoplayback.cpp deleted file mode 100644 index ed89913..0000000 --- a/phonon/videoplayback.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Matthias Kretz - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. - -*/ - -#include "videoplayback.h" - -#include - -#include -#include -#include -#include -#include -#include - -using namespace Phonon; - -MediaPlayer::MediaPlayer(QWidget *parent) - : QWidget(parent) -{ - QVBoxLayout *layout = new QVBoxLayout(this); - - m_vwidget = new VideoWidget(this); - layout->addWidget(m_vwidget); - m_vwidget->hide(); - - m_vpath = new VideoPath(this); - - // might need VideoCategory here - m_aoutput = new AudioOutput(Phonon::MusicCategory, this); - m_apath = new AudioPath(this); - - m_media = new MediaObject(this); - m_media->addVideoPath(m_vpath); - m_vpath->addOutput(m_vwidget); - m_media->addAudioPath(m_apath); - m_apath->addOutput(m_aoutput); - - m_controls = new MediaControls(this); - layout->addWidget(m_controls); - m_controls->setMediaProducer(m_media); - m_controls->setAudioOutput(m_aoutput); - - connect(m_media, SIGNAL(hasVideoChanged(bool)), SLOT(hasVideoChanged(bool))); -} - -void MediaPlayer::setUrl(const KUrl &url) -{ - m_media->setUrl(url); - m_vwidget->setVisible(m_media->hasVideo()); -} - -void MediaPlayer::hasVideoChanged(bool hasVideo) -{ - m_vwidget->setVisible(hasVideo); -} - -int main() -{ - return 0; -} - -#include "videoplayback.moc" diff --git a/phonon/videoplayback.h b/phonon/videoplayback.h deleted file mode 100644 index 1ee2ad0..0000000 --- a/phonon/videoplayback.h +++ /dev/null @@ -1,62 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Matthias Kretz - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. - -*/ - -#ifndef EXAMPLES_VIDEOPLAYBACK_H -#define EXAMPLES_VIDEOPLAYBACK_H - -#include - -class KUrl; - -namespace Phonon -{ - class VideoWidget; - class VideoPath; - class AudioOutput; - class AudioPath; - class MediaObject; - class MediaControls; -} // namespace Phonon - -using namespace Phonon; - -class MediaPlayer : public QWidget -{ - Q_OBJECT - public: - MediaPlayer(QWidget *parent); - void setUrl(const KUrl &url); - - private Q_SLOTS: - void hasVideoChanged(bool hasVideo); - - private: - VideoWidget *m_vwidget; - VideoPath *m_vpath; - AudioOutput *m_aoutput; - AudioPath *m_apath; - MediaObject *m_media; - MediaControls *m_controls; -}; - -#endif // EXAMPLES_VIDEOPLAYBACK_H diff --git a/plasma/CMakeLists.txt b/plasma/CMakeLists.txt deleted file mode 100644 index 2e0587a..0000000 --- a/plasma/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ - -include(MacroLibrary) - -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES}) - -add_subdirectory(c++) -add_subdirectory(declarative) -add_subdirectory(javascript) -add_subdirectory(python) -add_subdirectory(ruby) -#add_subdirectory(webkit) diff --git a/plasma/LICENSING b/plasma/LICENSING deleted file mode 100644 index 9c864e6..0000000 --- a/plasma/LICENSING +++ /dev/null @@ -1,25 +0,0 @@ -All code in this directory is copyrighted and licensed under the following terms: - -Copyright 2009 Aaron Seigo - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/plasma/c++/CMakeLists.txt b/plasma/c++/CMakeLists.txt deleted file mode 100644 index 159cd7b..0000000 --- a/plasma/c++/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(dataengines) -add_subdirectory(kpart) -add_subdirectory(plasmoids) -add_subdirectory(runner) -add_subdirectory(qml) diff --git a/plasma/c++/dataengines/CMakeLists.txt b/plasma/c++/dataengines/CMakeLists.txt deleted file mode 100644 index ea521bb..0000000 --- a/plasma/c++/dataengines/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(simpleEngine) -add_subdirectory(sourcesOnRequest) -add_subdirectory(customDataContainers) - diff --git a/plasma/c++/dataengines/customDataContainers/CMakeLists.txt b/plasma/c++/dataengines/customDataContainers/CMakeLists.txt deleted file mode 100644 index 22b0ebd..0000000 --- a/plasma/c++/dataengines/customDataContainers/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(customDataContainers_SRCS - customDataContainersEngine.cpp - httpContainer.cpp -) - -kde4_add_plugin(plasma_dataengine_example_customDataContainers ${customDataContainers_SRCS}) -target_link_libraries(plasma_dataengine_example_customDataContainers ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS}) - -install(TARGETS plasma_dataengine_example_customDataContainers DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES plasma-dataengine-example-customDataContainers.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) diff --git a/plasma/c++/dataengines/customDataContainers/customDataContainersEngine.cpp b/plasma/c++/dataengines/customDataContainers/customDataContainersEngine.cpp deleted file mode 100644 index c77bc61..0000000 --- a/plasma/c++/dataengines/customDataContainers/customDataContainersEngine.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "customDataContainersEngine.h" - -#include "httpContainer.h" - -/* - This DataEngine shows how to use a subclass of DataContainer to create and - manage sources. This is particularly useful when managing asynchronous requests, - such as sources that reflect network, D-Bus, etc. results. -*/ - -DataContainersEngine::DataContainersEngine(QObject *parent, const QVariantList &args) - : Plasma::DataEngine(parent, args) -{ - // We've passed the constructor's args to our parent class. - // We're done for now! -} - -bool DataContainersEngine::sourceRequestEvent(const QString &source) -{ - // This engine will fetch webpages over http. First thing we do is check - // the source to make sure it is indeed an http URL. - KUrl url(source); - kDebug() << "goin to fetch" << source << url << url.protocol(); - if (!url.protocol().startsWith("http", Qt::CaseInsensitive)) { - return false; - } - - // Create a HttpContainer, which is a subclass of Plasma::DataContainer - HttpContainer *container = new HttpContainer(url, this); - - // Set the object name to be the same as the source name; DataEngine - // relies on this to identify the container. This could also be done - // in HttpContainer's constructor, but for the sake of this example - // we're dong it here to show that it must be done *before* the - // DataContainer subclass is passed to addSource - container->setObjectName(source); - - // Now we tell Plasma::DataEngine about this new container - addSource(container); - - // Since we successfully set up the source, return true - return true; -} - -bool DataContainersEngine::updateSourceEvent(const QString &source) -{ - HttpContainer *container = qobject_cast(containerForSource(source)); - if (container) { - container->fetchUrl(); - } - - // HttpContainer is asynchronous, so the data hasn't actually been updated yet. So - // we return false here to let the DataEngine know that nothing has changed quite yet. - return false; -} - -// export the plugin; use the plugin name and the class name -K_EXPORT_PLASMA_DATAENGINE(org.kde.examples.customDataContainers, DataContainersEngine) - -// include the moc file so the build system makes it for us -#include "customDataContainersEngine.moc" - diff --git a/plasma/c++/dataengines/customDataContainers/customDataContainersEngine.h b/plasma/c++/dataengines/customDataContainers/customDataContainersEngine.h deleted file mode 100644 index 0a26dfa..0000000 --- a/plasma/c++/dataengines/customDataContainers/customDataContainersEngine.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DATACONTAINERSENGINE_H -#define DATACONTAINERSENGINE_H - -#include - -class DataContainersEngine : public Plasma::DataEngine -{ - Q_OBJECT - -public: - DataContainersEngine(QObject *parent, const QVariantList &args); - -protected: - bool sourceRequestEvent(const QString &source); - bool updateSourceEvent(const QString &source); -}; - -#endif diff --git a/plasma/c++/dataengines/customDataContainers/httpContainer.cpp b/plasma/c++/dataengines/customDataContainers/httpContainer.cpp deleted file mode 100644 index 98f26e4..0000000 --- a/plasma/c++/dataengines/customDataContainers/httpContainer.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "httpContainer.h" - -#include -#include - -HttpContainer::HttpContainer(const KUrl &url, QObject *parent) - : Plasma::DataContainer(parent), - m_url(url) -{ - // Since we are grabbing data over the network, we request a - // backing store. This way, if the network is down or on first start - // before we get our first reply back, if this source was previously - // available, we'll still have our data. This is a very nice "freebie" - // DataContainer gives us. - setStorageEnabled(true); - - // Now, start an initial fetch. - fetchUrl(false); -} - -void HttpContainer::fetchUrl(bool reload) -{ - // Now we go about the business of fetching the URL with KIO - m_data.clear(); - - KIO::TransferJob *job = KIO::get(m_url, reload ? KIO::Reload : KIO::NoReload, KIO::HideProgressInfo); - connect(job, SIGNAL(data(KIO::Job*,QByteArray)), - this, SLOT(data(KIO::Job*,QByteArray))); - connect(job, SIGNAL(finished(KJob*)), this, SLOT(fetchFinished(KJob*))); - - if (m_job) { - m_job.data()->kill(); - } - - m_job = job; -} - -void HttpContainer::data(KIO::Job *job, const QByteArray &data) -{ - if (job == m_job.data()) { - // we store the data as it arrives - m_data.append(data); - } -} - -void HttpContainer::fetchFinished(KJob *job) -{ - if (!job->error()) { - // We now set the data on the source with the retrieved data and some - // additional stats. Note that we don't include the source name, as that - // is implied as this object *is* the DataContainer. setData is called - // with just key/value pairs. - setData("Contents", m_data); - setData("Size", job->processedAmount(KJob::Bytes)); - - // Since we only create TransferJobs, it's safe to just static_cast here. - // In many real-world situations, this isn't the safest thing to do and a - // qobject_cast with a test on the result is often safer and cleaner. - KIO::TransferJob *tjob = static_cast(job); - setData("Error Page", tjob->isErrorPage()); - setData("Mimetype", tjob->mimetype()); - - // Let DataContainer know we have data that needs storing - setNeedsToBeStored(true); - - // Notify DataContainer that now is a good time to check to see that - // data has been updated. This will cause visualizations to be updated. - checkForUpdate(); - - // Clean up behind ourselves so there isn't unecessary memory usage - m_data.clear(); - } -} - -#include "httpContainer.moc" - diff --git a/plasma/c++/dataengines/customDataContainers/httpContainer.h b/plasma/c++/dataengines/customDataContainers/httpContainer.h deleted file mode 100644 index d8a05d7..0000000 --- a/plasma/c++/dataengines/customDataContainers/httpContainer.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef HTTPCONTAINER_H -#define HTTPCONTAINER_H - -#include - -namespace KIO -{ - class Job; -}; - -class HttpContainer : public Plasma::DataContainer -{ - Q_OBJECT - -public: - HttpContainer(const KUrl &url, QObject *parent = 0); - - void fetchUrl(bool reload = true); - -private Q_SLOTS: - void data(KIO::Job *job, const QByteArray &data); - void fetchFinished(KJob *); - -private: - const KUrl m_url; - QWeakPointer m_job; - QByteArray m_data; -}; - -#endif diff --git a/plasma/c++/dataengines/customDataContainers/plasma-dataengine-example-customDataContainers.desktop b/plasma/c++/dataengines/customDataContainers/plasma-dataengine-example-customDataContainers.desktop deleted file mode 100644 index f5bf39b..0000000 --- a/plasma/c++/dataengines/customDataContainers/plasma-dataengine-example-customDataContainers.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Name=Custom DataContainers -Comment=A demonstration of how to subclass DataContainer -Type=Service -Icon=plasma - -X-KDE-ServiceTypes=Plasma/DataEngine -X-KDE-Library=plasma_dataengine_example_customDataContainers - -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.examples.customDataContainers -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=BSD -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/c++/dataengines/dataEngineTracker/README b/plasma/c++/dataengines/dataEngineTracker/README deleted file mode 100644 index a28d05a..0000000 --- a/plasma/c++/dataengines/dataEngineTracker/README +++ /dev/null @@ -1,6 +0,0 @@ -DataEngineTracker is a simple class that follows all activity in a given Plasma::DataEngine. - -Simply add it to your project and then instantiate it with a Plasma::DataEngine* as the first -parameter. This will let you watch sources as they are added, removed and change state. Very -handy to see how a Plasma::DataEngine is being used and behaving, and as such useful for both -DataEngine authors as well as those writing code using DataEngines. diff --git a/plasma/c++/dataengines/dataEngineTracker/dataenginetracker.cpp b/plasma/c++/dataengines/dataEngineTracker/dataenginetracker.cpp deleted file mode 100644 index 7d5571f..0000000 --- a/plasma/c++/dataengines/dataEngineTracker/dataenginetracker.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "dataenginetracker.h" - -#include - -DataEngineTracker::DataEngineTracker(Plasma::DataEngine *engine, QObject *parent) - : QObject(parent), - m_engine(engine) -{ - connect(engine, SIGNAL(sourceAdded(QString)), this, SLOT(sourceAdded(QString))); - connect(engine, SIGNAL(sourceRemoved(QString)), this, SLOT(sourceRemoved(QString))); - engine->connectAllSources(this); -} - -void DataEngineTracker::dataUpdated(const QString &source, const Plasma::DataEngine::Data &data) -{ - kDebug() << QTime::currentTime() << source; - QHashIterator it(data); - while (it.hasNext()) { - it.next(); - kDebug() << " " << it.key() << it.value(); - } -} - -void DataEngineTracker::sourceAdded(const QString &source) -{ - kDebug() << QTime::currentTime() << source; - m_engine->connectSource(source, this); -} - -void DataEngineTracker::sourceRemoved(const QString &source) -{ - kDebug() << QTime::currentTime() << source; -} - -#include - diff --git a/plasma/c++/dataengines/dataEngineTracker/dataenginetracker.h b/plasma/c++/dataengines/dataEngineTracker/dataenginetracker.h deleted file mode 100644 index feeca2a..0000000 --- a/plasma/c++/dataengines/dataEngineTracker/dataenginetracker.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DATAENGINETRACKER_H -#define DATAENGINETRACKER_H - -#include - -#include - -class DataEngineTracker : QObject -{ - Q_OBJECT - -public: - DataEngineTracker(Plasma::DataEngine *engine, QObject *parent = 0); - -public Q_SLOTS: - void dataUpdated(const QString &source, const Plasma::DataEngine::Data &data); - void sourceAdded(const QString &source); - void sourceRemoved(const QString &source); - -private: - Plasma::DataEngine *m_engine; -}; - -#endif - diff --git a/plasma/c++/dataengines/simpleEngine/CMakeLists.txt b/plasma/c++/dataengines/simpleEngine/CMakeLists.txt deleted file mode 100644 index 09ef37a..0000000 --- a/plasma/c++/dataengines/simpleEngine/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(simpleEngine_SRCS - simpleEngine.cpp -) - -kde4_add_plugin(plasma_dataengine_example_simpleEngine ${simpleEngine_SRCS}) -target_link_libraries(plasma_dataengine_example_simpleEngine ${KDE4_PLASMA_LIBS}) - -install(TARGETS plasma_dataengine_example_simpleEngine DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES plasma-dataengine-example-simpleEngine.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) diff --git a/plasma/c++/dataengines/simpleEngine/plasma-dataengine-example-simpleEngine.desktop b/plasma/c++/dataengines/simpleEngine/plasma-dataengine-example-simpleEngine.desktop deleted file mode 100644 index 85b4a35..0000000 --- a/plasma/c++/dataengines/simpleEngine/plasma-dataengine-example-simpleEngine.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Name=Simple DataEngine Example -Comment=A very basic DataEngine implementation -Type=Service -Icon=plasma - -X-KDE-ServiceTypes=Plasma/DataEngine -X-KDE-Library=plasma_dataengine_example_simpleEngine - -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.examples.simpleEngine -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=BSD -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/c++/dataengines/simpleEngine/simpleEngine.cpp b/plasma/c++/dataengines/simpleEngine/simpleEngine.cpp deleted file mode 100644 index 54a4c26..0000000 --- a/plasma/c++/dataengines/simpleEngine/simpleEngine.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include - -#include "simpleEngine.h" - -/* - This DataEngine provides a static set of data that is created on - engine creation. This is a common pattern for DataEngines that relay - information such as hardware events and shows the most basic form of - a DataEngine -*/ - -SimpleEngine::SimpleEngine(QObject *parent, const QVariantList &args) - : Plasma::DataEngine(parent, args) -{ - // we've passed the constructor's args to our parent class - // we're done for now! -} - -void SimpleEngine::init() -{ - // init() is called after construction but before anything actually - // gets to use the Engine; it's a nice plce for delayed initialization. - - // So now we will set up some sources. - // Each DataEngine will, generally, be loaded once. Each DataEngine - // can provide multiple sets of data keyed by a string, called "Sources". - // In this simplest of cases, we just create some sources arbitrarily. - - // This is the simplest form, with source name and one bit of data. - // Note how the source name is not translated! They can be marked with - // I18N_NOOP, however, if they should be translatable in a visualization. - setData("Simple Source", i18n("Very simple data")); - - // a source can have multiple entries, differentiated by key names, - // which are also not translated: - setData("Multiple Source", "First", i18n("First")); - setData("Multiple Source", "Second", i18n("Second")); - - // We can also set the data up first and apply it all at once - // Note how data types other than strings can be used as well; anything - // that works with QVariant, in fact. - Plasma::DataEngine::Data data; - data.insert("Cow", "mooo"); - data.insert("Black", QColor(0, 0, 0)); - data.insert("Time", QTime::currentTime()); - setData("Another Source", data); -} - -// export the plugin; use the plugin name and the class name -K_EXPORT_PLASMA_DATAENGINE(org.kde.examples.simpleEngine, SimpleEngine) - -// include the moc file so the build system makes it for us -#include "simpleEngine.moc" - diff --git a/plasma/c++/dataengines/simpleEngine/simpleEngine.h b/plasma/c++/dataengines/simpleEngine/simpleEngine.h deleted file mode 100644 index 261fe3e..0000000 --- a/plasma/c++/dataengines/simpleEngine/simpleEngine.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SIMPLEENGINE_H -#define SIMPLEENGINE_H - -#include - -class SimpleEngine : public Plasma::DataEngine -{ - Q_OBJECT - -public: - SimpleEngine(QObject *parent, const QVariantList &args); - - void init(); -}; - -#endif diff --git a/plasma/c++/dataengines/sourcesOnRequest/CMakeLists.txt b/plasma/c++/dataengines/sourcesOnRequest/CMakeLists.txt deleted file mode 100644 index 955ee68..0000000 --- a/plasma/c++/dataengines/sourcesOnRequest/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(sourcesOnRequest_SRCS - sourcesOnRequest.cpp -) - -kde4_add_plugin(plasma_dataengine_example_sourcesOnRequest ${sourcesOnRequest_SRCS}) -target_link_libraries(plasma_dataengine_example_sourcesOnRequest ${KDE4_PLASMA_LIBS}) - -install(TARGETS plasma_dataengine_example_sourcesOnRequest DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES plasma-dataengine-example-sourcesOnRequest.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) diff --git a/plasma/c++/dataengines/sourcesOnRequest/plasma-dataengine-example-sourcesOnRequest.desktop b/plasma/c++/dataengines/sourcesOnRequest/plasma-dataengine-example-sourcesOnRequest.desktop deleted file mode 100644 index bd65554..0000000 --- a/plasma/c++/dataengines/sourcesOnRequest/plasma-dataengine-example-sourcesOnRequest.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Name=Sources On Request -Comment=A DataEngine example showing how to respond to requests for source creation and updates -Type=Service -Icon=plasma - -X-KDE-ServiceTypes=Plasma/DataEngine -X-KDE-Library=plasma_dataengine_example_sourcesOnRequest - -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.examples.sourcesOnRequest -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=BSD -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/c++/dataengines/sourcesOnRequest/sourcesOnRequest.cpp b/plasma/c++/dataengines/sourcesOnRequest/sourcesOnRequest.cpp deleted file mode 100644 index f5e8ff5..0000000 --- a/plasma/c++/dataengines/sourcesOnRequest/sourcesOnRequest.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "sourcesOnRequest.h" - -#include - -/* - This DataEngine shows how to created sources on demand as they are requested - and update them on visualization-requested update intervals. -*/ - -SourcesOnRequestEngine::SourcesOnRequestEngine(QObject *parent, const QVariantList &args) - : Plasma::DataEngine(parent, args) -{ - // We've passed the constructor's args to our parent class. - // We're done for now! -} - -bool SourcesOnRequestEngine::sourceRequestEvent(const QString &source) -{ - // When this method is called we can assume that: - // * the source does not exist yet - // * the source name parameter passed in is not an empty string - // * we are free to reject creating the source if we wish - - // We're going to reject any sources that start with the letter 'a' - // to demonstrate how to reject a request in a DataEngine. - if (source.startsWith('a') || source.startsWith('A')) { - return false; - } - - // For every other source, we're going to start an update count for it. - // Critically, we create a source before returning that has the exact - // same key as the source string. We MUST NOT create a source of a different - // name as that will cause unexpected results for the visualization. - // In such a case the DataEngine will remain happy and Do The Right Thing(tm) - // but the visualization will not get the source connected to it as it - // expects. So ALWAYS key the new data by the source string as below: - setData(source, "Update Count", 0); - - // as we successfully set up the source, return true - return true; -} - -bool SourcesOnRequestEngine::updateSourceEvent(const QString &source) -{ - // Whenever a visualization has requested an update, such as when passing - // an update interval to DataEngine::connectSource, this method will be called. - // When this method is called we can assume that: - // * the source exists - // * it hasn't been updated more frequently than the minimum update interval - // - // If not data is set in this method, then the update is skipped for the visualiation - // and that is just fine. - // - // We can also set data for other sources here if we wish, but as with - // sourceRequestEvent this may not be what the visualization expects. Unlike in - // sourceRequestEvent, however, this will result in expected behavior: visualizations - // connected to the sources which have setData called for them will be notified - // of these changes. - setData(source, "Update Count", containerForSource(source)->data().value("Update Count").toInt() + 1); - - // Since we updated the source immediately here, we need to return true so the DataEngine - // knows to continue with the update notification for visualizations. - return true; -} - -// export the plugin; use the plugin name and the class name -K_EXPORT_PLASMA_DATAENGINE(org.kde.examples.sourcesOnRequest, SourcesOnRequestEngine) - -// include the moc file so the build system makes it for us -#include "sourcesOnRequest.moc" - diff --git a/plasma/c++/dataengines/sourcesOnRequest/sourcesOnRequest.h b/plasma/c++/dataengines/sourcesOnRequest/sourcesOnRequest.h deleted file mode 100644 index 0fd5403..0000000 --- a/plasma/c++/dataengines/sourcesOnRequest/sourcesOnRequest.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SOURCESONREQUESTENGINE_H -#define SOURCESONREQUESTENGINE_H - -#include - -class SourcesOnRequestEngine : public Plasma::DataEngine -{ - Q_OBJECT - -public: - SourcesOnRequestEngine(QObject *parent, const QVariantList &args); - -protected: - bool sourceRequestEvent(const QString &source); - bool updateSourceEvent(const QString &source); -}; - -#endif diff --git a/plasma/c++/kpart/CMakeLists.txt b/plasma/c++/kpart/CMakeLists.txt deleted file mode 100644 index f0d9e2b..0000000 --- a/plasma/c++/kpart/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -set(plasma_example_kpart_shell_SRCS - main.cpp - containmentshell.cpp - testshellpluginloader.cpp - appletselector.cpp -) - -kde4_add_ui_files(plasma_example_kpart_shell_SRCS appletselector.ui) -kde4_add_executable(plasma-example-kpart-shell ${plasma_example_kpart_shell_SRCS}) - -target_link_libraries(plasma-example-kpart-shell ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_PLASMA_LIBS} ) - -########### install files ############### -install(TARGETS plasma-example-kpart-shell ${INSTALL_TARGETS_DEFAULT_ARGS} ) -install( PROGRAMS plasma-example-kpart-shell.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) -install(FILES plasma-default-layoutrc DESTINATION ${DATA_INSTALL_DIR}/plasma-example-kpart-shell/) -install( FILES plasma-kpart-shellui.rc DESTINATION ${DATA_INSTALL_DIR}/plasma-example-kpart-shell/ ) diff --git a/plasma/c++/kpart/appletselector.cpp b/plasma/c++/kpart/appletselector.cpp deleted file mode 100644 index 87263a9..0000000 --- a/plasma/c++/kpart/appletselector.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2010 Aleix Pol Gonzalez - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "appletselector.h" -#include "ui_appletselector.h" - -#include -#include - -AppletSelector::AppletSelector(QObject* parent, const QVariantList& args) - : KDialog() -{ - Q_UNUSED(args); - - setButtons(Close); - QWidget* w = new QWidget(this); - - m_ui = new Ui::AppletSelector; - m_ui->setupUi(w); - - m_ui->plugins->header()->setSortIndicator(0, Qt::AscendingOrder); - - setMainWidget(w); - - QStandardItemModel* model = new QStandardItemModel(this); - const KPluginInfo::List list= Plasma::Applet::listAppletInfo(); - foreach(const KPluginInfo& info, list) { - QStandardItem* item = new QStandardItem(KIcon(info.icon()), info.name()); - item->setEditable(false); - item->setToolTip(info.comment()); - item->setData(info.pluginName(), Qt::UserRole+1); - - model->appendRow(item); - } - - m_ui->plugins->setModel(model); - - connect(m_ui->plugins, SIGNAL(doubleClicked(QModelIndex)), SLOT(selected(QModelIndex))); -} - -AppletSelector::~AppletSelector() -{ - delete m_ui; -} - -void AppletSelector::selected(const QModelIndex& idx) -{ - emit addApplet(idx.data(Qt::UserRole+1).toString()); -} - -#include "appletselector.moc" diff --git a/plasma/c++/kpart/appletselector.h b/plasma/c++/kpart/appletselector.h deleted file mode 100644 index 99ac24f..0000000 --- a/plasma/c++/kpart/appletselector.h +++ /dev/null @@ -1,44 +0,0 @@ -/* This file is part of KDevelop - Copyright 2010 Aleix Pol Gonzalez - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef APPLETSELECTOR_H -#define APPLETSELECTOR_H - -#include - -class QModelIndex; -namespace Ui { class AppletSelector; } - -class AppletSelector : public KDialog -{ -Q_OBJECT -public: - explicit AppletSelector(QObject* parent = 0, const QVariantList& args = QVariantList()); - ~AppletSelector(); -public Q_SLOTS: - void selected(const QModelIndex& idx); - -Q_SIGNALS: - void addApplet(const QString& name); - -private: - Ui::AppletSelector* m_ui; -}; - -#endif // APPLETSELECTOR_H diff --git a/plasma/c++/kpart/appletselector.ui b/plasma/c++/kpart/appletselector.ui deleted file mode 100644 index 1974240..0000000 --- a/plasma/c++/kpart/appletselector.ui +++ /dev/null @@ -1,44 +0,0 @@ - - - AppletSelector - - - - 0 - 0 - 400 - 300 - - - - - - - Double-click on the widget you want to add: - - - - - - - false - - - false - - - true - - - false - - - false - - - - - - - - diff --git a/plasma/c++/kpart/containmentshell.cpp b/plasma/c++/kpart/containmentshell.cpp deleted file mode 100644 index bdd432f..0000000 --- a/plasma/c++/kpart/containmentshell.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* -* Copyright 2010 Ryan Rix -* Copyright 2010 Siddharth Sharma -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License version 2 as -* published by the Free Software Foundation -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "containmentshell.h" -#include "testshellpluginloader.h" -#include "appletselector.h" - -#include -#include -#include -#include -#include - - -#include - -#include - -ContainmentShell::ContainmentShell() - : KParts::MainWindow( ), - m_dialog(0) -{ - setXMLFile("plasma-kpart-shellui.rc"); - - KAction *action = KStandardAction::quit(qApp, SLOT(quit()), actionCollection()); - action = new KAction("&Configure", actionCollection()); - connect(action, SIGNAL(triggered()), this, SLOT(optionsPreferences())); - actionCollection()->addAction("options_configure", action); - - // this routine will find and load our Part. it finds the Part by - // name which is a bad idea usually.. but it's alright in this - // case since our Part is made for this Shell - KService::Ptr service = KService::serviceByDesktopPath( "plasma-kpart.desktop" ); - - if (service) { - Plasma::PluginLoader *loader = new TestShellPluginLoader(); - m_part = service->createInstance(0, QVariantList() << qVariantFromValue(loader)); - - if (m_part) { - // tell the KParts::MainWindow that this is indeed the main widget - setCentralWidget(m_part->widget()); - - // and integrate the part's GUI with the shell's - createGUI(m_part); - } else { - // For whatever reason the part didn't load - KMessageBox::error(this, "Could not instantiate our Part!"); - qApp->quit(); - } - } else { - // if we couldn't find our Part, we exit since the Shell by - // itself can't do anything useful - KMessageBox::error(this, "Could not find our Part!"); - qApp->quit(); - // we return here, cause qApp->quit() only means "exit the - // next time we enter the event loop... - return; - } - - // apply the saved mainwindow settings, if any, and ask the mainwindow - // to automatically save settings if changed: window size, toolbar - // position, icon size, etc. - setAutoSaveSettings(); -} - -ContainmentShell::~ContainmentShell() -{ -} - -void ContainmentShell::optionsPreferences() -{ - if (!m_dialog) { - m_dialog = new AppletSelector( m_part ); - connect( m_dialog, SIGNAL(addApplet(QString)), m_part, SLOT(addApplet(QString)) ); - } - m_dialog->show(); -} - -#include "containmentshell.moc" diff --git a/plasma/c++/kpart/containmentshell.h b/plasma/c++/kpart/containmentshell.h deleted file mode 100644 index 0b4618a..0000000 --- a/plasma/c++/kpart/containmentshell.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -* Copyright 2010 Ryan Rix -* Copyright 2010 Siddharth Sharma -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License version 2 as -* published by the Free Software Foundation -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef CONTAINMENTSHELL_H -#define CONTAINMENTSHELL_H - -#include -#include - -/** - * This is the application "Shell". It has a menubar, toolbar, and - * statusbar but relies on the "Part" to do all the real work. - * - * @short Generic Application Shell - * @author Ryan Rix - * @version 0.01 - */ -class ContainmentShell : public KParts::MainWindow -{ -Q_OBJECT -public: - ContainmentShell(); - virtual ~ContainmentShell(); - -public Q_SLOTS: - void optionsPreferences(); - -private: - KParts::Part* m_part; - KDialog* m_dialog; -}; - -#endif // CONTAINMENTSHELL_H diff --git a/plasma/c++/kpart/main.cpp b/plasma/c++/kpart/main.cpp deleted file mode 100644 index b6abe51..0000000 --- a/plasma/c++/kpart/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* -* Copyright 2010 Ryan Rix -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License version 2 as -* published by the Free Software Foundation -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "containmentshell.h" -#include -#include -#include - -static const char version[] = "0.1"; - -int main(int argc, char** argv) -{ - KAboutData about("plasma-kpart-shell", 0, ki18n("Plasma KPart Shell"), version, ki18n("A KDE KPart Application"), KAboutData::License_GPL, ki18n("(C) 2010 Ryan Rix"), KLocalizedString(), 0, "ry@n.rix.si"); - about.addAuthor( ki18n("Ryan Rix"), KLocalizedString(), "ry@n.rix.si" ); - KCmdLineArgs::init(argc, argv, &about); - - KApplication app; - - // see if we are starting with session management - if (app.isSessionRestored()) { - RESTORE(ContainmentShell) - } else { - ContainmentShell *widget = new ContainmentShell; - widget->show(); - } - - return app.exec(); -} diff --git a/plasma/c++/kpart/plasma-default-layoutrc b/plasma/c++/kpart/plasma-default-layoutrc deleted file mode 100644 index 500c8c7..0000000 --- a/plasma/c++/kpart/plasma-default-layoutrc +++ /dev/null @@ -1,61 +0,0 @@ -[Containments][1] -activity=Newspaper -desktop=-1 -formfactor=0 -geometry=806,0,800,480 -immutability=1 -location=0 -plugin=newspaper -screen=0 -wallpaperplugin=image -wallpaperpluginmode=SingleImage -zvalue=0 - -[Containments][1][ToolBox] -corner=7 -offset=0 - -[Containments][1][Applets][1] -geometry=14,38,343,236 -immutability=1 -plugin=news -zvalue=52 - -[Containments][1][Applets][1][LayoutInformation] -Column=0 -Order=0 - - -[Containments][1][Applets][2] -geometry=14,278,343,188 -immutability=1 -plugin=weather -zvalue=57 - -[Containments][1][Applets][2][LayoutInformation] -Column=0 -Order=1 - -[Containments][1][Applets][3] -geometry=1000,38,424,241 -immutability=1 -plugin=opendesktop -zvalue=47 - -[Containments][1][Applets][3][LayoutInformation] -Column=1 -Order=0 - -[Containments][1][Applets][4] -geometry=1000,283,424,182 -immutability=1 -plugin=knowledgebase -zvalue=47 - -[Containments][1][Applets][4][LayoutInformation] -Column=1 -Order=1 - - -[General] -immutability=1 diff --git a/plasma/c++/kpart/plasma-example-kpart-shell.desktop b/plasma/c++/kpart/plasma-example-kpart-shell.desktop deleted file mode 100755 index f5cb20e..0000000 --- a/plasma/c++/kpart/plasma-example-kpart-shell.desktop +++ /dev/null @@ -1,24 +0,0 @@ -[Desktop Entry] -Name=plasma-kpart-shell -Name[en_GB]=plasma-kpart-shell -Name[ia]=plasma-kpart-shell -Name[nl]=plasma-kpart-shell -Name[pt]=plasma-kpart-shell -Name[pt_BR]=plasma-kpart-shell -Name[sv]=Plasma-delprogramskal -Name[uk]=plasma-kpart-shell -Name[x-test]=xxplasma-kpart-shellxx -Exec=plasma-example-kpart-shell %i -caption %c -Icon=plasma-example-kpart-shell -Type=Application -X-DocPath=plasma-kpart-shell/index.html -GenericName=A KPart shell for Plasma -GenericName[en_GB]=A KPart shell for Plasma -GenericName[ia]=Un shell de KPart pro Plasma -GenericName[nl]=Een KPart-shell voor Plasma -GenericName[pt]=Uma consola de KParts para o Plasma -GenericName[pt_BR]=Uma shell de KPart para o Plasma -GenericName[sv]=Ett delprogramskal för Plasma -GenericName[uk]=Оболонка модулів для Плазми -GenericName[x-test]=xxA KPart shell for Plasmaxx -Terminal=false diff --git a/plasma/c++/kpart/plasma-kpart-shellui.rc b/plasma/c++/kpart/plasma-kpart-shellui.rc deleted file mode 100644 index 8255d44..0000000 --- a/plasma/c++/kpart/plasma-kpart-shellui.rc +++ /dev/null @@ -1,31 +0,0 @@ - - - - &File - - - - - - - - &Settings - - - - - - - - - - - - -Main Toolbar - - - - - - diff --git a/plasma/c++/kpart/testshellpluginloader.cpp b/plasma/c++/kpart/testshellpluginloader.cpp deleted file mode 100644 index 084f6a3..0000000 --- a/plasma/c++/kpart/testshellpluginloader.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* -* Copyright 2010 Ryan Rix -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License version 2 as -* published by the Free Software Foundation -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "testshellpluginloader.h" - -#include - -#include -#include -#include -#include - -TestShellPluginLoader::~TestShellPluginLoader() -{ -} - -Plasma::Applet* TestShellPluginLoader::internalLoadApplet (const QString &name, uint appletId, const QVariantList &args) -{ - kDebug() << "loadApplet called with" << name << appletId << args; - return 0; -} - -Plasma::DataEngine* TestShellPluginLoader::internalLoadDataEngine(const QString &name) -{ - kDebug() << "loadEngine called with" << name; - return 0; -} - -Plasma::Service* TestShellPluginLoader::internalLoadService(const QString &name, const QVariantList &args, QObject *parent) -{ - kDebug() << "loadService called with" << name << args << parent; - return 0; -} - diff --git a/plasma/c++/kpart/testshellpluginloader.h b/plasma/c++/kpart/testshellpluginloader.h deleted file mode 100644 index 01fd4ae..0000000 --- a/plasma/c++/kpart/testshellpluginloader.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -* Copyright 2010 Ryan Rix -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License version 2 as -* published by the Free Software Foundation -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef TESTSHELLPLUGINLOADER_H -#define TESTSHELLPLUGINLOADER_H - -#include - -class TestShellPluginLoader : public Plasma::PluginLoader -{ -public: - ~TestShellPluginLoader(); - - Plasma::Applet* internalLoadApplet (const QString &name, uint appletId = 0, - const QVariantList &args = QVariantList()); - Plasma::DataEngine* internalLoadDataEngine(const QString &name); - Plasma::Service* internalLoadService(const QString &name, const QVariantList &args, QObject *parent = 0); -}; - -#endif diff --git a/plasma/c++/plasmoids/CMakeLists.txt b/plasma/c++/plasmoids/CMakeLists.txt deleted file mode 100644 index 1aa76bc..0000000 --- a/plasma/c++/plasmoids/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(animation) -add_subdirectory(scrollwidget) -add_subdirectory(tooltips) diff --git a/plasma/c++/plasmoids/animation/CMakeLists.txt b/plasma/c++/plasmoids/animation/CMakeLists.txt deleted file mode 100644 index 18c8417..0000000 --- a/plasma/c++/plasmoids/animation/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Project Needs a name, of course -project(PlasmaAnimationExample) - -# We add our source code here -set(example_SRCS PlasmaAnimationExample.cpp) - -# Now make sure all files get to the right place -kde4_add_plugin(plasma_applet_example_animation ${example_SRCS}) -target_link_libraries(plasma_applet_example_animation ${KDE4_PLASMA_LIBS}) - -# Install the library and .desktop file -install(TARGETS plasma_applet_example_animation DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES plasma-applet-example-animation.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/plasma/c++/plasmoids/animation/PlasmaAnimationExample.cpp b/plasma/c++/plasmoids/animation/PlasmaAnimationExample.cpp deleted file mode 100644 index d2cc421..0000000 --- a/plasma/c++/plasmoids/animation/PlasmaAnimationExample.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright 2009 Mehmet Akmanalp - * Copyright 2009 Adenilson Cavalcanti - * Copyright 2009 Igor Trindade Oliveira - * Copyright 2009 Marco Martin - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PlasmaAnimationExample.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include - -using namespace Plasma; - -Q_DECLARE_METATYPE(QGraphicsWidget*) -Q_DECLARE_METATYPE(QGraphicsLayoutItem*) -Q_DECLARE_METATYPE(QEasingCurve) - -K_EXPORT_PLASMA_APPLET(plasma-applet-pltest, PlasmaAnimationExample) - -PlasmaAnimationExample::PlasmaAnimationExample(QObject *parent, const QVariantList &args) - : Plasma::Applet(parent, args) -{ - // set a default size - resize(300, 500); -} - -void PlasmaAnimationExample::init() -{ - QGraphicsLinearLayout *mLayout = new QGraphicsLinearLayout(this); - QGraphicsWidget *frontWidget = new QGraphicsWidget(this); - QGraphicsLinearLayout *frontLayout = new QGraphicsLinearLayout(Qt::Vertical, frontWidget); - - PushButton* button1 = new PushButton(frontWidget); - button1->setText("Press me!"); - - PushButton *button2 = new PushButton(frontWidget); - button2->setText("Pulse Animation!"); - - PushButton* button3 = new PushButton(frontWidget); - button3->setText("Grow Animation!"); - - PushButton *button4 = new PushButton(frontWidget); - button4->setText("Fade Animation!"); - - PushButton *button5 = new PushButton(frontWidget); - button5->setText("Slide Animation!"); - - PushButton *button6 = new PushButton(frontWidget); - button6->setText("Rotation stacked!"); - - PushButton *button7 = new PushButton(frontWidget); - button7->setText("Rotation!"); - - PushButton *button8 = new PushButton(frontWidget); - button8->setText("Zoom"); - - PushButton *button9 = new PushButton(frontWidget); - button9->setText("Water\neffect"); - - PushButton *button10 = new PushButton(frontWidget); - button10->setText("Shake!"); - - PushButton *button11 = new PushButton(frontWidget); - button11->setText("jsanim!"); - - frontLayout->addItem(button1); - frontLayout->addItem(button2); - frontLayout->addItem(button3); - frontLayout->addItem(button4); - frontLayout->addItem(button8); - frontLayout->addItem(button5); - frontLayout->addItem(button6); - frontLayout->addItem(button7); - frontLayout->addItem(button9); - frontLayout->addItem(button10); - frontLayout->addItem(button11); - - qRegisterMetaType("QGraphicsLayoutItem *"); - - Animation* rotStackedAnim = - Plasma::Animator::create(Plasma::Animator::RotationStackedAnimation); - rotStackedAnim->setTargetWidget(frontWidget); - QVariant var; - var.setValue(static_cast(button6)); - rotStackedAnim->setProperty("backWidget", var); - rotStackedAnim->setProperty("reference", Animation::Center); - rotStackedAnim->setProperty("movementDirection", Animation::MoveRight); - //rotStackedAnim->setProperty("duration", 1000); - QVariant varLayout = rotStackedAnim->property("layout"); - mLayout->addItem(varLayout.value()); - - //animation - Animation *rotAnim = - Plasma::Animator::create(Plasma::Animator::RotationAnimation); - rotAnim->setProperty("axis", Qt::ZAxis); - rotAnim->setProperty("reference", Animation::Center); - rotAnim->setProperty("angle", 180); - rotAnim->setTargetWidget(button7); - connect(button7, SIGNAL(clicked()), rotAnim, SLOT(start())); - - Animation *fadeAnim = - Plasma::Animator::create(Plasma::Animator::FadeAnimation); - fadeAnim->setProperty("startOpacity", 0.8); - fadeAnim->setProperty("targetOpacity", 0.2); - fadeAnim->setTargetWidget(button4); - connect(button4, SIGNAL(clicked()), fadeAnim, SLOT(start())); - - Animation *pulseAnim = - Plasma::Animator::create(Plasma::Animator::PulseAnimation); - pulseAnim->setTargetWidget(button2); - connect(button2, SIGNAL(clicked()), pulseAnim, SLOT(start())); - - Animation *growAnim = - Plasma::Animator::create(Plasma::Animator::GrowAnimation); - growAnim->setProperty("factor", 2.0); - growAnim->setTargetWidget(button3); - connect(button3, SIGNAL(clicked()), growAnim, SLOT(start())); - - Animation *slideAnim = - Plasma::Animator::create(Plasma::Animator::SlideAnimation); - slideAnim->setProperty("movementDirection", Animation::MoveDown); - slideAnim->setProperty("distance", 30); - slideAnim->setTargetWidget(button5); - connect(button5, SIGNAL(clicked()), slideAnim, SLOT(start())); - - Animation *zoomAnim = - Plasma::Animator::create(Plasma::Animator::ZoomAnimation); - zoomAnim->setProperty("zoom", 2.0); - zoomAnim->setTargetWidget(button8); - connect(button8, SIGNAL(clicked()), zoomAnim, SLOT(start())); - - Animation *waterAnim = - Plasma::Animator::create(Plasma::Animator::WaterAnimation); - waterAnim->setTargetWidget(button9); - waterAnim->setProperty("duration", 3000); - waterAnim->setProperty("easingCurve", QVariant::fromValue(QEasingCurve(QEasingCurve::InOutSine))); - connect(button9, SIGNAL(clicked()), waterAnim, SLOT(start())); - - Animation *shakeAnim = - Plasma::Animator::create(Plasma::Animator::RotationAnimation); - shakeAnim->setTargetWidget(button10); - shakeAnim->setProperty("easingCurve", - QVariant::fromValue(Plasma::Animator::create(Plasma::Animator::PendularCurve))); - shakeAnim->setProperty("angle", 5); - shakeAnim->setProperty("duration", 250); - shakeAnim->setProperty("loopCount", 2); - connect(button10, SIGNAL(clicked()), shakeAnim, SLOT(start())); - - QParallelAnimationGroup *parallel = new QParallelAnimationGroup(button11); - Animation *jsAnim = - Plasma::Animator::create(QString("ZoomAnimation")); - if (!jsAnim) { - qDebug() << "***********\n\nFailed loading javascript: ZoomAnimation!"; - - } else { - qDebug() << "***********\n\nSuccess creating javascript based animation"; - jsAnim->setTargetWidget(button11); - parallel->addAnimation(jsAnim); - - jsAnim = Plasma::Animator::create(QString("FadeAnimation")); - if (jsAnim) { - jsAnim->setProperty("duration", 600); - - jsAnim->setTargetWidget(button11); - parallel->addAnimation(jsAnim); - } else { - qDebug() << "***********\n\nFailed loading javascript: FadeAnimation!"; - } - connect(button11, SIGNAL(clicked()), parallel, SLOT(start())); - } - //group 'em up! - m_seqGroup = new QSequentialAnimationGroup(this); - m_seqGroup->addAnimation(rotAnim); - m_seqGroup->addAnimation(zoomAnim); - m_seqGroup->addAnimation(fadeAnim); - m_seqGroup->addAnimation(pulseAnim); - m_seqGroup->addAnimation(growAnim); - m_seqGroup->addAnimation(slideAnim); - m_seqGroup->addAnimation(waterAnim); - m_seqGroup->addAnimation(shakeAnim); - m_seqGroup->addAnimation(rotStackedAnim); - if (jsAnim) { - m_seqGroup->addAnimation(parallel); - } - - - QObject::connect(button1, SIGNAL(clicked()), this, SLOT(startAll())); - QObject::connect(button6, SIGNAL(clicked()), this, SLOT(revertDirection())); -} - -void PlasmaAnimationExample::revertDirection() -{ - if (m_seqGroup->property("direction") == QAbstractAnimation::Forward) { - m_seqGroup->setProperty("direction", QAbstractAnimation::Backward); - } - - m_seqGroup->start(); -} -void PlasmaAnimationExample::startAll() -{ - if (m_seqGroup->property("direction") == QAbstractAnimation::Backward) { - m_seqGroup->setProperty("direction", QAbstractAnimation::Forward); - } - - m_seqGroup->start(); -} - - -#include "PlasmaAnimationExample.moc" diff --git a/plasma/c++/plasmoids/animation/PlasmaAnimationExample.h b/plasma/c++/plasmoids/animation/PlasmaAnimationExample.h deleted file mode 100644 index 5e72cb0..0000000 --- a/plasma/c++/plasmoids/animation/PlasmaAnimationExample.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2009 Mehmet Akmanalp - * Copyright 2009 Adenilson Cavalcanti - * Copyright 2009 Igor Trindade Oliveira - * Copyright 2009 Marco Martin - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef PLASMA_ANIMATION_EXAMPLE_H -#define PLASMA_ANIMATION_EXAMPLE_H - -#include - -#include -#include - -class PlasmaAnimationExample : public Plasma::Applet -{ - Q_OBJECT - -public: - PlasmaAnimationExample(QObject *parent, const QVariantList &args); - - void init(); - -private Q_SLOTS: - - void startAll(); - void revertDirection(); - -private: - QSequentialAnimationGroup *m_seqGroup; -}; - -#endif diff --git a/plasma/c++/plasmoids/animation/jsanimtheme/animations/all.js b/plasma/c++/plasmoids/animation/jsanimtheme/animations/all.js deleted file mode 100644 index f5ba1af..0000000 --- a/plasma/c++/plasmoids/animation/jsanimtheme/animations/all.js +++ /dev/null @@ -1,69 +0,0 @@ -//*************************************************************************// -function ZoomAnimation(target, duration) { - this.target = target; - this.duration = duration; - - this.updateCurrentTime = function(currentTime) { - - var delta = currentTime/this.duration; - this.target.scale = delta; - - } -} - -registerAnimation("ZoomAnimation", ZoomAnimation) - -//*************************************************************************// -function RotationAnimation(target, duration) { - this.target = target; - this.duration = duration; - this.angle = 360; - //TODO: allow to set angle and axis on the 'constructor' - //this.axis = axis; - - this.updateCurrentTime = function(currentTime) { - - var delta = currentTime/this.duration; - this.target.rotation = delta * this.angle; - - } -} - -registerAnimation("RotationAnimation", RotationAnimation) - -//*************************************************************************// -function FadeAnimation(target, duration) { - this.target = target; - this.duration = duration; - //TODO: maybe a 'resetAnimation' function could use this - //and be called when the animation status change from running - //to stopped - this.opacityStart = target.opacity - - this.updateCurrentTime = function(currentTime) { - - var delta = currentTime/duration; - target.opacity = delta; - - } -} - -registerAnimation("FadeAnimation", FadeAnimation) - -//*************************************************************************// -function SlideAnimation(target, duration) { - this.target = target; - this.duration = duration; - this.x = target.x - - this.updateCurrentTime = function(currentTime) { - - var delta = currentTime/this.duration; - this.target.x = delta * this.x; - - } -} - -registerAnimation("SlideAnimation", SlideAnimation) - - diff --git a/plasma/c++/plasmoids/animation/jsanimtheme/metadata.desktop b/plasma/c++/plasmoids/animation/jsanimtheme/metadata.desktop deleted file mode 100644 index 453f9f5..0000000 --- a/plasma/c++/plasmoids/animation/jsanimtheme/metadata.desktop +++ /dev/null @@ -1,16 +0,0 @@ -[Desktop Entry] -Name=jsanim -Comment=javascript based animations test - -X-KDE-PluginInfo-Author=jsanim -X-KDE-PluginInfo-Email=cavalcantii@gmail.com -X-KDE-PluginInfo-Name=default -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website=http://plasma.kde.org -X-KDE-PluginInfo-Category= -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true - -[Animations] -all.js=ZoomAnimation,RotationAnimation,FadeAnimation,SlideAnimation diff --git a/plasma/c++/plasmoids/animation/plasma-applet-example-animation.desktop b/plasma/c++/plasmoids/animation/plasma-applet-example-animation.desktop deleted file mode 100644 index f37402b..0000000 --- a/plasma/c++/plasmoids/animation/plasma-applet-example-animation.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Name=animation_example -Comment=animation_example -Type=Service -ServiceTypes=Plasma/Applet - -X-Plasma-Defaultsize=300,400 - -X-KDE-Library=plasma_applet_example_animation -X-KDE-PluginInfo-Author=Mehmet Ali Akmanalp -X-KDE-PluginInfo-Email=foo@bar.com -X-KDE-PluginInfo-Name=plasma_applet_example_animation -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/c++/plasmoids/scrollwidget/CMakeLists.txt b/plasma/c++/plasmoids/scrollwidget/CMakeLists.txt deleted file mode 100644 index 1c9769e..0000000 --- a/plasma/c++/plasmoids/scrollwidget/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -project( scrollwidgetexample ) - -include_directories (${KDE4_INCLUDES} - ${KDE4WORKSPACE_INCLUDE_DIR} - ${KDEPIMLIBS_INCLUDE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/libs) - -set( scrollwidgetexample_SRCS scrollwidgetexample.cpp ) - -kde4_add_plugin( plasma_applet_scrollwidgetexample ${scrollwidgetexample_SRCS} ) -target_link_libraries( plasma_applet_scrollwidgetexample ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS}) - -install(TARGETS plasma_applet_scrollwidgetexample - DESTINATION ${PLUGIN_INSTALL_DIR}) - -install(FILES plasma-applet-scrollwidgetexample.desktop - DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/plasma/c++/plasmoids/scrollwidget/plasma-applet-scrollwidgetexample.desktop b/plasma/c++/plasmoids/scrollwidget/plasma-applet-scrollwidgetexample.desktop deleted file mode 100644 index 4edf386..0000000 --- a/plasma/c++/plasmoids/scrollwidget/plasma-applet-scrollwidgetexample.desktop +++ /dev/null @@ -1,20 +0,0 @@ -[Desktop Entry] -Name=ScrollWidget Example -Comment=ScrollWidget Example -Type=Service -Icon=plasma - -X-KDE-ServiceTypes=Plasma/Applet -X-KDE-Library=plasma_applet_scrollwidgetexample -X-KDE-PluginInfo-Author=Ryan Rix -X-KDE-PluginInfo-Email=ry@n.rix.si -X-KDE-PluginInfo-Name=org.kde.plasma.scrollwidgetexample -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category= -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=BSD -X-KDE-PluginInfo-EnabledByDefault=true - -X-Plasma-Requires-FileDialog=Unused -X-Plasma-Requires-LaunchApp=Unused diff --git a/plasma/c++/plasmoids/scrollwidget/scrollwidgetexample.cpp b/plasma/c++/plasmoids/scrollwidget/scrollwidgetexample.cpp deleted file mode 100644 index 0ddfb50..0000000 --- a/plasma/c++/plasmoids/scrollwidget/scrollwidgetexample.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright 2010 Ryan Rix - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - **/ - -#include "scrollwidgetexample.h" - -#include -#include -#include - -#include -#include -#include -#include -#include - -K_EXPORT_PLASMA_APPLET(scrollwidgetexample, ScrollWidgetExample) - -ScrollWidgetExample::ScrollWidgetExample( QObject* parent, const QVariantList& args ) - : Plasma::Applet( parent, args ), - m_scrollWidget(0), - m_scroller(0), - m_scrollerLayout(0) -{ - setPreferredSize(100,400); -} - -void ScrollWidgetExample::init() -{ - // Start by setting up the Applet with a layout - QGraphicsLinearLayout* lay = new QGraphicsLinearLayout(Qt::Vertical); - setLayout(lay); - - // Create the scroll widget and set the desired size policy if different than the default - // this ScrollWidget will handle the scrollbars as well actual scrolling, including - // kinetic and gesture-based (e.g. flicking) scrolling for us! - m_scrollWidget = new Plasma::ScrollWidget(this); - m_scrollWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - - // Create the QGraphicsWidget we will be scrolling across - m_scroller = new QGraphicsWidget(m_scroller); - m_scrollerLayout = new QGraphicsLinearLayout(Qt::Vertical, m_scroller); - - // Put that widget inside the ScrollWidget - m_scrollWidget->setWidget(m_scroller); - - // add the scrollwidget to the top level layout of the Applet - lay->addItem(m_scrollWidget); - - // now we add some items to the scrolling widget - for (int i = 0; i < 10; i++) { - addScrollerItem(QString::number(i)); - } -} - -void ScrollWidgetExample::addScrollerItem(const QString &text) -{ - // Objects in scrollers can be any type of widget you - // want, but Plasma::Frames look rather good. - Plasma::Frame* item = new Plasma::Frame(m_scroller); - QGraphicsLinearLayout* lay = new QGraphicsLinearLayout(Qt::Horizontal); - Plasma::Label* label = new Plasma::Label(item); - label->setText(text); - lay->addItem(label); - item->setLayout(lay); - - // Add the widget we've just created to the scroller - m_scrollerLayout->addItem(item); -} - -#include "scrollwidgetexample.moc" diff --git a/plasma/c++/plasmoids/scrollwidget/scrollwidgetexample.h b/plasma/c++/plasmoids/scrollwidget/scrollwidgetexample.h deleted file mode 100644 index 3bfdd3e..0000000 --- a/plasma/c++/plasmoids/scrollwidget/scrollwidgetexample.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright 2010 Ryan Rix - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - **/ - -#ifndef SCROLLWIDGETEXAMPLE_H -#define SCROLLWIDGETEXAMPLE_H - -#include - -namespace Plasma -{ - class ScrollWidget; - class Frame; -} // namespace Plasma - -class QGraphicsLinearLayout; -class QGraphicsWidget; - -class ScrollWidgetExample : public Plasma::Applet -{ -Q_OBJECT -public: - ScrollWidgetExample(QObject *parent, const QVariantList &args); - - void init(); - void addScrollerItem(const QString &text); - -private: - Plasma::ScrollWidget* m_scrollWidget; - QGraphicsWidget* m_scroller; - QGraphicsLinearLayout* m_scrollerLayout; -}; - -#endif diff --git a/plasma/c++/plasmoids/tooltips/CMakeLists.txt b/plasma/c++/plasmoids/tooltips/CMakeLists.txt deleted file mode 100644 index 669ad30..0000000 --- a/plasma/c++/plasmoids/tooltips/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -project( tooltipexample ) - -include_directories (${KDE4_INCLUDES}) - -set(tooltipexample_SRCS tooltips.cpp) - -kde4_add_plugin(plasma_applet_example_tooltips ${tooltipexample_SRCS}) -target_link_libraries(plasma_applet_example_tooltips ${KDE4_PLASMA_LIBS}) - -install(TARGETS plasma_applet_example_tooltips DESTINATION ${PLUGIN_INSTALL_DIR}) - -install(FILES plasma-applet-example-tooltips.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/plasma/c++/plasmoids/tooltips/plasma-applet-example-tooltips.desktop b/plasma/c++/plasmoids/tooltips/plasma-applet-example-tooltips.desktop deleted file mode 100644 index 2708452..0000000 --- a/plasma/c++/plasmoids/tooltips/plasma-applet-example-tooltips.desktop +++ /dev/null @@ -1,17 +0,0 @@ -[Desktop Entry] -Name=Tooltips Example -Type=Service -ServiceTypes=Plasma/Applet - -X-Plasma-Defaultsize=300,400 - -X-KDE-Library=plasma_applet_example_tooltips -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.exampletooltips -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=BSD -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/c++/plasmoids/tooltips/tooltips.cpp b/plasma/c++/plasmoids/tooltips/tooltips.cpp deleted file mode 100644 index 64fc50c..0000000 --- a/plasma/c++/plasmoids/tooltips/tooltips.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - **/ - -#include "tooltips.h" - -#include - -#include - -#include -#include - -ToolTipExample::ToolTipExample(QObject *parent, const QVariantList &args) - : Plasma::Applet(parent, args), - m_count(0) -{ - // setup a simple user interface: a single icon - Plasma::IconWidget *icon = new Plasma::IconWidget(this); - icon->setIcon(KIcon("plasma")); - - QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(this); - layout->addStretch(); - layout->addItem(icon); - - // now we will create a static tooltip for the icon - Plasma::ToolTipContent content(i18n("This is an icon!"), i18n("Here is more text"), KIcon("plasma")); - Plasma::ToolTipManager::self()->setContent(icon, content); - - // now we will register the applet itself for a tooltip as well, but this time it will be - // a dynamic one: we will set the content in toolTipAboutToShow and clear it in toolTipHidden - Plasma::ToolTipManager::self()->registerWidget(this); -} - -void ToolTipExample::toolTipAboutToShow() -{ - // the ToolTip is about to show! Set up some content. - Plasma::ToolTipContent content; - content.setMainText(i18np("This tooltip has been shown once.", - "This tooltip has been shown %1 times", - ++m_count)); - Plasma::ToolTipManager::self()->setContent(this, content); - - // we could also start updating the ToolTip, e.g. with a timer, and stop the - // updating in toolTipHidden -} - -void ToolTipExample::toolTipHidden() -{ - // our ToolTip has been hidden; we can, if we wish, do something in response to that - // such as stop any ToolTip updating code or even just clear the data from memory - Plasma::ToolTipManager::self()->clearContent(this); -} - -K_EXPORT_PLASMA_APPLET(org.kde.exampletooltips, ToolTipExample) -#include "tooltips.moc" - diff --git a/plasma/c++/plasmoids/tooltips/tooltips.h b/plasma/c++/plasmoids/tooltips/tooltips.h deleted file mode 100644 index e9f7c98..0000000 --- a/plasma/c++/plasmoids/tooltips/tooltips.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright 2011 Aaron Seigo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - **/ - -#ifndef TOOLTIPWIDGETEXAMPLE_H -#define TOOLTIPWIDGETEXAMPLE_H - -#include - -class ToolTipExample : public Plasma::Applet -{ -Q_OBJECT -public: - ToolTipExample(QObject *parent, const QVariantList &args); - -private Q_SLOTS: - // these slots could also be public or protected; doesn't matter! - void toolTipAboutToShow(); - void toolTipHidden(); - -private: - int m_count; -}; - -#endif diff --git a/plasma/c++/qml/CMakeLists.txt b/plasma/c++/qml/CMakeLists.txt deleted file mode 100644 index 99a845b..0000000 --- a/plasma/c++/qml/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ - -include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} ) - -add_subdirectory(src) - -# QML-only thing -install(DIRECTORY package/ DESTINATION ${DATA_INSTALL_DIR}/plasma/packages/org.kde.examples.qmlapp) -install(FILES example-qmlapp.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) - diff --git a/plasma/c++/qml/example-qmlapp.desktop b/plasma/c++/qml/example-qmlapp.desktop deleted file mode 100755 index 0d86cc5..0000000 --- a/plasma/c++/qml/example-qmlapp.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Name=Example QML App -Exec=example-qmlapp -Terminal=false -Icon=plasma -Type=Application -Categories=Qt;KDE;Examples diff --git a/plasma/c++/qml/package/contents/images/background.png b/plasma/c++/qml/package/contents/images/background.png deleted file mode 100644 index f3c7232..0000000 Binary files a/plasma/c++/qml/package/contents/images/background.png and /dev/null differ diff --git a/plasma/c++/qml/package/contents/ui/main.qml b/plasma/c++/qml/package/contents/ui/main.qml deleted file mode 100644 index c45fe2e..0000000 --- a/plasma/c++/qml/package/contents/ui/main.qml +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2011 Marco Martin - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import QtQuick 1.0 -import org.kde.plasma.core 0.1 as PlasmaCore - -Image { - id: root - width: 800 - height: 600 - source: "../images/background.png" - fillMode: Image.Tile - - Text { - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - text: i18n("Hello world!") - } -} diff --git a/plasma/c++/qml/package/metadata.desktop b/plasma/c++/qml/package/metadata.desktop deleted file mode 100644 index d46263f..0000000 --- a/plasma/c++/qml/package/metadata.desktop +++ /dev/null @@ -1,17 +0,0 @@ -[Desktop Entry] -Name=Example QML App - -Encoding=UTF-8 -Type=Service -Icon=plasma -X-KDE-ParentApp= -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=mart@kde.org -X-KDE-PluginInfo-Name=org.kde.examples.qmlapp -X-KDE-PluginInfo-Version=1.1 -X-KDE-PluginInfo-Website=http://kde.org -X-KDE-PluginInfo-Category=Information -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-MainScript=ui/main.qml diff --git a/plasma/c++/qml/src/CMakeLists.txt b/plasma/c++/qml/src/CMakeLists.txt deleted file mode 100644 index ccde429..0000000 --- a/plasma/c++/qml/src/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -find_package(KDeclarative REQUIRED) - -include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} ) - -set(example-qmlapp_SRCS - main.cpp - exampleapp.cpp - kdeclarativeview.cpp -) - -kde4_add_executable(example-qmlapp ${example-qmlapp_SRCS}) - -target_link_libraries(example-qmlapp - ${QT_QTDECLARATIVE_LIBRARY} - ${QT_QTOPENGL_LIBRARY} - ${QT_QTSCRIPT_LIBRARY} - ${KDE4_KDEUI_LIBS} - ${KDE4_KIO_LIBS} - ${KDE4_PLASMA_LIBS} - ${KDECLARATIVE_LIBRARIES} -) - -install(TARGETS example-qmlapp ${INSTALL_TARGETS_DEFAULT_ARGS} ) - diff --git a/plasma/c++/qml/src/exampleapp.cpp b/plasma/c++/qml/src/exampleapp.cpp deleted file mode 100644 index ddb3040..0000000 --- a/plasma/c++/qml/src/exampleapp.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/** - * - * Copyright 2011 Sebastian Kügler - * Copyright 2011 Marco Martin - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "exampleapp.h" - -ExampleApp::ExampleApp() - : KDeclarativeView() -{ - setPackageName("org.kde.examples.qmlapp"); -} - -#include "exampleapp.moc" diff --git a/plasma/c++/qml/src/exampleapp.h b/plasma/c++/qml/src/exampleapp.h deleted file mode 100644 index 3783ebd..0000000 --- a/plasma/c++/qml/src/exampleapp.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * - * Copyright 2011 Sebastian Kügler - * Copyright 2011 Marco Martin - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef ABOUTAPP_H -#define ABOUTAPP_H - -#include "kdeclarativeview.h" - -class ExampleApp : public KDeclarativeView -{ - Q_OBJECT -public: - ExampleApp(); -}; - -#endif // ABOUTAPP_H diff --git a/plasma/c++/qml/src/kdeclarativeview.cpp b/plasma/c++/qml/src/kdeclarativeview.cpp deleted file mode 100644 index af7dca7..0000000 --- a/plasma/c++/qml/src/kdeclarativeview.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/** - * - * Copyright 2011 Sebastian Kügler - * Copyright 2011 Marco Martin - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "kdeclarativeview.h" - -#include -#include -#include -#include - -#include - -#include - -#include - -class KDeclarativeViewPrivate -{ -public: - KDeclarativeViewPrivate() - {} - - KDeclarative kdeclarative; - Plasma::PackageStructure::Ptr structure; - Plasma::Package *package; - QString packageName; -}; - -KDeclarativeView::KDeclarativeView(QWidget *parent) - : QDeclarativeView(parent), - d(new KDeclarativeViewPrivate) -{ - // avoid flicker on show - setAttribute(Qt::WA_OpaquePaintEvent); - setAttribute(Qt::WA_NoSystemBackground); - viewport()->setAttribute(Qt::WA_OpaquePaintEvent); - viewport()->setAttribute(Qt::WA_NoSystemBackground); - - setResizeMode(QDeclarativeView::SizeRootObjectToView); - - d->kdeclarative.setDeclarativeEngine(engine()); - d->kdeclarative.initialize(); - //binds things like kconfig and icons - d->kdeclarative.setupBindings(); - - d->structure = Plasma::PackageStructure::load("Plasma/Generic"); - - show(); -} - -KDeclarativeView::~KDeclarativeView() -{ -} - - -void KDeclarativeView::setPackageName(const QString &packageName) -{ - d->package = new Plasma::Package(QString(), packageName, d->structure); - d->packageName = packageName; - setSource(QUrl(d->package->filePath("mainscript"))); -} - -QString KDeclarativeView::packageName() const -{ - return d->packageName; -} - -Plasma::Package *KDeclarativeView::package() const -{ - return d->package; -} - -QSize KDeclarativeView::sizeHint() const -{ - return QSize(800, 600); -} - -QScriptEngine *KDeclarativeView::scriptEngine() const -{ - return d->kdeclarative.scriptEngine(); -} - -#include "kdeclarativeview.moc" diff --git a/plasma/c++/qml/src/kdeclarativeview.h b/plasma/c++/qml/src/kdeclarativeview.h deleted file mode 100644 index 7d4c413..0000000 --- a/plasma/c++/qml/src/kdeclarativeview.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * - * Copyright 2011 Sebastian Kügler - * Copyright 2011 Marco Martin - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef KDECLARATIVEVIEW_H -#define KDECLARATIVEVIEW_H - -#include - -namespace Plasma -{ - class Package; -} - -class QScriptEngine; -class KDeclarativeViewPrivate; - -class KDeclarativeView : public QDeclarativeView -{ - Q_OBJECT - -public: - KDeclarativeView(QWidget *parent = 0); - ~KDeclarativeView(); - - /** - * Sets the package from where load the application QML UI - * The package must be of the type "Generic package" - * it must provide a qml file as "mainscript" - * @arg QString packageName the plugin name of the package - */ - void setPackageName(const QString &packageName); - /** - * @returns the plugin name of the package - */ - QString packageName() const; - - /** - * @returns the plugin name of the package that holds the application QML UI - */ - Plasma::Package *package() const; - - QSize sizeHint() const; - - QScriptEngine *scriptEngine() const; - -private: - KDeclarativeViewPrivate *const d; -}; - -#endif //KDECLARATIVEVIEW_H diff --git a/plasma/c++/qml/src/main.cpp b/plasma/c++/qml/src/main.cpp deleted file mode 100644 index a737aad..0000000 --- a/plasma/c++/qml/src/main.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - * Copyright 2011 Sebastian Kügler - * Copyright 2011 Marco Martin - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// KDE -#include -#include -#include -#include -#include -#include -#include - -// Own -#include "exampleapp.h" - -static const char description[] = I18N_NOOP("Example QML App"); -static const char version[] = "1.0"; - -int main(int argc, char **argv) -{ - KAboutData about("example-qmlapp", 0, ki18n("Example QML App"), version, ki18n(description), - KAboutData::License_GPL, ki18n("Copyright 2011 Marco Martin"), KLocalizedString(), 0, "mart@kde.org"); - about.addAuthor( ki18n("Marco Martin"), KLocalizedString(), "mart@kde.org" ); - about.setProgramIconName("plasma"); - KCmdLineArgs::init(argc, argv, &about); - - KCmdLineOptions options; - - KCmdLineArgs::addCmdLineOptions(options); - KApplication app; - - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - - ExampleApp *mainWindow = new ExampleApp(); - mainWindow->show(); - args->clear(); - return app.exec(); -} diff --git a/plasma/c++/runner/CMakeLists.txt b/plasma/c++/runner/CMakeLists.txt deleted file mode 100644 index 21ea71d..0000000 --- a/plasma/c++/runner/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# Project Needs a name, of course -project(RunnerExample) - -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) -include_directories(${KDE4_INCLUDES}) - -# We add our source code here -set(example_SRCS homefilesrunner.cpp) - -# Now make sure all files get to the right place -kde4_add_plugin(plasma_runner_example_homefiles ${example_SRCS}) -target_link_libraries(plasma_runner_example_homefiles ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS}) - -# Install the library and .desktop file -install(TARGETS plasma_runner_example_homefiles DESTINATION ${PLUGIN_INSTALL_DIR}) -install(FILES plasma-runner-example-homefiles.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/plasma/c++/runner/Messages.sh b/plasma/c++/runner/Messages.sh deleted file mode 100755 index 4fb602e..0000000 --- a/plasma/c++/runner/Messages.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /usr/bin/env bash -$XGETTEXT *.cpp -o $podir/plasma_runner_example_homefiles.pot diff --git a/plasma/c++/runner/homefilesrunner.cpp b/plasma/c++/runner/homefilesrunner.cpp deleted file mode 100644 index 39d0205..0000000 --- a/plasma/c++/runner/homefilesrunner.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2009 Aaron Seigo - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "homefilesrunner.h" - -#include -#include -#include -#include - -#include -#include -#include - -HomeFilesRunner::HomeFilesRunner(QObject *parent, const QVariantList &args) - : AbstractRunner(parent, args) -{ - setIgnoredTypes(Plasma::RunnerContext::NetworkLocation | - Plasma::RunnerContext::Executable | - Plasma::RunnerContext::ShellCommand); - setSpeed(SlowSpeed); - setPriority(LowPriority); - setHasRunOptions(true); -} - -void HomeFilesRunner::init() -{ - reloadConfiguration(); - connect(this, SIGNAL(prepare()), this, SLOT(prepareForMatchSession())); - connect(this, SIGNAL(teardown()), this, SLOT(matchSessionFinished())); -} - -void HomeFilesRunner::reloadConfiguration() -{ - KConfigGroup c = config(); - m_triggerWord = c.readEntry("trigger", QString()); - if (!m_triggerWord.isEmpty()) { - m_triggerWord.append(' '); - } - - m_path = c.readPathEntry("path", QDir::homePath()); - QFileInfo pathInfo(m_path); - if (!pathInfo.isDir()) { - m_path = QDir::homePath(); - } - - QList syntaxes; - Plasma::RunnerSyntax syntax(QString("%1:q:").arg(m_triggerWord), - i18n("Finds files matching :q: in the %1 folder", m_path)); - syntaxes.append(syntax); - setSyntaxes(syntaxes); -} - -void HomeFilesRunner::prepareForMatchSession() -{ - -} - -void HomeFilesRunner::match(Plasma::RunnerContext &context) -{ - QString query = context.query(); - if (query == QChar('.') || query == "..") { - return; - } - - if (!m_triggerWord.isEmpty()) { - if (!query.startsWith(m_triggerWord)) { - return; - } - - query.remove(0, m_triggerWord.length()); - } - - if (query.length() > 2) { - query.prepend('*').append('*'); - } - - QDir dir(m_path); - QList matches; - - foreach (const QString &file, dir.entryList(QStringList(query))) { - const QString path = dir.absoluteFilePath(file); - if (!path.startsWith(m_path)) { - // this file isn't in our directory; looks like we got a query with some - // ..'s in it! - continue; - } - - if (!context.isValid()) { - return; - } - - Plasma::QueryMatch match(this); - match.setText(i18n("Open %1", path)); - match.setData(path); - match.setId(path); - if (m_iconCache.contains(path)) { - match.setIcon(m_iconCache.value(path)); - } else { - KIcon icon(KMimeType::iconNameForUrl(path)); - m_iconCache.insert(path, icon); - match.setIcon(icon); - } - - if (file.compare(query, Qt::CaseInsensitive)) { - match.setRelevance(1.0); - match.setType(Plasma::QueryMatch::ExactMatch); - } else { - match.setRelevance(0.8); - } - - matches.append(match); - } - - context.addMatches(context.query(), matches); -} - -void HomeFilesRunner::matchSessionFinished() -{ - m_iconCache.clear(); -} - -void HomeFilesRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) -{ - Q_UNUSED(context) - // KRun autodeletes itself, so we can just create it and forget it! - KRun *opener = new KRun(match.data().toString(), 0); - opener->setRunExecutables(false); -} - -void HomeFilesRunner::createRunOptions(QWidget *widget) -{ - QVBoxLayout *layout = new QVBoxLayout(widget); - QCheckBox *cb = new QCheckBox(widget); - cb->setText(i18n("This is just for show")); - layout->addWidget(cb); -} - -K_EXPORT_PLASMA_RUNNER(example-homefiles, HomeFilesRunner) - diff --git a/plasma/c++/runner/homefilesrunner.h b/plasma/c++/runner/homefilesrunner.h deleted file mode 100644 index c535380..0000000 --- a/plasma/c++/runner/homefilesrunner.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2009 Aaron Seigo - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef HOMEFILES_H -#define HOMEFILES_H - -#include - -#include - -#include - -class HomeFilesRunner : public Plasma::AbstractRunner -{ - Q_OBJECT - -public: - HomeFilesRunner(QObject *parent, const QVariantList &args); - - void match(Plasma::RunnerContext &context); - void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match); - void createRunOptions(QWidget *widget); - void reloadConfiguration(); - -protected Q_SLOTS: - void init(); - void prepareForMatchSession(); - void matchSessionFinished(); - -private: - QHash m_iconCache; - QString m_path; - QString m_triggerWord; -}; - -#endif - diff --git a/plasma/c++/runner/plasma-runner-example-homefiles.desktop b/plasma/c++/runner/plasma-runner-example-homefiles.desktop deleted file mode 100644 index 1729b35..0000000 --- a/plasma/c++/runner/plasma-runner-example-homefiles.desktop +++ /dev/null @@ -1,17 +0,0 @@ -[Desktop Entry] -Name=Home Files -Comment=Part of a tutorial demonstrating how to create Runner plugins -Icon=user-home -Type=Service -X-KDE-ServiceTypes=Plasma/Runner - -X-KDE-Library=plasma_runner_example_homefiles -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=example-homefiles -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/declarative/CMakeLists.txt b/plasma/declarative/CMakeLists.txt deleted file mode 100644 index 22d932a..0000000 --- a/plasma/declarative/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -add_subdirectory(wallpapers) - -# addons -install(DIRECTORY addons/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.addons-example-qml) -install(FILES addons/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME addons-example.desktop) -# fakemail -install(DIRECTORY fakemail/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/fakemail-qml) -install(FILES fakemail/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME akemail-example.desktop) -# nowplaying -install(DIRECTORY nowplaying/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.nowplaying-qml) -install(FILES nowplaying/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME nowplaying-example.desktop) -# qmltasks -install(DIRECTORY qmltasks/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/qmltasks) -install(FILES qmltasks/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME qmltasks-example.desktop) -# samegame -install(DIRECTORY samegame/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.samegame-qml) -install(FILES samegame/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME samegame-example.desktop) - -# widgetgallery -install(DIRECTORY widgetgallery/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.example.widgetgallery) -install(FILES widgetgallery/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-applet-org.kde.example.widgetgallery.desktop) diff --git a/plasma/declarative/addons/contents/qml/include.js b/plasma/declarative/addons/contents/qml/include.js deleted file mode 100644 index 0a91258..0000000 --- a/plasma/declarative/addons/contents/qml/include.js +++ /dev/null @@ -1,2 +0,0 @@ - -print("Hello, i'm a file included by an addon, and i live in the applet package!") diff --git a/plasma/declarative/addons/contents/qml/main.qml b/plasma/declarative/addons/contents/qml/main.qml deleted file mode 100644 index 3ce9659..0000000 --- a/plasma/declarative/addons/contents/qml/main.qml +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2010 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import Qt 4.7 -import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets -import org.kde.plasma.core 0.1 as PlasmaCore -import org.kde.plasma.graphicslayouts 4.7 as GraphicsLayouts - -QGraphicsWidget { - id: page; - preferredSize: "250x600" - minimumSize: "200x200" - - Item { - PlasmaCore.Svg { - id:svgExample - imagePath: "widgets/clock" - } - } - - Component.onCompleted: { - plasmoid.addEventListener('ConfigChanged', configChanged) - plasmoid.addEventListener("addoncreated", addonCreated) - plasmoid.addEventListener("initExtenderItem", initExtenderItem) - - print(i18n("Translated message")); - - var addons = plasmoid.listAddons("org.kde.plasma.javascript-addons-example") - - if (addons.length < 1) { - // uh-oh, something didn't work! - print("You probably need to run `plasmapkg -t Plasma/JavascriptAddon -i exampleAddon && kbuildsycoca4`") - } else { - print("number of addons: "+ addons.length) - - print(plasmoid.loadAddon("org.kde.plasma.javascript-addons-example", addons[0].id)) - } - - var e = plasmoid.extender() - if (e.hasItem("yes!")) { - print(i18n("We already have our extender, it will be recreated for us. Expect a call to initEtenderItem.")); - } else { - // new ExtenderItems are automatically added to our widget's Extender - var ext = new ExtenderItem - ext.name = "yes!" - initExtenderItem(ext) - } - } - - function initExtenderItem(item) - { - extenderButton.text = i18n("Hello") - item.widget = extenderButton - print(i18n("Widget in Extender '%1' has text '%2'", item.name, extenderButton.text)) - } - - function addonCreated(addon) - { - print("Addon says: " + addon.toString()); - label.text = addon.toString() - if (addon.svg) { - svgWidget.svg = addon.svg - } - } - - function configChanged() - { - print("Configuration changed listener"); - } - - function openFileDialogAccepted(dialog) - { - var url = dialog.url - print("open this file! " + url.protocol + ' ' + url.host + ' ' + url.path) - - if (plasmoid['openUrl']) { - plasmoid.openUrl(url); - } else { - print("no openUrl method available to us!") - } - } - - function openFileDialogFinished(dialog) - { - dialog.accepted.disconnect(openFileDialogAccepted) - dialog.finished.disconnect(openFileDialogFinished) - plasmoid.gc() - } - - PlasmaWidgets.PushButton { - id: extenderButton - } - - layout: GraphicsLayouts.QGraphicsLinearLayout { - orientation: Qt.Vertical - PlasmaWidgets.Label { - id: label - text: "Testing Javascript addons" - } - - PlasmaWidgets.PushButton { - id: openButton - text: "Open File" - icon: QIcon("document-open") - onClicked: { - print("opening a file?") - var dialog = new OpenFileDialog() - print(dialog) - dialog.accepted.connect(openFileDialogAccepted) - dialog.finished.connect(openFileDialogFinished) - dialog.show() - } - } - - PlasmaWidgets.SvgWidget { - id: svgWidget - } - } - -} diff --git a/plasma/declarative/addons/metadata.desktop b/plasma/declarative/addons/metadata.desktop deleted file mode 100644 index be6c8ce..0000000 --- a/plasma/declarative/addons/metadata.desktop +++ /dev/null @@ -1,32 +0,0 @@ -[Desktop Entry] -Name=Addons example (QML) -Name[km]=ឧទាហរណ៍​បន្ថែម (QML) -Name[nds]=Verwiedern-Bispill (QML) -Name[pt]=Exemplo de extensão (QML) -Name[pt_BR]=Exemplo de extensão (QML) -Name[sv]=Tilläggsexempel (QML) -Name[uk]=Приклад додатків (QML) -Name[x-test]=xxAddons example (QML)xx -Comment=An example on how to use javascript addons in the qml plasmoids -Comment[km]=ឧទាហរណ៍​អំពី​វិធី​ប្រើ​ផ្នែក​បន្ថែម javascript នៅ​ក្នុង qml plasmoids -Comment[pt]=Um exemplo de utilização de extensões em JavaScript nos plasmóides em QML -Comment[pt_BR]=Um exemplo de utilização de extensões em JavaScript nos plasmoides em QML -Comment[sv]=Ett exempel på hur Javascript-tillägg används i QML-plasmoider -Comment[uk]=Приклад використання додатків javascript у плазмоїдах мовою qml -Comment[x-test]=xxAn example on how to use javascript addons in the qml plasmoidsxx -Encoding=UTF-8 -ServiceTypes=Plasma/Applet -Type=Service -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-Email=notmart@gmail.com -X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=org.kde.addons-example-qml -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=qml/main.qml -X-Plasma-RequiredExtensions=FileDialog -X-Plasma-OptionalExtensions=LaunchApp diff --git a/plasma/declarative/fakemail/contents/qml/components/Composer.qml b/plasma/declarative/fakemail/contents/qml/components/Composer.qml deleted file mode 100644 index f4326f6..0000000 --- a/plasma/declarative/fakemail/contents/qml/components/Composer.qml +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2010 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import Qt 4.7 -import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets -import org.kde.plasma.core 0.1 as PlasmaCore -import org.kde.plasma.graphicslayouts 4.7 as GraphicsLayouts - -QGraphicsWidget { - id: root; - - signal backClicked - signal sendClicked - - property string subjectText: "" - property string bodyText: "" - property string toText: "" - - - PlasmaWidgets.Frame { - id: frame - anchors.left: parent.left - anchors.right: parent.right - frameShadow : "Raised" - - layout: GraphicsLayouts.QGraphicsGridLayout { - id : lay - - PlasmaWidgets.PushButton { - GraphicsLayouts.QGraphicsGridLayout.row : 0 - GraphicsLayouts.QGraphicsGridLayout.column : 0 - GraphicsLayouts.QGraphicsGridLayout.columnMaximumWidth : 30 - text: "Back" - onClicked: { - root.backClicked() - } - } - - - PlasmaWidgets.PushButton { - id: fromButton - GraphicsLayouts.QGraphicsGridLayout.row : 0 - GraphicsLayouts.QGraphicsGridLayout.column : 1 - text: "John" - } - - PlasmaWidgets.LineEdit { - minimumSize.height : fromButton.size.height - GraphicsLayouts.QGraphicsGridLayout.row : 0 - GraphicsLayouts.QGraphicsGridLayout.column : 2 - GraphicsLayouts.QGraphicsGridLayout.columnSpan : 2 - //QGraphicsGridLayout.alignment : QGraphicsGridLayout.Center - text: root.subjectText - } - - - - PlasmaWidgets.PushButton { - id: toButton - GraphicsLayouts.QGraphicsGridLayout.row : 1 - GraphicsLayouts.QGraphicsGridLayout.column : 1 - text: "To:" - } - PlasmaWidgets.LineEdit { - minimumSize.height : toButton.size.height - GraphicsLayouts.QGraphicsGridLayout.row : 1 - GraphicsLayouts.QGraphicsGridLayout.column : 2 - GraphicsLayouts.QGraphicsGridLayout.columnStretchFactor : 3 - text: root.toText - } - PlasmaWidgets.PushButton { - GraphicsLayouts.QGraphicsGridLayout.row : 1 - GraphicsLayouts.QGraphicsGridLayout.column : 3 - text: "Send" - onClicked: { - root.sendClicked() - } - } - } - } - - Item { - PlasmaCore.Theme { - id: theme - } - } - - PlasmaWidgets.WebView { - id : text - - anchors.left: parent.left - anchors.leftMargin: 60 - anchors.right: parent.right - anchors.top : frame.bottom - anchors.bottom : parent.bottom - width : parent.width - 60 - dragToScroll : true - html: "
"+root.bodyText+"
" - } - - - PlasmaWidgets.PushButton { - id : buttonA - anchors.left: parent.left - anchors.top: parent.bottom - text: "A" - rotation : -90 - } - PlasmaWidgets.PushButton { - id : buttonActions - anchors.left: parent.left - anchors.bottom: buttonA.top - anchors.bottomMargin : 25 - text: "Actions" - rotation : -90 - } -} \ No newline at end of file diff --git a/plasma/declarative/fakemail/contents/qml/components/MessageDetails.qml b/plasma/declarative/fakemail/contents/qml/components/MessageDetails.qml deleted file mode 100644 index 5b9bda8..0000000 --- a/plasma/declarative/fakemail/contents/qml/components/MessageDetails.qml +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2010 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import Qt 4.7 -import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets -import org.kde.plasma.core 0.1 as PlasmaCore -import org.kde.plasma.graphicslayouts 4.7 as GraphicsLayouts - -QGraphicsWidget { - id: mainWidget - property int currentIndex: 0 - - signal replyClicked - signal forwardClicked - signal backClicked - - property string subjectText: "" - property string bodyText: "" - property string fromText: "" - - Item { - id : main - anchors.fill : mainWidget - - PlasmaCore.Theme { - id: theme - } - - Component { - id : messageDelegate - - Item { - id: content - width: mainView.width - height: mainView.height - - - PlasmaWidgets.WebView { - id : bodyView - width : content.width - height: content.height - dragToScroll : true - html: "
Subject:"+subject+"
From:"+from+"
"+body+"" - } - } - } - - MessagesModel { - id: model - } - - PlasmaWidgets.Frame { - id: toolBar - width: main.width - frameShadow : "Raised" - - layout: GraphicsLayouts.QGraphicsLinearLayout { - PlasmaWidgets.PushButton { - text: "Back" - onClicked: { - mainWidget.backClicked() - } - } - PlasmaWidgets.PushButton { - text: "Reply" - onClicked: { - mainWidget.subjectText = model.get(mainView.currentIndex).subject - mainWidget.bodyText = model.get(mainView.currentIndex).body - mainWidget.fromText = model.get(mainView.currentIndex).from - mainWidget.replyClicked() - } - } - PlasmaWidgets.PushButton { - text: "Forward" - onClicked: { - mainWidget.forwardClicked() - } - } - QGraphicsWidget{} - } - } - - ListView { - id : mainView - anchors.top : toolBar.bottom - anchors.bottom: main.bottom - anchors.left: main.left - anchors.right: main.right - - /*contentWidth: content.width - contentHeight: content.height*/ - highlightRangeMode: ListView.StrictlyEnforceRange - clip : true - orientation: ListView.Horizontal - snapMode: ListView.SnapOneItem - - model: model - - delegate: messageDelegate - currentIndex: mainWidget.currentIndex - - /*Connections { - target: messageList - onItemClicked: mainView.currentIndex = 1 - onNewClicked: mainView.currentIndex = 1 - }*/ - } - } -} diff --git a/plasma/declarative/fakemail/contents/qml/components/MessageList.qml b/plasma/declarative/fakemail/contents/qml/components/MessageList.qml deleted file mode 100644 index fe78434..0000000 --- a/plasma/declarative/fakemail/contents/qml/components/MessageList.qml +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2010 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import Qt 4.7 -import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets -import org.kde.plasma.core 0.1 as PlasmaCore -import org.kde.plasma.graphicslayouts 4.7 as GraphicsLayouts - -QGraphicsWidget { - id: mainWidget - - property int currentIndex: list.currentIndex - - signal itemClicked - signal newClicked - - Item { - id: main - width: mainWidget.width - height: mainWidget.height - - PlasmaCore.Theme { - id: theme - } - - Component { - id : messageDelegate - PlasmaCore.FrameSvgItem { - id: delegateItem - imagePath: "widgets/frame" - prefix: "plain" - width: list.width - height: delegateLayout.height+5 - - Column { - id : delegateLayout - spacing: 5 - - Text { - color: theme.textColor - text: subject - } - Text { - color: theme.textColor - text: from - } - } - - MouseArea { - id: itemMouse - anchors.fill: delegateItem - onClicked: { - list.currentIndex = index - mainWidget.itemClicked() - } - } - } - } - - - PlasmaWidgets.Frame { - id: frame - anchors.left: parent.left - anchors.right: parent.right - frameShadow : "Raised" - - layout : GraphicsLayouts.QGraphicsLinearLayout { - PlasmaWidgets.PushButton { - //FIXME: either icons should be accessible by name or bindings for KIcon would be neede - //icon: "mail-message-new" - text: "Write" - onClicked : mainWidget.newClicked() - } - PlasmaWidgets.PushButton { - //icon: "mail-receive" - text: "Check" - } - - QGraphicsWidget{} - - PlasmaWidgets.LineEdit { - clickMessage: "Search..." - clearButtonShown: true - } - } - } - - MessagesModel { - id: model - } - - ListView { - id: list - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.top: frame.bottom - spacing: 5; - clip: true - model: model - delegate: messageDelegate - } - - } - -} \ No newline at end of file diff --git a/plasma/declarative/fakemail/contents/qml/components/MessagesModel.qml b/plasma/declarative/fakemail/contents/qml/components/MessagesModel.qml deleted file mode 100644 index 0497dbc..0000000 --- a/plasma/declarative/fakemail/contents/qml/components/MessagesModel.qml +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2010 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import Qt 4.7 - -ListModel { - id: messagesModel - ListElement { - from: "John Doe " - subject: "Hello" - body: "Hello, how are you?" - } - ListElement { - from: "Foo Bar " - subject: "[PATCH] Crash fix" - body: "Hello,
this patch will fix the problem you encounered
Duis et tellus nunc, lobortis porta tellus. Phasellus id erat mauris, sed sagittis elit. Aenean sodales vestibulum nisi non condimentum. Aenean a felis vitae leo bibendum suscipit." - } - ListElement { - from: "John Doe " - subject: "Hello" - body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin massa enim, dapibus a fringilla at, interdum et nisl. Cras volutpat nisl et neque faucibus convallis. Vivamus dapibus placerat diam ut congue. Quisque eu leo id sapien lacinia vestibulum." - } - ListElement { - from: "British Lottery " - subject: "[SPAM] Lottery" - body: "You won the $3 billion first prize!" - } - ListElement { - from: "John Doe " - subject: "Things" - body: "Donec pulvinar eleifend turpis, eget gravida dolor eleifend et. Etiam commodo leo a nisl viverra eget suscipit urna volutpat. Morbi ut diam non mi eleifend commodo quis a urna. Aenean rutrum dignissim metus, vel commodo tellus tincidunt non. Donec tempus sem at erat consectetur ornare id quis magna." - } - ListElement { - from: "John Doe " - subject: "What about tomorrow?" - body: "Etiam dapibus cursus lectus, eget tristique odio cursus in. Suspendisse bibendum risus eget tellus cursus vulputate. Curabitur placerat lacus gravida ipsum euismod id lacinia est mollis. Cras iaculis felis at purus mollis suscipit. Integer tempor hendrerit sodales. Praesent eu rhoncus felis.
Maecenas ut nisi augue. Proin non sapien fringilla nibh pretium dignissim. Pellentesque ut erat eget lacus vestibulum pulvinar sollicitudin ac libero. Fusce fringilla ligula id metus viverra dictum." - } - ListElement { - from: "John Doe " - subject: "Lorem ipsum" - body: "Quisque porta consectetur ante, in pretium leo sollicitudin in. Praesent rutrum dignissim sagittis. Aenean faucibus est a ligula lobortis auctor. Nam tincidunt odio ac nisi laoreet mattis. Proin in aliquam ligula. Pellentesque et est vitae lorem hendrerit commodo suscipit ullamcorper augue. Nullam sed malesuada nisl. Maecenas feugiat lectus vitae leo pulvinar cursus. Etiam in justo sit amet enim pellentesque rhoncus. Pellentesque vel nisi leo, id semper turpis." - } - ListElement { - from: "John Doe " - subject: "Dolor sit amet" - body: "Nulla ac massa magna, a vulputate tellus. Donec a nisl sed sapien venenatis aliquam. Cras at turpis velit. Suspendisse pellentesque est sit amet felis condimentum blandit. Aenean ut quam at orci elementum semper. Nulla sit amet pellentesque eros. Ut fermentum dolor a turpis interdum imperdiet. Proin vel leo eu quam facilisis volutpat." - } - ListElement { - from: "John Doe " - subject: "consectetur adipiscing elit" - body: "Suspendisse rutrum ultrices tempus. Duis et tellus nunc, lobortis porta tellus. Phasellus id erat mauris, sed sagittis elit. Aenean sodales vestibulum nisi non condimentum. Aenean a felis vitae leo bibendum suscipit." - } - ListElement { - from: "John Doe " - subject: "Proin massa enim" - body: "Maecenas velit ante, rutrum non sollicitudin et, fringilla id nulla. Nullam ac sem eget justo consectetur iaculis. Duis semper semper mauris, vitae mattis sem sagittis a. Pellentesque vel dolor justo." - } - ListElement { - from: "John Doe " - subject: "dapibus a fringilla at" - body: "Curabitur a suscipit augue. Nunc vehicula, magna pretium fringilla malesuada, urna ante vulputate libero, eget ultrices ante orci pulvinar urna. Phasellus interdum orci a neque pellentesque condimentum tincidunt lectus consequat. Nunc venenatis odio sodales nunc blandit accumsan a a enim." - } - ListElement { - from: "John Doe " - subject: "Quisque porta consectetur ante" - body: "Phasellus odio eros, eleifend ac consectetur sed, luctus nec tortor. Maecenas et orci et eros condimentum imperdiet ac tempor augue. Aenean ut quam at orci elementum semper. Nulla sit amet pellentesque eros. Ut fermentum dolor a turpis interdum imperdiet. Proin vel leo eu quam facilisis volutpat." - } - ListElement { - from: "John Doe " - subject: "Nam tincidunt odio ac nisi laoreet mattis" - body: "Cras iaculis felis at purus mollis suscipit. Integer tempor hendrerit sodales. Praesent eu rhoncus felis. Maecenas ut nisi augue. Proin non sapien fringilla nibh pretium dignissim. Pellentesque ut erat eget lacus vestibulum pulvinar sollicitudin ac libero. Fusce fringilla ligula id metus viverra dictum." - } - ListElement { - from: "John Doe " - subject: "Suspendisse rutrum ultrices tempus" - body: "Donec tempus sem at erat consectetur ornare id quis magna. Vestibulum at neque sapien, at convallis nisi. In risus metus, hendrerit venenatis pellentesque at, auctor vel turpis. Curabitur vitae est non orci tempus pulvinar. Praesent sem urna, ullamcorper ac ultricies ut, mollis sit amet mauris." - } - ListElement { - from: "John Doe " - subject: "Duis et tellus nunc" - body: "Proin in aliquam ligula. Pellentesque et est vitae lorem hendrerit commodo suscipit ullamcorper augue. Nullam sed malesuada nisl. Maecenas feugiat lectus vitae leo pulvinar cursus. Etiam in justo sit amet enim pellentesque rhoncus. Pellentesque vel nisi leo, id semper turpis." - } - ListElement { - from: "John Doe " - subject: "Aenean a felis vitae" - body: "Phasellus id erat mauris, sed sagittis elit. Aenean sodales vestibulum nisi non condimentum. Aenean a felis vitae leo bibendum suscipit. Maecenas velit ante, rutrum non sollicitudin et, fringilla id nulla. Nullam ac sem eget justo consectetur iaculis. Duis semper semper mauris, vitae mattis sem sagittis a. Pellentesque vel dolor justo. Curabitur a suscipit augue. Nunc vehicula, magna pretium fringilla malesuada, urna ante vulputate libero, eget ultrices ante orci pulvinar urna." - } - ListElement { - from: "John Doe " - subject: "Vivamus auctor arcu metus" - body: "Duis consectetur rhoncus leo, at scelerisque risus ornare a. Nunc blandit enim vitae lectus eleifend molestie. Aenean bibendum tincidunt lacinia. Donec nulla urna, adipiscing non euismod ut, porttitor eu libero. Donec semper, eros aliquet vulputate rutrum, ligula orci tempus mauris, ac iaculis nibh tortor sed massa. Praesent in felis at lacus facilisis molestie lobortis ac quam. Etiam sodales aliquam libero, vitae facilisis diam aliquet laoreet. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque pretium varius aliquam. Sed porta volutpat laoreet." - } -} \ No newline at end of file diff --git a/plasma/declarative/fakemail/contents/qml/main.qml b/plasma/declarative/fakemail/contents/qml/main.qml deleted file mode 100644 index f7f1e1c..0000000 --- a/plasma/declarative/fakemail/contents/qml/main.qml +++ /dev/null @@ -1,71 +0,0 @@ -import Qt 4.7 -import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets -import org.kde.plasma.core 0.1 as PlasmaCore -import org.kde.plasma.graphicslayouts 4.7 as GraphicsLayouts - -import "components" - -QGraphicsWidget { - id : main - - Item { - id: mainItem - anchors.fill: main - PlasmaWidgets.TabBar { - id : mainView - anchors.fill : mainItem - tabBarShown: false - - MessageList { - id : messageList - PlasmaWidgets.TabBar.tabText : "Page" - } - MessageDetails { - id : messageDetails - } - Composer { - id : composer - } - } - - - Connections { - target: messageList - onItemClicked: { - mainView.currentIndex = 1 - messageDetails.currentIndex = messageList.currentIndex - } - onNewClicked: { - composer.subjectText = "" - composer.bodyText = "" - composer.toText = "" - mainView.currentIndex = 2 - } - } - - Connections { - target: messageDetails - onBackClicked: mainView.currentIndex = 0 - - onReplyClicked: { - composer.subjectText = messageDetails.subjectText - composer.bodyText = messageDetails.bodyText - composer.toText = messageDetails.fromText - mainView.currentIndex = 2 - } - onForwardClicked: { - composer.subjectText = messageDetails.subjectText - composer.bodyText = messageDetails.bodyText - composer.toText = messageDetails.fromText - mainView.currentIndex = 2 - } - } - - Connections { - target: composer - onBackClicked: mainView.currentIndex = 0 - onSendClicked: mainView.currentIndex = 0 - } - } - -} diff --git a/plasma/declarative/fakemail/metadata.desktop b/plasma/declarative/fakemail/metadata.desktop deleted file mode 100644 index 7b8e2b0..0000000 --- a/plasma/declarative/fakemail/metadata.desktop +++ /dev/null @@ -1,32 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Fake mail client (QML) -Name[en_GB]=Fake mail client (QML) -Name[km]=កម្មវិធី​ផ្ញើ​សំបុត្រ​ក្លែង​ក្លាយ (QML) -Name[pt]=Cliente de e-mail falso (QML) -Name[pt_BR]=Cliente de e-mail falso (QML) -Name[sv]=E-postprogram för test (QML) -Name[uk]=Тестова клієнтська поштова програма (QML) -Name[x-test]=xxFake mail client (QML)xx -Comment=A proof of concept of a mail app ui written in qml -Comment[en_GB]=A proof of concept of a mail app ui written in qml -Comment[km]=ការ​ផ្ទៀង​ផ្ទាត់​បែប​បទ​ចំណុច​ប្រទាក់​កម្មវិធី​ផ្ញើ​សំបុត្រ​ដែល​សរសេរ​ជា​ qml -Comment[pt]=Uma prova de conceito de uma interface de e-mail feita em QML -Comment[pt_BR]=Uma prova de conceito de uma interface de e-mail feita em QML -Comment[sv]=Ett koncept för ett e-postprograms användargränssnitt skrivet i QML -Comment[uk]=Тестовий інтерфейс роботи з електронною поштою, написаний мовою qml -Comment[x-test]=xxA proof of concept of a mail app ui written in qmlxx -Type=Service -ServiceTypes=Plasma/Applet -Icon=kmail -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=qml/main.qml -X-KDE-PluginInfo-Author=MArco MArtin -X-KDE-PluginInfo-Email=notmart@gmail.com -X-KDE-PluginInfo-Name=fakemail-qml -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/declarative/helloworld/contents/ui/main.qml b/plasma/declarative/helloworld/contents/ui/main.qml deleted file mode 100644 index 4fed736..0000000 --- a/plasma/declarative/helloworld/contents/ui/main.qml +++ /dev/null @@ -1,32 +0,0 @@ -// -*- coding: iso-8859-1 -*- -/* - * Copyright 2012 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 1.1 -import org.kde.plasma.core 0.1 as PlasmaCore -import org.kde.plasma.components 0.1 as PlasmaComponents - -Item { - property int minimumWidth: 200 - property int minimumHeight: 300 - - PlasmaComponents.Label { - text: i18n("Hello world") - } -} diff --git a/plasma/declarative/helloworld/metadata.desktop b/plasma/declarative/helloworld/metadata.desktop deleted file mode 100644 index bcb1fbf..0000000 --- a/plasma/declarative/helloworld/metadata.desktop +++ /dev/null @@ -1,20 +0,0 @@ -[Desktop Entry] -Comment= -Encoding=UTF-8 -Keywords= -Name=hello world -Type=Service -Icon=package_toys -X-KDE-ParentApp= -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Category=Miscellaneous -X-KDE-PluginInfo-Email=mart@kde.org -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=org.kde.examples.helloworld -X-KDE-PluginInfo-Version= -X-KDE-PluginInfo-Website= -X-KDE-ServiceTypes=Plasma/Applet,Plasma/PopupApplet -X-Plasma-API=declarativeappletscript -X-Plasma-DefaultSize=200,100 -X-Plasma-MainScript=ui/main.qml -X-Plasma-RemoteLocation= diff --git a/plasma/declarative/helloworldcustompopup/contents/ui/main.qml b/plasma/declarative/helloworldcustompopup/contents/ui/main.qml deleted file mode 100644 index 86808a3..0000000 --- a/plasma/declarative/helloworldcustompopup/contents/ui/main.qml +++ /dev/null @@ -1,38 +0,0 @@ -// -*- coding: iso-8859-1 -*- -/* - * Copyright 2012 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 1.1 -import org.kde.plasma.core 0.1 as PlasmaCore -import org.kde.plasma.components 0.1 as PlasmaComponents - -Item { - property int minimumWidth: 200 - property int minimumHeight: 300 - property Component compactRepresentation: Component { - PlasmaComponents.Button { - text: i18n("Click me") - onClicked: plasmoid.togglePopup() - } - } - - PlasmaComponents.Label { - text: i18n("Hello world") - } -} diff --git a/plasma/declarative/helloworldcustompopup/metadata.desktop b/plasma/declarative/helloworldcustompopup/metadata.desktop deleted file mode 100644 index bcb1fbf..0000000 --- a/plasma/declarative/helloworldcustompopup/metadata.desktop +++ /dev/null @@ -1,20 +0,0 @@ -[Desktop Entry] -Comment= -Encoding=UTF-8 -Keywords= -Name=hello world -Type=Service -Icon=package_toys -X-KDE-ParentApp= -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Category=Miscellaneous -X-KDE-PluginInfo-Email=mart@kde.org -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=org.kde.examples.helloworld -X-KDE-PluginInfo-Version= -X-KDE-PluginInfo-Website= -X-KDE-ServiceTypes=Plasma/Applet,Plasma/PopupApplet -X-Plasma-API=declarativeappletscript -X-Plasma-DefaultSize=200,100 -X-Plasma-MainScript=ui/main.qml -X-Plasma-RemoteLocation= diff --git a/plasma/declarative/localegallery/contents/ui/main.qml b/plasma/declarative/localegallery/contents/ui/main.qml deleted file mode 100644 index ca7fc8b..0000000 --- a/plasma/declarative/localegallery/contents/ui/main.qml +++ /dev/null @@ -1,484 +0,0 @@ -// -*- coding: iso-8859-1 -*- -/* - * Author: Giorgos Tsiapaliwkas - * Date: Wed Feb 15 2012, 18:28:32 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 1.1 -import org.kde.plasma.components 0.1 as PlasmaComponents -import org.kde.locale 0.1 - -Item { - id: root - property int minimumHeight: 200 - property int minimumWidth: 500 - Column { - id: column - width: parent.width - height: parent.height - anchors.horizontalCenter: root.horizontalCenter - spacing: 20 - Text { - id: text1 - anchors.horizontalCenter: column.horizontalCenter - text: "This is a test plasmoid for the locale bindings" - color: "black" - } - - Text { - id: text2 - anchors.horizontalCenter: column.horizontalCenter - text: "If you see this text,that means that every " + - " non printable property/method has been already set. And it works!!" - color: "black" - } - - PlasmaComponents.Button { - id: bt1 - anchors.horizontalCenter: column.horizontalCenter - text: "click in order to test the Locale component" - onClicked:{ - console.log("=====Locale Component====") - console.log("country:" + locale.country) - - locale.binaryUnitDialect = Locale.IECBinaryDialect - locale.calendarSystem = Locale.CopticCalendar - - locale.countryDivisionCode = "AL" - console.log("countryDivisionCode:" + locale.countryDivisionCode) - - console.log("currencyCode:" + locale.currencyCode) - - locale.currencySymbol = "$" - console.log("currencySymbol:" + locale.currencySymbol) - - locale.dateTimeDigitSet = Locale.EasternArabicIndicDigits - - locale.dateFormat = "Y" - console.log("dateFormat:" + locale.dateFormat) - - locale.dateFormatShort = "Y" - console.log("dateFormatShort:" + locale.dateFormatShort) - - locale.dateMonthNamePossessive = false - console.log("dateMonthNamePossessive:" + locale.dateMonthNamePossessive) - - locale.decimalPlaces = 2 - console.log("decimalPlaces:" + locale.decimalPlaces) - - locale.decimalSymbol = "." - console.log("decimalSymbol:" + locale.decimalSymbol) - - locale.digitSet = Locale.EasternArabicIndicDigits - console.log("digitSet:" + locale.digitSet) - - console.log("language:" + locale.language) - - locale.measureSystem = Locale.Imperial - - locale.monetaryDecimalPlaces = 3 - console.log("monetaryDecimalPlaces:" + locale.monetaryDecimalPlaces) - - locale.monetaryDecimalSymbol = "." - console.log("monetaryDecimalSymbol:" + locale.monetaryDecimalSymbol) - - locale.monetaryDigitSet = Locale.EasternArabicIndicDigits - - locale.monetaryThousandsSeparator = "." - console.log("monetaryThousandsSeparator:" + locale.monetaryThousandsSeparator) - - locale.negativeMonetarySignPosition = Locale.AfterMoney - - locale.negativePrefixCurrencySymbol = false - console.log("negativePrefixCurrencySymbol:" + locale.negativePrefixCurrencySymbol) - - locale.negativeSign = "-" - console.log("negativeSign:" + locale.negativeSign) - - locale.pageSize = 6 - console.log("pageSize:" + locale.pageSize) - - locale.positiveMonetarySignPosition = Locale.AfterMoney - - locale.positivePrefixCurrencySymbol = false - console.log("positivePrefixCurrencySymbol:" + locale.positivePrefixCurrencySymbol) - - locale.positiveSign = "+" - console.log("positiveSign:" + locale.positiveSign) - - locale.thousandsSeparator = "." - console.log("thousandsSeparator:" + locale.thousandsSeparator) - - locale.weekDayOfPray = 10 - console.log("weekDayOfPray:" + locale.weekDayOfPray) - - locale.weekNumberSystem = Locale.FirstFullWeek - - locale.weekStartDay = 3 - console.log("weekStartDay:" + locale.weekStartDay) - - locale.workingWeekEndDay = 6 - console.log("workingWeekEndDay:" + locale.workingWeekEndDay) - - locale.workingWeekStartDay = 2 - console.log("workingWeekStartDay:" + locale.workingWeekEndDay) - - console.log("use12Clock:" + locale.use12Clock) - - console.log("defaultLanguage:" + locale.defaultLanguage) - - console.log("defaultCountry:" + locale.defaultCountry) - - console.log("defaultCurrencyCode:" + locale.defaultCurrencyCode) - - console.log("the useTranscript:" + locale.useTranscript) - - console.log("the encodingMib:" + locale.encodingMib) - - for (var i in locale.languageList) { - console.log("languageList:" + locale.languageList[i]) - } - - for (var i in locale.currencyCodeList) { - console.log("currencyCodeList:" + locale.currencyCodeList[i]) - } - - for (var i in locale.installedLanguages) { - console.log("installedLanguages:" + locale.installedLanguages[i]) - } - - for (var i in locale.allCountriesList) { - console.log("allCountriesList:" + locale.allCountriesList[i]) - } - - console.log("formatDate:" + locale.formatDate("2010-05-05")) - - console.log("formatDateTime:" + locale.formatDateTime("2010-05-05")) - - console.log("formatMoney:" + locale.formatMoney(10)) - - console.log("formatLong:" + locale.formatLong(10)) - - console.log("formatByteSize:" + locale.formatByteSize(10)) - - console.log("formatDuration:" + locale.formatDuration(10)) - - console.log("prettyFormatDuration:" + locale.prettyFormatDuration(10)) - - console.log("formatLocaleTime:" + locale.formatLocaleTime("11:12:13")) - - console.log("dayPeriodText:" + locale.dayPeriodText("11:22:33")) - - console.log("readMoney:" + locale.readMoney("$ 21")) - - console.log("readNumber:" + locale.readNumber(10.0,3)) - - console.log("readDate:" + locale.readDate("2004-02-01", Locale.IsoFormat)) - - console.log("readTime:" + locale.readTime("11:22:33 AM")) - - console.log("readLocaleTime:" + locale.readLocaleTime("11:12:13 AM")) - - console.log("fileEncodingMib:" + locale.fileEncodingMib) - - console.log("languageCodeToName:" + locale.languageCodeToName("en_US")) - - console.log("isApplicationTranslatedInto:" + locale.isApplicationTranslatedInto("en_US")) - - console.log("removeAcceleratorMarker:" + locale.removeAcceleratorMarker("&*hello")) - - console.log("convertDigits:" + locale.convertDigits(locale.digitSet, Locale.ArabicDigits)) - - for (var i in locale.allDigitSetsList) { - console.log("allDigitSetsList:" + locale.allDigitSetsList[i]) - } - - console.log("===========end===========") - } - } - - PlasmaComponents.Button { - id: bt2 - property variant hash - anchors.horizontalCenter: column.horizontalCenter - text: "click in order to test the CalendarSystem component" - onClicked:{ - console.log("=====CalendarSystem Component====") - - console.log("calendarLabel:" + calendar.calendarLabel) - - console.log("epoch:" + calendar.epoch) - - console.log("earliestValidDate:" + calendar.earliestValidDate) - - console.log("latestValidDate:" + calendar.latestValidDate) - - console.log("shortYearWindowStartYear:" + calendar.shortYearWindowStartYear) - - console.log("weekStartDay:" + locale.weekStartDay) - - console.log("isLunar:" + calendar.isLunar) - - console.log("isLunisolar:" + calendar.isLunisolar) - - console.log("isSolar:" + calendar.isSolar) - - console.log("isProleptic:" + calendar.isProleptic) - //Q_INVOKABLE methods - - console.log("isValidIsoWeekDate:" + calendar.isValidIsoWeekDate(2012, 2, 3)) - - console.log("isValid:" + calendar.isValid("2012-02-03")) - - console.log("year:" + calendar.year("2012-02-03")) - - console.log("month:" + calendar.month("2012-02-03")) - - console.log("day:" + calendar.day("2012-02-03")) - - console.log("eraName:" + calendar.eraName("2012-02-03")) - - console.log("eraYear:" + calendar.eraYear("2012-02-03")) - - console.log("yearInEra:" + calendar.yearInEra("2012-02-03")) - - console.log("addYears:" + calendar.addYears("2012-02-03", 3)) - - console.log("addMonthss:" + calendar.addMonths("2012-02-03", 3)) - - console.log("addDays:" + calendar.addDays("2012-02-03", 3)) - - console.log("yearsDifference:" + calendar.yearsDifference("2010-02-03", "2012-02-03")) - - console.log("monthsDifference:" + calendar.monthsDifference("2012-02-03", "2012-04-03")) - - console.log("daysDifference:" + calendar.daysDifference("2012-02-03", "2012-02-13")) - - console.log("monthsInYear:" + calendar.monthsInYear(2012)) - - console.log("weeksInYear:" + calendar.weeksInYear(2012, CalendarSystem.SimpleWeek)) - - console.log("daysInYear:" + calendar.daysInYear("2012-02-03")) - - console.log("daysInMonth:" + calendar.daysInMonth(2012, 8)) - - console.log("daysInWeek:" + calendar.daysInWeek("2012-02-03")) - - console.log("dayOfYear:" + calendar.dayOfYear("2012-02-03")) - - console.log("week:" + calendar.week("2012-02-03", CalendarSystem.SimpleWeek)) - - console.log("isLeapYear:" + calendar.isLeapYear(2012)) - - console.log("firstDayOfYear:" + calendar.firstDayOfYear(2012)) - - console.log("lastDayOfYear:" + calendar.lastDayOfYear(2012)) - - console.log("firstDayOfMonth:" + calendar.firstDayOfMonth(2012, 02)) - - console.log("lastDayOfMonth:" + calendar.lastDayOfMonth(2012, 02)) - - console.log("monthName:" + calendar.monthName(02, 2012)) - - console.log("weekDayName:" + calendar.weekDayName(3)) - - console.log("formatDate:" + calendar.formatDate("2012-02-03", CalendarSystem.Year, CalendarSystem.ShortNumber, CalendarSystem.SimpleWeek)) - - console.log("readDate:" + calendar.readDate("2012-02-03", CalendarSystem.IsoFormat)) - - console.log("applyShortYearWindow:" + calendar.applyShortYearWindow(50)) - - console.log("calendarSystem:" + calendar.calendarSystem) - console.log("getDate:") - hash = calendar.getDate("2012-02-03") - for (var i in hash) { - console.log(" " + i, "=", hash[i]) - } - - console.log("dateDifference:") - hash = calendar.dateDifference("2012-01-01", "2014-03-03") - for (var i in hash) { - console.log(" " + i, "=", hash[i]) - } - - for (var i in calendar.calendarSystemsList) { - console.log("calendarSystemsList:" + calendar.calendarSystemsList[i]) - } - - console.log("===============end===============") - } - } - - Locale { - id: locale - - binaryUnitDialect: Locale.DefaultBinaryUnits - onBinaryUnitDialectChanged: { - console.log("the binaryUnitDialect property has been changed") - } - - calendarSystem: Locale.QDateCalendar - onCalendarSystemChanged: { - console.log("the calendarSystem property has been changed") - } - - onCurrencyCodeChanged: { - console.log("the currencyCode property has been changed") - } - - currencySymbol: "$" - onCurrencySymbolChanged: { - console.log("the currencySymbol property has been changed") - } - - countryDivisionCode: "AD" - onCountryDivisionCodeChanged: { - console.log("the countryDivisionCode property has been changed") - } - - dateFormat: "y" - onDateFormatChanged: { - console.log("the dateFormat property has been changed") - } - - dateFormatShort: "y" - onDateFormatShortChanged: { - console.log("the dateFormatShort property has been changed") - } - - dateMonthNamePossessive: true - onDateMonthNamePossessiveChanged: { - console.log("the dateMonthNamePossessive property has been changed") - } - - dateTimeDigitSet: Locale.ArabicDigits - onDateTimeDigitSetChanged: { - console.log("the dateTimeDigitSet property has been changed") - } - - decimalPlaces: 1 - onDecimalPlacesChanged: { - console.log("the decimalPlaces property has been changed") - } - - decimalSymbol: "," - onDecimalSymbolChanged: { - console.log("the decimalSymbol property has been changed") - } - - digitSet: Locale.ArabicDigits - onDigitSetChanged: { - console.log("the digitSet property has been changed") - } - - measureSystem: Locale.Metric - onMeasureSystemChanged: { - console.log("the measureSystem property has been changed") - } - - monetaryDecimalPlaces: 2 - onMonetaryDecimalPlacesChanged: { - console.log("the monetaryDecimalPlaces property has been changed") - } - - monetaryDecimalSymbol: "," - onMonetaryDecimalSymbolChanged: { - console.log("the monetaryDecimalSymbol property has been changed") - } - - monetaryDigitSet: Locale.ArabicDigits - onMonetaryDigitSetChanged: { - console.log("the monetaryDigitSet property has been changed") - } - - monetaryThousandsSeparator: "," - onMonetaryThousandsSeparatorChanged: { - console.log("the monetaryThousandsSeparator property has been changed") - } - - negativeMonetarySignPosition: Locale.ParensAround - onNegativeMonetarySignPositionChanged: { - console.log("the negativeMonetarySignPosition property has been changed") - } - - negativePrefixCurrencySymbol: true - onNegativePrefixCurrencySymbolChanged: { - console.log("the negativePrefixCurrencySymbol property has been changed") - } - - negativeSign: "-----" - onNegativeSignChanged: { - console.log("the negativeSign property has been changed") - } - - pageSize: 5 - onPageSizeChanged: { - console.log("the pageSign property has been changed") - } - - positiveMonetarySignPosition: Locale.ParensAround - onPositiveMonetarySignPositionChanged: { - console.log("the positiveMonetarySignPosition property has been changed") - } - - positivePrefixCurrencySymbol: true - onPositivePrefixCurrencySymbolChanged: { - console.log("the positivePrefixCurrencySymbol property has been changed") - } - - positiveSign: " " - onPositiveSignChanged: { - console.log("the positiveSign property has been changed") - } - - thousandsSeparator: "," - onThousandsSeparatorChanged: { - console.log("the thousandsSeparator property has been changed") - } - - weekDayOfPray: 20 - onWeekDayOfPrayChanged: { - console.log("the weekDayOfPray property has been changed") - } - - weekNumberSystem: Locale.IsoWeekNumber - onWeekNumberSystemChanged: { - console.log("the weekNumberSystem property has been changed") - } - - weekStartDay: 2 - onWeekStartDayChanged: { - console.log("the weekStartDay property has been changed") - } - - workingWeekEndDay: 5 - onWorkingWeekEndDayChanged: { - console.log("the workingWeekEndDay property has been changed") - } - - workingWeekStartDay: 1 - onWorkingWeekStartDayChanged: { - console.log("the workingWeekStartDay property has been changed") - } - } - - CalendarSystem { - id: calendar - } - } -} diff --git a/plasma/declarative/localegallery/metadata.desktop b/plasma/declarative/localegallery/metadata.desktop deleted file mode 100644 index 909eea8..0000000 --- a/plasma/declarative/localegallery/metadata.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Locale gallery -Comment=gallery of KLocale QML Bindings -Type=Service -ServiceTypes=Plasma/Applet -Icon=preferences-desktop-theme -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/main.qml -X-KDE-PluginInfo-Author=Giorgos Tsiapaliwkas -X-KDE-PluginInfo-Email=terietor@gmail.com -X-KDE-PluginInfo-Name=org.kde.example.locale -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/declarative/nowplaying/contents/qml/main.qml b/plasma/declarative/nowplaying/contents/qml/main.qml deleted file mode 100644 index 39938dd..0000000 --- a/plasma/declarative/nowplaying/contents/qml/main.qml +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2010 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import Qt 4.7 -import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets -import org.kde.plasma.core 0.1 as PlasmaCore -import org.kde.plasma.graphicslayouts 4.7 as GraphicsLayouts - - -QGraphicsWidget { - id: page; - preferredSize: "200x200" - minimumSize: "200x20" - property string activeSource: '' - - Item { - id:main - - PlasmaCore.DataSource { - id: dataSource - dataEngine: "nowplaying" - connectedSources: ['players'] - interval: 500 - - onNewData: { - if (sourceName == 'players') { - print("going to connect to " + data['players'][0]) - activeSource = data['players'][0] - connectedSources = ['players', activeSource] - } - } - - onDataChanged: { - if (!activeSource) { - return; - } - - if (data[activeSource].State == "playing") { - playPause.setIcon("media-playback-pause") - } else { - playPause.setIcon("media-playback-start") - } - - progress.value = 100*data[activeSource].Position/data[activeSource].Length - } - } - - PlasmaCore.Theme { - id: theme - } - } - - Component.onCompleted: - { - dataSource.serviceForSource(activeSource).associateWidget(stop, "stop"); - dataSource.serviceForSource(activeSource).associateWidget(progress, "progress"); - } - - layout: GraphicsLayouts.QGraphicsLinearLayout { - - PlasmaWidgets.IconWidget { - id: playPause - property string state: "stop" - - onClicked: { - var operation; - if (dataSource.data[activeSource].State == "playing") { - operation = "pause" - } else { - operation = "play" - } - var data = dataSource.serviceForSource(activeSource).operationDescription(operation); - print(dataSource.serviceForSource(activeSource).name); - - for ( var i in data ) { - print(i + ' -> ' + data[i] ); - } - - dataSource.serviceForSource(activeSource).startOperationCall(dataSource.serviceForSource(activeSource).operationDescription(operation)); - print("stopping"); - } - } - - PlasmaWidgets.IconWidget { - id: stop - Component.onCompleted: { - setIcon("media-playback-stop"); - } - onClicked: { - var data = dataSource.serviceForSource(activeSource).operationDescription("stop"); - print(dataSource.serviceForSource(activeSource).name); - - for ( var i in data ) { - print(i + ' -> ' + data[i] ); - } - - dataSource.serviceForSource(activeSource).startOperationCall(dataSource.serviceForSource(activeSource).operationDescription("stop")); - print("stopping"); - } - } - - PlasmaWidgets.Slider { - id: progress - orientation: Qt.Horizontal - - onSliderMoved: { - var operation = dataSource.serviceForSource(activeSource).operationDescription("seek"); - operation.seconds = Math.round(dataSource.data[activeSource].Length*(value/100)); - - for ( var i in operation ) { - print(i + ' -> ' + operation[i] ); - } - - dataSource.serviceForSource(activeSource).startOperationCall(operation); - print("set progress to " + progress); - } - } - } -} diff --git a/plasma/declarative/nowplaying/metadata.desktop b/plasma/declarative/nowplaying/metadata.desktop deleted file mode 100644 index 900f4dc..0000000 --- a/plasma/declarative/nowplaying/metadata.desktop +++ /dev/null @@ -1,32 +0,0 @@ -[Desktop Entry] -Name=Now playing (QML) -Name[ja]=今聴いているもの (QML) -Name[km]=ឥឡូវ​កំពុង​ចាក់ (QML) -Name[nds]=Lopen Stück (QML) -Name[pt]=Agora a tocar (QML) -Name[pt_BR]=Reproduzindo agora (QML) -Name[sv]=Spelar nu (QML) -Name[uk]=Зараз відтворюється (QML) -Name[x-test]=xxNow playing (QML)xx -Comment=A proof of concept media player controller qml -Comment[km]=ការ​បញ្ជាក់​​ឧបករណ៍​ត្រួតពិនិត្យ​កម្មវិធី​ចាក់​មេឌៀ​គោល qml -Comment[pt]=Uma prova de conceito de um controlador multimédia em QML -Comment[pt_BR]=Uma prova de conceito de um controlador multimídia em QML -Comment[sv]=Ett koncept för ett kontrollverktyg för mediaspelare i QML -Comment[uk]=Тестова програма для спостереження за відтворенням мультимедійних даних, написана мовою qml -Comment[x-test]=xxA proof of concept media player controller qmlxx -Encoding=UTF-8 -Icon=applications-multimedia -ServiceTypes=Plasma/Applet -Type=Service -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-Email=notmart@gmail.com -X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=org.kde.nowplaying-qml -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=qml/main.qml diff --git a/plasma/declarative/pairsgame/contents/ui/Card.qml b/plasma/declarative/pairsgame/contents/ui/Card.qml deleted file mode 100644 index c2db4cf..0000000 --- a/plasma/declarative/pairsgame/contents/ui/Card.qml +++ /dev/null @@ -1,138 +0,0 @@ -/*************************************************************************** - * Copyright 2010 by Davide Bettio * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -import QtQuick 1.0 - -Flipable { - id: card; - property string cardPicture: "card.svgz"; - property bool showPicture: false; - property bool matched: false; - state: "normal" - width: cardBack.width - height: cardBack.height - - Behavior on opacity { - NumberAnimation { - target: card - property: "opacity" - duration: 300 - } - } - - front: Image { - id: cardBack - anchors.centerIn: parent - source: "card.svgz"; - } - back: Image { - anchors.centerIn: parent - source: cardPicture; - } - - transform: Rotation { - id: rotation - origin.x: card.width/2 - origin.y: card.height/2 - axis.x: 0; axis.y: 1; axis.z: 0 - angle: 0 - Behavior on angle { - NumberAnimation { - target: rotation - property: "angle" - duration: 300 - } - } - } - - SequentialAnimation { - id: checkAnimation - NumberAnimation { - target: rotation - property: "angle" - duration: 300 - from: 0 - to: 180 - } - PauseAnimation { - duration: 300 - } - NumberAnimation { - target: rotation - property: "angle" - duration: 300 - from: 180 - to: 0 - } - } - - MouseArea { - id: mouseArea; - anchors.fill: parent; - onClicked: { - if (!pairsCanvas.currentCard){ - pairsCanvas.currentCard = card; - card.state = "checking" - } else if (pairsCanvas.currentCard != card) { - if (pairsCanvas.currentCard.cardPicture == card.cardPicture){ - card.state = pairsCanvas.currentCard.state = "matched" - pairsCanvas.matchesCountdown--; - } else { - card.state = pairsCanvas.currentCard.state = "normal" - checkAnimation.running = true - } - pairsCanvas.currentCard = null; - } - } - } - - states: [ - State { - name: "normal"; - PropertyChanges { - target: card; - showPicture: false - } - PropertyChanges { - target: rotation; - angle: 0 - } - }, - State { - name: "checking"; - PropertyChanges { - target: rotation; - angle: 180 - } - }, - State { - name: "matched"; - PropertyChanges { - target: card; - opacity: 0.3 - enabled: false - showPicture: true - } - PropertyChanges { - target: rotation; - angle: 180 - } - } - ] -} diff --git a/plasma/declarative/pairsgame/contents/ui/GameTimer.qml b/plasma/declarative/pairsgame/contents/ui/GameTimer.qml deleted file mode 100644 index 385d596..0000000 --- a/plasma/declarative/pairsgame/contents/ui/GameTimer.qml +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************** - * Copyright 2010 by Marco Martin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id:main - property int time: 0 - property bool running: true - - color: Qt.rgba(1,1,1,0.7) - radius: 10 - smooth: true - - width: childrenRect.width + 20 - height: childrenRect.height + 20 - Text { - anchors.horizontalCenter: parent.horizontalCenter - x: 10 - y: 10 - text: ""+Math.floor((time/60)/10)+Math.floor((time/60))+":"+Math.floor((time%60)/10)+(time%60)%10 - font.pointSize: 22 - } - - Timer { - interval: 1000 - running: main.running - repeat: true - onTriggered: { - time++ - } - } -} diff --git a/plasma/declarative/pairsgame/contents/ui/WinMessage.qml b/plasma/declarative/pairsgame/contents/ui/WinMessage.qml deleted file mode 100644 index b94445c..0000000 --- a/plasma/declarative/pairsgame/contents/ui/WinMessage.qml +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************** - * Copyright 2010 by Marco Martin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id:main - property int time: 0 - property bool running: true - - color: Qt.rgba(1,1,1,0.7) - radius: 10 - smooth: true - - width: childrenRect.width + 20 - height: childrenRect.height + 20 - Text { - x: 10 - y: 10 - text: "WIN!!!" - font.pointSize: 52 - } - - Behavior on y { - NumberAnimation { - target: main - property: "y" - duration: 1000 - easing.type: "OutBounce" - - } - } -} diff --git a/plasma/declarative/pairsgame/contents/ui/application-exit.png b/plasma/declarative/pairsgame/contents/ui/application-exit.png deleted file mode 100644 index 32be6b3..0000000 Binary files a/plasma/declarative/pairsgame/contents/ui/application-exit.png and /dev/null differ diff --git a/plasma/declarative/pairsgame/contents/ui/background.jpg b/plasma/declarative/pairsgame/contents/ui/background.jpg deleted file mode 100644 index 9a327ee..0000000 Binary files a/plasma/declarative/pairsgame/contents/ui/background.jpg and /dev/null differ diff --git a/plasma/declarative/pairsgame/contents/ui/bug-card.png b/plasma/declarative/pairsgame/contents/ui/bug-card.png deleted file mode 100644 index f749ee2..0000000 Binary files a/plasma/declarative/pairsgame/contents/ui/bug-card.png and /dev/null differ diff --git a/plasma/declarative/pairsgame/contents/ui/card.svgz b/plasma/declarative/pairsgame/contents/ui/card.svgz deleted file mode 100644 index 993b765..0000000 Binary files a/plasma/declarative/pairsgame/contents/ui/card.svgz and /dev/null differ diff --git a/plasma/declarative/pairsgame/contents/ui/cards-reset.png b/plasma/declarative/pairsgame/contents/ui/cards-reset.png deleted file mode 100644 index d84366b..0000000 Binary files a/plasma/declarative/pairsgame/contents/ui/cards-reset.png and /dev/null differ diff --git a/plasma/declarative/pairsgame/contents/ui/clock-card.png b/plasma/declarative/pairsgame/contents/ui/clock-card.png deleted file mode 100644 index 360ca80..0000000 Binary files a/plasma/declarative/pairsgame/contents/ui/clock-card.png and /dev/null differ diff --git a/plasma/declarative/pairsgame/contents/ui/gamelogic.js b/plasma/declarative/pairsgame/contents/ui/gamelogic.js deleted file mode 100644 index 712af4a..0000000 --- a/plasma/declarative/pairsgame/contents/ui/gamelogic.js +++ /dev/null @@ -1,50 +0,0 @@ -/*************************************************************************** - * Copyright 2010 by Davide Bettio * - * Copyright 2010 by Marco Martin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - - -var rows = 3 -var columns = 4 -var maxVal = rows*columns -var elementsGrid = new Array(rows) -for (var i=0; i < rows; ++i) { - elementsGrid[i] = new Array(columns) -} - -function init() -{ - gameTimer.running = true - gameTimer.time = 0 - winMessage.y = -winMessage.height - matchesCountdown = rows*columns / 2; - var pairs = new Array("bug", "bug", "clock", "clock", "kde", "kde", "konqueror", "konqueror", "magicwand", "magicwand", "plasma", "plasma") - elements.clear(); - var remaining = maxVal - for (var i=0; i < maxVal; ++i) { - var randVal = Math.round((Math.random()*remaining-1)) - - var element = pairs.splice(randVal, 1) - - --remaining - elements.append({"card": String(element)}) - - elementsGrid[Math.floor(i/columns)][columns%i] = element - } -} - diff --git a/plasma/declarative/pairsgame/contents/ui/kde-card.png b/plasma/declarative/pairsgame/contents/ui/kde-card.png deleted file mode 100644 index 2311fc3..0000000 Binary files a/plasma/declarative/pairsgame/contents/ui/kde-card.png and /dev/null differ diff --git a/plasma/declarative/pairsgame/contents/ui/konqueror-card.png b/plasma/declarative/pairsgame/contents/ui/konqueror-card.png deleted file mode 100644 index 4612299..0000000 Binary files a/plasma/declarative/pairsgame/contents/ui/konqueror-card.png and /dev/null differ diff --git a/plasma/declarative/pairsgame/contents/ui/magicwand-card.png b/plasma/declarative/pairsgame/contents/ui/magicwand-card.png deleted file mode 100644 index ba5300b..0000000 Binary files a/plasma/declarative/pairsgame/contents/ui/magicwand-card.png and /dev/null differ diff --git a/plasma/declarative/pairsgame/contents/ui/main.qml b/plasma/declarative/pairsgame/contents/ui/main.qml deleted file mode 100644 index 4e73517..0000000 --- a/plasma/declarative/pairsgame/contents/ui/main.qml +++ /dev/null @@ -1,82 +0,0 @@ -/*************************************************************************** - * Copyright 2010 by Davide Bettio * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -import QtQuick 1.0 -import "gamelogic.js" as GameLogic - - -Image { - id: pairsCanvas; - width: 800; - height: 480; - source: "background.jpg" - property Item currentCard; - property int matchesCountdown; - - onMatchesCountdownChanged: { - if (matchesCountdown == 0) { - gameTimer.running = false - winMessage.y = pairsCanvas.height/2 - winMessage.height/2 - } - } - - - Column { - Image { - source: "cards-reset.png" - - MouseArea { - anchors.fill: parent; - onClicked: GameLogic.init(); - } - } - GameTimer { - id: gameTimer - width: parent.width - } - } - - ListModel { - id: elements - Component.onCompleted: { - GameLogic.init() - } - } - - Grid { - id: mainGrid - anchors.fill: parent - rows: GameLogic.rows - columns: GameLogic.columns - spacing: 5 - Repeater { - id: repeater - model: elements - delegate: Card { - cardPicture: card+"-card.png" - } - } - } - - WinMessage { - id: winMessage - anchors.horizontalCenter: mainGrid.horizontalCenter - y: -height - } -} diff --git a/plasma/declarative/pairsgame/contents/ui/plasma-card.png b/plasma/declarative/pairsgame/contents/ui/plasma-card.png deleted file mode 100644 index 4e54c90..0000000 Binary files a/plasma/declarative/pairsgame/contents/ui/plasma-card.png and /dev/null differ diff --git a/plasma/declarative/qmltasks/contents/config/default-configrc b/plasma/declarative/qmltasks/contents/config/default-configrc deleted file mode 100644 index e69de29..0000000 diff --git a/plasma/declarative/qmltasks/contents/config/main.xml b/plasma/declarative/qmltasks/contents/config/main.xml deleted file mode 100644 index e69de29..0000000 diff --git a/plasma/declarative/qmltasks/contents/ui/config.ui b/plasma/declarative/qmltasks/contents/ui/config.ui deleted file mode 100644 index e69de29..0000000 diff --git a/plasma/declarative/qmltasks/contents/ui/qmltasks.qml b/plasma/declarative/qmltasks/contents/ui/qmltasks.qml deleted file mode 100644 index 07dfe1a..0000000 --- a/plasma/declarative/qmltasks/contents/ui/qmltasks.qml +++ /dev/null @@ -1,52 +0,0 @@ -// -*- coding: iso-8859-1 -*- -/* - * Author: Marco Martin - * Date: Sun Nov 7 2010, 18:51:24 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import Qt 4.7 -import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets -import org.kde.plasma.core 0.1 as PlasmaCore -import org.kde.plasma.graphicslayouts 4.7 as GraphicsLayouts - -Item { - width: 200 - height: 300 - - PlasmaCore.DataSource { - id: tasksSource - dataEngine: "tasks" - interval: 0 - onSourceAdded: { - connectSource(source) - } - Component.onCompleted: { - connectedSources = sources - } - } - - ListView { - anchors.fill: parent - model: PlasmaCore.DataModel { - dataSource: tasksSource - } - delegate: Text { - text: visibleName+" onAllDesktops: "+onAllDesktops - } - } -} diff --git a/plasma/declarative/qmltasks/metadata.desktop b/plasma/declarative/qmltasks/metadata.desktop deleted file mode 100644 index f4beed8..0000000 --- a/plasma/declarative/qmltasks/metadata.desktop +++ /dev/null @@ -1,25 +0,0 @@ -[Desktop Entry] -Comment= -Encoding=UTF-8 -Keywords= -Name=qmltasks -Name[km]=qmltasks -Name[pt]=qmltasks -Name[pt_BR]=qmltasks -Name[sv]=QML-uppgifter -Name[uk]=qmltasks -Name[x-test]=xxqmltasksxx -Type=Service -X-KDE-ParentApp= -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Category=Miscellaneous -X-KDE-PluginInfo-Email=mart@kde.org -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=qmltasks -X-KDE-PluginInfo-Version= -X-KDE-PluginInfo-Website= -X-KDE-ServiceTypes=Plasma/Applet -X-Plasma-API=declarativeappletscript -X-Plasma-DefaultSize=200,100 -X-Plasma-MainScript=ui/qmltasks.qml -X-Plasma-RemoteLocation= diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/.directory b/plasma/declarative/samegame/contents/qml/SamegameCore/.directory deleted file mode 100644 index 74d4d9c..0000000 --- a/plasma/declarative/samegame/contents/qml/SamegameCore/.directory +++ /dev/null @@ -1,2 +0,0 @@ -[Dolphin] -Timestamp=2010,8,30,14,12,1 diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/BoomBlock.qml b/plasma/declarative/samegame/contents/qml/SamegameCore/BoomBlock.qml deleted file mode 100644 index 43050af..0000000 --- a/plasma/declarative/samegame/contents/qml/SamegameCore/BoomBlock.qml +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt 4.7 -import Qt.labs.particles 1.0 - -Item { - id: block - property bool dying: false - property bool spawned: false - property int type: 0 - - Behavior on x { - enabled: spawned; - SpringAnimation{ spring: 2; damping: 0.2 } - } - Behavior on y { - SpringAnimation{ spring: 2; damping: 0.2 } - } - - Image { - id: img - source: { - if(type == 0){ - "pics/redStone.png"; - } else if(type == 1) { - "pics/blueStone.png"; - } else { - "pics/greenStone.png"; - } - } - opacity: 0 - Behavior on opacity { NumberAnimation { duration: 200 } } - anchors.fill: parent - } - - Particles { - id: particles - - width: 1; height: 1 - anchors.centerIn: parent - - emissionRate: 0 - lifeSpan: 700; lifeSpanDeviation: 600 - angle: 0; angleDeviation: 360; - velocity: 100; velocityDeviation: 30 - source: { - if(type == 0){ - "pics/redStar.png"; - } else if (type == 1) { - "pics/blueStar.png"; - } else { - "pics/greenStar.png"; - } - } - } - - states: [ - State { - name: "AliveState"; when: spawned == true && dying == false - PropertyChanges { target: img; opacity: 1 } - }, - - State { - name: "DeathState"; when: dying == true - StateChangeScript { script: particles.burst(50); } - PropertyChanges { target: img; opacity: 0 } - StateChangeScript { script: block.destroy(1000); } - } - ] -} diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/Button.qml b/plasma/declarative/samegame/contents/qml/SamegameCore/Button.qml deleted file mode 100644 index d5979b2..0000000 --- a/plasma/declarative/samegame/contents/qml/SamegameCore/Button.qml +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt 4.7 - -Rectangle { - id: container - - property string text: "Button" - - signal clicked - - width: buttonLabel.width + 20; height: buttonLabel.height + 6 - smooth: true - border { width: 1; color: Qt.darker(activePalette.button) } - radius: 8 - color: activePalette.button - - gradient: Gradient { - GradientStop { - position: 0.0 - color: { - if (mouseArea.pressed) - return activePalette.dark - else - return activePalette.light - } - } - GradientStop { position: 1.0; color: activePalette.button } - } - - MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } - - Text { - id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText - } -} diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/Dialog.qml b/plasma/declarative/samegame/contents/qml/SamegameCore/Dialog.qml deleted file mode 100644 index 7e64bd6..0000000 --- a/plasma/declarative/samegame/contents/qml/SamegameCore/Dialog.qml +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt 4.7 - -Rectangle { - id: page - - property Item text: dialogText - - signal closed - signal opened - function forceClose() { - if(page.opacity == 0) - return; //already closed - page.closed(); - page.opacity = 0; - } - - function show(txt) { - page.opened(); - dialogText.text = txt; - page.opacity = 1; - } - - width: dialogText.width + 20; height: dialogText.height + 20 - color: "white" - border.width: 1 - opacity: 0 - visible: opacity > 0 - Behavior on opacity { - NumberAnimation { duration: 1000 } - } - - Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" } - - MouseArea { anchors.fill: parent; onClicked: forceClose(); } -} - diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/background.png b/plasma/declarative/samegame/contents/qml/SamegameCore/pics/background.png deleted file mode 100644 index 3734a27..0000000 Binary files a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/background.png and /dev/null differ diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/blueStar.png b/plasma/declarative/samegame/contents/qml/SamegameCore/pics/blueStar.png deleted file mode 100644 index ff9588f..0000000 Binary files a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/blueStar.png and /dev/null differ diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/blueStone.png b/plasma/declarative/samegame/contents/qml/SamegameCore/pics/blueStone.png deleted file mode 100644 index 20e43c7..0000000 Binary files a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/blueStone.png and /dev/null differ diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/greenStar.png b/plasma/declarative/samegame/contents/qml/SamegameCore/pics/greenStar.png deleted file mode 100644 index cd06854..0000000 Binary files a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/greenStar.png and /dev/null differ diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/greenStone.png b/plasma/declarative/samegame/contents/qml/SamegameCore/pics/greenStone.png deleted file mode 100644 index b568a19..0000000 Binary files a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/greenStone.png and /dev/null differ diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/redStar.png b/plasma/declarative/samegame/contents/qml/SamegameCore/pics/redStar.png deleted file mode 100644 index 0a4dffe..0000000 Binary files a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/redStar.png and /dev/null differ diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/redStone.png b/plasma/declarative/samegame/contents/qml/SamegameCore/pics/redStone.png deleted file mode 100644 index 36b09a2..0000000 Binary files a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/redStone.png and /dev/null differ diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/star.png b/plasma/declarative/samegame/contents/qml/SamegameCore/pics/star.png deleted file mode 100644 index defbde5..0000000 Binary files a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/star.png and /dev/null differ diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/yellowStone.png b/plasma/declarative/samegame/contents/qml/SamegameCore/pics/yellowStone.png deleted file mode 100644 index b1ce762..0000000 Binary files a/plasma/declarative/samegame/contents/qml/SamegameCore/pics/yellowStone.png and /dev/null differ diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/qmldir b/plasma/declarative/samegame/contents/qml/SamegameCore/qmldir deleted file mode 100644 index e17b1f5..0000000 --- a/plasma/declarative/samegame/contents/qml/SamegameCore/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -BoomBlock BoomBlock.qml -Button Button.qml -Dialog Dialog.qml diff --git a/plasma/declarative/samegame/contents/qml/SamegameCore/samegame.js b/plasma/declarative/samegame/contents/qml/SamegameCore/samegame.js deleted file mode 100755 index aa1b359..0000000 --- a/plasma/declarative/samegame/contents/qml/SamegameCore/samegame.js +++ /dev/null @@ -1,237 +0,0 @@ -/* This script file handles the game logic */ - -var maxColumn = 10; -var maxRow = 15; -var maxIndex = maxColumn*maxRow; -var board = new Array(maxIndex); -var blockSrc = "SamegameCore/BoomBlock.qml"; -var scoresURL = ""; -var gameDuration; -var component = Qt.createComponent(blockSrc); - -//Index function used instead of a 2D array -function index(column,row) { - return column + (row * maxColumn); -} - -function timeStr(msecs) { - var secs = Math.floor(msecs/1000); - var m = Math.floor(secs/60); - var ret = "" + m + "m " + (secs%60) + "s"; - return ret; -} - -function startNewGame() -{ - //Delete blocks from previous game - for(var i = 0; i= maxColumn || column < 0 || row >= maxRow || row < 0) - return; - if(board[index(column, row)] == null) - return; - //If it's a valid block, remove it and all connected (does nothing if it's not connected) - floodFill(column,row, -1); - if(fillFound <= 0) - return; - gameCanvas.score += (fillFound - 1) * (fillFound - 1); - shuffleDown(); - victoryCheck(); -} - -function floodFill(column,row,type) -{ - if(board[index(column, row)] == null) - return; - var first = false; - if(type == -1){ - first = true; - type = board[index(column,row)].type; - - //Flood fill initialization - fillFound = 0; - floodBoard = new Array(maxIndex); - } - if(column >= maxColumn || column < 0 || row >= maxRow || row < 0) - return; - if(floodBoard[index(column, row)] == 1 || (!first && type != board[index(column,row)].type)) - return; - floodBoard[index(column, row)] = 1; - floodFill(column+1,row,type); - floodFill(column-1,row,type); - floodFill(column,row+1,type); - floodFill(column,row-1,type); - if(first==true && fillFound == 0) - return;//Can't remove single blocks - board[index(column,row)].dying = true; - board[index(column,row)] = null; - fillFound += 1; -} - -function shuffleDown() -{ - //Fall down - for(var column=0; column=0; row--){ - if(board[index(column,row)] == null){ - fallDist += 1; - }else{ - if(fallDist > 0){ - var obj = board[index(column,row)]; - obj.y = (row+fallDist) * gameCanvas.blockSize; - board[index(column,row+fallDist)] = obj; - board[index(column,row)] = null; - } - } - } - } - //Fall to the left - fallDist = 0; - for(column=0; column 0){ - for(row=0; row=0; column--) - if(board[index(column, maxRow - 1)] != null) - deservesBonus = false; - if(deservesBonus) - gameCanvas.score += 500; - //Checks for game over - if(deservesBonus || !(floodMoveCheck(0,maxRow-1, -1))){ - gameDuration = new Date() - gameDuration; - nameInputDialog.show("You won! Please enter your name: "); - nameInputDialog.initialWidth = nameInputDialog.text.width + 20; - nameInputDialog.width = nameInputDialog.initialWidth; - nameInputDialog.text.opacity = 0;//Just a spacer - } -} - -//only floods up and right, to see if it can find adjacent same-typed blocks -function floodMoveCheck(column, row, type) -{ - if(column >= maxColumn || column < 0 || row >= maxRow || row < 0) - return false; - if(board[index(column, row)] == null) - return false; - var myType = board[index(column, row)].type; - if(type == myType) - return true; - return floodMoveCheck(column + 1, row, myType) || - floodMoveCheck(column, row - 1, board[index(column,row)].type); -} - -function createBlock(column,row){ - // Note that we don't wait for the component to become ready. This will - // only work if the block QML is a local file. Otherwise the component will - // not be ready immediately. There is a statusChanged signal on the - // component you could use if you want to wait to load remote files. - if(component.status == Component.Ready){ - var dynamicObject = component.createObject(gameCanvas); - if(dynamicObject == null){ - console.log("error creating block"); - console.log(component.errorString()); - return false; - } - dynamicObject.type = Math.floor(Math.random() * 3); - dynamicObject.x = column*gameCanvas.blockSize; - dynamicObject.y = row*gameCanvas.blockSize; - dynamicObject.width = gameCanvas.blockSize; - dynamicObject.height = gameCanvas.blockSize; - dynamicObject.spawned = true; - board[index(column,row)] = dynamicObject; - }else{ - console.log("error loading block component"); - console.log(component.errorString()); - return false; - } - return true; -} - -function saveHighScore(name) { - if(scoresURL!="") - sendHighScore(name); - //OfflineStorage - var db = openDatabaseSync("SameGameScores", "1.0", "Local SameGame High Scores",100); - var dataStr = "INSERT INTO Scores VALUES(?, ?, ?, ?)"; - var data = [name, gameCanvas.score, maxColumn+"x"+maxRow ,Math.floor(gameDuration/1000)]; - db.transaction( - function(tx) { - tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)'); - tx.executeSql(dataStr, data); - - //Only show results for the current grid size - var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "'+maxColumn+"x"+maxRow+'" ORDER BY score desc LIMIT 10'); - var r = "\nHIGH SCORES for this grid size\n\n" - for(var i = 0; i < rs.rows.length; i++){ - r += (i+1)+". " + rs.rows.item(i).name +' got ' - + rs.rows.item(i).score + ' points in ' - + rs.rows.item(i).time + ' seconds.\n'; - } - dialog.show(r); - } - ); -} - -function sendHighScore(name) { - var postman = new XMLHttpRequest() - var postData = "name="+name+"&score="+gameCanvas.score - +"&gridSize="+maxColumn+"x"+maxRow +"&time="+Math.floor(gameDuration/1000); - postman.open("POST", scoresURL, true); - postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - postman.onreadystatechange = function() { - if (postman.readyState == postman.DONE) { - dialog.show("Your score has been uploaded."); - } - } - postman.send(postData); -} diff --git a/plasma/declarative/samegame/contents/qml/highscores/README b/plasma/declarative/samegame/contents/qml/highscores/README deleted file mode 100644 index eaa00fa..0000000 --- a/plasma/declarative/samegame/contents/qml/highscores/README +++ /dev/null @@ -1 +0,0 @@ -The SameGame example can interface with a simple PHP script to store XML high score data on a remote server. We do not have a publically accessible server available for this use, but if you have access to a PHP capable webserver you can copy the files (score_data.xml, score.php, score_style.xsl) to it and alter the highscore_server variable at the top of the samegame.js file to point to it. diff --git a/plasma/declarative/samegame/contents/qml/highscores/score_data.xml b/plasma/declarative/samegame/contents/qml/highscores/score_data.xml deleted file mode 100755 index c3fd90d..0000000 --- a/plasma/declarative/samegame/contents/qml/highscores/score_data.xml +++ /dev/null @@ -1,2 +0,0 @@ -1000000Alan the Tester0x00 -6213Alan12x1751 diff --git a/plasma/declarative/samegame/contents/qml/highscores/score_style.xsl b/plasma/declarative/samegame/contents/qml/highscores/score_style.xsl deleted file mode 100755 index 670354c..0000000 --- a/plasma/declarative/samegame/contents/qml/highscores/score_style.xsl +++ /dev/null @@ -1,28 +0,0 @@ - - - - - SameGame High Scores - -

SameGame High Scores

- - - - - - - - - - - - - - - - -
NameScoreGrid SizeTime, s
- - -
-
diff --git a/plasma/declarative/samegame/contents/qml/highscores/scores.php b/plasma/declarative/samegame/contents/qml/highscores/scores.php deleted file mode 100755 index 3cceb2d..0000000 --- a/plasma/declarative/samegame/contents/qml/highscores/scores.php +++ /dev/null @@ -1,34 +0,0 @@ -"; - echo "SameGame High Scores"; - if($score > 0){#Sending in a new high score - $name = $_POST["name"]; - $grid = $_POST["gridSize"]; - $time = $_POST["time"]; - if($name == "") - $name = "Anonymous"; - //if($grid != "10x10"){ - //Need a standard, so as to reject others? - //} - $file = fopen("score_data.xml", "a"); #It's XML. Happy? - $ret = fwrite($file, "". $score . "" - . $name . "" . $grid . "" - . $time . "\n"); - echo "Your score has been recorded. Thanks for playing!"; - if($ret == False) - echo "
There was an error though, so don't expect to see that score again."; - }else{#Read high score list - #Now uses XSLT to display. So just print the file. With XML cruft added. - #Note that firefox at least won't apply the XSLT on a php file. So redirecting - $file = fopen("scores.xml", "w"); - $ret = fwrite($file, '' . "\n" - . '' . "\n" - . "\n" . file_get_contents("score_data.xml") . "\n"); - if($ret == False) - echo "There was an internal error. Sorry."; - else - echo ''; - } - echo ""; -?> diff --git a/plasma/declarative/samegame/contents/qml/samegame.qml b/plasma/declarative/samegame/contents/qml/samegame.qml deleted file mode 100644 index bf2e706..0000000 --- a/plasma/declarative/samegame/contents/qml/samegame.qml +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import Qt 4.7 -import "SamegameCore" -import "SamegameCore/samegame.js" as Logic - -Rectangle { - id: screen - width: 490; height: 720 - property bool inAnotherDemo: false //Samegame often is just plonked straight into other demos - clip:true - - SystemPalette { id: activePalette } - - Item { - width: parent.width - anchors { top: parent.top; left:parent.left; right: parent.right; bottom: toolBar.top } - - Image { - id: background - anchors.fill: parent - source: "SamegameCore/pics/background.png" - fillMode: Image.Scale - } - - Item { - id: gameCanvas - property int score: 0 - property int blockSize: 40 - - z: 20; anchors.centerIn: parent - width: parent.width - (parent.width % blockSize); - height: parent.height - (parent.height % blockSize); - - MouseArea { - anchors.fill: parent; onClicked: Logic.handleClick(mouse.x,mouse.y); - } - } - } - - Dialog { id: dialog; anchors.centerIn: parent; z: 21 } - - Dialog { - id: nameInputDialog - - property int initialWidth: 0 - - anchors.centerIn: parent - z: 22; - - Behavior on width { - NumberAnimation {} - enabled: nameInputDialog.initialWidth != 0 - } - - onOpened: nameInputText.focus = true; - onClosed: { - nameInputText.focus = false; - if (nameInputText.text != "") - Logic.saveHighScore(nameInputText.text); - } - Text { - id: dialogText - anchors { left: nameInputDialog.left; leftMargin: 20; verticalCenter: parent.verticalCenter } - text: "You won! Please enter your name: " - } - MouseArea { - anchors.fill: parent - onClicked: { - if (nameInputText.text == "") - nameInputText.openSoftwareInputPanel(); - else - nameInputDialog.forceClose(); - } - } - - TextInput { - id: nameInputText - anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } - focus: false - autoScroll: false - maximumLength: 24 - onTextChanged: { - var newWidth = nameInputText.width + dialogText.width + 40; - if ( (newWidth > nameInputDialog.width && newWidth < screen.width) - || (nameInputDialog.width > nameInputDialog.initialWidth) ) - nameInputDialog.width = newWidth; - } - onAccepted: { - nameInputDialog.forceClose(); - } - } - } - - Rectangle { - id: toolBar - width: parent.width; height: 32 - color: activePalette.window - anchors.bottom: screen.bottom - - Button { - id: newGameButton - anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } - text: "New Game" - onClicked: Logic.startNewGame() - } - - Button { - visible: !inAnotherDemo - text: "Quit" - anchors { left: newGameButton.right; leftMargin: 3; verticalCenter: parent.verticalCenter } - onClicked: Qt.quit(); - } - - Text { - id: score - anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } - text: "Score: " + gameCanvas.score - font.bold: true - color: activePalette.windowText - } - } -} diff --git a/plasma/declarative/samegame/metadata.desktop b/plasma/declarative/samegame/metadata.desktop deleted file mode 100644 index 609b298..0000000 --- a/plasma/declarative/samegame/metadata.desktop +++ /dev/null @@ -1,31 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Same game (QML) -Name[km]=ល្បែង​ Same (QML) -Name[pt]=Jogo Same (QML) -Name[pt_BR]=Jogo Same (QML) -Name[sv]=Same game (QML) -Name[uk]=Та сама гра (QML) -Name[x-test]=xxSame game (QML)xx -Comment=The Same game QML Qt demo converted as plasmoid -Comment[km]=ល្បែង Same QML Qt បាន​បម្លែង​ជា plasmoid -Comment[pt]=O jogo Same do Qt, em QML, convertido para um plasmóide -Comment[pt_BR]=O jogo Same do Qt em QML, convertido para um plasmoide -Comment[sv]=Same game QML Qt-demonstrationen konverterad till en Plasmoid -Comment[uk]=Плазмоїд-демонстрація тієї самої гри на основі QML -Comment[x-test]=xxThe Same game QML Qt demo converted as plasmoidxx - -Type=Service -ServiceTypes=Plasma/Applet -Icon=applications-games -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=qml/samegame.qml -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=notmart@gmail.com -X-KDE-PluginInfo-Name=org.kde.samegame-qml -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/declarative/wallpapers/CMakeLists.txt b/plasma/declarative/wallpapers/CMakeLists.txt deleted file mode 100644 index 5b41abb..0000000 --- a/plasma/declarative/wallpapers/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -install(DIRECTORY ugly/ DESTINATION ${DATA_INSTALL_DIR}/plasma/wallpapers/org.kde.uglywallpaper) - -install(DIRECTORY html5wallpaper/ DESTINATION ${DATA_INSTALL_DIR}/plasma/wallpapers/org.kde.html5wallpaper) diff --git a/plasma/declarative/wallpapers/html5wallpaper/contents/qml/html5wp.qml b/plasma/declarative/wallpapers/html5wallpaper/contents/qml/html5wp.qml deleted file mode 100644 index 80d262b..0000000 --- a/plasma/declarative/wallpapers/html5wallpaper/contents/qml/html5wp.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 1.1 -import QtWebkit 1.0 - -QtWebView { - url: "http://www.chiptune.com/starfield/starfield.html" -} diff --git a/plasma/declarative/wallpapers/html5wallpaper/metadata.desktop b/plasma/declarative/wallpapers/html5wallpaper/metadata.desktop deleted file mode 100644 index afb1343..0000000 --- a/plasma/declarative/wallpapers/html5wallpaper/metadata.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Example HTML wallpaper -Comment=Puts a web page on your wallpaper - -Type=Service -ServiceTypes=Plasma/DeclarativeWallpaper -Icon=applications-toys -X-Plasma-MainScript=qml/html5wp.qml -X-KDE-PluginInfo-Author=Aleix Pol Gonzalez -X-KDE-PluginInfo-Email=aleixpol@kde.org -X-KDE-PluginInfo-Name=org.kde.html5wallpaper -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/declarative/wallpapers/ugly/contents/ui/wp.qml b/plasma/declarative/wallpapers/ugly/contents/ui/wp.qml deleted file mode 100644 index 63950f3..0000000 --- a/plasma/declarative/wallpapers/ugly/contents/ui/wp.qml +++ /dev/null @@ -1,24 +0,0 @@ -import QtQuick 1.1 - -Rectangle -{ - gradient: Gradient { - GradientStop { position: 0.0; color: "red" } - GradientStop { position: 1.0; color: "blue" } - } - - Timer { - interval: 1000; running: true; repeat: true - onTriggered: time.text = Date().toString() - } - - Text { anchors.centerIn: parent; id: time } - Text { - anchors { - top: parent.top - left: parent.left - margins: 40 - } - text: parent.width +"x"+ parent.height - } -} \ No newline at end of file diff --git a/plasma/declarative/wallpapers/ugly/metadata.desktop b/plasma/declarative/wallpapers/ugly/metadata.desktop deleted file mode 100644 index 310fdae..0000000 --- a/plasma/declarative/wallpapers/ugly/metadata.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Ugly Wallpaper -Comment=Tries to burn your retina - -Type=Service -ServiceTypes=Plasma/DeclarativeWallpaper -Icon=applications-toys -X-Plasma-MainScript=ui/wp.qml -X-KDE-PluginInfo-Author=Aleix Pol Gonzalez -X-KDE-PluginInfo-Email=aleixpol@kde.org -X-KDE-PluginInfo-Name=org.kde.uglywallpaper -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/declarative/widgetgallery/contents/ui/Busy.qml b/plasma/declarative/widgetgallery/contents/ui/Busy.qml deleted file mode 100644 index 96def63..0000000 --- a/plasma/declarative/widgetgallery/contents/ui/Busy.qml +++ /dev/null @@ -1,137 +0,0 @@ -/* -* Copyright (C) 2011 by Daker Fernandes Pinheiro -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License as -* published by the Free Software Foundation; either version 2, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 1.0 -import org.kde.plasma.components 0.1 as PlasmaComponents - -PlasmaComponents.Page { - height: childrenRect.height - property int implicitHeight: childrenRect.height - - tools: PlasmaComponents.ToolBarLayout { - spacing: 5 - PlasmaComponents.ToolButton { - visible: pageStack.depth > 1 - iconSource: "go-previous" - onClicked: pageStack.pop() - } - PlasmaComponents.ProgressBar { - value: 0.3 - } - PlasmaComponents.TextField { - clearButtonShown: true - text: "Busy widgets" - } - } - - Flickable { - id: flickable - contentWidth: column.width - contentHeight: column.height - clip: true - anchors.fill: parent - - Item { - width: Math.max(flickable.width, column.width) - height: column.height - Column { - id: column - spacing: 20 - anchors.horizontalCenter: parent.horizontalCenter - - PlasmaComponents.Label { - font.pixelSize: 20 - text: "Busy Indicator" - } - - PlasmaComponents.BusyIndicator { } - - PlasmaComponents.BusyIndicator { running: true } - - PlasmaComponents.Label { - font.pixelSize: 20 - text: "Progress Bar" - } - - PlasmaComponents.Label { text: "Horizontal" } - - PlasmaComponents.ProgressBar { - value: 0.3 - } - - PlasmaComponents.ProgressBar { - indeterminate: true - } - - PlasmaComponents.ProgressBar { - minimumValue: 0 - maximumValue: 100 - value: 30 - } - - PlasmaComponents.Label { text: "Vertical" } - Row { - spacing: 20 - PlasmaComponents.ProgressBar { - value: 0.3 - orientation: Qt.Vertical - width: 20 - height: 100 - } - PlasmaComponents.ProgressBar { - value: 0.4 - orientation: Qt.Vertical - width: 20 - height: 120 - } - PlasmaComponents.ProgressBar { - orientation: Qt.Vertical - width: 20 - height: 100 - indeterminate: true - } - } - } - } - } - - PlasmaComponents.ScrollBar { - id: horizontalScrollBar - - flickableItem: flickable - orientation: Qt.Horizontal - anchors { - left: parent.left - right: verticalScrollBar.left - bottom: parent.bottom - } - } - - PlasmaComponents.ScrollBar { - id: verticalScrollBar - - orientation: Qt.Vertical - flickableItem: flickable - anchors { - top: parent.top - right: parent.right - bottom: horizontalScrollBar.top - } - } -} diff --git a/plasma/declarative/widgetgallery/contents/ui/Buttons.qml b/plasma/declarative/widgetgallery/contents/ui/Buttons.qml deleted file mode 100644 index 0869d84..0000000 --- a/plasma/declarative/widgetgallery/contents/ui/Buttons.qml +++ /dev/null @@ -1,178 +0,0 @@ -/* -* Copyright (C) 2011 by Daker Fernandes Pinheiro -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License as -* published by the Free Software Foundation; either version 2, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 1.0 -import org.kde.plasma.components 0.1 as PlasmaComponents - -PlasmaComponents.Page { - height: childrenRect.height - tools: PlasmaComponents.ToolBarLayout { - spacing: 5 - PlasmaComponents.ToolButton { - visible: pageStack.depth > 1 - iconSource: "go-previous" - onClicked: pageStack.pop() - } - PlasmaComponents.Button { - text: "Button" - } - PlasmaComponents.TextField { - clearButtonShown: true - } - } - - Flickable { - id: flickable - contentWidth: column.width - contentHeight: column.height - clip: true - anchors.fill: parent - - Item { - width: Math.max(flickable.width, column.width) - height: column.height - Column { - id: column - spacing: 20 - anchors.horizontalCenter: parent.horizontalCenter - - PlasmaComponents.Label { - font.pixelSize: 20 - text: "Buttons" - } - - PlasmaComponents.Button { - id: bt1 - - text: "Button" - - onClicked: { - console.log("Clicked"); - pageStack.push(Qt.createComponent(plasmoid.file("ui", "Scrollers.qml"))) - } - - Keys.onTabPressed: bt2.forceActiveFocus(); - } - - PlasmaComponents.Button { - id: bt2 - - text: "Checkable Button" - checkable: true - - onCheckedChanged: { - if (checked) - console.log("Button Checked"); - else - console.log("Button Unchecked"); - } - - Keys.onTabPressed: bt3.forceActiveFocus(); - } - - PlasmaComponents.Button { - id: bt3 - - text: "Different Font" - font { - pointSize: 20 - family: "Helvetica" - } - - Keys.onTabPressed: bt4.forceActiveFocus(); - } - - PlasmaComponents.Button { - id: bt4 - - text: "Icon Button" - iconSource: "konqueror" - - Keys.onTabPressed: bt5.forceActiveFocus(); - } - - PlasmaComponents.Button { - id: bt5 - - iconSource: "plasma" - - Keys.onTabPressed: bt1.forceActiveFocus(); - } - - PlasmaComponents.Button { - - text: "Disabled Button" - enabled: false - } - - PlasmaComponents.ToolButton { - text: "ToolButton" - } - - PlasmaComponents.ToolButton { - text: "ToolButton not flat" - flat: false - } - - PlasmaComponents.ToolButton { - - text: "Icon ToolButton" - iconSource: "konqueror" - } - - PlasmaComponents.ToolButton { - iconSource: "plasma" - } - PlasmaComponents.ToolButton { - iconSource: "plasma" - flat: false - } - - PlasmaComponents.ToolButton { - text: "Disabled ToolButton" - enabled: false - } - } - } - } - - PlasmaComponents.ScrollBar { - id: horizontalScrollBar - - flickableItem: flickable - orientation: Qt.Horizontal - anchors { - left: parent.left - right: verticalScrollBar.left - bottom: parent.bottom - } - } - - PlasmaComponents.ScrollBar { - id: verticalScrollBar - - orientation: Qt.Vertical - flickableItem: flickable - anchors { - top: parent.top - right: parent.right - bottom: horizontalScrollBar.top - } - } -} diff --git a/plasma/declarative/widgetgallery/contents/ui/CheckableButtons.qml b/plasma/declarative/widgetgallery/contents/ui/CheckableButtons.qml deleted file mode 100644 index c320b4f..0000000 --- a/plasma/declarative/widgetgallery/contents/ui/CheckableButtons.qml +++ /dev/null @@ -1,165 +0,0 @@ -/* -* Copyright (C) 2011 by Daker Fernandes Pinheiro -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License as -* published by the Free Software Foundation; either version 2, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 1.0 -import org.kde.plasma.components 0.1 as PlasmaComponents - - -PlasmaComponents.Page { - - tools: PlasmaComponents.ToolBarLayout { - spacing: 5 - PlasmaComponents.ToolButton { - visible: pageStack.depth > 1 - iconSource: "go-previous" - onClicked: pageStack.pop() - } - PlasmaComponents.CheckBox { - text: "Checkbox in the toolbar" - } - PlasmaComponents.TextField { - clearButtonShown: true - text: "hello" - } - } - - Flickable { - id: flickable - contentWidth: column.width - contentHeight: column.height - clip: true - anchors.fill: parent - - Item { - width: Math.max(flickable.width, column.width) - height: column.height - Column { - id: column - spacing: 20 - anchors.horizontalCenter: parent.horizontalCenter - - PlasmaComponents.Label { - font.pixelSize: 20 - text: "Check Box" - } - - PlasmaComponents.CheckBox { - width: 140 - height: 30 - text: "Check Box 1" - - onCheckedChanged: { - if (checked) - console.log("CheckBox checked"); - else - console.log("CheckBox unchecked"); - } - onClicked: { - console.log("CheckBox clicked"); - } - } - - PlasmaComponents.CheckBox { - height: 30 - text: "Disabled" - enabled: false - } - - PlasmaComponents.CheckBox { - height: 30 - text: "" - } - - PlasmaComponents.CheckBox { - height: 30 - text: "A loooooooooooooong text" - } - - PlasmaComponents.Label { - font.pixelSize: 20 - text: "Radio Button" - } - - PlasmaComponents.RadioButton { - width: 140 - height: 30 - text: "RadioButton" - - onCheckedChanged: { - if (checked) - console.log("RadioButton Checked"); - else - console.log("RadioButton Unchecked"); - } - } - - PlasmaComponents.Switch { } - - PlasmaComponents.Label { - font.pixelSize: 20 - text: "Button Row" - } - - PlasmaComponents.ButtonRow { - spacing: 20 - PlasmaComponents.RadioButton { text: "A" } - PlasmaComponents.RadioButton { text: "B" } - PlasmaComponents.RadioButton { text: "C" } - } - - PlasmaComponents.Label { - font.pixelSize: 20 - text: "Button Column" - } - - PlasmaComponents.ButtonColumn { - spacing: 20 - PlasmaComponents.RadioButton { text: "Alice" } - PlasmaComponents.RadioButton { text: "Bob" } - PlasmaComponents.RadioButton { text: "Charles" } - } - - } - } - } - - PlasmaComponents.ScrollBar { - id: horizontalScrollBar - - flickableItem: flickable - orientation: Qt.Horizontal - anchors { - left: parent.left - right: verticalScrollBar.left - bottom: parent.bottom - } - } - - PlasmaComponents.ScrollBar { - id: verticalScrollBar - - orientation: Qt.Vertical - flickableItem: flickable - anchors { - top: parent.top - right: parent.right - bottom: horizontalScrollBar.top - } - } -} diff --git a/plasma/declarative/widgetgallery/contents/ui/Menu.qml b/plasma/declarative/widgetgallery/contents/ui/Menu.qml deleted file mode 100644 index c662ef0..0000000 --- a/plasma/declarative/widgetgallery/contents/ui/Menu.qml +++ /dev/null @@ -1,86 +0,0 @@ -/* -* Copyright (C) 2011 by Daker Fernandes Pinheiro -* Copyright (C) 2011 by Marco Martin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License as -* published by the Free Software Foundation; either version 2, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 1.1 -import org.kde.plasma.components 0.1 - -Page { - ListView { - id: pageSelector - clip: true - anchors.fill: parent - - model: ListModel { - id: pagesModel - ListElement { - page: "Buttons.qml" - title: "Buttons" - } - ListElement { - page: "CheckableButtons.qml" - title: "Checkable buttons" - } - ListElement { - page: "Busy.qml" - title: "Busy indicators" - } - ListElement { - page: "Sliders.qml" - title: "Sliders" - } - ListElement { - page: "Scrollers.qml" - title: "Scrollers" - } - ListElement { - page: "Texts.qml" - title: "Text elements" - } - ListElement { - page: "Typography.qml" - title: "Typography" - } - ListElement { - page: "Misc.qml" - title: "Misc stuff" - } - } - delegate: ListItem { - enabled: true - Column { - Label { - text: title - } - } - onClicked: pageStack.push(Qt.createComponent(plasmoid.file("ui", page))) - } - } - ScrollBar { - id: verticalScrollBar - - orientation: Qt.Vertical - flickableItem: pageSelector - anchors { - top: parent.top - right: parent.right - bottom: parent.bottom - } - } -} diff --git a/plasma/declarative/widgetgallery/contents/ui/Misc.qml b/plasma/declarative/widgetgallery/contents/ui/Misc.qml deleted file mode 100644 index a96b226..0000000 --- a/plasma/declarative/widgetgallery/contents/ui/Misc.qml +++ /dev/null @@ -1,674 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Components project. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.1 -import org.kde.plasma.components 0.1 -import org.kde.plasma.extras 0.1 as PlasmaExtras - - -Page { - implicitWidth: childrenRect.width - implicitHeight: childrenRect.height - tools: Row { - spacing: 5 - ToolButton { - visible: pageStack.depth > 1 - iconSource: "go-previous" - onClicked: pageStack.pop() - } - Button { - text: "Button" - } - } - - PlasmaExtras.ScrollArea { - anchors.fill: parent - Flickable { - id: flickable - contentWidth: column.width - contentHeight: column.height - clip: true - anchors.fill: parent - - Item { - width: Math.max(flickable.width, column.width) - height: column.height - Column { - id: column - spacing: 20 - anchors.horizontalCenter: parent.horizontalCenter - - // for demonstration and testing purposes each component needs to - // set its inverted state explicitly - property bool childrenInverted: false - property bool windowInverted: false - - Label { - anchors.horizontalCenter: parent.horizontalCenter - text: "Qt Components " + (enabled ? "(enabled)" : "(disabled)") - } - - Button { - anchors.horizontalCenter: parent.horizontalCenter - text: "Push me" - width: parent.width - parent.spacing - } - - TextField { - anchors.horizontalCenter: parent.horizontalCenter - placeholderText: "TextField" - width: parent.width - parent.spacing - } - - TextField { - id: clearable - clearButtonShown: true - anchors.horizontalCenter: parent.horizontalCenter - placeholderText: "Clearable TextField" - text: "Clearable TextField" - width: parent.width - parent.spacing - } - - TextField { - id: customOperation - anchors.horizontalCenter: parent.horizontalCenter - placeholderText: "Custom operation" - width: parent.width - parent.spacing - - Image { - id: addText - anchors { top: parent.top; right: parent.right } - smooth: true - fillMode: Image.PreserveAspectFit - source: "qrc:ok.svg" - height: parent.height; width: parent.height - scale: LayoutMirroring.enabled ? -1 : 1 - - MouseArea { - id: add - anchors.fill: parent - onClicked: textSelection.open() - } - - SelectionDialog { - id: textSelection - titleText: "Preset Texts" - selectedIndex: -1 - model: ListModel { - ListElement { name: "Lorem ipsum." } - ListElement { name: "Lorem ipsum dolor sit amet." } - ListElement { name: "Lorem ipsum dolor sit amet ipsum." } - } - - onAccepted: { - customOperation.text = textSelection.model.get(textSelection.selectedIndex).name - customOperation.forceActiveFocus() - } - - onRejected: selectedIndex = -1 - } - } - } - - TextArea { - anchors.horizontalCenter: parent.horizontalCenter - placeholderText: "This is a\n multiline control." - width: parent.width - parent.spacing; height: 280 - } - - Slider { - anchors.horizontalCenter: parent.horizontalCenter - value: 50 - } - - ButtonRow { - anchors.horizontalCenter: parent.horizontalCenter - spacing: parent.spacing - - exclusive: true - - RadioButton { - } - - RadioButton { - } - } - - Row { - anchors.horizontalCenter: parent.horizontalCenter - spacing: parent.spacing - - CheckBox { - } - - CheckBox { - checked: true - } - } - - Switch { - anchors.horizontalCenter: parent.horizontalCenter - } - - ProgressBar { - anchors.horizontalCenter: parent.horizontalCenter - - Timer { - running: true - repeat: true - interval: 25 - onTriggered: parent.value = (parent.value + 1) % 1.1 - } - } - - ProgressBar { - anchors.horizontalCenter: parent.horizontalCenter - indeterminate: true - } - - Component { - id: dialogComponent - CommonDialog { - id: dialog - titleText: "CommonDialog" - buttonTexts: ["Ok", "Cancel"] - - content: Label { - text: "This is the content" - font { bold: true; pixelSize: 16 } - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - } - - Button { - property CommonDialog dialog - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - parent.spacing - text: "CommonDialog" - onClicked: { - if (!dialog) - dialog = dialogComponent.createObject(column) - dialog.open() - } - } - - Component { - id: singleSelectionDialogComponent - SelectionDialog { - titleText: "Select background color" - selectedIndex: 1 - - model: ListModel { - id: colorModel - - ListElement { name: "Red" } - ListElement { name: "Blue" } - ListElement { name: "Green" } - ListElement { name: "Yellow" } - ListElement { name: "Black" } - ListElement { name: "White" } - ListElement { name: "Grey" } - ListElement { name: "Orange" } - ListElement { name: "Pink" } - } - - onAccepted: { selectionDialogButton.parent.color = colorModel.get(selectedIndex).name } - } - } - - Rectangle { - anchors.horizontalCenter: parent.horizontalCenter - height: selectionDialogButton.height - width: parent.width - parent.spacing - radius: 10 - - Button { - id: selectionDialogButton - property SelectionDialog singleSelectionDialog - anchors.centerIn: parent - text: "Selection Dialog" - onClicked: { - if (!singleSelectionDialog) - singleSelectionDialog = singleSelectionDialogComponent.createObject(column) - singleSelectionDialog.open() - } - } - } - - Button { - property QueryDialog queryDialog - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - parent.spacing - text: "QueryDialog" - onClicked: { - if (!queryDialog) - queryDialog = queryDialogComponent.createObject(column) - queryDialog.open() - } - } - - Component { - id: queryDialogComponent - QueryDialog { - titleText: "Query Dialog" - // Arabic character in the beginning to test right-to-left UI alignment - message: (LayoutMirroring.enabled ? "\u062a" : "") + "Lorem ipsum dolor sit amet, consectetur adipisici elit," - + "sed eiusmod tempor incidunt ut labore et dolore magna aliqua." - + "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris" - + "nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit" - + "in voluptate velit esse cillum dolore eu fugiat nulla pariatur." - + "Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui" - + "officia deserunt mollit anim id est laborum." - - acceptButtonText: "Ok" - rejectButtonText: "Cancel" - - titleIcon: "kmail" - } - } - - Rectangle { - anchors.horizontalCenter: parent.horizontalCenter - height: contentMenuButton.height - width: parent.width - parent.spacing - radius: 10 - - Button { - id: contentMenuButton - property ContextMenu contextMenu - anchors.horizontalCenter: parent.horizontalCenter - text: "ContextMenu" - onClicked: { - if (!contextMenu) - contextMenu = contextMenuComponent.createObject(contentMenuButton) - contextMenu.open() - } - } - } - - Component { - id: contextMenuComponent - ContextMenu { - visualParent: contentMenuButton - MenuItem { - text: "White" - onClicked: contentMenuButton.parent.color = "White" - } - MenuItem { - text: "Red" - onClicked: contentMenuButton.parent.color = "Red" - } - MenuItem { - text: "LightBlue" - onClicked: contentMenuButton.parent.color = "LightBlue" - } - MenuItem { - text: "LightGreen" - onClicked: contentMenuButton.parent.color = "LightGreen" - } - } - } - - ListView { - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - parent.spacing; height: 120 - clip: true - delegate: listDelegate - model: listModel - header: listHeading - } - - ListModel { - id: listModel - - ListElement { - titleText: "Title" - subTitleText: "SubTitle" - } - ListElement { - titleText: "Title2" - subTitleText: "SubTitle" - } - ListElement { - titleText: "Title3" - subTitleText: "SubTitle" - } - } - - Component { - id: listHeading - Label { - text: "Heading" - } - } - - Component { - id: listDelegate - ListItem { - id: listItem - Column { - - Label { - text: titleText - } - Label { - text: subTitleText - } - } - } - } - - Label { - property SelectionDialog selectionDialog - text: { - if (selectionDialog) { - if (selectionDialog.selectedIndex >= 0) - return selectionDialog.model.get(selectionDialog.selectedIndex).name - } - return "Three" - } - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - parent.spacing - - MouseArea { - anchors.fill: parent - onClicked: { - if (!selectionDialog) - selectionDialog = selectionDialogComponent.createObject(column) - selectionDialog.open() - } - } - - Component { - id: selectionDialogComponent - SelectionDialog { - titleText: "Select" - selectedIndex: 2 - model: ListModel { - ListElement { name: "One" } - ListElement { name: "Two" } - ListElement { name: "Three" } - ListElement { name: "Four" } - ListElement { name: "Five" } - ListElement { name: "Six" } - ListElement { name: "Seven" } - ListElement { name: "Eight" } - ListElement { name: "Nine" } - } - } - } - } - - - TabBar { - //width: parent.width - parent.spacing - //height: 50 - anchors.horizontalCenter: parent.horizontalCenter - TabButton { tab: tab1content; text: "1"; iconSource: "qrc:close_stop.svg"} - TabButton { tab: tab2content; text: "2"; iconSource: "konqueror"} - TabButton { tab: tab3content; text: "3"} - } - - TabGroup { - height: 100 - width: parent.width - parent.spacing - Button { id: tab1content; text: "tab1" } - Label { - id: tab2content - text: "tab2" - horizontalAlignment: "AlignHCenter" - verticalAlignment: "AlignVCenter" - } - Page { - id: tab3content - width: 50 - height: 32 - CheckBox { anchors.fill: parent; text: "tab3"} - } - } - - ToolButton { - id: toolButton - text: "ToolButton" - iconSource: "konqueror" - } - - ToolButton { - id: toolButton2 - flat: true - iconSource: "qrc:ok.svg" - } - - ToolButton { - id: toolButton3 - text: "ToolButton" - iconSource: "qrc:close_stop.svg" - } - - Row { - spacing: 5 - - BusyIndicator { - id: busyInd1 - width: 20 - height: 20 - running: true - } - - BusyIndicator { - // default width/height is 40 - id: busyInd2 - running: true - } - - BusyIndicator { - id: busyInd3 - width: 60 - height: 60 - running: true - } - - Button { - text: "Toggle" - onClicked: { - busyInd1.running = !busyInd1.running - busyInd2.running = !busyInd2.running - busyInd3.running = !busyInd3.running - } - } - } - - Button { - property CommonDialog sectionScroll - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width - parent.spacing - text: "SectionScroller" - iconSource: "konqueror" - onClicked: { - if (!sectionScroll) - sectionScroll = sectionScrollComponent.createObject(column) - sectionScroll.open() - } - } - - Component { - id: sectionScrollComponent - CommonDialog { - id: sectionScroll - titleText: "Section Scroller" - buttonTexts: ["Close"] - onButtonClicked: close() - - content: Rectangle { - color: Qr.rgba(1,1,1,0.8) - width: parent.width - implicitHeight: 300 - - ListModel { - id: testModel - ListElement { name: "A Cat 1"; alphabet: "A" } - ListElement { name: "A Cat 2"; alphabet: "A" } - ListElement { name: "Boo 1"; alphabet: "B" } - ListElement { name: "Boo 2"; alphabet: "B" } - ListElement { name: "Cat 1"; alphabet: "C" } - ListElement { name: "Cat 2"; alphabet: "C" } - ListElement { name: "Dog 1"; alphabet: "D" } - ListElement { name: "Dog 2"; alphabet: "D" } - ListElement { name: "Dog 3"; alphabet: "D" } - ListElement { name: "Dog 4"; alphabet: "D" } - ListElement { name: "Dog 5"; alphabet: "D" } - ListElement { name: "Dog 6"; alphabet: "D" } - ListElement { name: "Dog 7"; alphabet: "D" } - ListElement { name: "Dog 8"; alphabet: "D" } - ListElement { name: "Dog 9"; alphabet: "D" } - ListElement { name: "Dog 10"; alphabet: "D" } - ListElement { name: "Dog 11"; alphabet: "D" } - ListElement { name: "Dog 12"; alphabet: "D" } - ListElement { name: "Elephant 1"; alphabet: "E" } - ListElement { name: "Elephant 2"; alphabet: "E" } - ListElement { name: "FElephant 1"; alphabet: "F" } - ListElement { name: "FElephant 2"; alphabet: "F" } - ListElement { name: "Guinea pig"; alphabet: "G" } - ListElement { name: "Goose"; alphabet: "G" } - ListElement { name: "Horse"; alphabet: "H" } - ListElement { name: "Horse"; alphabet: "H" } - ListElement { name: "Parrot"; alphabet: "P" } - ListElement { name: "Parrot"; alphabet: "P" } - } - - PlasmaExtras.ScrollArea { - anchors.fill: parent - ListView { - id: list - anchors.fill: parent - clip: true - cacheBuffer: contentHeight - delegate: ListItem { - Label { - anchors { - top: parent.top; topMargin: 4 - left: parent.left; leftMargin: 4 - } - color: Qt.rgba(0,0,0,0.8) - text: name + " (index " + index + ")" - horizontalAlignment: Text.AlignLeft - } - } - - model: testModel - section.property: "alphabet" - section.criteria: ViewSection.FullString - section.delegate: ListItem { - sectionDelegate: true - Label { - anchors { - top: parent.top; topMargin: 4 - left: parent.left; leftMargin: 4 - } - color: Qt.rgba(0,0,0,0.8) - text: section - horizontalAlignment: Text.AlignLeft - font { bold: true; } - } - } - } - } - } - } - } - - ButtonRow { - id: buttonRow1 - width: parent.width - parent.spacing - exclusive: true - checkedButton: b2 - - Button { text: "b1" } - Button { text: "b2" } - Button { text: "b3" } - } - - ButtonRow { - id: buttonRow2 - width: parent.width - parent.spacing - exclusive: true - - ToolButton { text: "tb1" } - ToolButton { text: "tb2" } - } - ButtonRow { - id: buttonRow3 - exclusive: true - spacing: 0 - - ToolButton { flat:false; iconSource: "go-previous" } - ToolButton { flat:false; text: "tb2" } - ToolButton { flat:false; text: "tb3" } - ToolButton { flat:false; iconSource: "go-next" } - } - ButtonColumn { - id: buttonRow4 - exclusive: true - spacing: 0 - - ToolButton { flat:false; text: "tb1" } - ToolButton { flat:false; text: "tb2" } - ToolButton { flat:false; text: "tb3" } - ToolButton { flat:false; text: "tb4" } - } - - ButtonColumn { - id: buttonColumn - width: parent.width - parent.spacing - exclusive: true - - Button { text: "b4" } - Button { text: "b5" } - Button { text: "b6" } - Button { text: "b7" } - } - } - } - } - } - -} diff --git a/plasma/declarative/widgetgallery/contents/ui/Scrollers.qml b/plasma/declarative/widgetgallery/contents/ui/Scrollers.qml deleted file mode 100644 index e3660a6..0000000 --- a/plasma/declarative/widgetgallery/contents/ui/Scrollers.qml +++ /dev/null @@ -1,163 +0,0 @@ -/* -* Copyright (C) 2011 by Daker Fernandes Pinheiro -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License as -* published by the Free Software Foundation; either version 2, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 1.0 -import org.kde.plasma.components 0.1 as PlasmaComponents -import org.kde.plasma.extras 0.1 as PlasmaExtras - -PlasmaComponents.Page { - height: childrenRect.height - property int implicitHeight: childrenRect.height - - tools: PlasmaComponents.ToolBarLayout { - spacing: 5 - PlasmaComponents.ToolButton { - visible: pageStack.depth > 1 - iconSource: "go-previous" - onClicked: pageStack.pop() - } - PlasmaComponents.ScrollBar { - orientation: Qt.Horizontal - interactive: true - flickableItem: scrollArea - width: 200 - } - PlasmaComponents.TextField { - clearButtonShown: true - text: "hello" - } - } - - PlasmaExtras.ScrollArea { - anchors.fill: parent - Flickable { - id: flickable - contentWidth: column.width - contentHeight: column.height - clip: true - anchors.fill: parent - - Item { - width: Math.max(flickable.width, column.width) - height: column.height - Column { - id: column - spacing: 20 - anchors.horizontalCenter: parent.horizontalCenter - - PlasmaComponents.Label { - font.pixelSize: 20 - text: "Scroll Bar" - } - - PlasmaExtras.ScrollArea { - width: 200 - height: 200 - ListView { - id: scrollList - - width: 200 - height: 200 - clip: true - model: 20 - delegate: PlasmaComponents.Label { - width: 200 - height: 30 - text: index - font.pixelSize: 18 - } - - Rectangle { - anchors.fill: parent - color: "grey" - opacity: 0.3 - } - } - } - - PlasmaComponents.Label { - font.pixelSize: 20 - text: "Scroll Decorator" - } - - Item { - width: 200 - height: 200 - PlasmaComponents.Highlight { anchors.fill: parent } - Flickable { - id: scrollArea - anchors.fill: parent - clip: true - contentWidth: 400 - contentHeight: 400 - - // Flickable Contents - Rectangle { - color: "green" - width: 100 - height: 100 - } - Rectangle { - x: 80 - y: 80 - color: "blue" - width: 200 - height: 200 - } - Rectangle { - x: 200 - y: 200 - color: "red" - width: 150 - height: 150 - } - } - - // Scroll Decorators - PlasmaComponents.ScrollBar { - orientation: Qt.Vertical - flickableItem: scrollArea - inverted: true - anchors { - top: scrollArea.top - right: scrollArea.right - bottom: scrollArea.bottom - } - PlasmaComponents.Label { - y: parent.height / 2 - x: 13 - rotation: -90 - text: "inverted" - } - } - PlasmaComponents.ScrollBar { - orientation: Qt.Horizontal - flickableItem: scrollArea - anchors { - left: scrollArea.left - right: scrollArea.right - bottom: scrollArea.bottom - } - } - } - } - } - } - } -} diff --git a/plasma/declarative/widgetgallery/contents/ui/Sliders.qml b/plasma/declarative/widgetgallery/contents/ui/Sliders.qml deleted file mode 100644 index ad99f93..0000000 --- a/plasma/declarative/widgetgallery/contents/ui/Sliders.qml +++ /dev/null @@ -1,180 +0,0 @@ -/* -* Copyright (C) 2011 by Daker Fernandes Pinheiro -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License as -* published by the Free Software Foundation; either version 2, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 1.0 -import org.kde.plasma.components 0.1 as PlasmaComponents - -PlasmaComponents.Page { - height: childrenRect.height - property int implicitHeight: childrenRect.height - - tools: PlasmaComponents.ToolBarLayout { - spacing: 5 - PlasmaComponents.ToolButton { - visible: pageStack.depth > 1 - iconSource: "go-previous" - onClicked: pageStack.pop() - } - PlasmaComponents.Slider { - width: 140 - enabled: true - } - PlasmaComponents.TextField { - clearButtonShown: true - text: "hello" - } - } - - Flickable { - id: flickable - contentWidth: column.width - contentHeight: column.height - clip: true - anchors.fill: parent - - Item { - width: Math.max(flickable.width, column.width) - height: column.height - Column { - id: column - spacing: 20 - anchors.horizontalCenter: parent.horizontalCenter - - PlasmaComponents.Label { - font.pixelSize: 20 - text: "Slider" - } - - - Column { - spacing: 10 - - PlasmaComponents.Label { text: "Color Selector"; font.pixelSize: 20 } - - PlasmaComponents.Label { text: "Red" } - - PlasmaComponents.Slider { - id: redSlider - height: 20 - width: 255 - orientation: Qt.Horizontal - minimumValue: 0 - maximumValue: 255 - stepSize: 10 - Keys.onTabPressed: greenSlider.forceActiveFocus() - } - - PlasmaComponents.Label { text: "Green" } - - PlasmaComponents.Slider { - id: greenSlider - height: 20 - width: 255 - orientation: Qt.Horizontal - minimumValue: 0 - maximumValue: 255 - stepSize: 10 - Keys.onTabPressed: blueSlider.forceActiveFocus() - } - - PlasmaComponents.Label { text: "Blue" } - - PlasmaComponents.Slider { - id: blueSlider - height: 20 - width: 255 - orientation: Qt.Horizontal - minimumValue: 0 - maximumValue: 255 - stepSize: 10 - Keys.onTabPressed: redSlider.forceActiveFocus() - } - - Rectangle { - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width / 2 - height: width - color: Qt.rgba(redSlider.value / 255, greenSlider.value / 255, blueSlider.value / 255, 1) - } - } - - PlasmaComponents.Label { text: "Disabled Horizontal Slider" } - - PlasmaComponents.Slider { - id: horizontalSlider - width: 140 - height: 20 - enabled: false - } - - PlasmaComponents.Label { text: "Inverted Horizontal Slider" } - - PlasmaComponents.Slider { - id: invHorizontalSlider - width: 140 - height: 20 - inverted: true - enabled: true - } - - PlasmaComponents.Label { text: "Vertical Slider" } - - Row { - spacing: 30 - PlasmaComponents.Slider { - id: verticalSlider - width: 20 - height: 140 - orientation: Qt.Vertical - minimumValue: 10 - maximumValue: 1000 - stepSize: 50 - inverted: true - } - PlasmaComponents.Label { text: verticalSlider.value } - } - - } - } - } - - PlasmaComponents.ScrollBar { - id: horizontalScrollBar - - flickableItem: flickable - orientation: Qt.Horizontal - anchors { - left: parent.left - right: verticalScrollBar.left - bottom: parent.bottom - } - } - - PlasmaComponents.ScrollBar { - id: verticalScrollBar - - orientation: Qt.Vertical - flickableItem: flickable - anchors { - top: parent.top - right: parent.right - bottom: horizontalScrollBar.top - } - } -} diff --git a/plasma/declarative/widgetgallery/contents/ui/Texts.qml b/plasma/declarative/widgetgallery/contents/ui/Texts.qml deleted file mode 100644 index fdd1e8d..0000000 --- a/plasma/declarative/widgetgallery/contents/ui/Texts.qml +++ /dev/null @@ -1,162 +0,0 @@ -/* -* Copyright (C) 2011 by Daker Fernandes Pinheiro -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License as -* published by the Free Software Foundation; either version 2, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 1.1 -import org.kde.plasma.components 0.1 as PlasmaComponents - -PlasmaComponents.Page { - height: childrenRect.height - property int implicitHeight: childrenRect.height - - tools: PlasmaComponents.ToolBarLayout { - spacing: 5 - PlasmaComponents.ToolButton { - visible: pageStack.depth > 1 - iconSource: "go-previous" - onClicked: pageStack.pop() - } - PlasmaComponents.Label { - text: "Text label:" - } - PlasmaComponents.TextField { - placeholderText: "Place holder text" - } - PlasmaComponents.TextField { - clearButtonShown: true - text: "Text fields page" - } - } - - Flickable { - id: flickable - contentWidth: column.width - contentHeight: column.height - clip: true - anchors.fill: parent - - Item { - width: Math.max(flickable.width, column.width) - height: column.height - Column { - id: column - spacing: 20 - anchors.horizontalCenter: parent.horizontalCenter - - PlasmaComponents.Label { - text: "Text Fields" - font.pixelSize: 20 - } - - PlasmaComponents.Highlight { - width: 200 - height: 100 - Column { - spacing: 10 - Row { - PlasmaComponents.Label { - text: "Username: " - anchors.verticalCenter: tf1.verticalCenter - } - PlasmaComponents.TextField { - id: tf1 - placeholderText: "login" - Keys.onTabPressed: tf2.forceActiveFocus(); - } - } - - Row { - PlasmaComponents.Label { - text: "Password: " - anchors.verticalCenter: tf2.verticalCenter - } - PlasmaComponents.TextField { - id: tf2 - width: 120 - echoMode: TextInput.Password - Keys.onTabPressed: loginButton.forceActiveFocus(); - } - } - - PlasmaComponents.Button { - id: loginButton - text: "Login" - anchors { - right: parent.right - rightMargin: 0 - } - width: 100 - } - } - } - - PlasmaComponents.TextField { - width: 120 - placeholderText: "Disabled Text Field" - Keys.onTabPressed: loginButton.forceActiveFocus(); - enabled: false - } - - PlasmaComponents.Label { - text: "Text Area" - font.pixelSize: 20 - } - - PlasmaComponents.TextArea { - width: 200 - height: 200 - placeholderText: "Lorem ipsum et dolor" - wrapMode: TextEdit.WordWrap - contentMaxWidth: 400 - contentMaxHeight: 400 - } - - PlasmaComponents.TextArea { - width: 200 - height: 100 - enabled: false - text: "Disabled Text Area" - } - } - } - } - - PlasmaComponents.ScrollBar { - id: horizontalScrollBar - - flickableItem: flickable - orientation: Qt.Horizontal - anchors { - left: parent.left - right: verticalScrollBar.left - bottom: parent.bottom - } - } - - PlasmaComponents.ScrollBar { - id: verticalScrollBar - - orientation: Qt.Vertical - flickableItem: flickable - anchors { - top: parent.top - right: parent.right - bottom: horizontalScrollBar.top - } - } -} diff --git a/plasma/declarative/widgetgallery/contents/ui/Typography.qml b/plasma/declarative/widgetgallery/contents/ui/Typography.qml deleted file mode 100644 index 929cb1a..0000000 --- a/plasma/declarative/widgetgallery/contents/ui/Typography.qml +++ /dev/null @@ -1,177 +0,0 @@ -/* -* Copyright 2012 by Sebastian Kügler -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License as -* published by the Free Software Foundation; either version 2, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 1.1 -import org.kde.plasma.components 0.1 as PlasmaComponents -import org.kde.plasma.extras 0.1 as PlasmaExtras - - -PlasmaComponents.Page { - implicitWidth: childrenRect.width - implicitHeight: childrenRect.height - tools: Row { - spacing: 5 - PlasmaComponents.ToolButton { - visible: pageStack.depth > 1 - iconSource: "go-previous" - onClicked: pageStack.pop() - } - PlasmaExtras.Title { - text: "Typography" - } - } - - PlasmaExtras.ScrollArea { - anchors.fill: parent - Flickable { - id: flickable - //contentWidth: column.width - contentHeight: column.height - clip: true - anchors.fill: parent - - Column { - id: column - width: parent.width - anchors { - //fill: parent - margins: 12 - } - spacing: 12 - - PlasmaExtras.Title { - text: "A Title" - } - - Repeater { - model: 5 - PlasmaExtras.Heading { - level: index + 1 - text: "Header level " + (index + 1) - } - } - - PlasmaExtras.Heading { - level: 1 - text: "Paragraphs" - } - - PlasmaExtras.Paragraph { - text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sit amet turpis eros, in luctus lectus. Curabitur pulvinar ligula at leo pellentesque non faucibus mauris elementum. Pellentesque convallis porttitor sodales. Maecenas risus erat, viverra blandit vestibulum eu, suscipit in est. Praesent quis mattis eros. Sed ante ante, adipiscing non gravida sed, ultrices ultrices urna. Etiam congue mattis convallis. Maecenas sollicitudin mauris at lorem aliquam in venenatis erat convallis. Fusce eleifend scelerisque porttitor. Praesent metus sapien, hendrerit ac congue eget, feugiat id enim. Morbi venenatis gravida felis, vitae varius nunc dictum a. Etiam accumsan, velit ac tempor convallis, leo nibh consequat purus, sit amet fringilla nisi mi et libero." - } - - PlasmaExtras.Paragraph { - text: "Donec tincidunt justo eget nulla eleifend hendrerit. Ut eleifend erat nibh. Nunc sagittis tincidunt quam quis lobortis. Nam suscipit ultrices nulla. Suspendisse ullamcorper eleifend massa eu pharetra. Donec tempor iaculis elit, in suscipit velit tristique eu. Curabitur suscipit, lacus id pharetra dapibus, velit ante consectetur erat, ac dignissim quam arcu vitae diam. Suspendisse laoreet tortor nec dolor venenatis ultricies. Sed nunc erat, placerat non gravida sit amet, ullamcorper eu turpis. Nullam vestibulum lacus sed tellus fermentum mollis id at urna. Sed eleifend lobortis mollis. Donec lacus dolor, varius commodo gravida et, fringilla in justo. Nam gravida lorem in odio viverra elementum. Suspendisse non tellus at justo convallis placerat vel ac tellus. Nulla tristique tristique dui ut vestibulum." - } - - - PlasmaExtras.Heading { - level: 1 - text: "TBD Components" - } - - PlasmaComponents.Label { - id: menuEntry - text: "Menu entry" - } - - PlasmaComponents.Label { - id: notificationHeader - text: "Notification header" - } - - PlasmaComponents.Label { - id: notificationContent - text: "Menu entry" - } - - PlasmaComponents.Label { - id: activeTab - text: "Active tab" - } - - PlasmaComponents.Label { - id: inactiveTab - text: "Intactive tab" - } - - PlasmaComponents.Label { - id: activeSelection - text: "Active selection" - } - - PlasmaComponents.Label { - id: inactiveSelection - text: "Inactive selection" - } - - PlasmaComponents.Label { - id: listItemPrimary - text: "List item: primary text" - } - - PlasmaComponents.Label { - id: listItemSub - text: "List item: secondary text" - } - - PlasmaComponents.Label { - id: listItemPrimarySelected - text: "List item: selected, primary text" - } - - PlasmaComponents.Label { - id: listItemPrimarySub - text: "List item: selected, secondary text" - } - - PlasmaComponents.Label { - id: widgetHeader - text: "Widget headers" - } - - PlasmaComponents.Label { - id: widgetContent - text: "Widget Content" - } - - PlasmaComponents.Label { - id: iconTextSelected - text: "Icon text, selected" - } - - PlasmaComponents.Label { - id: iconTextUnselected - text: "Icon text, unselected" - } - - PlasmaComponents.Label { - id: groupHeader - text: "Group Header" - } - - PlasmaComponents.Label { - id: groupContent - text: "Group Content" - } - } - } - } -} - diff --git a/plasma/declarative/widgetgallery/contents/ui/main.qml b/plasma/declarative/widgetgallery/contents/ui/main.qml deleted file mode 100644 index a8bc533..0000000 --- a/plasma/declarative/widgetgallery/contents/ui/main.qml +++ /dev/null @@ -1,50 +0,0 @@ -/* -* Copyright (C) 2011 by Daker Fernandes Pinheiro -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License as -* published by the Free Software Foundation; either version 2, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 1.0 -import org.kde.plasma.components 0.1 - -Item { - property int minimumWidth: 300 - property int minimumHeight: 400 - - ToolBar { - id: toolBar - z: 10 - anchors { - top: parent.top - left: parent.left - right: parent.right - } - } - - - PageStack { - id: pageStack - toolBar: toolBar - clip: true - anchors { - top: toolBar.bottom - left: parent.left - right: parent.right - bottom: parent.bottom - } - initialPage: Qt.createComponent("Menu.qml") - } -} diff --git a/plasma/declarative/widgetgallery/metadata.desktop b/plasma/declarative/widgetgallery/metadata.desktop deleted file mode 100644 index 650f8c6..0000000 --- a/plasma/declarative/widgetgallery/metadata.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Widgets gallery -Comment=gallery of widgets done with Plasma QtComponents -Type=Service -ServiceTypes=Plasma/Applet -Icon=preferences-desktop-theme -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/main.qml -X-KDE-PluginInfo-Author=Marco MArtin -X-KDE-PluginInfo-Email=notmart@gmail.com -X-KDE-PluginInfo-Name=org.kde.example.widgetgallery -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/declarative/widgetgallery/platformcontents/application/tablet/ui/main.qml b/plasma/declarative/widgetgallery/platformcontents/application/tablet/ui/main.qml deleted file mode 100644 index 3076d4d..0000000 --- a/plasma/declarative/widgetgallery/platformcontents/application/tablet/ui/main.qml +++ /dev/null @@ -1,124 +0,0 @@ -/* -* Copyright (C) 2011 by Daker Fernandes Pinheiro -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Library General Public License as -* published by the Free Software Foundation; either version 2, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details -* -* You should have received a copy of the GNU Library General Public -* License along with this program; if not, write to the -* Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -import QtQuick 1.0 -import org.kde.plasma.components 0.1 -import org.kde.plasma.mobilecomponents 0.1 as MobileComponents - -Image { - property int minimumWidth: 300 - property int minimumHeight: 400 - source: "image://appbackgrounds/standard" - fillMode: Image.Tile - asynchronous: true - - ToolBar { - id: toolBar - anchors { - top: parent.top - left: parent.left - right: parent.right - } - } - - - Image { - id: sidebar - source: "image://appbackgrounds/contextarea" - fillMode: Image.Tile - asynchronous: true - width: 200 - z: 10 - anchors { - top: toolBar.bottom - bottom: parent.bottom - } - Image { - source: "image://appbackgrounds/shadow-right" - fillMode: Image.Tile - anchors { - left: parent.right - top: parent.top - bottom: parent.bottom - leftMargin: -1 - } - } - - ListView { - id: pageSelector - clip: true - anchors.fill: parent - - model: ListModel { - id: pagesModel - ListElement { - page: "Buttons.qml" - title: "Buttons" - } - ListElement { - page: "CheckableButtons.qml" - title: "Checkable buttons" - } - ListElement { - page: "Busy.qml" - title: "Busy indicators" - } - ListElement { - page: "Sliders.qml" - title: "Sliders" - } - ListElement { - page: "Scrollers.qml" - title: "Scrollers" - } - ListElement { - page: "Texts.qml" - title: "Text elements" - } - ListElement { - page: "Misc.qml" - title: "Misc stuff" - } - } - delegate: ListItem { - enabled: true - Column { - Label { - text: title - } - } - onClicked: pageStack.replace(Qt.createComponent(plasmoid.file("ui", page))) - } - } - } - - - PageStack { - id: pageStack - toolBar: toolBar - anchors { - top: toolBar.bottom - left: sidebar.right - right: parent.right - bottom: parent.bottom - } - initialPage: Qt.createComponent("Buttons.qml") - } - -} diff --git a/plasma/declarative/widgetgallery/widgetgallery-tablet b/plasma/declarative/widgetgallery/widgetgallery-tablet deleted file mode 100755 index a16aab8..0000000 --- a/plasma/declarative/widgetgallery/widgetgallery-tablet +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -export PLASMA_CUSTOM_PREFIX_PATHS=platformcontents/application/generic/:platformcontents/application/tablet/:contents/ - -plasmoidviewer -graphicssystem raster org.kde.example.widgetgallery diff --git a/plasma/javascript/CMakeLists.txt b/plasma/javascript/CMakeLists.txt deleted file mode 100644 index d238b48..0000000 --- a/plasma/javascript/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(plasmoids) diff --git a/plasma/javascript/CONTENTS b/plasma/javascript/CONTENTS deleted file mode 100644 index af53bff..0000000 --- a/plasma/javascript/CONTENTS +++ /dev/null @@ -1,40 +0,0 @@ -Overview -======== -This directory contains a set of example Javascript components for Plasma enabled applications. -More information such as tutorials and API documentation can be found here: - -http://techbase.kde.org/index.php?title=Development/Tutorials/Plasma#Plasma_Programming_with_JavaScript - -The examples are broken out into generic examples which are equally applicable to Plasmoids, DataEngines -or Runners (though the examples themeselves maybe implemented as one or the other of those addon types) -as well as examples specific to Plasmoids, DataEngines, Runners and Plasma Workspace Shell Scripting. - -Generic Examples -================ -* exampleAddon: to be used with usingAddons; use `plasmapkg -t Plasma/JavascriptAddon -i exampleADdon` to install it -* fileOperations: shows to load and use the FileDialog and LaunchApp Javascript API extension -* http: shows how to load and use the HTTP Javascript API extension -* usingAddons: shows how to enumerate, load and use Addons written in Javascript in your Javascript - addon; addons are essentially plugins-for-your-plugin. - -DataEngines -=========== -* basic: the esentials of writing a DataEngine in Javascript -* services: creating and offering custom Services from a Javascript DataEngine - -Plasmoids -========= -* animations: shows how to use the QtKinetic-based Plasma animations, as well as how to create your own - custom animations with Javascript -* configuration: shows how to use the configuration storage and user interface facilities -* digital-clock: a simple Plasmoid showing usage of a DataEngine and a Plasma::Label -* enumerateAPI: usage of Plasma::TabWidget as well as dynamically enumerating much of the Plasmoid API -* extenders: usage of Plasma::Extenders from Javascript -* geolocation: using the geolocation DataEngine -* mediaplayer: a simple audio/video player in Javascript -* notifications: using notifications -* nowplaying: using the NowPlaying DataEngine to interact with a media player from a Plasmoid -* tiger: painting using SVGs - -Runners -======= diff --git a/plasma/javascript/LICENSING b/plasma/javascript/LICENSING deleted file mode 100644 index 76519a0..0000000 --- a/plasma/javascript/LICENSING +++ /dev/null @@ -1,23 +0,0 @@ -All code in this directory is copyrighted and licensed under the following terms: - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/plasma/javascript/dataengines/basic/contents/code/main b/plasma/javascript/dataengines/basic/contents/code/main deleted file mode 100644 index 92daf9e..0000000 --- a/plasma/javascript/dataengines/basic/contents/code/main +++ /dev/null @@ -1,70 +0,0 @@ -// sources() allows us to return a set of source names for this engine, even before they are created -// normally, reimplementing sources() is not needed, as the default implementation returns the list -// of all sources that are already available and that it is generally what a DataEngine wants to -// advertise. However, in this example, we want to advertise three sources by default, even before -// they are requested and setup. -engine.sources = function() -{ - var sources = new Array('vegetables', 'fruits', 'grains') - return sources -} - -// sourceRequestEvent is called whenever a source that does not exist is requested by a -// visualization. The DataEngine can accept or refuse the request, signified by the return -// value. -engine.sourceRequestEvent = function(sourceRequested) -{ - var attributes = new Array() - attributes['healthy'] = true - attributes['tasty'] = true - attributes['eatenRaw'] = true - - // we'll set some data depending on the name of the source being requested - // note that the name of source passed to setData and the name of the source requested - // must match! - if (sourceRequested == 'vegetables') { - setData(sourceRequested, 'favorite', 'asparagus') - } else if (sourceRequested == 'fruits') { - setData(sourceRequested, 'favorite', 'apple') - } else if (sourceRequested == 'grains') { - setData(sourceRequested, 'favorite', 'quinoa') - attributes['eatenRaw'] = false - } else { - // returning false here means that the engine does not support that source name - return false - } - - // we can also set data using an associative array of key->value pairs - setData(sourceRequested, attributes) - - // return success; even if the source is asyncronous (so we don't set up any real data yet) - // we still need to return true - return true -} - -// the DataEngine will get an updateSourceEvent every time a source is scheduled to be updated -// for instance, if a visualization asks for updates every 500ms, this will get called twice -// per second. if the DataEngine is push (versus polling) oriented, then this function does -// not need to be implemented -engine.updateSourceEvent = function(sourceToUpdate) -{ - if (sourceToUpdate == 'vegetables') { - setData(sourceToUpdate, 'favorite', 'celery root') - } else if (sourceToUpdate == 'fruits') { - setData(sourceToUpdate, 'favorite', 'banana') - } else if (sourceToUpdate == 'grains') { - setData(sourceToUpdate, 'favorite', 'barley') - } -} - -// let's set up some default data for vegetables, even before it is requested by a visualization -/* -setData('vegetables', 'healthy', true) -setData('vegetables', 'tasty', true) -setData('vegetables', 'eatenRaw', true) -*/ -// and here's how we remove a source; there is also removeData for taking just part of the data -// associated with a source away and removeAllSources which expunges all sources in the engine -setData('meat', 'animal', 'yes') -removeAllData('meat') - diff --git a/plasma/javascript/dataengines/basic/metadata.desktop b/plasma/javascript/dataengines/basic/metadata.desktop deleted file mode 100644 index df2456c..0000000 --- a/plasma/javascript/dataengines/basic/metadata.desktop +++ /dev/null @@ -1,16 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Javascript DataEngine Example -Comment=A demonstration of the basic components of a Javascript DataEngine -Type=Service -ServiceTypes=Plasma/DataEngine - -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=plasma-devel@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.dataengine.examples.basic -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=BSD -X-Plasma-API=javascript diff --git a/plasma/javascript/dataengines/services/contents/code/main b/plasma/javascript/dataengines/services/contents/code/main deleted file mode 100644 index 57a2371..0000000 --- a/plasma/javascript/dataengines/services/contents/code/main +++ /dev/null @@ -1,55 +0,0 @@ -function startEcho() -{ - // an 'echoText' job has been started (see setupJob below) - // the this object is the job being started - // let's output some information to console, such as one of the parameters - // and the 'foo' property we set below - print('Starting echo, text is: ' + this.parameters['text'] + ', and our custom "foo" property is: ' + this.foo) - - // in our case, we're going to take immediate action by setting some data in the engine - setData('echo', 'text', this.parameters['text']) - - // set the result to true, since we're already finished. setting the result - // will cause the job to finish, including signalling the user of the job - // that it has finished. we can set the result to any value / object we wish - // though it is recommended to keep to "plain old data" types like boolean, - // number, string, array, etc. - // - // if this job were asynchronous, we would instead start some process in motion - // such as a network job and then set the result at some future point - // when we are finished - this.result = true; -} - -function setupJob(job) -{ - // a job has been created upon request, based on our service. - // we can use the operationName, destination and parameters - // of the job to determine if we accept it. - // if we do, then we need to set a startFunction - if (job.operationName == 'echoText') { - job.start = startEcho - - // we can set other properties, functions, etc on the job - // for later use, if we wish - job.foo = 'bar' - } -} - -// Whenever a Service is requested for a source, this function is called -// we need to return a Service for it to work properly -engine.serviceForSource = function(source) -{ - if (source == 'echo') { - // we recognize this source as being serviceable, and so create a Service - // the 'echo' parameter causes the contents/services/echo.operations file - // to be loaded as the service description. Any number of operations files - // may be included with a DataEngine, allowing for multiple services. - var service = new Service('echo') - service.setupJob = setupJob - return service; - } -} - -setData('echo', 'text', 'test') - diff --git a/plasma/javascript/dataengines/services/contents/services/echo.operations b/plasma/javascript/dataengines/services/contents/services/echo.operations deleted file mode 100644 index 28a08e5..0000000 --- a/plasma/javascript/dataengines/services/contents/services/echo.operations +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/plasma/javascript/dataengines/services/metadata.desktop b/plasma/javascript/dataengines/services/metadata.desktop deleted file mode 100644 index 5e673bf..0000000 --- a/plasma/javascript/dataengines/services/metadata.desktop +++ /dev/null @@ -1,16 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Javascript DataEngine With Services Example -Comment=A demonstration of a Javascript DataEngine that provides Services -Type=Service -ServiceTypes=Plasma/DataEngine - -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=plasma-devel@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.dataengine.examples.services -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=BSD -X-Plasma-API=javascript diff --git a/plasma/javascript/generic/exampleAddon/contents/code/main.js b/plasma/javascript/generic/exampleAddon/contents/code/main.js deleted file mode 100644 index 27a0fcb..0000000 --- a/plasma/javascript/generic/exampleAddon/contents/code/main.js +++ /dev/null @@ -1,23 +0,0 @@ -// we have access to the full API from in here as well, and can include files -// from the main addon's package as well. in this case, we load an svg from the -// addon package during construction. - -// this will serve as our constructor; we will feed it later on to registerAddon -function SampleAddon() -{ - this.svg = new Svg('tiger') -} - -// now let's add a little function to the prototype of our constructor -SampleAddon.prototype.toString = function() -{ - return "I'm a sample addon with an svg of a tiger! Roar!" -} - -// since there is no contents/code/include.js in this addon's package, -// it will look for it in the Plasmoid's own package -plasmoid.include("include.js") - -// and now we register our constructor; that's it! -registerAddon(SampleAddon) - diff --git a/plasma/javascript/generic/exampleAddon/contents/images/tiger.svg b/plasma/javascript/generic/exampleAddon/contents/images/tiger.svg deleted file mode 100644 index 983e570..0000000 --- a/plasma/javascript/generic/exampleAddon/contents/images/tiger.svg +++ /dev/null @@ -1,730 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plasma/javascript/generic/exampleAddon/metadata.desktop b/plasma/javascript/generic/exampleAddon/metadata.desktop deleted file mode 100644 index 85f4bbe..0000000 --- a/plasma/javascript/generic/exampleAddon/metadata.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Name=Example Addon -Comment=For the Using Addons Javascript example - -X-KDE-ServiceTypes=Plasma/JavascriptAddon -Type=Service -X-Plasma-API=javascript - -X-KDE-Library= -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.usingAddons.testAddon -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=org.kde.plasma.javascript-addons-example -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=LGPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/javascript/generic/fileOperations/contents/code/main.js b/plasma/javascript/generic/fileOperations/contents/code/main.js deleted file mode 100644 index a3a4491..0000000 --- a/plasma/javascript/generic/fileOperations/contents/code/main.js +++ /dev/null @@ -1,76 +0,0 @@ -// because we put the following lines in the metadata.desktop file, we have access -// to the FileDialog and LaunchApp extensions. -// -// X-Plasma-RequiredExtensions=FileDialog -// X-Plasma-OptionalExtensions=LaunchApp -// -// More documentation can be found here: -// -// http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API#Extensions - -function showOpenFileDialog() -{ - print("opening a file?") - var dialog = new OpenFileDialog - dialog.accepted.connect(openFileDialogAccepted) - dialog.finished.connect(openFileDialogFinished) - dialog.show() -} - -function openFileDialogAccepted(dialog) -{ - var url = dialog.url - print("open this file! " + url.protocol + ' ' + url.host + ' ' + url.path) - /* - var urls = new Array - urls.push(url) - plasmoid.runApplication("kate", urls) - */ - if (plasmoid['openUrl']) { - plasmoid.openUrl(url); - } else { - print("no openUrl method available to us!") - } -} - -function openFileDialogFinished(dialog) -{ - dialog.accepted.disconnect(openFileDialogAccepted) - dialog.finished.disconnect(openFileDialogFinished) - plasmoid.gc() -} - -function showSaveFileDialog() -{ - print("saving a file?") - var dialog = new SaveFileDialog - dialog.accepted.connect(saveFileDialogAccepted) - dialog.finished.connect(saveFileDialogFinished) - dialog.show() -} - -function saveFileDialogAccepted(dialog) -{ - print("save to this file! " + dialog.files) -} - -function saveFileDialogFinished(dialog) -{ - dialog.accepted.disconnect(saveFileDialogAccepted) - dialog.finished.disconnect(saveFileDialogFinished) - plasmoid.gc() -} - -open = new PushButton -open.text = i18n("Open File") -open.clicked.connect(showOpenFileDialog) - -save = new PushButton -save.text = i18n("Save File") -save.clicked.connect(showSaveFileDialog) - -layout = new LinearLayout -layout.orientation = QtVertical -layout.addItem(open) -layout.addItem(save) - diff --git a/plasma/javascript/generic/fileOperations/metadata.desktop b/plasma/javascript/generic/fileOperations/metadata.desktop deleted file mode 100644 index c497a9d..0000000 --- a/plasma/javascript/generic/fileOperations/metadata.desktop +++ /dev/null @@ -1,22 +0,0 @@ -[Desktop Entry] -Name=JavaScript File Operations -Comment=Demonstrates file operations in JavaScript -Icon=text-x-generic - -Type=Service -X-KDE-ServiceTypes=Plasma/Applet - -X-Plasma-API=javascript -X-Plasma-MainScript=code/main.js - -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.simplified-javascript-fileops-example -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website= -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL - -X-Plasma-RequiredExtensions=FileDialog -X-Plasma-OptionalExtensions=LaunchApp diff --git a/plasma/javascript/generic/http/contents/code/main.js b/plasma/javascript/generic/http/contents/code/main.js deleted file mode 100644 index 50a8f62..0000000 --- a/plasma/javascript/generic/http/contents/code/main.js +++ /dev/null @@ -1,45 +0,0 @@ -// because we put the following line in the metadata.desktop file, we have access -// to the HTTP extension in this Plasmoid. -// -// X-Plasma-RequiredExtensions=http -// -// More documentation can be found here: -// -// http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API#Extensions - -output = new TextEdit -output.readOnly = true - -layout = new LinearLayout -layout.orientation = QtVertical -layout.addItem(output) - -// in case our request for HTTP urls in the metadata.desktop was rejected (e.g. due -// to security restrictions) we won't have a plasmoid.get, so let's check for it -// before using it! -if (plasmoid.getUrl) { - var getJob = plasmoid.getUrl("http://dot.kde.org/rss.xml"); - function recv(job, data) - { - if (job == getJob) { - print("we have our job") - if (data.length) { - output.append(data.toUtf8()) - } - } - } - - function fini(job) - { - if (job == getJob) { - print("our job is finished") - } else { - print("some other job is finished?") - } - } - - getJob.data.connect(recv) - getJob.finished.connect(fini) -} else { - output.text = i18n("HTTP access denied!") -} diff --git a/plasma/javascript/generic/http/metadata.desktop b/plasma/javascript/generic/http/metadata.desktop deleted file mode 100644 index 9d6cf95..0000000 --- a/plasma/javascript/generic/http/metadata.desktop +++ /dev/null @@ -1,21 +0,0 @@ -[Desktop Entry] -Name=JavaScript File Operations -Comment=Demonstrates accessing data via HTTP in JavaScript -Icon=text-x-generic - -Type=Service -X-KDE-ServiceTypes=Plasma/Applet - -X-Plasma-API=javascript -X-Plasma-MainScript=code/main.js - -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.simpified-javascript-http-example -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website= -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL - -X-Plasma-OptionalExtensions=http diff --git a/plasma/javascript/generic/usingAddons/contents/code/include.js b/plasma/javascript/generic/usingAddons/contents/code/include.js deleted file mode 100644 index 873bb7a..0000000 --- a/plasma/javascript/generic/usingAddons/contents/code/include.js +++ /dev/null @@ -1 +0,0 @@ -print("This could be a library of Javascript code for use by addons") diff --git a/plasma/javascript/generic/usingAddons/contents/code/main.js b/plasma/javascript/generic/usingAddons/contents/code/main.js deleted file mode 100644 index 8061f7e..0000000 --- a/plasma/javascript/generic/usingAddons/contents/code/main.js +++ /dev/null @@ -1,52 +0,0 @@ -// we create a function to use to listen to addonCreated events -function addonCreated(addon) -{ - // now we'll access a custom function in the addon, proving it worked! - textArea.append(i18n("Addon says: %1", addon.toString())) - if (addon.svg) { - textArea.append(i18n(" and we got an svg => " + addon.svg.imagePath)) - var svg = new SvgWidget - svg.svg = addon.svg - layout.addItem(svg) - } - - // in real world usage, we may add this addon to a global Array or record its - // existence in some other way for later usage -} - -// now we register the function as an event listener with the right event name -// if we didn't care to actually do things with the addons from this script, we -// wouldn't need to do this; most times, though, we usually want to hang on to -// the addon object to do fun things with it -plasmoid.addEventListener("addonCreated", addonCreated) - -// create a small little UI here -var layout = new LinearLayout -layout.orientation = QtVertical -var textArea = new TextEdit -layout.addItem(textArea) - -textArea.readOnly = true -textArea.append(i18n("Loading addons...")) - -// this maps to the X-KDE-PluginInfo-Category= entry in the addon's .desktop file entry -var addonType = "org.kde.plasma.javascript-addons-example" - -// we request the list of all addons -var addons = plasmoid.listAddons(addonType) - -if (addons.length < 1) { - // uh-oh, something didn't work! - textArea.append(i18n("You probably need to run `plasmapkg -t Plasma/JavascriptAddon -i exampleAddon && kbuildsycoca4`")) -} else { - var message = i18np("number of addons: 1", "number of addons: %1", addons.length) - textArea.append(message) - for (i in addons) { - // an addon has a user visible name and an id; the id is used to load the addon - textArea.append(i18n("Addon: ") + addons[i].name) - plasmoid.loadAddon(addonType, addons[i].id) - } -} - -plasmoid.include("include.js") - diff --git a/plasma/javascript/generic/usingAddons/metadata.desktop b/plasma/javascript/generic/usingAddons/metadata.desktop deleted file mode 100644 index 2a43255..0000000 --- a/plasma/javascript/generic/usingAddons/metadata.desktop +++ /dev/null @@ -1,17 +0,0 @@ -[Desktop Entry] -Name=Javascript Addons Example -Icon=configure -Type=Service -X-KDE-ServiceTypes=Plasma/Applet -X-Plasma-MainScript=code/main.js -X-Plasma-DefaultSize=500,400 -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.javascript-addons-example -X-KDE-PluginInfo-Version=0.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=javascript diff --git a/plasma/javascript/plasma-shell-scripting/LICENSING b/plasma/javascript/plasma-shell-scripting/LICENSING deleted file mode 100644 index 9c864e6..0000000 --- a/plasma/javascript/plasma-shell-scripting/LICENSING +++ /dev/null @@ -1,25 +0,0 @@ -All code in this directory is copyrighted and licensed under the following terms: - -Copyright 2009 Aaron Seigo - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/plasma/javascript/plasma-shell-scripting/addAndMoveWidget.js b/plasma/javascript/plasma-shell-scripting/addAndMoveWidget.js deleted file mode 100644 index f1cb6c0..0000000 --- a/plasma/javascript/plasma-shell-scripting/addAndMoveWidget.js +++ /dev/null @@ -1,16 +0,0 @@ -a = activityForScreen(0) - -if (a) { - a.addWidget("clock") - p = panelById(panelIds[0]) - - if (p) { - for (i = 0; i < p.widgetIds.length; ++i) { - w = p.widgetById(p.widgetIds[i]) - print (w.type) - if (w.type == 'launcher') { - a.addWidget(w); - } - } - } -} diff --git a/plasma/javascript/plasma-shell-scripting/containmentIds.js b/plasma/javascript/plasma-shell-scripting/containmentIds.js deleted file mode 100644 index 15a90e3..0000000 --- a/plasma/javascript/plasma-shell-scripting/containmentIds.js +++ /dev/null @@ -1,16 +0,0 @@ -// screen geometries -var i = 0 -while (i < screenCount) { - var geom = screenGeometry(i) - print("screen " + i + " is " + geom.width + "x" + geom.height) - ++i -} - -// containments -print("panels are: " + panelIds) -print("activities are: " + activityIds) - -var panel = panelById(panelIds[0]) -print("panel id is " + panel.id) -print("panel name is " + panel.name) -print("panel type is " + panel.type) diff --git a/plasma/javascript/plasma-shell-scripting/createPanel.js b/plasma/javascript/plasma-shell-scripting/createPanel.js deleted file mode 100644 index ef4189d..0000000 --- a/plasma/javascript/plasma-shell-scripting/createPanel.js +++ /dev/null @@ -1,6 +0,0 @@ -panel = new Panel -panel.location = "top" -panel.length = 200 -panel.alignment = "center" -sleep(2000) -panel.remove() diff --git a/plasma/javascript/plasma-shell-scripting/findingApplications.js b/plasma/javascript/plasma-shell-scripting/findingApplications.js deleted file mode 100644 index 870cbc9..0000000 --- a/plasma/javascript/plasma-shell-scripting/findingApplications.js +++ /dev/null @@ -1,9 +0,0 @@ -print("default browser: " + defaultApplication("browser")) -print("default email client: " + defaultApplication("mailer")) -print("default terminal: " + defaultApplication("terminal")) -print("default filemanager (exec): " + defaultApplication("filemanager")) -print("default filemanager (storageId): " + defaultApplication("filemanager", true)) -print("default pdf reader (exec): " + defaultApplication("application/pdf")) -print("default pdf reader (storageId): " + defaultApplication("application/pdf", true)) -print("default im client: " + defaultApplication("imClient")) -print("should be false: " + defaultApplication("should failure spectacularly")) \ No newline at end of file diff --git a/plasma/javascript/plasma-shell-scripting/findingPaths.js b/plasma/javascript/plasma-shell-scripting/findingPaths.js deleted file mode 100644 index 00bb8a6..0000000 --- a/plasma/javascript/plasma-shell-scripting/findingPaths.js +++ /dev/null @@ -1,16 +0,0 @@ -print('Home: ' + userDataPath('home')) -print('Desktop: ' + userDataPath('desktop')) -print('Autostart: ' + userDataPath('autostart')) -print('Documents: ' + userDataPath('documents')) -print('Music: ' + userDataPath('music')) -print('Video: ' + userDataPath('video')) -print('Downloads: ' + userDataPath('downloads')) -print('Pictures: ' + userDataPath('pictures')) -print('plasma-desktop data directory: ' + userDataPath('data', 'plasma-desktop')) -print('Okular data directory: ' + userDataPath('data', 'okular')) -print('Okular config: ' + userDataPath('config', 'okularrc')) -print('Icons: ' + userDataPath('icon', '')) -print('Non-existent type: ' + userDataPath('foobar')) - -print('Path to Okular: ' + applicationPath('okular')) -print('Path to Okular .desktop file: ' + applicationPath('okular.desktop')) \ No newline at end of file diff --git a/plasma/javascript/plasma-shell-scripting/listWidgetConfigValues.js b/plasma/javascript/plasma-shell-scripting/listWidgetConfigValues.js deleted file mode 100644 index 2e609b5..0000000 --- a/plasma/javascript/plasma-shell-scripting/listWidgetConfigValues.js +++ /dev/null @@ -1,44 +0,0 @@ -function enumerateWidgets(c) -{ - widgets = c.widgetIds - if (widgets.length < 1) { - print("No widgets") - return; - } - - for (i = 0; i < widgets.length; ++i) { - w = c.widgetById(widgets[i]) - print(w.type) - keys = w.configKeys; - - if (keys.length > 0) { - for (j = 0; j < keys.length; ++j) { - print(" " + keys[j] + " = " + w.readConfig(keys[j], "")) - } - } - } -} - -containments = activityIds -for (i = 0; i < containments.length; ++i) { - c = activityById(containments[i]) - if (c) { - print("" + c.id + ": " + c.type + "") - enumerateWidgets(c) - } else { - print ("could not find containment id " + id + " using " + func) - } -} - -containments = panelIds -for (i = 0; i < containments.length; ++i) { - c = panelById(containments[i]) - if (c) { - print("" + c.id + ": " + c.type + "") - enumerateWidgets(c) - } else { - print ("could not find containment id " + id + " using " + func) - } -} - - diff --git a/plasma/javascript/plasma-shell-scripting/listingPanelsActivitiesAndAvailablePlugins.js b/plasma/javascript/plasma-shell-scripting/listingPanelsActivitiesAndAvailablePlugins.js deleted file mode 100644 index 9fbf6c6..0000000 --- a/plasma/javascript/plasma-shell-scripting/listingPanelsActivitiesAndAvailablePlugins.js +++ /dev/null @@ -1,28 +0,0 @@ -function printWidgets(container) -{ - widgets = container.widgets() - for (i in widgets) { - print(" " + i + ": " + widgets[i].type + ", id = " + widgets[i].id + ", version = " + widgets[i].version) - } -} - -print("Versions: Platform => " + platformVersion + ", Application => " + applicationVersion + ", Scripting API => " + scriptingVersion) -print("Available widgets: " + knownWidgetTypes) -print("Available activities: " + knownActivityTypes) -print("Available panels: " + knownPanelTypes) - -print("============="); -print("Panels are: ") -p = panels() -for (i in p) { - print(" " + p[i].type + ", id = " + p[i].id + ", version = " + p[i].version + ", widgets:") - printWidgets(p[i]) -} - -print("============="); -print("Activities are: ") -a = activities() -for (i in a) { - print(" " + a[i].type + ", id = " + a[i].id + ", version = " + a[i].version + " widgets:") - printWidgets(a[i]) -} diff --git a/plasma/javascript/plasma-shell-scripting/listingWallpaperPlugins.js b/plasma/javascript/plasma-shell-scripting/listingWallpaperPlugins.js deleted file mode 100644 index fa62edf..0000000 --- a/plasma/javascript/plasma-shell-scripting/listingWallpaperPlugins.js +++ /dev/null @@ -1,7 +0,0 @@ -var wallpapers = wallpaperPlugins(); -for (i in wallpapers) { - print(i); - for (j in wallpapers[i]) { - print(" Mode: " + wallpapers[i][j]); - } -} \ No newline at end of file diff --git a/plasma/javascript/plasma-shell-scripting/manipulatePanel.js b/plasma/javascript/plasma-shell-scripting/manipulatePanel.js deleted file mode 100644 index 0d5c483..0000000 --- a/plasma/javascript/plasma-shell-scripting/manipulatePanel.js +++ /dev/null @@ -1,11 +0,0 @@ -panel = panelById(panelIds[0]) -panel.length = screenGeometry(panel.screen).width / 2 -panel.alignment = "center" -sleep(1000) -panel.alignment = "left" -panel.offset = screenGeometry(panel.screen).width / 5 -panel.height = 32 -sleep(1000) -panel.offset = 0 -panel.length = screenGeometry(panel.screen).width -panel.height = 24 diff --git a/plasma/javascript/plasma-shell-scripting/org.kde.plasma-desktop.findWidgets/contents/layout.js b/plasma/javascript/plasma-shell-scripting/org.kde.plasma-desktop.findWidgets/contents/layout.js deleted file mode 100644 index d2bc0f3..0000000 --- a/plasma/javascript/plasma-shell-scripting/org.kde.plasma-desktop.findWidgets/contents/layout.js +++ /dev/null @@ -1,25 +0,0 @@ -function findWidgetsIn(containment, type, callback) -{ - var widgetIds = containment.widgetIds - for (id in widgetIds) { - var widget = containment.widgetById(widgetIds[id]) - if (widget.type == type) { - print("Found a " + type + " tray with id " + widget.id + " in " + containment.type + " with id " + containment.id) - if (callback) { - callback(widget, containment) - } - } - } -} - -this.findWidgets = function(type, callback) -{ - for (i in panelIds) { - findWidgetsIn(panelById(panelIds[i]), type, callback) - } - - for (i in activityIds) { - findWidgetsIn(activityById(activityIds[i]), type, callback) - } -} - diff --git a/plasma/javascript/plasma-shell-scripting/org.kde.plasma-desktop.findWidgets/metadata.desktop b/plasma/javascript/plasma-shell-scripting/org.kde.plasma-desktop.findWidgets/metadata.desktop deleted file mode 100644 index a799844..0000000 --- a/plasma/javascript/plasma-shell-scripting/org.kde.plasma-desktop.findWidgets/metadata.desktop +++ /dev/null @@ -1,72 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Find Widgets -Name[ar]=جد الودجات -Name[ast]=Guetar componentes -Name[bg]=Откриване на джаджи -Name[bs]=Traženje grafičkih kontrola -Name[ca]=Cerca estris -Name[ca@valencia]=Cerca estris -Name[cs]=Najít widgety -Name[da]=Find widgets -Name[de]=Miniprogramme suchen -Name[el]=Εύρεση συστατικών -Name[en_GB]=Find Widgets -Name[es]=Buscar componentes -Name[et]=Vidinate otsimine -Name[eu]=Aurkitu trepetak -Name[fi]=Etsi sovelmia -Name[fr]=Trouver des composants graphiques -Name[ga]=Aimsigh Giuirléidí -Name[gl]=Buscar widgets -Name[he]=מציאת ווידג׳טים -Name[hi]=विडजेट खोजें -Name[hr]=Nađi widgete -Name[hu]=Widgetek keresése -Name[ia]=Trova Widgets -Name[is]=Finna græjur -Name[it]=Trova oggetti -Name[ja]=ウィジェットの検索 -Name[kk]=Виджеттерді іздеу -Name[km]=​រក​ធាតុ​ក្រាហ្វិក​​ -Name[ko]=위젯 찾기 -Name[lt]=Rasti valdiklių -Name[lv]=Atrast sīkrīkus -Name[mr]=विजेट्स शोधा -Name[nb]=Finn skjermelementer -Name[nds]=Lüttprogrammen söken -Name[nl]=Widgets zoeken -Name[pa]=ਵਿਦਜੈੱਟ ਲੱਭੋ -Name[pl]=Znajdź elementy interfejsu -Name[pt]=Procurar Elementos -Name[pt_BR]=Localizar widgets -Name[ro]=Caută controale -Name[ru]=Поиск виджетов -Name[sk]=Nájsť widgety -Name[sl]=Najdi gradnike -Name[sr]=Тражење виџета -Name[sr@ijekavian]=Тражење виџета -Name[sr@ijekavianlatin]=Traženje vidžeta -Name[sr@latin]=Traženje vidžeta -Name[sv]=Sök efter grafiska komponenter -Name[th]=ค้นหาวิดเจ็ต -Name[tr]=Araçları Bul -Name[ug]=Widget ئىزدە -Name[uk]=Пошук віджетів -Name[vi]=Tìm widget -Name[wa]=Trover ahesses -Name[x-test]=xxFind Widgetsxx -Name[zh_CN]=查找部件 -Name[zh_TW]=尋找元件 -Type=Service -ServiceTypes=Plasma/LayoutTemplate -X-Plasma-Shell=plasma-desktop -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma-desktop.findWidgets -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category= -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/javascript/plasma-shell-scripting/removeSystrayApplet.js b/plasma/javascript/plasma-shell-scripting/removeSystrayApplet.js deleted file mode 100644 index 1c59b26..0000000 --- a/plasma/javascript/plasma-shell-scripting/removeSystrayApplet.js +++ /dev/null @@ -1,34 +0,0 @@ -/* Kubuntu 13.10 changes from networkmanagement to plasma-nm applet. -this script removes networkmanagement from systray which turns out to -be faffy as there is no API for it, we need to find the applet then -wipe the config setting. - -Copyright Jonathan Riddell, jriddell@ubuntu.com 2013-09-13 -see LICENSING for copying licence -*/ - -pids = panelIds; -for (i = 0; i < pids.length; ++i) { //search through the panels - panel = panelById(pids[i]); - if (!panel) continue; - ids = panel.widgetIds; - for (j = 0; j < ids.length; ++j) { //search through the widgets for systray - widget = panel.widgetById(ids[j]); - if (!widget || widget.type != "systemtray") { - continue; - } - //widget var is now the systray - widget.currentConfigGroup = Array("Applets"); - noOfApplets = widget.configGroups.length; - var groups = new Array(); - for (k = 0; k < noOfApplets; ++k) { - groups.push(widget.configGroups[k]) - } - for (k = 0; k < noOfApplets; ++k) { - widget.currentConfigGroup = new Array("Applets", groups[k]); - if (widget.readConfig("plugin") == "org.kde.networkmanagement") { - widget.writeConfig("plugin",""); //found it at last, wipe it blank - } - } - } -} diff --git a/plasma/javascript/plasma-shell-scripting/setWallpaper.js b/plasma/javascript/plasma-shell-scripting/setWallpaper.js deleted file mode 100644 index 7a2df95..0000000 --- a/plasma/javascript/plasma-shell-scripting/setWallpaper.js +++ /dev/null @@ -1,29 +0,0 @@ -a = activityForScreen(0) - -if (a) { - // set a plugin, in this case the standard image handler - a.wallpaperPlugin = 'image' - - // set a mode; the image plugin has both SingleImage and Slideshow - // modes. in the configuration user interface these show up as two - // separate options in the wallpaper types list - a.wallpaperMode = 'SingleImage' - - // now lets set some configuration details; these are just the - // entries as they appear in the -appletsrc configuration file. - // we begin by setting the config group, which is in a subgroup of - //[Wallpapers] that is named after the plugin - a.currentConfigGroup = Array('Wallpaper', 'image') - - // wallpaper image paths can be full paths or the name of a wallpaper - // package that is installed to one of the standard wallpaper - // directories - a.writeConfig('wallpaper', 'Horos') - - // other possible entries for the image wallpaper plugin include - // wallpaperoclor, wallpaperposition, userswallpapers, slidepaths - // and slideTimer. an easy way to discover these keys is to run - // plasmawallpaperviewer with the desired plugin, right click to - // call up the configuration, set some values and then look in the - // plasmawallpaperviewerrc file. -} diff --git a/plasma/javascript/plasma-shell-scripting/showConfig.js b/plasma/javascript/plasma-shell-scripting/showConfig.js deleted file mode 100644 index b05a939..0000000 --- a/plasma/javascript/plasma-shell-scripting/showConfig.js +++ /dev/null @@ -1,11 +0,0 @@ -a = activityForScreen(0) - -if (a) { - a.showConfigurationInterface() - if (a.widgetIds.length > 0) { - w = a.widgetById(a.widgetIds[0]) - if (w) { - w.showConfigurationInterface() - } - } -} diff --git a/plasma/javascript/plasma-shell-scripting/swapWidgets.js b/plasma/javascript/plasma-shell-scripting/swapWidgets.js deleted file mode 100644 index 451ee90..0000000 --- a/plasma/javascript/plasma-shell-scripting/swapWidgets.js +++ /dev/null @@ -1,25 +0,0 @@ -p = panelById(panelIds[0]) -if (!p) { - exit() -} - -ids = p.widgetIds -targetIndex = -1 -kickoff = 0; - -for (i = 0; i < ids.length; ++i) { - w = p.widgetById(ids[i]) - if (w) { - if (w.type == 'launcher' && !kickoff) { - kickoff = w - } else if (w.type == 'notifier') { - targetIndex = w.index - } - } - - if (targetIndex != -1 && kickoff) { - kickoff.index = targetIndex - break - } -} - diff --git a/plasma/javascript/plasmoids/CMakeLists.txt b/plasma/javascript/plasmoids/CMakeLists.txt deleted file mode 100644 index 4aefb28..0000000 --- a/plasma/javascript/plasmoids/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# animations -install(DIRECTORY animations/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma.javascript-animations-example) -install(FILES animations/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME animations-js-example.desktop) -# configuration -install(DIRECTORY configuration/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma.javascript-config-example) -install(FILES configuration/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME configuration-js-example.desktop) -# digital-clock -install(DIRECTORY digital-clock/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma.script-digital-clock-example) -install(FILES digital-clock/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME digital-clock-js-example.desktop) -# enumerateAPI -install(DIRECTORY enumerateAPI/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma.simpified-javascript-enumerator) -install(FILES enumerateAPI/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME enumerate-api-js-example.desktop) -# extenders -install(DIRECTORY extenders/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma.simpified-javascript-extenders-example) -install(FILES extenders/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME extenders-js-example.desktop) -# geolocation -install(DIRECTORY geolocation/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma.javascript-geolocation-example) -install(FILES geolocation/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME geolocation-js-example.desktop) -# mediaplayer -install(DIRECTORY mediaplayer/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma.script-mediaplayer-example) -install(FILES mediaplayer/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME mediaplayer-js-example.desktop) -# notifications -install(DIRECTORY notifications/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma.script-notifications-example) -install(FILES notifications/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME otifications-js-example.desktop) -# popup -install(DIRECTORY popup/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/popupApplet) -install(FILES popup/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME popup-js-example.desktop) -# tiger -install(DIRECTORY tiger/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma.tiger-example) -install(FILES tiger/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME tiger-js-example.desktop) -# usingServices -install(DIRECTORY usingServices/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/org.kde.plasma.script-nowplaying-example) -install(FILES usingServices/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME services-js-example.desktop) diff --git a/plasma/javascript/plasmoids/animations/contents/animations/foo.js b/plasma/javascript/plasmoids/animations/contents/animations/foo.js deleted file mode 100644 index 1b998d2..0000000 --- a/plasma/javascript/plasmoids/animations/contents/animations/foo.js +++ /dev/null @@ -1,13 +0,0 @@ -//*************************************************************************// -function FooAnimation(target, duration) { - this.target = target; - this.duration = duration; - - this.updateCurrentTime = function(currentTime) { - var delta = currentTime/this.duration; - this.target.scale = delta; - } -} - -registerAnimation("Foo", FooAnimation) - diff --git a/plasma/javascript/plasmoids/animations/contents/code/main b/plasma/javascript/plasmoids/animations/contents/code/main deleted file mode 100644 index dcc4a4b..0000000 --- a/plasma/javascript/plasmoids/animations/contents/code/main +++ /dev/null @@ -1,157 +0,0 @@ -//***************** Animation Example *********************// -// This example Plasmoid demonstrates how to use some -// the animation system provided in Plasma which itself -// builds on the QtKinetic framework in Qt. -// -// Requires KDE 4.4 at a minimum -// -// For more information see the Techbase tutorial at -// http://techbase.kde.org/....? - - -// Create a layout and set it to vertical; -// since we don't define the parent item -// it will become the layout for our Plasmoid -layout = new LinearLayout(); -layout.orientation = QtVertical; - - -//*************************************************************/ -//** A simple animation: Pulsing a button when it is clicked **/ - -// Create a button; it will default to being a child of the Plasmoid -// since we don't define a parent for it in the constructor. Then -// add it to the layout. The i18n() call translates the text for us -// if a translation is available. -button = new PushButton() -button.text = i18n('Pulse') -layout.addItem(button) - -// Create a Pulse animation and set it to operate on the button -// There are several stock animations provided in Plasma, and you -// can access them by name (case insensitive) -pulseAnimation = animation('pulse') -pulseAnimation.targetWidget = button - -// Set the duration to be 1/5th of a second, or 200ms -pulseAnimation.duration = 200 - -// connect the button to the animation's start method and we're done! -button.clicked.connect(pulseAnimation.start); - - -//***************************************************************************/ -//** Combining animations: Fading and rotating a button when it is clicked **/ - -// Create a button; it will default to being a child of the Plasmoid -// since we don't define a parent for it in the constructor. Then -// add it to the layout. The i18n() call translates the text for us -// if a translation is available. -button = new PushButton -button.text = i18n('Rotate and Fade') -layout.addItem(button) - -// Create a Fade animation and set it to operate on the button -fadeAnimation = animation('fade') -fadeAnimation.startOpacity = 1 -fadeAnimation.targetOpacity = 0.5 -fadeAnimation.targetWidget = button - -// Create a Rotation animation and set it to operate on the button -rotateAnimation = animation('rotate') -rotateAnimation.angle = 180 -rotateAnimation.targetWidget = button - -// Now we will add them to a group to run in parallel with each other -// this coordinates the animations for us and we will just use the animation -// group to start all of the animations -rotateAndFadeAnimationGroup = new ParallelAnimationGroup -rotateAndFadeAnimationGroup.addAnimation(fadeAnimation) -rotateAndFadeAnimationGroup.addAnimation(rotateAnimation) -rotateAndFadeAnimationGroup.direction = AnimationBackward; - -// this function will be triggered by the 'Rotate and Fade' button being clicked -startRotateAndFadeAnimation = function() -{ - // now reverse the direction for the next click! - rotateAndFadeAnimationGroup.direction = rotateAndFadeAnimationGroup.direction == AnimationForward ? AnimationBackward : AnimationForward; - - // start the animation - rotateAndFadeAnimationGroup.start() -} -// connect the clicked signal to our function above -button.clicked.connect(startRotateAndFadeAnimation); - -//***********************************************************************************/ -//** Combining animations sequentialy: Rotating two label when a button is clicked **/ - -// add some space to the layout for the next bunch of widgets -layout.addStretch(5) - -// This button will trigger an animation to rotate the two labels -// below it -button = new PushButton -button.text = i18n('Rotate Labels') -layout.addItem(button) - -// Here is our first label, center aligned -label1 = new Label -label1.text = i18n('Rotates first') -label1.alignment = QtAlignHCenter -layout.addItem(label1) - -// Here is our second label, also center aligned -label2 = new Label -label2.text = i18n('Rotates second') -label2.alignment = QtAlignHCenter -layout.addItem(label2) - -// Now that we have our button and two labels, let's create the animation! - -// First, create an animation group, but this time don't set it to operate -// in parallel; this will cause the animations in the group to trigger -// one after the other, in sequence -rotateLabelsAnimationGroup = new AnimationGroup - -// Create a Rotation animation and set it to operate on the first label, -// then add it to the group -rotateAnimation = animation('rotate') -rotateAnimation.targetWidget = label1 -rotateAnimation.angle = 360 -rotateLabelsAnimationGroup.addAnimation(rotateAnimation) - -// Let's create a pause to put between the two animations -pause = animation('pause') -pause.duration = 100 -rotateLabelsAnimationGroup.addAnimation(pause) - -// Create a Rotation animation and set it to operate on the second label, -// then add it to the group -rotateAnimation = animation('rotate') -rotateAnimation.targetWidget = label2 -rotateAnimation.angle = 360 -rotateLabelsAnimationGroup.addAnimation(rotateAnimation) - -// finally, connect the button's clicked event to the start method in the -// animation group -button.clicked.connect(rotateLabelsAnimationGroup.start) - -function test() -{ - print("testing the anim"); - if (anim) { - anim.start() - } -} - -button = new PushButton() -button.text = 'Javascript Zoom' -layout.addItem(button) -var anim = animation("Foo") -if (anim) { - anim.targetWidget = button - button.clicked.connect(anim.start) -} - -// add some space at the bottom of the widget -layout.addStretch(10) diff --git a/plasma/javascript/plasmoids/animations/metadata.desktop b/plasma/javascript/plasmoids/animations/metadata.desktop deleted file mode 100644 index 93f6376..0000000 --- a/plasma/javascript/plasmoids/animations/metadata.desktop +++ /dev/null @@ -1,20 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=JavaScript Animations -Comment=An example showing how animations can be used from JavaScript -Type=Service -ServiceTypes=Plasma/Applet - -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=plasma-devel@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.javascript-animations-example -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=BSD -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=javascript - -[Animations] -foo.js=Foo diff --git a/plasma/javascript/plasmoids/configuration/contents/code/main.js b/plasma/javascript/plasmoids/configuration/contents/code/main.js deleted file mode 100644 index 6a8a48c..0000000 --- a/plasma/javascript/plasmoids/configuration/contents/code/main.js +++ /dev/null @@ -1,13 +0,0 @@ -plasmoid.configChanged = function() -{ - plasmoid.activeConfig = "main"; - print("Configuration changed: " + plasmoid.readConfig("Test")); -} - -print(plasmoid.readConfig("Test")); -plasmoid.activeConfig = "secondary"; -print(plasmoid.activeConfig); -print(plasmoid.readConfig("Test")); -plasmoid.writeConfig("Test", "A different text!"); -print(plasmoid.readConfig("Test")); - diff --git a/plasma/javascript/plasmoids/configuration/contents/config/main.xml b/plasma/javascript/plasmoids/configuration/contents/config/main.xml deleted file mode 100644 index b8e5869..0000000 --- a/plasma/javascript/plasmoids/configuration/contents/config/main.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - Hello hello! - - - - diff --git a/plasma/javascript/plasmoids/configuration/contents/config/secondary.xml b/plasma/javascript/plasmoids/configuration/contents/config/secondary.xml deleted file mode 100644 index e401c17..0000000 --- a/plasma/javascript/plasmoids/configuration/contents/config/secondary.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - This is in the secondary config XML - - - - diff --git a/plasma/javascript/plasmoids/configuration/contents/ui/config.ui b/plasma/javascript/plasmoids/configuration/contents/ui/config.ui deleted file mode 100644 index 8d2e43f..0000000 --- a/plasma/javascript/plasmoids/configuration/contents/ui/config.ui +++ /dev/null @@ -1,54 +0,0 @@ - - - Form - - - - 0 - 0 - 400 - 38 - - - - - - - &Text: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - kcfg_Test - - - - - - - - - - Qt::Vertical - - - - 20 - 3 - - - - - - - - - KLineEdit - QLineEdit -
klineedit.h
-
-
- - -
diff --git a/plasma/javascript/plasmoids/configuration/metadata.desktop b/plasma/javascript/plasmoids/configuration/metadata.desktop deleted file mode 100644 index 36b59c1..0000000 --- a/plasma/javascript/plasmoids/configuration/metadata.desktop +++ /dev/null @@ -1,73 +0,0 @@ -[Desktop Entry] -Name=javascript-config-test -Name[cs]=Test nastavení JavaScript -Name[es]=test-de-config-javascript -Name[fy]=javaskript-konfig-test -Name[gu]=જાવાસ્ક્રિપ્ટ-રૂપરેખાંકન-ચકાસણી -Name[hr]=javascript-test-konfiguracije -Name[is]=JavaScript stillingaprófun -Name[lt]=javascript-config-testas -Name[nds]=JavaScript-Instellen-Test -Name[sv]=Javascript-inställningstest -Name[tg]=Проверка работы Knotify -Name[tr]=javascript-yapılandırma-testi -Name[x-test]=xxjavascript-config-testxx -Name[zh_CN]=JavaScript-配置测试 -Comment=Javascript config object test widget -Comment[ca]=Eina de proves de configuració d'objectes de Javascript -Comment[ca@valencia]=Eina de proves de configuració d'objectes de Javascript -Comment[cs]=Widget pro testování Javascriptu -Comment[da]=Widget til test af Javascript config-objekt -Comment[de]=Javascript-Einrichtungsobjekt Testelement -Comment[el]=Γραφικό συστατικό ελέγχου αντικειμένου ρυθμίσεων Javascript -Comment[es]=widget de prueba de configuración objeto de javascript -Comment[et]=JavaScripti seadistuse objekti testi vidin -Comment[fr]=Plasmoïde de test de configuration Javascript -Comment[fy]=Javaskript konfiguraasje objekt test widget -Comment[ga]=Giuirléid tástála cumraíochta JavaScript -Comment[gl]=Widget de proba da configuración do obxecto en Javascript -Comment[gu]=જાવાસ્ક્રિપ્ટ રૂપરેખાંકન ઓબ્જેક્ટ ચકાસણી વિજેટ -Comment[hr]=Widget za testiranje Javascript konfiguracijskog objekta -Comment[hu]=JavaScript-tesztobjektum -Comment[id]=Widget tes objek konfigurasi javascript -Comment[is]=Javascript græja til stillingaprófana -Comment[it]=Oggetto di prova per la gestione della configurazione in JavaScript -Comment[km]=ធាតុក្រាហ្វិក​សាកល្បង​វត្ថុ​របស់ Javascript config -Comment[ko]=자바스크립트 config 개체 테스트 위젯 -Comment[lt]=Javascript configūravimo objekto bandomasis valdiklis -Comment[lv]=Javascript configurācijas objekta testa logdaļa -Comment[ml]=ജാവാസ്ക്രിപ്റ്റ് ക്രമീകരണ ലക്ഷ്യപരിശോധനാ വിഡ്ജറ്റ് -Comment[nb]=Javascript config objekt testelement -Comment[nds]=JavaScript-Instellenobjekt-Testelement -Comment[nl]=Widget voor javascript-config-test -Comment[nn]=Testeprogram for oppsett av JavaScript -Comment[pa]=ਜਾਵਾਸਕ੍ਰਿਪਟ ਸੰਰਚਨਾ ਆਬਜੈਕਟ ਟੈਸਟ ਵਿਦਜੈੱਟ -Comment[pl]=Testowy element do konfiguracji obiektu Javascript -Comment[pt]=Elemento de teste de objectos de configuração em JavaScript -Comment[pt_BR]=Widget de teste de objetos de configuração em Javascript -Comment[ru]=Тестовый виджет с возможностью настройки, написанный на языке JavaScript -Comment[sl]=Preizkusni gradnik nastavitvenega objekta za Javascript -Comment[sr]=Виџет за пробу јаваскриптног објекта поставе -Comment[sr@latin]=Vidžet za probu javascript objekta postave -Comment[sv]=Grafisk testkomponent för Javascript-inställningsobjekt -Comment[te]=జావాస్క్రిప్‍ట్ కాన్ఫిగ్ ఆబ్జక్‍ట్ టెస్‍ట్ విడ్జట్ -Comment[tg]=Проверка работы Knotify -Comment[tr]=Javascript yapılandırma nesnesi deneme parçacığı -Comment[uk]=Віджет перевірки налаштувань об’єктів Javascript -Comment[x-test]=xxJavascript config object test widgetxx -Comment[zh_CN]=JavaScript 配置对象测试部件 -Comment[zh_TW]=Javascript 設定物件測試元件 -Icon=configure -Type=Service -X-KDE-ServiceTypes=Plasma/Applet -X-Plasma-MainScript=code/main.js -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.javascript-config-example -X-KDE-PluginInfo-Version=0.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Utilities -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=javascript diff --git a/plasma/javascript/plasmoids/digital-clock/contents/code/main.js b/plasma/javascript/plasmoids/digital-clock/contents/code/main.js deleted file mode 100644 index b9d7bfb..0000000 --- a/plasma/javascript/plasmoids/digital-clock/contents/code/main.js +++ /dev/null @@ -1,16 +0,0 @@ -layout = new LinearLayout(plasmoid); -label = new Label(); -layout.addItem(label); - -//print(dataEngine("time").query("UTC").Time.toString()); - -plasmoid.dataUpdated = function(a, b) -{ - if (b.DateTime) { - print("Current date and time is: " + b.DateTime) - } - label.text = "It is " + b.Time + " in " + a -} - -dataEngine("time").connectSource("UTC", plasmoid, 500) - diff --git a/plasma/javascript/plasmoids/digital-clock/metadata.desktop b/plasma/javascript/plasmoids/digital-clock/metadata.desktop deleted file mode 100644 index f562c27..0000000 --- a/plasma/javascript/plasmoids/digital-clock/metadata.desktop +++ /dev/null @@ -1,85 +0,0 @@ -[Desktop Entry] -Name=script-digital-clock -Name[cs]=Skript pro digitální hodiny -Name[es]=script-Reloj-digital -Name[fy]=skript-digitale-klok -Name[gu]=સ્ક્રિપ્ટ-ડિજીટલ-ઘડિયાળ -Name[hr]=script-digitalni-sat -Name[is]=Stafræn klukkuskrifta -Name[km]=នាឡិកា​ឌីជីថលស្គ្រីប -Name[lt]=scenarijus-skaitmeninis-laikrodis -Name[mai]=स्क्रिप्ट डिजिटल घडी -Name[mk]=Едноставен дигитален часовник -Name[nds]=Skript-Digitaalklock -Name[nl]=script-digitale-klok -Name[pt_BR]=script-relógio-digital -Name[ro]=script-ceas-digital -Name[sv]=Skript med digitalklocka -Name[tg]=Часы, поддерживающие темы SVG -Name[tr]=betik-dijital-saat -Name[x-test]=xxscript-digital-clockxx -Name[zh_CN]=脚本-数字钟 -Comment=Javascript digital clock -Comment[bg]=Цифров часовник (JavaScript) -Comment[ca]=Rellotge digital en Javascript -Comment[ca@valencia]=Rellotge digital en Javascript -Comment[cs]=Digitální hodiny v JavaScriptu -Comment[da]=Digitalt ur i Javascript -Comment[de]=Eine digitale Javascript-Uhr -Comment[el]=Ψηφιακό ρολόι Javascript -Comment[es]=Reloj javascript digital -Comment[et]=Javascripti digikell -Comment[fr]=Horloge numérique JavaScript -Comment[fy]=Javaskript digitale klok -Comment[ga]=Clog digiteach JavaScript -Comment[gl]=Reloxo dixital escrito en JavaScript -Comment[gu]=જાવાસ્ક્રિપ્ટ ડિજીટલ ઘડિયાળ -Comment[hr]=Jednostavan digitalni sat -Comment[hu]=JavaScript-alapú digitális óra -Comment[id]=Jam digital javascript -Comment[is]=JavaScript stafræn klukka -Comment[it]=Orologio digitale JavaScript -Comment[ja]=JavaScript のデジタル時計 -Comment[kk]=JavaScript цифрлық сағат -Comment[km]=នាឡិកា​ឌីជីថល Javascript -Comment[ko]=자바스크립트 디지털 시계 -Comment[lt]=JavaScript skaitmeninis laikrodis -Comment[lv]=Javascript digitālais pulkstenis -Comment[mai]=जावास्क्रिप्ट डिजिटल घडी -Comment[mk]=Javascript-дигитален часовник -Comment[ml]=ജാവാസ്ക്രിപ്റ്റ് ഡിജിറ്റല്‍ ഘടികാരം -Comment[nb]=Javascript digital klokke -Comment[nds]=JavaScript-Digitaalklock -Comment[nl]=Digitale klok geschreven in Javascript -Comment[nn]=Digitalklokke i JavaScript -Comment[or]=Javascript ସାଂଖିକ ଘଡ଼ି -Comment[pa]=ਜਾਵਾ-ਸਕ੍ਰਿਪਟ ਡਿਜਟੈੱਲ ਕਲਾਕ -Comment[pl]=Zegar cyfrowy w Javascript -Comment[pt]=Relógio digital em JavaScript -Comment[pt_BR]=Relógio digital em JavaScript -Comment[ro]=Un ceas digital Javascript -Comment[ru]=Цифровые часы, написанные на языке JavaScript -Comment[sl]=Digitalna ura v Javascriptu -Comment[sr]=Јаваскриптни дигитални сат -Comment[sr@latin]=Javascript digitalni sat -Comment[sv]=Javascript-digitalklocka -Comment[tg]=Часы, поддерживающие темы SVG -Comment[tr]=Javascript dijital saat -Comment[uk]=Цифровий годинник на JavaScript -Comment[x-test]=xxJavascript digital clockxx -Comment[zh_CN]=JavaScript 数字钟 -Comment[zh_TW]=Javascript 數位時鐘 -Icon=configure -Type=Service -X-KDE-ServiceTypes=Plasma/Applet -X-Plasma-MainScript=code/main.js -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=notmart@gmail.com -X-KDE-PluginInfo-Name=org.kde.plasma.script-digital-clock-example -X-KDE-PluginInfo-Version=0.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=javascript diff --git a/plasma/javascript/plasmoids/enumerateAPI/contents/code/main.js b/plasma/javascript/plasmoids/enumerateAPI/contents/code/main.js deleted file mode 100644 index 118a810..0000000 --- a/plasma/javascript/plasmoids/enumerateAPI/contents/code/main.js +++ /dev/null @@ -1,213 +0,0 @@ -var text = true - -classNames = new Array() -classNames.push('BusyWidget') -classNames.push('CheckBox') -classNames.push('ComboBox') -classNames.push('FlashingLabel') -classNames.push('Frame') -classNames.push('GroupBox') -classNames.push('IconWidget') -classNames.push('ItemBackground') -classNames.push('Label') -classNames.push('LineEdit') -classNames.push('Meter') -classNames.push('PushButton') -classNames.push('RadioButton') -classNames.push('ScrollBar') -classNames.push('ScrollWidget') -classNames.push('Separator') -classNames.push('SignalPlotter') -classNames.push('Slider') -classNames.push('SpinBox') -classNames.push('SvgWidget') -classNames.push('TabBar') -classNames.push('TextEdit') -classNames.push('ToolButton') -classNames.push('TreeView') -classNames.push('VideoWidget') -classNames.push('WebView') - -var commonProperties = new Array -commonProperties.push("objectName") -commonProperties.push("parent") -commonProperties.push("id") -commonProperties.push("opacity") -commonProperties.push("enabled") -commonProperties.push("visible") -commonProperties.push("pos") -commonProperties.push("x") -commonProperties.push("y") -commonProperties.push("z") -commonProperties.push("rotation") -commonProperties.push("scale") -commonProperties.push("transformOriginPoint") -commonProperties.push("palette") -commonProperties.push("font") -commonProperties.push("layoutDirection") -commonProperties.push("size") -commonProperties.push("focusPolicy") -commonProperties.push("windowFlags") -commonProperties.push("windowTitle") -commonProperties.push("geometry") -commonProperties.push("parentWidget") -commonProperties.push("stylesheet") -commonProperties.push("nativeWidget") -commonProperties.push("destroyed(QObject*)") -commonProperties.push("destroyed()") -commonProperties.push("deleteLater()") -commonProperties.push("parentChanged()") -commonProperties.push("opacityChanged()") -commonProperties.push("visibleChanged()") -commonProperties.push("enabledChanged()") -commonProperties.push("xChanged()") -commonProperties.push("yChanged()") -commonProperties.push("zChanged()") -commonProperties.push("rotationChanged()") -commonProperties.push("scaleChanged()") -commonProperties.push("close()") -commonProperties.push("newProxyWidget(const QWidget*)") -commonProperties.push("styleSheet()") -commonProperties.push("timerEvent(QTimerEvent*)") - -function enumerateObject(name, obj, excludeCommon) -{ - var rv - if (text) { - rv = name + '\n'; - } else { - rv = '

' + name + "

    \n"; - } - - for (i in obj) { - if (excludeCommon && commonProperties.indexOf(i) != -1) { - continue; - } - - if (text) { - rv += ' * ' - } else { - rv += '
  • ' - } - - if (i.substr(i.length - 1, 1) != ')') { - rv += typeof obj[i] + " " + i - if (text) { - rv += "\n" - } - } else { - openbracket = i.lastIndexOf('(') - objname = i.substr(0, openbracket) - if (text) { - rv += 'function ' + i + '\n' - } else { - rv += "function " + i - } - } - - if (!text) { - rv += "
  • \n" - } - } - - if (text) { - rv += "\n" - } else { - rv += "
" - } - - return rv -} - -// WIDGET API -var widgetApi = '' -for (index in classNames) { - var widgetName = classNames[index] - var widget = new this[widgetName] - widgetApi += enumerateObject(widgetName, widget, true) - widget.deleteLater() -} - -layout = new LinearLayout -tabbar = new TabBar -display = new TextEdit -display.readOnly = true -display.text = widgetApi -tabbar.addTab(i18n("Widgets"), display) - -// LAYOUTS API -var layoutApi = '' -layoutApi += enumerateObject("LinearLayout", layout, true) -var q = new PushButton -var gl = new GridLayout(q) -layoutApi += enumerateObject("GridLayout", layout, true) -q.deleteLater() -var p = new PushButton -var l = new AnchorLayout(p) -layoutApi += enumerateObject("AnchorLayout", l, true) -p.deleteLater() -l = 0 -var sp = new QSizePolicy -layoutApi += enumerateObject("QSizePolicy", sp, true) - -display = new TextEdit -display.readOnly = true -display.text = layoutApi -tabbar.addTab(i18n("Layouts"), display) - -// IMAGE API -fsvg = new FrameSvg('panel-background') -var imageApi = enumerateObject('FrameSvg', fsvg, false) -svg = new Svg('panel-background') -imageApi += enumerateObject('Svg', svg, false) -pixmap = new QPixmap -imageApi += enumerateObject('QPixmap', pixmap, false) - -display = new TextEdit -display.readOnly = true -display.text = imageApi -tabbar.addTab(i18n("Images"), display) - -// PAINTING API -var paintingApi = '' -var p = new QColor -paintingApi += enumerateObject('QColor', p, false) -p = new QFont -paintingApi += enumerateObject('QFont', p, false) -p = new QPoint -paintingApi = enumerateObject('QPainter', p, false) -p = new QPainter -paintingApi += enumerateObject('QPainter', p, false) -p = new QPen -paintingApi += enumerateObject('QPen', p, false) -p = new QPoint -paintingApi += enumerateObject('QPoint', p, false) -p = new QRectF -paintingApi += enumerateObject('QRectF', p, false) -p = new QSizeF(2,2) -paintingApi += enumerateObject('QSizeF', p, false) -p = 0 - -display = new TextEdit -display.readOnly = true -display.text = paintingApi -tabbar.addTab(i18n("Painting"), display) - -// DATAENGINE API -var dataApi = '' -var d = dataEngine("time") -dataApi += enumerateObject("DataEngine", d, false) -var d = dataEngine("time").serviceForSource("Local") -var d = service("time", "Local") -dataApi += enumerateObject("Service", d, false) -d = 0 - -display = new TextEdit -display.readOnly = true -display.text = dataApi -tabbar.addTab(i18n("DataEngine"), display) - -tabbar.adjustSize() -layout.addItem(tabbar) - -plasmoid.gc() diff --git a/plasma/javascript/plasmoids/enumerateAPI/metadata.desktop b/plasma/javascript/plasmoids/enumerateAPI/metadata.desktop deleted file mode 100644 index cebff57..0000000 --- a/plasma/javascript/plasmoids/enumerateAPI/metadata.desktop +++ /dev/null @@ -1,20 +0,0 @@ -[Desktop Entry] -Name=JavaScript API Enumerator -Comment=Lists the API available in the various Plasma Widgets to Simplified JavaScript Plasmoids -Icon=chronometer - -Type=Service -X-KDE-ServiceTypes=Plasma/Applet - -X-Plasma-API=javascript -X-Plasma-MainScript=code/main.js -X-Plasma-DefaultSize=344,159 - -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.simpified-javascript-enumerator -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website= -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL diff --git a/plasma/javascript/plasmoids/extenders/contents/code/main.js b/plasma/javascript/plasmoids/extenders/contents/code/main.js deleted file mode 100644 index fc3a3b2..0000000 --- a/plasma/javascript/plasmoids/extenders/contents/code/main.js +++ /dev/null @@ -1,26 +0,0 @@ -var ext - -plasmoid.initExtenderItem = function(item) -{ - ext = item - var button = new PushButton - button.text = i18n("Hello") - ext.widget = button - print(i18n("Widget in Extender '%1' has text '%2'", item.name, button.text)) -} - -var e = plasmoid.extender() -if (e.hasItem("yes!")) { - print(i18n("We already have our extender, it will be recreated for us. Expect a call to initEtenderItem.")); -} else { - // new ExtenderItems are automatically added to our widget's Extender - ext = new ExtenderItem - ext.name = "yes!" - plasmoid.initExtenderItem(ext) -} - -var layout = new LinearLayout -if (ext) { - layout.addItem(ext) -} - diff --git a/plasma/javascript/plasmoids/extenders/contents/code/second.js b/plasma/javascript/plasmoids/extenders/contents/code/second.js deleted file mode 100644 index 8154169..0000000 --- a/plasma/javascript/plasmoids/extenders/contents/code/second.js +++ /dev/null @@ -1,11 +0,0 @@ -var test = 'rocking' -test2 = 'dancing' -plasmoid.test = 'disco, baby!' -print('second is loaded') -print(exists) -print(existant) - -plasmoid.getTest = function() -{ - return test; -} diff --git a/plasma/javascript/plasmoids/extenders/contents/code/third.js b/plasma/javascript/plasmoids/extenders/contents/code/third.js deleted file mode 100644 index ec553f8..0000000 --- a/plasma/javascript/plasmoids/extenders/contents/code/third.js +++ /dev/null @@ -1 +0,0 @@ -var test = 'not rocking' diff --git a/plasma/javascript/plasmoids/extenders/metadata.desktop b/plasma/javascript/plasmoids/extenders/metadata.desktop deleted file mode 100644 index 7c8f919..0000000 --- a/plasma/javascript/plasmoids/extenders/metadata.desktop +++ /dev/null @@ -1,20 +0,0 @@ -[Desktop Entry] -Name=JavaScript Extender -Comment=Demonstrates usage of Extenders in JavaScript -Icon=text-x-generic - -Type=Service -X-KDE-ServiceTypes=Plasma/Applet - -X-Plasma-API=javascript -X-Plasma-MainScript=code/main.js - -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo-Email=aseigo@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.simpified-javascript-extenders-example -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website= -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL - diff --git a/plasma/javascript/plasmoids/geolocation/contents/code/main.js b/plasma/javascript/plasmoids/geolocation/contents/code/main.js deleted file mode 100644 index a7c6885..0000000 --- a/plasma/javascript/plasmoids/geolocation/contents/code/main.js +++ /dev/null @@ -1,40 +0,0 @@ -// -*- coding: iso-8859-1 -*- -/* - * Author: rich - * Date: Sat Feb 20 2010, 15:03:07 - * - * (c) Copyright 2010 Richard Moore, rich@kde.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -mainLayout = new LinearLayout(plasmoid); - -engine = dataEngine('geolocation'); - -// Create and set a simple label; then add it -label = new Label(); -label.text = 'Where am I?'; -mainLayout.addItem(label); - -plasmoid.dataUpdated = function(name, data) -{ - label.text = 'You are in ' + data['city'] + ' in the country ' + data['country']; -} - -engine.connectSource(engine.sources[0], plasmoid, 10*1000); - - diff --git a/plasma/javascript/plasmoids/geolocation/metadata.desktop b/plasma/javascript/plasmoids/geolocation/metadata.desktop deleted file mode 100644 index 6c786c0..0000000 --- a/plasma/javascript/plasmoids/geolocation/metadata.desktop +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Comment=Demonstrates the user of the geolocation dataengine from javascript -Encoding=UTF-8 -Keywords= -Name=Sample Javascript Geolocation -Type=Service -X-KDE-ParentApp= -X-KDE-PluginInfo-Author=Richard Moore -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Email=rich@kde.org -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=org.kde.plasma.javascript-geolocation-example -X-KDE-PluginInfo-Version=0.1 -X-KDE-PluginInfo-Website= -X-KDE-ServiceTypes=Plasma/Applet -X-Plasma-API=javascript -X-Plasma-DefaultSize=200,100 -X-Plasma-MainScript=code/main.js -X-Plasma-RemoteLocation= diff --git a/plasma/javascript/plasmoids/mediaplayer/contents/code/main.js b/plasma/javascript/plasmoids/mediaplayer/contents/code/main.js deleted file mode 100644 index e435df7..0000000 --- a/plasma/javascript/plasmoids/mediaplayer/contents/code/main.js +++ /dev/null @@ -1,7 +0,0 @@ - -layout = new LinearLayout(plasmoid); -video = new VideoWidget(); -video.usedControls = video.DefaultControls; -layout.addItem(video); -video.url = startupArguments[0]; -video.play(); diff --git a/plasma/javascript/plasmoids/mediaplayer/metadata.desktop b/plasma/javascript/plasmoids/mediaplayer/metadata.desktop deleted file mode 100644 index e112b98..0000000 --- a/plasma/javascript/plasmoids/mediaplayer/metadata.desktop +++ /dev/null @@ -1,78 +0,0 @@ -[Desktop Entry] -Name=script-mediaplayer -Name[es]=script-reproductordemedios -Name[fy]=script-mediaspiler -Name[gu]=સ્ક્રિપ્ટ-મીડિઆપ્લેયર -Name[hr]=script-multimedijski_program -Name[is]=margmiðlunarspilara-skrifta -Name[mai]=स्क्रिप्ट मीडिया प्लेयर -Name[mk]=скрипта-„медиаплеер“ -Name[nds]=Afspeler-Skript -Name[nl]=script-mediaspeler -Name[ro]=script-lectormultimedia -Name[sv]=script-mediaspelare -Name[tg]=Quake Script -Name[tr]=betik-çokluortam oynatıcı -Name[x-test]=xxscript-mediaplayerxx -Name[zh_CN]=脚本-媒体播放器 - -Comment=Javascript media player -Comment[bg]=Медиа плеър (JavaScript) -Comment[ca]=Reproductor de suports en Javascript -Comment[ca@valencia]=Reproductor de suports en Javascript -Comment[da]=Medieafspiller i Javascript -Comment[de]=Javascript-Medienspieler -Comment[el]=Αναπαραγωγή πολυμέσων Javascript -Comment[es]=Reproductor de medios javascript -Comment[et]=Javascripti meediamängija -Comment[fi]=Javascript-mediasoitin -Comment[fr]=Lecteur multimédia JavaScript -Comment[fy]=Javaskript media spiler -Comment[ga]=Seinnteoir meán JavaScript -Comment[gl]=Reprodutor multimedia escrito en Javascript -Comment[gu]=જાવાસ્ક્રિપ્ટ મિડીઆ પ્લેયર -Comment[hr]=Multimedijski program -Comment[hu]=JavaScript-alapú médialejátszó -Comment[id]=Pemutar media Javascript -Comment[is]=JavaScript margmiðlunarspilari -Comment[ja]=JavaScript のメディアプレーヤー -Comment[km]=កម្មវិធី​ចាក់មេឌៀ Javascript -Comment[ko]=자바스크립트 미디어 재생기 -Comment[lv]=Javascript multivides atskaņotājs -Comment[mai]=जावास्क्रिप्ट मीडिया प्लेयर -Comment[ml]=ജാവാസ്ക്രിപ്റ്റ് മീഡിയാ പ്ലെയര്‍ -Comment[nb]=Javascript mediaspiller -Comment[nds]=JavaScript-Afspeler -Comment[nl]=Mediaspeler in Javascript -Comment[nn]=Mediespelar i JavaScript -Comment[pl]=Odtwarzacz multimedialny w Javascript -Comment[pt]=Leitor multimédia em JavaScript -Comment[pt_BR]=Leitor de mídias em JavaScript -Comment[ro]=Lector multimedia Javascript -Comment[ru]=Проигрыватель, написанный на языке JavaScript -Comment[sl]=Večpredstavnostni predvajalnik v JavaScriptu -Comment[sr]=Јаваскриптни медија плејер -Comment[sr@latin]=Javascript medija plejer -Comment[sv]=Javascript-mediaspelare -Comment[tg]=Часы, поддерживающие темы SVG -Comment[tr]=Javascript çokluortam oynatıcı -Comment[uk]=Програвач на JavaScript -Comment[x-test]=xxJavascript media playerxx -Comment[zh_CN]=JavaScript 媒体播放器 -Comment[zh_TW]=Javascript 媒體播放器 - -Icon=applications-multimedia -Type=Service -X-KDE-ServiceTypes=Plasma/Applet -X-Plasma-DropMimeTypes=video/mpeg,video/quicktime,video/ogg,video/x-msvideo, audio/mpeg, audio/x-vorbis+ogg, audio/x-flac -X-Plasma-MainScript=code/main.js -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=notmart@gmail.com -X-KDE-PluginInfo-Name=org.kde.plasma.script-mediaplayer-example -X-KDE-PluginInfo-Version=0.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Utilities -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=javascript diff --git a/plasma/javascript/plasmoids/notifications/contents/code/main b/plasma/javascript/plasmoids/notifications/contents/code/main deleted file mode 100644 index 82352c0..0000000 --- a/plasma/javascript/plasmoids/notifications/contents/code/main +++ /dev/null @@ -1,22 +0,0 @@ - - -plasmoid.newNotification = function() -{ - engine = dataEngine("notifications"); - service = engine.serviceForSource("notification"); - op = service.operationDescription("createNotification"); - op["appName"] = "foobar"; - op["appIcon"] = "konqueror"; - op["summary"] = "this is a summary"; - op["body"] = "body of notification"; - op["timeout"] = 2000; - - service.startOperationCall(op); -} - -layout = new LinearLayout(plasmoid); -button = new PushButton(); -button.text = "New notification"; -layout.addItem(button); - -button.clicked.connect(plasmoid.newNotification); \ No newline at end of file diff --git a/plasma/javascript/plasmoids/notifications/metadata.desktop b/plasma/javascript/plasmoids/notifications/metadata.desktop deleted file mode 100644 index 6544b4c..0000000 --- a/plasma/javascript/plasmoids/notifications/metadata.desktop +++ /dev/null @@ -1,17 +0,0 @@ -[Desktop Entry] -Name=script-notifications -Comment=Javascript client for the notifications service -Icon=dialog-information -Type=Service -X-KDE-ServiceTypes=Plasma/Applet -X-Plasma-MainScript=code/main -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=notmart@gmail.com -X-KDE-PluginInfo-Name=org.kde.plasma.script-notifications-example -X-KDE-PluginInfo-Version=0.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Utilities -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=javascript diff --git a/plasma/javascript/plasmoids/popup/contents/code/popupApplet.js b/plasma/javascript/plasmoids/popup/contents/code/popupApplet.js deleted file mode 100644 index 3c5eff9..0000000 --- a/plasma/javascript/plasmoids/popup/contents/code/popupApplet.js +++ /dev/null @@ -1,32 +0,0 @@ -// -*- coding: iso-8859-1 -*- -/* - * Author: Diego Casella - * Date: Sat Apr 16 2011, 17:10:39 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -label = new Label(); -label.text = 'Hey I\'m a Popup Label :)'; -label.minimumSize = QSizeF(200,200) -// The famous popupIcon :) -plasmoid.popupIcon = QIcon("plasma"); -// When the applet is smaller than this minimum size, the popupIcon will be displayed. -plasmoid.setMinimumSize(100,100); -// When the popupIcon gets a click event, the associated popupWidget will be shown. -plasmoid.popupWidget = label; - - diff --git a/plasma/javascript/plasmoids/popup/metadata.desktop b/plasma/javascript/plasmoids/popup/metadata.desktop deleted file mode 100644 index 38f4a42..0000000 --- a/plasma/javascript/plasmoids/popup/metadata.desktop +++ /dev/null @@ -1,20 +0,0 @@ -[Desktop Entry] -Comment= -Encoding=UTF-8 -Icon=plasma -Keywords= -Name=popupApplet -Type=Service -X-KDE-ParentApp= -X-KDE-PluginInfo-Author=[Po]lentino -X-KDE-PluginInfo-Category=Miscellaneous -X-KDE-PluginInfo-Email=polentino911@gmail.com -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=popupApplet -X-KDE-PluginInfo-Version= -X-KDE-PluginInfo-Website= -X-KDE-ServiceTypes=Plasma/Applet,Plasma/PopupApplet -X-Plasma-API=javascript -X-Plasma-DefaultSize=200,100 -X-Plasma-MainScript=code/popupApplet.js -X-Plasma-RemoteLocation= diff --git a/plasma/javascript/plasmoids/tiger/contents/code/main b/plasma/javascript/plasmoids/tiger/contents/code/main deleted file mode 100644 index d7b7511..0000000 --- a/plasma/javascript/plasmoids/tiger/contents/code/main +++ /dev/null @@ -1,56 +0,0 @@ -// We create the SVG object; this will cause it to load the file in -// contents/images/tiger.svg -svg = new PlasmaSvg('tiger') - -// And now a PNG; similarly to the SVG file, this will be pulled from -// contents/images/kde.png -p = new QPixmap('kde.png') - -// Now we create a context menu action -plasmoid.setAction('myAction', i18n('Silly name'), 'plasma') - -// And change its name -plasmoid.setAction('myAction', i18n('Toggle KDE Logo'), 'plasma') - -// And add a second action -> they will appear in the context menu in the order that they are created -plasmoid.setAction('mySecondAction', i18n('Also toggles KDE Logo'), 'plasma') - -// and something to control the painting of the logo -drawLogo = true - -// print some output about the pixmap -print('size of pixmap is: ' + p.rect.width + 'x' + p.rect.height) - -// this function will be called automatically when myAction is triggered -plasmoid.action_myAction = function() -{ - drawLogo = !drawLogo - plasmoid.update() - if (drawLogo) { - print(i18n("Refreshing Plasmoid with the KDE logo.")) - } else { - print(i18n("Refreshing Plasmoid without the KDE logo.")) - } -} - -// and this one with mySecondAction is triggered -plasmoid.action_mySecondAction = function() -{ - plasmoid.action_myAction() -} - -// plasmoid.paintInterface is called whenever the plasmoid should be repainted -plasmoid.paintInterface = function(painter, options, rect) -{ - rect = plasmoid.rect - svg.resize(rect.width, rect.height) - svg.paint(painter, rect.x, rect.y) - - if (drawLogo) { - // draw the KDE logo centered - painter.drawPixmap(rect.x + (rect.width / 2 - p.rect.width / 2), - rect.y + (rect.height / 2 - p.rect.height / 2), p) - - } -} - diff --git a/plasma/javascript/plasmoids/tiger/contents/images/kde.png b/plasma/javascript/plasmoids/tiger/contents/images/kde.png deleted file mode 100644 index 06dbbc1..0000000 Binary files a/plasma/javascript/plasmoids/tiger/contents/images/kde.png and /dev/null differ diff --git a/plasma/javascript/plasmoids/tiger/contents/images/tiger.svg b/plasma/javascript/plasmoids/tiger/contents/images/tiger.svg deleted file mode 100644 index 983e570..0000000 --- a/plasma/javascript/plasmoids/tiger/contents/images/tiger.svg +++ /dev/null @@ -1,730 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plasma/javascript/plasmoids/tiger/metadata.desktop b/plasma/javascript/plasmoids/tiger/metadata.desktop deleted file mode 100644 index b706b24..0000000 --- a/plasma/javascript/plasmoids/tiger/metadata.desktop +++ /dev/null @@ -1,108 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Tiger -Name[ar]=النمر -Name[be@latin]=Tyhra -Name[bn]=টাইগার -Name[el]=Τίγρης -Name[es]=Tigre -Name[fi]=Tiikeri -Name[fr]=Tigre -Name[gl]=Tigre -Name[gu]=વાઘ -Name[he]=נמר -Name[hi]=शेर -Name[hne]=टाइगर -Name[hr]=Tigar -Name[id]=Harimau -Name[it]=Tigre -Name[ja]=タイガー -Name[kk]=Жолбарыс -Name[km]=ខ្លា -Name[ku]=Piling -Name[lt]=Tigras -Name[lv]=Tīģeris -Name[mai]=बाघ -Name[mk]=Тигар -Name[ml]=ടൈഗര്‍ -Name[nl]=Tijger -Name[or]=ଟାଇଗର -Name[pa]=ਟਾਈਗਰ -Name[pl]=Tygrys -Name[pt]=Tigre -Name[pt_BR]=Tigre -Name[ro]=Tigru -Name[ru]=Тигр -Name[sr]=тигар -Name[sr@latin]=tigar -Name[tg]=Паланг -Name[th]=เสือโคร่ง -Name[tr]=Kaplan -Name[uk]=Тигр -Name[wa]=Tigue -Name[x-test]=xxTigerxx -Name[zh_CN]=虎 -Name[zh_TW]=老虎 -Comment=An example of how to use SVGs, pixmaps and actions in JavaScript plasmoids -Comment[bg]=Адаптор за скриптове -Comment[ca]=Un adaptador de scripts -Comment[ca@valencia]=Un adaptador de scripts -Comment[cs]=Zpracování skriptu -Comment[da]=En script-adaptor -Comment[de]=Eine Skript-Anpassung -Comment[el]=Ένας προσαρμογέας σεναρίου -Comment[es]=Un adaptador javascript -Comment[et]=Skriptiadapter -Comment[fr]=Un adaptateur de script -Comment[fy]=In Skript oanpasser -Comment[ga]=Cuibheoir Scripte -Comment[gl]=Un adaptador de script -Comment[gu]=સ્ક્રિપ્ટ એડપ્ટર -Comment[hr]=Prilagodnik skripte -Comment[hu]=Szkriptkezelő modul -Comment[id]=Adaptor Skrip -Comment[is]=Skriftumótari -Comment[it]=Script adattatore -Comment[km]=អាដាប់ទ័ឬ​ស្គ្រីប -Comment[ko]=스크립트 어댑터 -Comment[lt]=Scenarijų adaptatorius -Comment[lv]=Skriptu pielāgotājs -Comment[mai]=स्क्रिप्ट एडाप्टर -Comment[mk]=Адаптер за скрипти -Comment[ml]=സ്ക്രിപ്റ്റിന്റെ ഒരു ഇണക്ക് -Comment[nb]=En skripttilpasser -Comment[nds]=En Skript-Topasser -Comment[nl]=Een scriptadaptor -Comment[nn]=Ein skripttilpassar -Comment[or]=ଗୋଟିଏ ସ୍କ୍ରିପ୍ଟ ଏଡ଼ପଟର -Comment[pa]=ਸਕ੍ਰਿਪਟ ਅਡਾਪਟਰ -Comment[pl]=Adapter skryptów -Comment[pt]=Um Adaptador de Programas -Comment[pt_BR]=Um adaptador de script -Comment[ro]=Adaptor de scripturi -Comment[ru]=Адаптер скриптов -Comment[sl]=Skriptni prilagodilnik -Comment[sr]=Адаптор скрипти -Comment[sr@latin]=Adaptor skripti -Comment[sv]=En skriptanpassning -Comment[te]=స్క్రిప్ట్ ఎడాప్టర్ -Comment[tg]=Графический адаптер -Comment[tr]=Bir Betik Uyarlayıcısı -Comment[uk]=Пристосування скриптів -Comment[x-test]=xxA Script Adaptorxx -Comment[zh_CN]=脚本适配器 -Comment[zh_TW]=文稿適配器 -Type=Service -ServiceTypes=Plasma/Applet - -X-KDE-PluginInfo-Author=Richard Moore -X-KDE-PluginInfo-Email=panel-devel@kde.org -X-KDE-PluginInfo-Name=org.kde.plasma.tiger-example -X-KDE-PluginInfo-Version=0.2 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=javascript -X-Plasma-ConfigPlugins=kcmtrash diff --git a/plasma/javascript/plasmoids/usingServices/contents/code/main.js b/plasma/javascript/plasmoids/usingServices/contents/code/main.js deleted file mode 100644 index 66e5b72..0000000 --- a/plasma/javascript/plasmoids/usingServices/contents/code/main.js +++ /dev/null @@ -1,84 +0,0 @@ -// set up the engine, player and controller -var controller -var watchingPlayer = "" -var engine = dataEngine("nowplaying") - -// define a few functions -plasmoid.dataUpdated = function(a, b) -{ - print("updated data for " + a) - if (a == "players") { - if (watchingPlayer != '') { - engine.disconnectSource(watchingPlayer) - } - - watchingPlayer = b.players[0]; - engine.connectSource(watchingPlayer, plasmoid) - - controller = service("nowplaying", watchingPlayer) - controller.associateWidget(stopButton, "stop") - controller.associateWidget(progress, "progress") - controller.finished.connect(plasmoid.jobFinished) - print("Now watching player " + watchingPlayer); - } else { - label.text = "Playing " + b.Title + " by " + b.Artist + ". time: " + - Math.floor(b.Position/60) + ":" + (parseInt(b.Position)%60) - progress.value = 100*b.Position/b.Length - } -} - -plasmoid.jobFinished = function(job) -{ - print("The job " + job.operationName + " is finished.") -} - -plasmoid.stop = function() -{ - if (!controller) { - return - } - - data = controller.operationDescription("stop") - print(controller.name) - for ( var i in data ) { - print(i + ' -> ' + data[i] ) - } - - job = controller.startOperationCall(controller.operationDescription("stop")) - print("Job is..." + job) - //job.finished.connect(plasmoid.jobFinished) - print("stopping") -} - -plasmoid.setProgress = function(progress) -{ - operation = controller.operationDescription("seek"); - operation.seconds = progress; - for ( var i in operation ) { - print(i + ' -> ' + operation[i] ); - } - - controller.startOperationCall(operation); - print("set progress to " + progress); -} - -engine.connectSource("players", plasmoid) - -// Set up the UI -layout = new LinearLayout(plasmoid); -layout.orientation = QtVertical; -label = new Label(); -layout.addItem(label); - -var stopButton = new PushButton(); -stopButton.text = "Stop"; -layout.addItem(stopButton); - -var progress = new Slider(); -progress.orientation = QtHorizontal; -layout.addItem(progress); - -// Glue things together -stopButton.clicked.connect(plasmoid.stop); -progress.sliderMoved.connect(plasmoid.setProgress); - diff --git a/plasma/javascript/plasmoids/usingServices/metadata.desktop b/plasma/javascript/plasmoids/usingServices/metadata.desktop deleted file mode 100644 index 3eba988..0000000 --- a/plasma/javascript/plasmoids/usingServices/metadata.desktop +++ /dev/null @@ -1,80 +0,0 @@ -[Desktop Entry] -Name=script-nowplaying -Name[cs]=Skript "Právě hraje" -Name[es]=script-ejecutando -Name[fy]=skript-no ôfspyljend -Name[hr]=script-sadasvira -Name[is]=spilanúna-skrifta -Name[lt]=scenarijus-dabar groja -Name[mai]=स्क्रिप्ट अखनचलाए रहल अछि -Name[mk]=скрипта-„сега свири“ -Name[ml]=ലഘു ആജ്ഞയാണ് ഇപ്പോള്‍ ഓടിക്കൊണ്ടിരിക്കുന്നത് -Name[nds]=Warrt-jüst-afspeelt-Skript -Name[nl]=script-nu-aan-het-spelen -Name[ro]=script-înredare -Name[sv]=script-spelar-nu -Name[te]=ఇప్పుడునడుస్తున్న-స్క్రిప్ట్ -Name[tg]=Quake Script -Name[tr]=betik-şimdi dinlenen parça -Name[x-test]=xxscript-nowplayingxx -Name[zh_CN]=脚本-现在收听 -Comment=Javascript version current track playing -Comment[bg]=Текущо изпълняван запис (JavaScript) -Comment[ca]=Versió en Javascript de la peça actual en reproducció -Comment[ca@valencia]=Versió en Javascript de la peça actual en reproducció -Comment[cs]=JavaScriptová verze skriptu "Právě hraje" -Comment[da]=Javascript-version af nuværende spor som afspilles -Comment[de]=Javascript-Version der Musiktitel-Anzeige -Comment[el]=Τρέχον κομμάτι αναπαραγωγής σε έκδοση Javascript -Comment[es]=versión javascript de la reproducción actual -Comment[et]=Esitatava pala JavaScripti versioon -Comment[fi]=Nyt soi -sovelman Javascript-versio -Comment[fr]=Morceau en cours de lecture - version Javascript -Comment[fy]=Javaskript-ferzje fan do no ôfspiljend nûmer -Comment[ga]=Amhrán á sheinm anois in JavaScript -Comment[gl]=Versión en Javascript da pista a reproducir -Comment[hr]=Javascript verzija spravice za prikaz trenutne pjesme koja svira -Comment[hu]=JavaScript-függvény az éppen lejátszott szám jellemzőihez -Comment[id]=Memutar jalur saat ini versi javascript -Comment[is]=Javascript útgáfa núverandi spilunar -Comment[it]=La traccia attualmente in riproduzione (versione JavaScript) -Comment[ja]=「今聴いているもの」の JavaScript バージョン -Comment[km]=ការ​ចាក់​បទ​បច្ចុប្បន្ន​កំណែ​ Javascript -Comment[ko]=자바스크립트 버전 지금 재생 중 -Comment[lt]=JavaScript versija – dabar grojantis takelis -Comment[lv]=Pašlaik atskaņo javascript versija -Comment[ml]=ഇപ്പോള്‍ ഓടിക്കൊണ്ടിരിക്കുന്ന ട്രാക്ക് ജാവാ സ്ക്രിപ്റ്റ് പതിപ്പാണ്. -Comment[nb]=Javascript versjon – spor som spilles nå -Comment[nds]=JavaScript-Verschoon vun Opstunns afspeelt Stück -Comment[nl]=Javascript-versie van momenteel spelende track -Comment[nn]=JavaScript-versjon for vising av gjeldande spor -Comment[pl]=Wersja "Teraz odtwarzany" w Javascript -Comment[pt]=Versão em JavaScript do 'Agora a tocar' -Comment[pt_BR]=Versão em Javascript da reprodução da trilha atual -Comment[ro]=Pista în redare în versiune Javascript -Comment[ru]=Виджет «Сейчас проигрывается», написанный на языке JavaScript -Comment[sl]=Trenutno predvajana skladba v Javascriptu -Comment[sr]=Јаваскриптна верзија тренутне свирке -Comment[sr@latin]=Javascript verzija trenutne svirke -Comment[sv]=Javascript-version av nuvarande spår som spelas -Comment[te]=ప్లేఅవుతున్న జావాస్క్రిప్ట్ వర్షన్ ప్రస్తుత ట్రాక్ -Comment[tg]=Часы, поддерживающие темы SVG -Comment[tr]=Şimdi çalınan parça bilgisi betiğinin Javascript sürümü -Comment[uk]=Javascript-версія показу назви композиції, що відтворюється -Comment[x-test]=xxJavascript version current track playingxx -Comment[zh_CN]=Javascript 版本的现在收听 -Comment[zh_TW]=Javascript 版本的「正在播放」 -Icon=configure -Type=Service -X-KDE-ServiceTypes=Plasma/Applet -X-Plasma-MainScript=code/main.js -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=notmart@gmail.com -X-KDE-PluginInfo-Name=org.kde.plasma.script-nowplaying-example -X-KDE-PluginInfo-Version=0.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Utilities -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=javascript diff --git a/plasma/python/CMakeLists.txt b/plasma/python/CMakeLists.txt deleted file mode 100644 index 388e4ec..0000000 --- a/plasma/python/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(applets) diff --git a/plasma/python/applets/CMakeLists.txt b/plasma/python/applets/CMakeLists.txt deleted file mode 100644 index fe6e8f6..0000000 --- a/plasma/python/applets/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# pyclock -install(DIRECTORY pyclock/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/plasma-pyclock) -install(FILES pyclock/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME pyclock-example.desktop) -# pyhello -install(DIRECTORY pyhello/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/pyhello) -install(FILES pyhello/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME pyhello-example.desktop) diff --git a/plasma/python/applets/pyclock/contents/code/analog_clock_config_ui.py b/plasma/python/applets/pyclock/contents/code/analog_clock_config_ui.py deleted file mode 100644 index 6518a38..0000000 --- a/plasma/python/applets/pyclock/contents/code/analog_clock_config_ui.py +++ /dev/null @@ -1,69 +0,0 @@ - -#!/usr/bin/env python -# Generated by pykdeuic4 from analog_clock_config.ui on Sun Sep 14 13:02:52 2008 -# -# WARNING! All changes to this file will be lost. -from PyKDE4 import kdecore -from PyKDE4 import kdeui -from PyQt4 import QtCore, QtGui - -class Ui_clockConfig(object): - def setupUi(self, clockConfig): - clockConfig.setObjectName("clockConfig") - clockConfig.resize(400, 300) - clockConfig.setMinimumSize(QtCore.QSize(400, 300)) - self.vboxlayout = QtGui.QVBoxLayout(clockConfig) - self.vboxlayout.setObjectName("vboxlayout") - self.vboxlayout1 = QtGui.QVBoxLayout() - self.vboxlayout1.setObjectName("vboxlayout1") - self.groupBox = QtGui.QGroupBox(clockConfig) - self.groupBox.setFlat(True) - self.groupBox.setObjectName("groupBox") - self.vboxlayout2 = QtGui.QVBoxLayout(self.groupBox) - self.vboxlayout2.setObjectName("vboxlayout2") - self.vboxlayout3 = QtGui.QVBoxLayout() - self.vboxlayout3.setObjectName("vboxlayout3") - self.showSecondHandCheckBox = QtGui.QCheckBox(self.groupBox) - self.showSecondHandCheckBox.setObjectName("showSecondHandCheckBox") - self.vboxlayout3.addWidget(self.showSecondHandCheckBox) - self.showTimeStringCheckBox = QtGui.QCheckBox(self.groupBox) - self.showTimeStringCheckBox.setObjectName("showTimeStringCheckBox") - self.vboxlayout3.addWidget(self.showTimeStringCheckBox) - self.vboxlayout2.addLayout(self.vboxlayout3) - self.vboxlayout1.addWidget(self.groupBox) - self.groupBox_2 = QtGui.QGroupBox(clockConfig) - self.groupBox_2.setFlat(True) - self.groupBox_2.setObjectName("groupBox_2") - self.vboxlayout4 = QtGui.QVBoxLayout(self.groupBox_2) - self.vboxlayout4.setObjectName("vboxlayout4") - self.vboxlayout5 = QtGui.QVBoxLayout() - self.vboxlayout5.setObjectName("vboxlayout5") - self.localTimeZone = QtGui.QCheckBox(self.groupBox_2) - self.localTimeZone.setObjectName("localTimeZone") - self.vboxlayout5.addWidget(self.localTimeZone) - self.timeZones = KTimeZoneWidget(self.groupBox_2) - self.timeZones.setMinimumSize(QtCore.QSize(300, 150)) - self.timeZones.setObjectName("timeZones") - self.vboxlayout5.addWidget(self.timeZones) - self.vboxlayout4.addLayout(self.vboxlayout5) - self.vboxlayout1.addWidget(self.groupBox_2) - self.vboxlayout.addLayout(self.vboxlayout1) - - self.retranslateUi(clockConfig) - QtCore.QMetaObject.connectSlotsByName(clockConfig) - - def retranslateUi(self, clockConfig): - self.groupBox.setTitle(kdecore.i18n("Appearance")) - self.showSecondHandCheckBox.setToolTip(kdecore.i18n("Show the seconds")) - self.showSecondHandCheckBox.setWhatsThis(kdecore.i18n("Check this if you want to show the seconds.")) - self.showSecondHandCheckBox.setText(kdecore.i18n("Show &seconds")) - self.showTimeStringCheckBox.setToolTip(kdecore.i18n("Show the time in text")) - self.showTimeStringCheckBox.setWhatsThis(kdecore.i18n("Check this if you want to show the time as a text within the clock.")) - self.showTimeStringCheckBox.setText(kdecore.i18n("Also show the time in text")) - self.groupBox_2.setTitle(kdecore.i18n("Timezones")) - self.localTimeZone.setText(kdecore.i18n("Use &local timezone")) - self.timeZones.headerItem().setText(0, kdecore.i18n("Area")) - self.timeZones.headerItem().setText(1, kdecore.i18n("Region")) - self.timeZones.headerItem().setText(2, kdecore.i18n("Comment")) - -from PyKDE4.kdeui import KTimeZoneWidget diff --git a/plasma/python/applets/pyclock/contents/code/calendar_ui.py b/plasma/python/applets/pyclock/contents/code/calendar_ui.py deleted file mode 100644 index d5c3aa2..0000000 --- a/plasma/python/applets/pyclock/contents/code/calendar_ui.py +++ /dev/null @@ -1,29 +0,0 @@ - -#!/usr/bin/env python -# Generated by pykdeuic4 from calendar.ui on Sun Sep 14 13:02:53 2008 -# -# WARNING! All changes to this file will be lost. -from PyKDE4 import kdecore -from PyKDE4 import kdeui -from PyQt4 import QtCore, QtGui - -class Ui_calendar(object): - def setupUi(self, calendar): - calendar.setObjectName("calendar") - calendar.resize(276, 255) - self.vboxlayout = QtGui.QVBoxLayout(calendar) - self.vboxlayout.setSpacing(0) - self.vboxlayout.setMargin(0) - self.vboxlayout.setObjectName("vboxlayout") - self.kdatepicker = KDatePicker(calendar) - self.kdatepicker.setAutoFillBackground(True) - self.kdatepicker.setObjectName("kdatepicker") - self.vboxlayout.addWidget(self.kdatepicker) - - self.retranslateUi(calendar) - QtCore.QMetaObject.connectSlotsByName(calendar) - - def retranslateUi(self, calendar): - pass - -from PyKDE4.kdeui import KDatePicker diff --git a/plasma/python/applets/pyclock/contents/code/clockapplet.py b/plasma/python/applets/pyclock/contents/code/clockapplet.py deleted file mode 100644 index 5278744..0000000 --- a/plasma/python/applets/pyclock/contents/code/clockapplet.py +++ /dev/null @@ -1,103 +0,0 @@ - -from PyQt4.QtCore import * -from PyQt4.QtGui import * -from PyKDE4.kdecore import * -from PyKDE4.kdeui import * -import plasma -from timezonesConfig_ui import * -from calendar_ui import * - -class ClockApplet(plasma.Applet): - def __init__(self,parent,args=None): - plasma.Applet.__init__(self,parent) - - self.calendar = None - self.currentTimezone = "Local" - - self.calendarUi = Ui_calendar() - self.timezonesUi = Ui_timezonesConfig() - self.clicked = QPoint() - self.timeZones = [] - - def updateToolTipContent(self): - pass - - def createConfigurationInterface(self,parent): - self.createClockConfigurationInterface(parent) - - #widget = QWidget(parent) - #self.timezonesUi.setupUi(widget) - - #parent.addPage(widget, i18n("Time Zones"), self.icon()) - - #self.timezonesUi.localTimeZone.checked = self.isLocalTimezone() - #self.timezonesUi.timeZones.setSelected(self.currentTimezone, True) - #self.timezonesUi.timeZones.setEnabled(not self.isLocalTimezone()) - - parent.setButtons(KDialog.ButtonCodes(KDialog.ButtonCode(KDialog.Ok | KDialog.Cancel | KDialog.Apply))) - self.connect(parent, SIGNAL("applyClicked"), self.configAccepted) - self.connect(parent, SIGNAL("okClicked"), self.configAccepted) - - def createClockConfigurationInterface(self,parent): - pass - - def clockConfigAccepted(self): - pass - - def configAccepted(self): - cg = self.config() - - self.timeZones = self.timezonesUi.timeZones.selection() - cg.writeEntry("timeZones", self.timeZones) - - newTimezone = self.localTimezone() - - if not self.timezonesUi.localTimeZone.isChecked() and not self.timeZones.isEmpty(): - newTimezone = self.timeZones[0] - - self.changeEngineTimezone(self.currentTimezone, newTimezone) - - self.currentTimezone = newTimezone - cg.writeEntry("currentTimezone", newTimezone) - - self.clockConfigAccepted() - - self.constraintsEvent(Plasma.SizeConstraint) - self.update() - self.emit(SIGNAL("configNeedsSaving()")) - - def changeEngineTimezone(self, oldTimezone, newTimezone): - pass - - def mousePressEvent(self,event): - if event.buttons() == Qt.LeftButton: - self.clicked = self.scenePos.toPoint() - event.setAccepted(True) - return - plasma.Applet.mousePressEvent(self,event) - - def mouseReleaseEvent(self,event): - if (self.clicked - self.scenePos.toPoint()).manhattanLength() < \ - KGlobalSettings.dndEventDelay(): - self.showCalendar(event) - - def showCalendar(self,event): - if self.calendar is None: - self.calendar = Plasma.Dialog() - self.calendarUi.setupUi(self.calendar) - self.calendar.setWindowFlags(Qt.Popup) - self.calendar.adjustSize() - - if self.calendar.isVisible(): - self.calendar.hide() - else: - data = self.dataEngine("time").query(self.currentTimezone) - self.calendarUi.kdatepicker.date = data[QString("Date")].toDate() - self.calendar.move(self.popupPosition(self.calendar.sizeHint())) - self.calendar.show() - - def isLocalTimezone(self): - return self.currentTimezone == self.localTimezone() - - def localTimezone(self): - return "Local" diff --git a/plasma/python/applets/pyclock/contents/code/main.py b/plasma/python/applets/pyclock/contents/code/main.py deleted file mode 100644 index 02a7099..0000000 --- a/plasma/python/applets/pyclock/contents/code/main.py +++ /dev/null @@ -1,284 +0,0 @@ -# -# Copyright (C) 2005,2006,2007 by Siraj Razick -# Copyright 2008 Simon Edwards (Translated to Python) -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Library General Public License as -# published by the Free Software Foundation; either version 2, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details -# -# You should have received a copy of the GNU Library General Public -# License along with this program; if not, write to the -# Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -from PyQt4.QtCore import * -from PyQt4.QtGui import * -from PyKDE4.kdecore import * -from PyKDE4.kdeui import * -from PyKDE4.plasma import Plasma -from analog_clock_config_ui import * -from calendar_ui import * -from PyKDE4 import plasmascript - -class AnalogClockConfig(QWidget,Ui_clockConfig): - def __init__(self,parent): - QWidget.__init__(self,parent) - self.setupUi(self) - self.connect(self.localTimeZone, SIGNAL("stateChanged(int)"), self, SLOT("slotLocalTimeZoneToggled(int)")) - - @pyqtSignature("slotLocalTimeZoneToggled(int)") - def slotLocalTimeZoneToggled(self,b): - self.timeZones.setDisabled(b) - -class PyClockApplet(plasmascript.Applet): - def __init__(self,parent,args=None): - plasmascript.Applet.__init__(self,parent) - - self.calendar = None - self.currentTimezone = "Local" - self.clicked = QPoint() - self.timeZones = [] - - def init(self): - KGlobal.locale().insertCatalog("libplasmaclock") - - self.setHasConfigurationInterface(True) - self.setAspectRatioMode(Plasma.Square) - - self.timezone = "" - self.showTimeString = False - self.showSecondHand = False - - self.dialog = None - self.calendarUi = Ui_calendar() - self.lastTimeSeen = QTime() - self.time = QTime() - - self.theme = Plasma.Svg(self) - #print("svg: "+str(self.package().filePath("images", "clock.svgz"))) - #self.theme.setImagePath(self.package().filePath("images", "clock.svgz")) - - self.theme.setImagePath("widgets/clock") # FIXME pull this out of this applet itself. - self.theme.setContainsMultipleImages(False) - self.theme.resize(self.size()) - - cg = self.config() - self.showTimeString = cg.readEntry("showTimeString", QVariant(False)).toBool() - self.showSecondHand = cg.readEntry("showSecondHand", QVariant(False)).toBool() - self.fancyHands = cg.readEntry("fancyHands", QVariant(False)).toBool() - self.currentTimezone = cg.readEntry("timezone", self.localTimezone()) - - self.connectToEngine() - - def connectToEngine(self): - self.timeEngine = self.dataEngine("time") - if self.showSecondHand: - self.timeEngine.connectSource(self.currentTimezone, self, 500) - else: - self.timeEngine.connectSource(self.currentTimezone, self, 6000, Plasma.AlignToMinute) - - def constraintsEvent(self, constraints): - if constraints & Plasma.FormFactorConstraint: - self.setBackgroundHints(Plasma.Applet.NoBackground) - if constraints & Plasma.SizeConstraint: - self.theme.resize(self.size()) - - def shape(self): - if self.theme.hasElement("hint-square-clock"): - return plasma.Applet.shape(self) - - path = QPainterPath() - path.addEllipse(self.boundingRect().adjusted(-2, -2, 2, 2)) - return path - - @pyqtSignature("dataUpdated(const QString &, const Plasma::DataEngine::Data &)") - def dataUpdated(self, sourceName, data): - self.time = data[QString("Time")].toTime() - - if self.time.minute() == self.lastTimeSeen.minute() and \ - self.time.second() == self.lastTimeSeen.second(): - # avoid unnecessary repaints - return - - self.lastTimeSeen = self.time - self.update() - - def updateToolTipContent(self): - pass - - def mousePressEvent(self,event): - if event.buttons() == Qt.LeftButton: - self.clicked = self.scenePos().toPoint() - event.setAccepted(True) - - def mouseReleaseEvent(self,event): - if (self.clicked - self.scenePos().toPoint()).manhattanLength() < \ - KGlobalSettings.dndEventDelay(): - self.showCalendar(event) - - def showCalendar(self,event): - if self.calendar is None: - self.calendar = Plasma.Dialog() - self.calendarUi.setupUi(self.calendar) - self.calendar.setWindowFlags(Qt.Popup) - self.calendar.adjustSize() - - if self.calendar.isVisible(): - self.calendar.hide() - else: - data = self.dataEngine("time").query(self.currentTimezone) - self.calendarUi.kdatepicker.date = data[QString("Date")].toDate() - self.calendar.move(self.popupPosition(self.calendar.sizeHint())) - self.calendar.show() - - def isLocalTimezone(self): - return self.currentTimezone == self.localTimezone() - - def localTimezone(self): - return "Local" - - def showConfigurationInterface(self): - windowTitle = str(self.applet.name()) + " Settings" #i18nc("@title:window", "%s Settings" % str(self.applet.name())) - - if self.dialog is None: - self.dialog = KDialog(None) - self.dialog.setWindowTitle(windowTitle) - - self.ui = AnalogClockConfig(self.dialog) - self.dialog.setMainWidget(self.ui) - - self.dialog.setButtons(KDialog.ButtonCodes(KDialog.ButtonCode(KDialog.Ok | KDialog.Cancel | KDialog.Apply))) - self.dialog.showButton(KDialog.Apply, False) - - self.connect(self.dialog, SIGNAL("applyClicked()"), self, SLOT("configAccepted()")) - self.connect(self.dialog, SIGNAL("okClicked()"), self, SLOT("configAccepted()")) - - self.ui.showTimeStringCheckBox.setChecked(self.showTimeString) - self.ui.showSecondHandCheckBox.setChecked(self.showSecondHand) - self.ui.localTimeZone.setChecked(self.isLocalTimezone()) - self.ui.timeZones.setSelected(self.currentTimezone, True) - self.ui.timeZones.setEnabled(not self.isLocalTimezone()) - - self.dialog.show() - - @pyqtSignature("configAccepted()") - def configAccepted(self): - cg = self.config() - - # Timezones - self.timeZones = self.ui.timeZones.selection() - cg.writeEntry("timeZones", self.timeZones) - newTimezone = self.localTimezone() - if not self.ui.localTimeZone.isChecked() and not self.timeZones.isEmpty(): - newTimezone = self.timeZones[0] - self.changeEngineTimezone(self.currentTimezone, newTimezone) - self.currentTimezone = newTimezone - cg.writeEntry("currentTimezone", newTimezone) - - # Display - self.showTimeString = self.ui.showTimeStringCheckBox.isChecked() - self.showSecondHand = self.ui.showSecondHandCheckBox.isChecked() - cg.writeEntry("showTimeString", QVariant(self.showTimeString)) - cg.writeEntry("showSecondHand", QVariant(self.showSecondHand)) - - self.dataEngine("time").disconnectSource(self.currentTimezone, self) - self.connectToEngine() - - self.constraintsEvent(Plasma.SizeConstraint) - self.update() - self.emit(SIGNAL("configNeedsSaving()")) - - def changeEngineTimezone(self, oldTimezone, newTimezone): - self.dataEngine("time").disconnectSource(oldTimezone, self) - self.timeEngine = self.dataEngine("time") - if self.showSecondHand: - self.timeEngine.connectSource(newTimezone, self, 500) - else: - self.timeEngine.connectSource(newTimezone, self, 6000, Plasma.AlignToMinute) - - def drawHand(self, painter, rotation, handName, rect): - painter.save() - elementRect = self.theme.elementRect(handName) - - painter.translate(rect.width() / 2, rect.height() / 2) - painter.rotate(rotation) - painter.translate(-elementRect.width() / 2, 0) - self.theme.paint(painter, QRectF(QPointF(0.0, 0.0), elementRect.size()), handName) - - painter.restore() - - def paintInterface(self, painter, option, rect): - tempRect = QRectF(0, 0, 0, 0) - - boundSize = self.size() - - painter.setRenderHint(QPainter.SmoothPixmapTransform) - - minutes = 6.0 * self.time.minute() - 180 - hours = 30.0 * self.time.hour() - 180 + ((self.time.minute() / 59.0) * 30.0) - - self.theme.paint(painter, QRectF(rect), "ClockFace") - - if self.showTimeString: - fm = QFontMetrics(QApplication.font()) - margin = 4 - if self.showSecondHand: - # FIXME: temporary time output - time = self.time.toString() - else: - time = self.time.toString("hh:mm") - - textRect = QRect((rect.width()/2 - fm.width(time) / 2),((rect.height() / 2) - fm.xHeight() * 4), fm.width(time), fm.xHeight()) - - painter.pen = Qt.NoPen - background = Plasma.Theme.defaultTheme().color(Plasma.Theme.BackgroundColor) - background.setAlphaF(0.5) - painter.brush = QBrush(background) - - painter.setRenderHint(QPainter.Antialiasing, True) - painter.drawPath(Plasma.PaintUtils.roundedRectangle(QRectF(textRect.adjusted(-margin, -margin, margin, margin)), margin)) - painter.setRenderHint(QPainter.Antialiasing, False) - - painter.pen = Plasma.Theme.defaultTheme().color(Plasma.Theme.TextColor) - - painter.drawText(textRect.bottomLeft(), time) - - # Make sure we paint the second hand on top of the others - if self.showSecondHand: - anglePerSec = 6.0 - seconds = anglePerSec * self.time.second() - 180 - - if self.theme.hasElement("HourHandShadow"): - painter.translate(1,3) - self.drawHand(painter, hours, "HourHandShadow",rect) - self.drawHand(painter, minutes, "MinuteHandShadow",rect) - - if self.showSecondHand: - self.drawHand(painter, seconds, "SecondHandShadow",rect) - - painter.translate(-1,-3) - - self.drawHand(painter, hours, "HourHand",rect) - self.drawHand(painter, minutes, "MinuteHand",rect) - if self.showSecondHand: - self.drawHand(painter, seconds, "SecondHand",rect) - - painter.save() - self.theme.resize(boundSize) - elementSize = QSizeF(self.theme.elementSize("HandCenterScrew")) - tempRect.size = elementSize - painter.translate(boundSize.width() / 2.0 - elementSize.width() / 2.0, boundSize.height() / 2.0 - elementSize.height() / 2.0) - self.theme.paint(painter, tempRect, "HandCenterScrew") - painter.restore() - - self.theme.paint(painter, QRectF(rect), "Glass") - -def CreateApplet(parent): - return PyClockApplet(parent) diff --git a/plasma/python/applets/pyclock/contents/code/timezonesConfig_ui.py b/plasma/python/applets/pyclock/contents/code/timezonesConfig_ui.py deleted file mode 100644 index 805f678..0000000 --- a/plasma/python/applets/pyclock/contents/code/timezonesConfig_ui.py +++ /dev/null @@ -1,34 +0,0 @@ - -#!/usr/bin/env python -# Generated by pykdeuic4 from timezonesConfig.ui on Sun Sep 14 13:02:53 2008 -# -# WARNING! All changes to this file will be lost. -from PyKDE4 import kdecore -from PyKDE4 import kdeui -from PyQt4 import QtCore, QtGui - -class Ui_timezonesConfig(object): - def setupUi(self, timezonesConfig): - timezonesConfig.setObjectName("timezonesConfig") - timezonesConfig.resize(308, 227) - self.vboxlayout = QtGui.QVBoxLayout(timezonesConfig) - self.vboxlayout.setObjectName("vboxlayout") - self.localTimeZone = QtGui.QCheckBox(timezonesConfig) - self.localTimeZone.setObjectName("localTimeZone") - self.vboxlayout.addWidget(self.localTimeZone) - self.timeZones = KTimeZoneWidget(timezonesConfig) - self.timeZones.setMinimumSize(QtCore.QSize(300, 150)) - self.timeZones.setObjectName("timeZones") - self.vboxlayout.addWidget(self.timeZones) - - self.retranslateUi(timezonesConfig) - QtCore.QObject.connect(self.localTimeZone, QtCore.SIGNAL("toggled(bool)"), self.timeZones.setDisabled) - QtCore.QMetaObject.connectSlotsByName(timezonesConfig) - - def retranslateUi(self, timezonesConfig): - self.localTimeZone.setText(kdecore.i18n("Use &local time zone")) - self.timeZones.headerItem().setText(0, kdecore.i18n("Area")) - self.timeZones.headerItem().setText(1, kdecore.i18n("Region")) - self.timeZones.headerItem().setText(2, kdecore.i18n("Comment")) - -from PyKDE4.kdeui import KTimeZoneWidget diff --git a/plasma/python/applets/pyclock/contents/ui/analog_clock_config.ui b/plasma/python/applets/pyclock/contents/ui/analog_clock_config.ui deleted file mode 100644 index 2d461bc..0000000 --- a/plasma/python/applets/pyclock/contents/ui/analog_clock_config.ui +++ /dev/null @@ -1,124 +0,0 @@ - - clockConfig - - - - 0 - 0 - 400 - 300 - - - - - 400 - 300 - - - - - - - - - Appearance - - - true - - - - - - - - Show the seconds - - - Check this if you want to show the seconds. - - - Show &seconds - - - - - - - Show the time in text - - - Check this if you want to show the time as a text within the clock. - - - Also show the time in text - - - - - - - - - - - - Timezones - - - true - - - - - - - - Use &local timezone - - - - - - - - 300 - 150 - - - - - Area - - - - - Region - - - - - Comment - - - - - - - - - - - - - - - - KTimeZoneWidget - QTreeWidget -
ktimezonewidget.h
-
-
- - -
diff --git a/plasma/python/applets/pyclock/contents/ui/calendar.ui b/plasma/python/applets/pyclock/contents/ui/calendar.ui deleted file mode 100644 index 8334e40..0000000 --- a/plasma/python/applets/pyclock/contents/ui/calendar.ui +++ /dev/null @@ -1,39 +0,0 @@ - - calendar - - - - 0 - 0 - 276 - 255 - - - - - - - - 0 - - - 0 - - - - - true - - - - - - - - KDatePicker - QFrame -
kdatepicker.h
-
-
- -
diff --git a/plasma/python/applets/pyclock/contents/ui/timezonesConfig.ui b/plasma/python/applets/pyclock/contents/ui/timezonesConfig.ui deleted file mode 100644 index 38e3f69..0000000 --- a/plasma/python/applets/pyclock/contents/ui/timezonesConfig.ui +++ /dev/null @@ -1,73 +0,0 @@ - - timezonesConfig - - - - 0 - 0 - 308 - 227 - - - - - - - Use &local time zone - - - - - - - - 300 - 150 - - - - - Area - - - - - Region - - - - - Comment - - - - - - - - - KTimeZoneWidget - QTreeWidget -
ktimezonewidget.h
-
-
- - - - localTimeZone - toggled(bool) - timeZones - setDisabled(bool) - - - 209 - 53 - - - 209 - 239 - - - - -
diff --git a/plasma/python/applets/pyclock/contents/ui/updateui.sh b/plasma/python/applets/pyclock/contents/ui/updateui.sh deleted file mode 100644 index 7c2f15b..0000000 --- a/plasma/python/applets/pyclock/contents/ui/updateui.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -pykdeuic4 analog_clock_config.ui > ../code/analog_clock_config_ui.py -pykdeuic4 calendar.ui > ../code/calendar_ui.py -pykdeuic4 timezonesConfig.ui > ../code/timezonesConfig_ui.py diff --git a/plasma/python/applets/pyclock/metadata.desktop b/plasma/python/applets/pyclock/metadata.desktop deleted file mode 100644 index aff62c2..0000000 --- a/plasma/python/applets/pyclock/metadata.desktop +++ /dev/null @@ -1,83 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Python Clock -Name[ar]=ساعة بايثون -Name[be@latin]=Hadzińnik dla „Python” -Name[bg]=Чсовник Python -Name[bn]=পাইথন ঘড়ি -Name[bn_IN]=Python-র ঘড়ি -Name[ca]=Rellotge en Python -Name[ca@valencia]=Rellotge en Python -Name[cs]=Hodiny v Pythonu -Name[csb]=Zédżer Pythona -Name[da]=Python-ur -Name[de]=Python-Uhr -Name[el]=Ρολόι Python -Name[en_GB]=Python Clock -Name[es]=Reloj de Python -Name[et]=Pythoni kell -Name[eu]=Python erlojua -Name[fi]=Python-kello -Name[fr]=Horloge Python -Name[fy]=Python klok -Name[ga]=Clog Python -Name[gl]=Reloxo en Python -Name[gu]=પાયથોન ઘડિયાળ -Name[he]=שעון של פייתון -Name[hi]=पायथन घड़ी -Name[hne]=पायथन घड़ी -Name[hr]=Python sat -Name[hu]=Python-óra -Name[id]=Jam Python -Name[is]=Python klukka -Name[it]=Orologio Python -Name[ja]=Python 時計 -Name[kk]=Python сағаты -Name[km]=នាឡិកា Python -Name[ko]=파이썬 시계 -Name[ku]=Demjimêra Python -Name[lt]=Python laikrodis -Name[lv]=Python pulkstenis -Name[ml]=പൈത്തണ്‍ ഘടികാരം -Name[mr]=Python Clock -Name[nb]=Pythonklokke -Name[nds]=Python-Klock -Name[nl]=Python-klok -Name[nn]=Python-klokke -Name[or]=ପାଇଥନ ଘଣ୍ଟା -Name[pa]=ਪਾਈਥਨ ਘੜੀ -Name[pl]=Zegar w Pythonie -Name[pt]=Relógio em Python -Name[pt_BR]=Relógio em Python -Name[ro]=Ceas Python -Name[ru]=Часы на языке Python -Name[si]=Python ඔරලෝසුව -Name[sk]=Python hodiny -Name[sl]=Python ura -Name[sr]=питонски сат -Name[sr@latin]=python sat -Name[sv]=Python klocka -Name[ta]=Python Clock -Name[tg]=Соати Python -Name[th]=นาฬิกาภาษาไพธอน -Name[tr]=Python Saati -Name[uk]=Годинник Python -Name[x-test]=xxPython Clockxx -Name[zh_CN]=Python 时钟 -Name[zh_TW]=Python 時鐘 -Type=Service -ServiceTypes=Plasma/Applet -Icon=chronometer -X-Plasma-API=python -X-Plasma-MainScript=code/main.py -X-Plasma-DefaultSize=125,125 - -X-KDE-PluginInfo-Author=Simon Edwards -X-KDE-PluginInfo-Email=simon@simonzone.com -X-KDE-PluginInfo-Name=plasma-pyclock -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/python/applets/pyhello/contents/code/main.py b/plasma/python/applets/pyhello/contents/code/main.py deleted file mode 100644 index c914a01..0000000 --- a/plasma/python/applets/pyhello/contents/code/main.py +++ /dev/null @@ -1,95 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2009 Petri Damstén -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Library General Public License as -# published by the Free Software Foundation; either version 2, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details -# -# You should have received a copy of the GNU Library General Public -# License along with this program; if not, write to the -# Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -import os, sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * -from PyQt4 import uic -from PyKDE4.plasma import Plasma -from PyKDE4.plasmascript import Applet -from PyKDE4.kdecore import * -from PyKDE4.kdeui import * - -class Hello(Applet): - def __init__(self, parent, args = None): - Applet.__init__(self, parent) - self.frame = None - - def init(self): - print '~~~ init' - self.setPopupIcon('text-x-python') - if not self.extender().hasItem('pyhello'): - self.extenderItem = Plasma.ExtenderItem(self.extender()) - self.initExtenderItem(self.extenderItem) - self.engine = self.dataEngine('pyhello') - self.engine.connectSource('hello_index', self, 500) - self.controller = self.engine.serviceForSource('hello_index') - - def initExtenderItem(self, item): - print '~~~ initExtenderItem' - self.layout = QGraphicsLinearLayout(Qt.Vertical) - - self.frame = Plasma.Frame(item) - f = self.frame.font() - f.setPointSizeF(36.0) - self.frame.setFont(f) - self.layout.addItem(self.frame) - - self.edit = Plasma.LineEdit(item) - self.edit.setText('10') - self.layout.addItem(self.edit) - - self.button = Plasma.PushButton(item) - self.button.setText('Change') - self.connect(self.button, SIGNAL('clicked()'), self.clicked) - self.layout.addItem(self.button) - - self.widget = QGraphicsWidget(item) - self.widget.setLayout(self.layout) - #self.widget.setMinimumSize(QSizeF(250, 45)); - #self.widget.setPreferredSize(QSizeF(250, 45)); - - item.setWidget(self.widget) - item.setName('pyhello') - item.setTitle(i18n('Python Hello')) - item.showCloseButton() - - def createConfigurationInterface(self, dlg): - print '~~~ createConfigurationInterface' - w = QWidget(dlg) - uic.loadUi(self.package().filePath('ui', 'config.ui'), w) - dlg.addPage(w, i18n('Python Hello'), 'text-x-python') - - def clicked(self): - print '~~~ clicked' - operation = self.controller.operationDescription('value') - operation.writeEntry('set', QVariant(int(self.edit.text()))) - self.controller.startOperationCall(operation) - - @pyqtSignature('dataUpdated(const QString&, const Plasma::DataEngine::Data&)') - def dataUpdated(self, sourceName, data): - print '~~~ dataUpdated', data[QString('index')] - if self.frame: - self.frame.setText(str(data[QString('index')])) - - -def CreateApplet(parent): - return Hello(parent) - diff --git a/plasma/python/applets/pyhello/contents/config/xmain.xml b/plasma/python/applets/pyhello/contents/config/xmain.xml deleted file mode 100644 index 7980d3d..0000000 --- a/plasma/python/applets/pyhello/contents/config/xmain.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - true - - - diff --git a/plasma/python/applets/pyhello/contents/ui/config.ui b/plasma/python/applets/pyhello/contents/ui/config.ui deleted file mode 100644 index db80431..0000000 --- a/plasma/python/applets/pyhello/contents/ui/config.ui +++ /dev/null @@ -1,38 +0,0 @@ - - - Config - - - - 0 - 0 - 376 - 76 - - - - - - - Test - - - - - - - Qt::Vertical - - - - 20 - 4 - - - - - - - - - diff --git a/plasma/python/applets/pyhello/metadata.desktop b/plasma/python/applets/pyhello/metadata.desktop deleted file mode 100644 index 7e26394..0000000 --- a/plasma/python/applets/pyhello/metadata.desktop +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Name=Python Hello -Comment=Python Applet Test -Type=Service -Icon=text-x-python - -X-KDE-ServiceTypes=Plasma/Applet -X-KDE-PluginInfo-Author=Petri Damstén -X-KDE-PluginInfo-Email=damu@iki.fi -X-KDE-PluginInfo-Name=pyhello -X-KDE-PluginInfo-Version=0.0 -X-KDE-PluginInfo-Website= -X-KDE-PluginInfo-Category=Test -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPLv2+ -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=python -X-Plasma-MainScript=code/main.py -X-Plasma-DefaultSize=200,150 diff --git a/plasma/python/dataengines/pyhello/contents/code/main.py b/plasma/python/dataengines/pyhello/contents/code/main.py deleted file mode 100644 index 9eadb01..0000000 --- a/plasma/python/dataengines/pyhello/contents/code/main.py +++ /dev/null @@ -1,110 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2009 Petri Damstén -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Library General Public License as -# published by the Free Software Foundation; either version 2, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details -# -# You should have received a copy of the GNU Library General Public -# License along with this program; if not, write to the -# Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -from PyQt4.QtCore import * -from PyKDE4.plasma import Plasma -from PyKDE4.plasmascript import DataEngine -from PyKDE4.kdecore import * - -class HelloJob(Plasma.ServiceJob): - def __init__(self, source, operation, parameters, parent = None): - print '######### HelloJob' - Plasma.ServiceJob.__init__(self, source.objectName(), operation, parameters, parent) - self.source = source - - def start(self): - print '######### HelloJob start', self.operationName(), self.parameters() - if self.operationName() == 'value': - if QString('set') in self.parameters(): - self.source.setData('index', self.parameters()[QString('set')].toInt()[0]) - self.setResult(True) - return - self.setResult(False) - - -class HelloService(Plasma.Service): - def __init__(self, parent): - print '####### HelloService' - Plasma.Service.__init__(self, parent) - self.setName('hello') - - def createJob(self, operation, parameters): - print '####### HelloService createJob' - return HelloJob(self.parent(), operation, parameters, self) - - def registerOperationsScheme(self): - print '####### HelloService registerOperationsScheme' - engine = self.parent().parent() - path = engine.package().filePath('data', 'hello.operations') - if path.isEmpty(): - print '####### Cannot find operations' - return - f = QFile(path) - self.setOperationsScheme(f) - - -class HelloSource(Plasma.DataContainer): - def __init__(self, parent): - print '##### HelloSource' - Plasma.DataContainer.__init__(self, parent) - self.setObjectName('hello_index') - self.setData('index', 0) - - def createService(self): - print '##### HelloSource createService' - return HelloService(self) - - -class Hello(DataEngine): - def __init__(self, parent, args = None): - DataEngine.__init__(self, parent) - - def init(self): - print '### init' - self.setMinimumPollingInterval(500) - self.source = HelloSource(self) - self.addSource(self.source) - - def updateSourceEvent(self, name): - print '### updateSourceEvent:', name - if name == 'hello': - self.setData(name, 'message', 'Hello World!') - return True - return False - - def sourceRequestEvent(self, name): - print '### sourceRequestedEvent:', name - return self.updateSourceEvent(name) - - def sources(self): - print '### sources' - return ['hello', 'hello_index'] - - def serviceForSource(self, source): - print '### serviceForSource:', source - container = self.containerForSource(source) - if container: - return container.createService() - else: - return DataEngine.serviceForSource(source) - - -def CreateDataEngine(parent): - return Hello(parent) diff --git a/plasma/python/dataengines/pyhello/contents/data/hello.operations b/plasma/python/dataengines/pyhello/contents/data/hello.operations deleted file mode 100644 index 1d3ebb3..0000000 --- a/plasma/python/dataengines/pyhello/contents/data/hello.operations +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/plasma/python/dataengines/pyhello/metadata.desktop b/plasma/python/dataengines/pyhello/metadata.desktop deleted file mode 100644 index ee8ba74..0000000 --- a/plasma/python/dataengines/pyhello/metadata.desktop +++ /dev/null @@ -1,20 +0,0 @@ -[Desktop Entry] -Name=Python Hello -Comment=Python DataEngine Test -Type=Service -Icon=text-x-python - -X-KDE-ServiceTypes=Plasma/DataEngine -X-KDE-PluginInfo-Author=Petri Damstén -X-KDE-PluginInfo-Email=damu@iki.fi -X-KDE-PluginInfo-Name=pyhello -X-KDE-PluginInfo-Version=0.0 -X-KDE-PluginInfo-Website= -X-KDE-PluginInfo-Category=Test -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPLv2+ -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=python -X-Plasma-MainScript=code/main.py - - diff --git a/plasma/python/dataengines/pytime/contents/code/main.py b/plasma/python/dataengines/pytime/contents/code/main.py deleted file mode 100644 index ede71fe..0000000 --- a/plasma/python/dataengines/pytime/contents/code/main.py +++ /dev/null @@ -1,67 +0,0 @@ -# -# Copyright 2007 Aaron Seigo -# Copyright 2008 Alex Merry -# Copyright 2008 Simon Edwards (Translated to Python) -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Library General Public License as -# published by the Free Software Foundation; either version 2, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details -# -# You should have received a copy of the GNU Library General Public -# License along with this program; if not, write to the -# Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -from PyQt4.QtCore import * -from PyKDE4.kdecore import * -from PyKDE4 import plasmascript - -class PyTimeEngine(plasmascript.DataEngine): - def __init__(self,parent,args=None): - plasmascript.DataEngine.__init__(self,parent) - - def init(self): - self.setMinimumPollingInterval(333) - - def sources(self): - sources = ["Local"] - sources.extend(KSystemTimeZones.zones().keys()) - return sources - - def sourceRequestEvent(self, name): - return self.updateSourceEvent(name) - - def updateSourceEvent(self, tz): - localName = "Local" - if tz == localName: - self.setData(localName, "Time", QVariant(QTime.currentTime())) - self.setData(localName, "Date", QVariant(QDate.currentDate())) - # this is relatively cheap - KSTZ::local() is cached - timezone = KSystemTimeZones.local().name() - else: - newTz = KSystemTimeZones.zone(tz) - if not newTz.isValid(): - return False - dt = KDateTime.currentDateTime(KDateTime.Spec(newTz)) - self.setData(tz, "Time", QVariant(dt.time())) - self.setData(tz, "Date", QVariant(dt.date())) - timezone = tz - - trTimezone = timezone - self.setData(tz, "Timezone", QVariant(trTimezone)); - tzParts = str(trTimezone).split("/") - if len(tzParts)>=2: - self.setData(tz, "Timezone Continent", QVariant(tzParts[0])) - self.setData(tz, "Timezone City", QVariant(tzParts[1])) - - return True - -def CreateDataEngine(parent): - return PyTimeEngine(parent) diff --git a/plasma/python/dataengines/pytime/metadata.desktop b/plasma/python/dataengines/pytime/metadata.desktop deleted file mode 100644 index ffa751f..0000000 --- a/plasma/python/dataengines/pytime/metadata.desktop +++ /dev/null @@ -1,145 +0,0 @@ -[Desktop Entry] -Name=Python Date and Time -Name[ar]=التاريخ و الوقت بالبايثون -Name[be@latin]=Data j čas dla „Python” -Name[bg]=Дата и час (Python) -Name[bn]=পাইথন তারিখ এবং সময় -Name[bn_IN]=Python তারিখ ও সময় -Name[ca]=Dia i hora en Python -Name[ca@valencia]=Dia i hora en Python -Name[cs]=Datum a čas v Pythonu -Name[csb]=Datum ë czas Pythona -Name[da]=Python dato og tid -Name[de]=Python - Datum und Zeit -Name[el]=Ημερομηνία και ώρα Python -Name[en_GB]=Python Date and Time -Name[es]=Fecha y hora de Python -Name[et]=Pythoni kuupäev ja kellaaeg -Name[eu]=Python data eta ordua -Name[fi]=Päivämäärä ja aika Pythonilla -Name[fr]=Date et heure Python -Name[fy]=Python Datum en tiid -Name[ga]=Dáta agus Am Python -Name[gl]=Data e hora en Python -Name[gu]=પાયથોન તારીખ અને સમય -Name[he]=תאריך ושעה של פייתון -Name[hi]=पायथन तारीख़ और समय -Name[hne]=पायथन तारीक अउ समय -Name[hr]=Python Datum i vrijeme -Name[hu]=Python-alapú dátum és idő -Name[id]=Tanggal dan Waktu Python -Name[is]=Python dagssetning og tími -Name[it]=Data e ora Python -Name[ja]=Python 日付と時間 -Name[kk]=Python күні мен уақыты -Name[km]=ពេលវេលា និង​កាលបរិច្ឆេទ​ Python -Name[ko]=파이썬 날짜와 시간 -Name[ku]=Python Dîrok û Dem -Name[lt]=Python data ir laikas -Name[lv]=Python datums un laiks -Name[ml]=പൈത്തണ്‍ തീയതിയും സമയവും -Name[mr]=Plasma दिनांक आणि वेळ -Name[nb]=Python dato og klokkeslett -Name[nds]=Python-Datum un -Tiet -Name[nl]=Python Datum en Tijd -Name[nn]=Dato og klokkeslett for Python -Name[or]=ପାଇଥନ ତାରିଖ ଏବଂ ସମୟ -Name[pa]=ਪਾਈਥਨ ਮਿਤੀ ਅਤੇ ਟਾਈਮ -Name[pl]=Data i czas w Pythonie -Name[pt]=Data e Hora em Python -Name[pt_BR]=Data e hora em Python -Name[ro]=Data și ora Python -Name[ru]=Дата и время на языке Python -Name[si]=Python දිනය සහ වේලාව -Name[sk]=Python dátum a čas -Name[sl]=Python datum in čas -Name[sr]=питонски датум и време -Name[sr@latin]=python datum i vreme -Name[sv]=Python datum och tid -Name[ta]=Python Date and Time -Name[tg]=Сана ва вақти Python -Name[th]=วันและเวลาภาษาไพธอน -Name[tr]=Python Tarih ve Saat -Name[uk]=Дата і час Python -Name[x-test]=xxPython Date and Timexx -Name[zh_CN]=Python 日期和时间 -Name[zh_TW]=Python 日期與時間 -Comment=Python Time data for Plasmoids -Comment[ar]=بلازمويدات الوقت والتاريخ بالبايثون -Comment[be@latin]=Źviestki pra čas dla widžetaŭ „Python” -Comment[bg]=Време за Python (Plasmoids) -Comment[bn_IN]=Plasmoids-র জন্য Python-র সময়ের তথ্য -Comment[ca]=Dades d'hora en Python pels Plasmoides -Comment[ca@valencia]=Dades d'hora en Python pels Plasmoides -Comment[cs]=Časová data v Pythonu pro plasmoidy -Comment[csb]=Czasu ë datuma dlô plazmoidów - Pythona -Comment[da]=Python tiddata til plasmoids -Comment[de]=Python - Zeitdaten für Plasma-Miniprogramme -Comment[el]=Δεδομένα χρόνου για πλασμοειδή Python -Comment[en_GB]=Python Time data for Plasmoids -Comment[es]=Datos horarios de Python para los plasmoides -Comment[et]=Pythoni ajaandmed plasmoididele -Comment[eu]=Python ordu datuak Plasmoidentzako -Comment[fi]=Python-aikatietoa Plasmoideille -Comment[fr]=Données temporelles Python pour les plasmoïdes -Comment[fy]=Python Tiid gegevens foar Plasmoids -Comment[ga]=Sonraí ama Python le haghaidh Plasmóidí -Comment[gl]=Datos de tempo para os Plasmoides en Python -Comment[gu]=પ્લાઝમોઇડ માટે પાયથોન સમય માહિતી -Comment[he]=נתוני זמן עבור פלסמואידים של של פייתון -Comment[hi]=प्लाज़्माइड्स के लिए पायथन टाइम डाटा -Comment[hne]=प्लाज्माइड्स बर पायथन समय डाटा -Comment[hr]=Python podaci o vremenu za plasmoide -Comment[hu]=Időadatok plazmoidokhoz Python nyelven -Comment[id]=Data Waktu Python untuk Plasmoid -Comment[is]=Python tímaupplýsingar fyrir Plasmadót -Comment[it]=Dati temporali di Python per i plasmoidi -Comment[ja]=プラズモイドのための Python の時間データ -Comment[kk]=Плазмоидтерге Python уақыт деректері -Comment[km]=ទិន្នន័យ​ពេលវេលា Python សម្រាប់ Plasmoids -Comment[ko]=Plasmoid를 위한 파이썬 시간 데이터 -Comment[ku]=Python dane yên Demê ji bo Plasmoidan -Comment[lt]=Plazmoidams skirti laiko duomenys iš Python -Comment[lv]=Python laika dati Plazmoīdiem -Comment[ml]=പ്ലാസ്മോയിഡ്സിനുള്ള പൈത്തണ്‍ സമയത്തിന്റെ ഡാറ്റ -Comment[mr]=Plasmoids करीता Python वेळ माहिती -Comment[nb]=Python tidsdata for Plasmoider -Comment[nds]=Python-Tietdaten för Plasma-Lüttprogrammen -Comment[nl]=Python-tijdgegevens voor Plasmoids -Comment[nn]=Python-tidsdata for plasmoidar -Comment[or]=ପ୍ଲାଜମଏଡ଼ ପାଇଁ ପାଇଥନ ସମୟ ତଥ୍ୟ -Comment[pa]=ਪਲਾਜਮੋਡੀਸ ਲਈ ਪਾਈਥਨ ਟਾਈਮ ਡਾਟਾ -Comment[pl]=Dane o czasie dla plazmoidów w Pythonie -Comment[pt]=Dados de data/hora para os Plasmóides em Python -Comment[pt_BR]=Dados de hora para os Plasmoids em Python -Comment[ro]=Date Python despre oră pentru plasmoizi -Comment[ru]=Данные о времени на языке Python для виджетов -Comment[si]=Python Time data for Plasmoids -Comment[sk]=Python údaje o čase pre plazmoidy -Comment[sl]=Pythonovi podatki o času za gradnike -Comment[sr]=Питонови подаци о времену за плазмоиде -Comment[sr@latin]=Pythonovi podaci o vremenu za plazmoide -Comment[sv]=Python tiddata för Plasmoider -Comment[ta]=Python Time data for Plasmoids -Comment[tg]=Ахбороти нашрро дар файл гузоред -Comment[th]=ข้อมูลเวลาสำหรับพลาสมอยด์โดยใช้ภาษาไพธอน -Comment[tr]=Plasma programcıkları için Python zaman verileri -Comment[uk]=Дані часу для Плазмоїдів Python -Comment[x-test]=xxPython Time data for Plasmoidsxx -Comment[zh_CN]=Plasma 的 Python 时间数据 -Comment[zh_TW]=Plasmoids 的 Python 時間資料 -Type=Service -Icon=preferences-system-time -ServiceTypes=Plasma/DataEngine -X-Plasma-API=python -X-Plasma-MainScript=code/main.py - -X-KDE-PluginInfo-Author=Simon Edwards -X-KDE-PluginInfo-Email=simon@simonzone.com -X-KDE-PluginInfo-Name=plasma-dataengine-pytime -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Python Date and Time -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=LGPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/python/runners/pyhello/contents/code/main.py b/plasma/python/runners/pyhello/contents/code/main.py deleted file mode 100644 index 7dbff49..0000000 --- a/plasma/python/runners/pyhello/contents/code/main.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2009 Petri Damstén -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Library General Public License as -# published by the Free Software Foundation; either version 2, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details -# -# You should have received a copy of the GNU Library General Public -# License along with this program; if not, write to the -# Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -from PyQt4.QtCore import * -from PyQt4 import uic -from PyKDE4.kdecore import * -from PyKDE4.kdeui import * -from PyKDE4.plasma import * -from PyKDE4.plasmascript import Runner - -class Hello(Runner): - def __init__(self, parent, args = None): - Runner.__init__(self, parent) - self.actions = [] - - def init(self): - print '### init' - self.reloadConfiguration() - ign = Plasma.RunnerContext.Types(Plasma.RunnerContext.Directory | - Plasma.RunnerContext.File | \ - Plasma.RunnerContext.NetworkLocation) - self.setIgnoredTypes(ign) - description = i18n("Python Test Runner. Responds Hello World! to hello (= :q:)"); - self.addSyntax(Plasma.RunnerSyntax(":q:", description)) - self.setSpeed(Plasma.AbstractRunner.NormalSpeed) - self.setPriority(Plasma.AbstractRunner.LowestPriority) - self.setHasRunOptions(True) - - def match(self, search): - print '### match:', - term = search.query() - print term - if term.toLower() == 'hello': - match = Plasma.QueryMatch(self.runner) - match.setType(Plasma.QueryMatch.ExactMatch) - match.setIcon(KIcon('text-x-python')) - match.setText(i18n('Hello World!')) - match.setData(self.url) - search.addMatch(term, match) - - def run(self, search, action): - print '### run:', - data = action.data().toString() - print data - KToolInvocation.invokeBrowser(data) - - def prepare(self): - print '### prepare', - lock = QMutexLocker(self.bigLock()) - print 'in BIG lock' - - def teardown(self): - print '### teardown' - - def createRunOptions(self, parent): - print '### createRunOptions', parent - uic.loadUi(self.package().filePath('ui', 'config.ui'), parent) - - def reloadConfiguration(self): - print '### reloadConfiguration: ', - self.url = unicode(self.config().readEntry('url', 'http://www.kde.org').toString()) - print self.url - - -def CreateRunner(parent): - return Hello(parent) - diff --git a/plasma/python/runners/pyhello/contents/ui/config.ui b/plasma/python/runners/pyhello/contents/ui/config.ui deleted file mode 100644 index db80431..0000000 --- a/plasma/python/runners/pyhello/contents/ui/config.ui +++ /dev/null @@ -1,38 +0,0 @@ - - - Config - - - - 0 - 0 - 376 - 76 - - - - - - - Test - - - - - - - Qt::Vertical - - - - 20 - 4 - - - - - - - - - diff --git a/plasma/python/runners/pyhello/metadata.desktop b/plasma/python/runners/pyhello/metadata.desktop deleted file mode 100644 index 94e5d07..0000000 --- a/plasma/python/runners/pyhello/metadata.desktop +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Name=Python Hello -Comment=Python Runner Test -Type=Service -Icon=text-x-python - -X-KDE-ServiceTypes=Plasma/Runner -X-KDE-PluginInfo-Author=Petri Damstén -X-KDE-PluginInfo-Email=damu@iki.fi -X-KDE-PluginInfo-Name=pyhello -X-KDE-PluginInfo-Version=0.0 -X-KDE-PluginInfo-Website= -X-KDE-PluginInfo-Category=Test -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPLv2+ -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=python -X-Plasma-MainScript=code/main.py - diff --git a/plasma/python/wallpapers/pyhello/contents/code/main.py b/plasma/python/wallpapers/pyhello/contents/code/main.py deleted file mode 100644 index 09dad9d..0000000 --- a/plasma/python/wallpapers/pyhello/contents/code/main.py +++ /dev/null @@ -1,122 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (c) 2009 by Petri Damstén -# Copyright (c) 2007 by Paolo Capriotti -# Copyright (c) 2007 by Aaron Seigo -# Copyright (c) 2008 by Alexis Ménard -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Library General Public License as -# published by the Free Software Foundation; either version 2, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details -# -# You should have received a copy of the GNU Library General Public -# License along with this program; if not, write to the -# Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -# Some parts of the code are converted to python from C++ Image wallpaper plugin (GPLv2+) - -import os, sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * -from PyQt4.phonon import * -from PyQt4 import uic -from PyKDE4.plasma import Plasma -from PyKDE4.plasmascript import Wallpaper -from PyKDE4.kdecore import * -from PyKDE4.kdeui import * - -class Test(Wallpaper): - def __init__(self, parent, args = None): - Wallpaper.__init__(self, parent) - self.pixmap = None - - def init(self, config): - print '### init', - self.method = Plasma.Wallpaper.ResizeMethod(config.readEntry('method', \ - Plasma.Wallpaper.ScaledResize).toInt()[0]) - self.color = QColor(config.readEntry("wallpapercolor", QColor(56, 111, 150))) - self.size = self.boundingRect().size().toSize() - self.image = self.package().filePath('images', 'wallpaper.png') - print self.size, self.image - self.render(self.image, self.size, self.method, self.color) - self.test = QAction(i18n('Test'), self) - self.setContextualActions([self.test]) - self.connect(self.test, SIGNAL('triggered(bool)'), self.play) - - def paint(self, painter, exposedRect): - print '### paint' - painter.fillRect(exposedRect, self.color) - - if self.pixmap: - if painter.worldMatrix() == QMatrix(): - # draw the background untransformed when possible; (saves lots of per-pixel-math) - painter.resetTransform() - - # blit the background (saves all the per-pixel-products that blending does) - painter.setCompositionMode(QPainter.CompositionMode_Source) - - # for pixmaps we draw only the exposed part (untransformed since the - # bitmapBackground already has the size of the viewport) - painter.drawPixmap(exposedRect, self.pixmap, - exposedRect.translated(-self.boundingRect().topLeft())) - - def createConfigurationInterface(self, parent): - print '### createConfigurationInterface ' - self.currentColor = self.color - widget = QWidget(parent) - ui = uic.loadUi(self.package().filePath('ui', 'config.ui'), widget) - ui.resizeCombo.setCurrentIndex(self.method) - self.connect(ui.resizeCombo, SIGNAL('currentIndexChanged(int)'), self.resizeChanged) - return widget - - def resizeChanged(self, index): - print '### resizeChanged' - self.method = index - self.settingsChanged(True) - self.render(self.image, self.size, self.method, self.color) - - def save(self, config): - print '### save' - config.writeEntry('method', self.method) - - def mouseMoveEvent(self, event): - print '### mouseMoveEvent', event.scenePos() - - def mousePressEvent(self, event): - print '### mousePressEvent', event.scenePos() - - def mouseReleaseEvent(self, event): - print '### mouseReleaseEvent', event.scenePos() - - def wheelEvent(self, event): - print '### wheelEvent', event.scenePos() - - def renderCompleted(self, image): - print '### renderCompleted', image.size() - self.pixmap = QPixmap(image) - self.update(self.boundingRect()) - - def urlDropped(self, url): - print '### urlDropped', url - - def play(self): - print '### play' - media = Phonon.MediaObject(self) - output = Phonon.AudioOutput(self); - Phonon.createPath(media, output) - media.setCurrentSource(Phonon.MediaSource(\ - KStandardDirs.locate('sound', 'KDE-Sys-Log-In.ogg'))) - media.play() - - -def CreateWallpaper(parent): - return Test(parent) - diff --git a/plasma/python/wallpapers/pyhello/contents/images/wallpaper.png b/plasma/python/wallpapers/pyhello/contents/images/wallpaper.png deleted file mode 100644 index 2e3a6db..0000000 Binary files a/plasma/python/wallpapers/pyhello/contents/images/wallpaper.png and /dev/null differ diff --git a/plasma/python/wallpapers/pyhello/contents/ui/config.ui b/plasma/python/wallpapers/pyhello/contents/ui/config.ui deleted file mode 100644 index ba1e9c6..0000000 --- a/plasma/python/wallpapers/pyhello/contents/ui/config.ui +++ /dev/null @@ -1,91 +0,0 @@ - - - Config - - - - 0 - 0 - 305 - 51 - - - - Color - - - - - - - 125 - 0 - - - - Resize Method: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - Scaled - - - - - Centered - - - - - Scaled and Cropped - - - - - Tiled - - - - - Center Tiled - - - - - Maxpect - - - - - - - - Qt::Vertical - - - - 20 - 10 - - - - - - - - - KComboBox - QComboBox -
kcombobox.h
-
-
- - -
diff --git a/plasma/python/wallpapers/pyhello/metadata.desktop b/plasma/python/wallpapers/pyhello/metadata.desktop deleted file mode 100644 index b0972f3..0000000 --- a/plasma/python/wallpapers/pyhello/metadata.desktop +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Name=Python Hello -Comment=Python Wallpaper Test -Type=Service -Icon=text-x-python - -X-KDE-ServiceTypes=Plasma/Wallpaper -X-KDE-PluginInfo-Author=Petri Damstén -X-KDE-PluginInfo-Email=damu@iki.fi -X-KDE-PluginInfo-Name=pyhello -X-KDE-PluginInfo-Version=0.0 -X-KDE-PluginInfo-Website= -X-KDE-PluginInfo-Category=Test -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPLv2+ -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=python -X-Plasma-MainScript=code/main.py - diff --git a/plasma/ruby/CMakeLists.txt b/plasma/ruby/CMakeLists.txt deleted file mode 100644 index c6572b3..0000000 --- a/plasma/ruby/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(applets) -# add_subdirectory(dataengines) - diff --git a/plasma/ruby/applets/CMakeLists.txt b/plasma/ruby/applets/CMakeLists.txt deleted file mode 100644 index b6b8c38..0000000 --- a/plasma/ruby/applets/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# clock -install(DIRECTORY clock/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/ruby-clock) -install(FILES clock/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME ruby-clock-example.desktop) -# ruby-extender-tutorial -install(DIRECTORY ruby-extender-tutorial/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/ruby-extender-tutorial) -install(FILES ruby-extender-tutorial/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME ruby-extender-tutorial-example.desktop) -# ruby_tiger -install(DIRECTORY ruby_tiger/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/ruby-tiger) -install(FILES ruby_tiger/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME ruby-tiger-example.desktop) -# webapplet -install(DIRECTORY webapplet/ DESTINATION ${DATA_INSTALL_DIR}/plasma/plasmoids/ruby-webapplet) -install(FILES webapplet/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME ruby-webapplet-example.desktop) diff --git a/plasma/ruby/applets/clock/contents/code/analog_clock_config.rb b/plasma/ruby/applets/clock/contents/code/analog_clock_config.rb deleted file mode 100644 index c062f5a..0000000 --- a/plasma/ruby/applets/clock/contents/code/analog_clock_config.rb +++ /dev/null @@ -1,67 +0,0 @@ -=begin -** Form generated from reading ui file 'clockConfig.ui' -** -** Created: Wed Aug 6 19:25:39 2008 -** by: Qt User Interface Compiler version 4.4.1 -** -** WARNING! All changes made in this file will be lost when recompiling ui file! -=end - -class Ui_AnalogClockConfig - attr_reader :verticalLayout - attr_reader :showSecondHandCheckBox - attr_reader :showTimeStringCheckBox - attr_reader :verticalSpacer - - def setupUi(clockConfig) - if clockConfig.objectName.nil? - clockConfig.objectName = "clockConfig" - end - clockConfig.resize(449, 300) - clockConfig.minimumSize = Qt::Size.new(400, 300) - @verticalLayout = Qt::VBoxLayout.new(clockConfig) - @verticalLayout.objectName = "verticalLayout" - @showSecondHandCheckBox = Qt::CheckBox.new(clockConfig) - @showSecondHandCheckBox.objectName = "showSecondHandCheckBox" - - @verticalLayout.addWidget(@showSecondHandCheckBox) - - @showTimeStringCheckBox = Qt::CheckBox.new(clockConfig) - @showTimeStringCheckBox.objectName = "showTimeStringCheckBox" - - @verticalLayout.addWidget(@showTimeStringCheckBox) - - @verticalSpacer = Qt::SpacerItem.new(20, 235, Qt::SizePolicy::Minimum, Qt::SizePolicy::Minimum) - - @verticalLayout.addItem(@verticalSpacer) - - - retranslateUi(clockConfig) - - Qt::MetaObject.connectSlotsByName(clockConfig) - end # setupUi - - def setup_ui(clockConfig) - setupUi(clockConfig) - end - - def retranslateUi(clockConfig) - @showSecondHandCheckBox.toolTip = Qt::Application.translate("AnalogClockConfig", "Show the seconds", nil, Qt::Application::UnicodeUTF8) - @showSecondHandCheckBox.whatsThis = Qt::Application.translate("AnalogClockConfig", "Check this if you want to show the seconds.", nil, Qt::Application::UnicodeUTF8) - @showSecondHandCheckBox.text = Qt::Application.translate("AnalogClockConfig", "Show &seconds", nil, Qt::Application::UnicodeUTF8) - @showTimeStringCheckBox.toolTip = Qt::Application.translate("AnalogClockConfig", "Show the time in text", nil, Qt::Application::UnicodeUTF8) - @showTimeStringCheckBox.whatsThis = Qt::Application.translate("AnalogClockConfig", "Check this if you want to display the time as text within the clock.", nil, Qt::Application::UnicodeUTF8) - @showTimeStringCheckBox.text = Qt::Application.translate("AnalogClockConfig", "Also show the time as text", nil, Qt::Application::UnicodeUTF8) - end # retranslateUi - - def retranslate_ui(clockConfig) - retranslateUi(clockConfig) - end - -end - -module Ui - class AnalogClockConfig < Ui_AnalogClockConfig - end -end # module Ui - diff --git a/plasma/ruby/applets/clock/contents/code/calendar.rb b/plasma/ruby/applets/clock/contents/code/calendar.rb deleted file mode 100644 index 018206e..0000000 --- a/plasma/ruby/applets/clock/contents/code/calendar.rb +++ /dev/null @@ -1,53 +0,0 @@ -=begin -** Form generated from reading ui file 'calendar.ui' -** -** Created: Wed Aug 6 19:25:39 2008 -** by: Qt User Interface Compiler version 4.4.1 -** -** WARNING! All changes made in this file will be lost when recompiling ui file! -=end - -class Ui_Calendar - attr_reader :vboxLayout - attr_reader :kdatepicker - - def setupUi(calendar) - if calendar.objectName.nil? - calendar.objectName = "calendar" - end - calendar.resize(276, 255) - calendar.styleSheet = "" - @vboxLayout = Qt::VBoxLayout.new(calendar) - @vboxLayout.spacing = 0 - @vboxLayout.margin = 0 - @vboxLayout.objectName = "vboxLayout" - @kdatepicker = KDE::DatePicker.new(calendar) - @kdatepicker.objectName = "kdatepicker" - @kdatepicker.autoFillBackground = true - - @vboxLayout.addWidget(@kdatepicker) - - - retranslateUi(calendar) - - Qt::MetaObject.connectSlotsByName(calendar) - end # setupUi - - def setup_ui(calendar) - setupUi(calendar) - end - - def retranslateUi(calendar) - end # retranslateUi - - def retranslate_ui(calendar) - retranslateUi(calendar) - end - -end - -module Ui - class Calendar < Ui_Calendar - end -end # module Ui - diff --git a/plasma/ruby/applets/clock/contents/code/clockapplet.rb b/plasma/ruby/applets/clock/contents/code/clockapplet.rb deleted file mode 100644 index c650201..0000000 --- a/plasma/ruby/applets/clock/contents/code/clockapplet.rb +++ /dev/null @@ -1,136 +0,0 @@ -=begin -/*************************************************************************** - * Copyright (C) 2007-2008 by Riccardo Iaconelli * - * Copyright (C) 2007-2008 by Sebastian Kuegler * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ -=end - -class ClockApplet < PlasmaScripting::Applet - attr_accessor :currentTimezone - - slots :configAccepted, - 'showCalendar(QGraphicsSceneMouseEvent *)', - 'currentTimezone=(QString)' - - def initialize(parent, args) - super(parent, args) - @calendar = nil - @currentTimezone = "Local" - - @calendarUi = Ui::Calendar.new - @timezonesUi = Ui::TimezonesConfig.new - @clicked = Qt::Point.new - @timeZones = [] - end - - def updateToolTipContent() - end - - def createConfigurationInterface(parent) - createClockConfigurationInterface(parent) - - widget = Qt::Widget.new - @timezonesUi.setupUi(widget) - - parent.addPage(widget, KDE.i18n("Time Zones"), icon()) - - @timezonesUi.localTimeZone.checked = localTimezone? - @timezonesUi.timeZones.setSelected(@currentTimezone, true) - @timezonesUi.timeZones.enabled = !localTimezone? - - parent.buttons = KDE::Dialog::Ok | KDE::Dialog::Cancel | KDE::Dialog::Apply - connect(parent, SIGNAL(:applyClicked), self, SLOT(:configAccepted)) - connect(parent, SIGNAL(:okClicked), self, SLOT(:configAccepted)) - end - - def createClockConfigurationInterface(parent) - end - - def clockConfigAccepted() - end - - def configAccepted() - cg = config() - - @timeZones = @timezonesUi.timeZones.selection() - cg.writeEntry("timeZones", @timeZones) - - newTimezone = localTimezone() - - if !@timezonesUi.localTimeZone.checked? && !@timeZones.empty? - newTimezone = @timeZones[0] - end - - changeEngineTimezone(@currentTimezone, newTimezone) - - @currentTimezone = newTimezone - cg.writeEntry("currentTimezone", newTimezone) - - clockConfigAccepted() - - constraintsEvent(Plasma::SizeConstraint) - update() - emit configNeedsSaving - end - - def changeEngineTimezone(oldTimezone, newTimezone) - end - - def mousePressEvent(event) - if event.buttons == Qt::LeftButton - @clicked = scenePos.toPoint - event.accepted = true - return - end - - super(event) - end - - def mouseReleaseEvent(event) - if (@clicked - scenePos.toPoint).manhattanLength < - KDE::GlobalSettings.dndEventDelay() - showCalendar(event) - end - end - - def showCalendar(event) - if @calendar == 0 - @calendar = Plasma::Dialog.new - @calendarUi.setupUi(@calendar) - @calendar.setWindowFlags(Qt::Popup) - @calendar.adjustSize - end - - if @calendar.visible? - @calendar.hide - else - data = dataEngine("time").query(@currentTimezone) - @calendarUi.kdatepicker.date = data["Date"].toDate - @calendar.move(popupPosition(@calendar.sizeHint)) - @calendar.show - end - end - - def localTimezone? - return @currentTimezone == localTimezone() - end - - def localTimezone() - return "Local" - end -end diff --git a/plasma/ruby/applets/clock/contents/code/main.rb b/plasma/ruby/applets/clock/contents/code/main.rb deleted file mode 100644 index 83117c1..0000000 --- a/plasma/ruby/applets/clock/contents/code/main.rb +++ /dev/null @@ -1,274 +0,0 @@ -=begin -/*************************************************************************** - * Copyright (C) 2005,2006,2007 by Siraj Razick * - * siraj@kdemail.net * - * * - * Translated to Ruby by Richard Dale * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with self program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ -=end - -require 'analog_clock_config' -require 'timezones_config' -require 'calendar' -require 'clockapplet' - -module RubyClock - -class Main < ClockApplet - - slots :moveSecondHand, :configAccepted, - 'dataUpdated(QString, Plasma::DataEngine::Data)' - - def initialize(parent, args = nil) - super - KDE::Global.locale.insertCatalog("libplasmaclock") - - setHasConfigurationInterface(true) - setAspectRatioMode(Plasma::Square) - - @theme = Plasma::Svg.new(self) - @theme.imagePath = "widgets/clock" - @theme.containsMultipleImages = false - @theme.resize(size()) - - @timezone = "" - @showTimeString = false - @showSecondHand = false - @ui = Ui::AnalogClockConfig.new - @calendarUi = Ui::Calendar.new - - @lastTimeSeen = Qt::Time.new - @calendar = 0 - @time = Qt::Time.new - end - - def init - cg = config() - @showTimeString = cg.readEntry("showTimeString", false) - @showSecondHand = cg.readEntry("showSecondHand", false) - @fancyHands = cg.readEntry("fancyHands", false) - self.currentTimezone = cg.readEntry("timezone", localTimezone()) - - connectToEngine() - end - - def connectToEngine - # Use 'dataEngine("ruby-time")' for the ruby version of the engine - timeEngine = dataEngine("time") - if @showSecondHand - timeEngine.connectSource(currentTimezone(), self, 500) - else - timeEngine.connectSource(currentTimezone(), self, 6000, Plasma::AlignToMinute) - end - end - - def constraintsEvent(constraints) - if constraints.to_i & Plasma::FormFactorConstraint.to_i - setBackgroundHints(NoBackground) - end - - if constraints.to_i & Plasma::SizeConstraint.to_i - @theme.resize(size()) - end - end - - def shape - if @theme.hasElement("hint-square-clock") - return super - end - - path = Qt::PainterPath.new - path.addEllipse(boundingRect().adjusted(-2, -2, 2, 2)) - return path - end - - def dataUpdated(source, data) - @time = data["Time"].toTime() - if @time.minute == @lastTimeSeen.minute && - @time.second == @lastTimeSeen.second - # avoid unnecessary repaints - return - end - - if @secondHandUpdateTimer - @secondHandUpdateTimer.stop - end - - @lastTimeSeen = @time - update() - end - - def createClockConfigurationInterface(parent) - # TODO: Make the size settable - widget = Qt::Widget.new - @ui.setupUi(widget) - parent.addPage(widget, KDE.i18n("General"), icon) - - @ui.showTimeStringCheckBox.checked = @showTimeString - @ui.showSecondHandCheckBox.checked = @showSecondHand - end - - def clockConfigAccepted() - cg = config() - @showTimeString = @ui.showTimeStringCheckBox.checked? - @showSecondHand = @ui.showSecondHandCheckBox.checked? - - cg.writeEntry("showTimeString", @showTimeString) - cg.writeEntry("showSecondHand", @showSecondHand) - update() - - dataEngine("time").disconnectSource(currentTimezone(), self) - connectToEngine - - constraintsEvent(Plasma::AllConstraints) - emit configNeedsSaving - end - - def changeEngineTimezone(oldTimezone, newTimezone) - dataEngine("time").disconnectSource(oldTimezone, self) - timeEngine = dataEngine("time") - if @showSecondHand - timeEngine.connectSource(newTimezone, self, 500) - else - timeEngine.connectSource(newTimezone, self, 6000, Plasma::AlignToMinute) - end - end - - def moveSecondHand - update - end - - def drawHand(p, rotation, handName) - p.save - boundSize = boundingRect.size - elementRect = @theme.elementRect(handName) - - p.translate(boundSize.width() / 2, boundSize.height() / 2) - p.rotate(rotation) - p.translate(-elementRect.width / 2, -(@theme.elementRect("clockFace").center.y - elementRect.top)) - @theme.paint(p, Qt::RectF.new(Qt::PointF.new(0.0, 0.0), elementRect.size), handName) - - p.restore - end - - def paintInterface(p, option, rect) - tempRect = Qt::RectF.new(0, 0, 0, 0) - - boundSize = geometry.size - - p.renderHint = Qt::Painter::SmoothPixmapTransform - - minutes = 6.0 * @time.minute - 180 - hours = 30.0 * @time.hour - 180 + ((@time.minute / 59.0) * 30.0) - - @theme.paint(p, Qt::RectF.new(rect), "ClockFace") - - if @showTimeString - fm = Qt::FontMetrics.new(Qt::Application.font) - margin = 4 - if @showSecondHand - # FIXME: temporary time output - time = @time.toString - else - time = @time.toString("hh:mm") - end - - textRect = Qt::Rect.new((rect.width/2 - fm.width(time) / 2),((rect.height / 2) - fm.xHeight * 4), - fm.width(time), fm.xHeight()) - - p.pen = Qt::NoPen - background = Plasma::Theme.defaultTheme.color(Plasma::Theme::BackgroundColor) - background.setAlphaF(0.5) - p.brush = Qt::Brush.new(background) - - p.setRenderHint(Qt::Painter::Antialiasing, true) - p.drawPath(Plasma::PaintUtils.roundedRectangle(Qt::RectF.new(textRect.adjusted(-margin, -margin, margin, margin)), margin)) - p.setRenderHint(Qt::Painter::Antialiasing, false) - - p.pen = Plasma::Theme::defaultTheme.color(Plasma::Theme::TextColor) - - p.drawText(textRect.bottomLeft, time) - end - - # Make sure we paint the second hand on top of the others - if @showSecondHand - anglePerSec = 6.0 - seconds = anglePerSec * @time.second() - 180 - - if @fancyHands - if @secondHandUpdateTimer.nil? - @secondHandUpdateTimer = Qt::Timer.new(self) - connect(@secondHandUpdateTimer, SIGNAL(:timeout), self, SLOT(:moveSecondHand)) - end - - if !@secondHandUpdateTimer.active? - @secondHandUpdateTimer.start(50) - @animationStart = Qt::Time.currentTime.msec - else - runTime = 500 - m = 1.0 # Mass - b = 1.0 # Drag coefficient - k = 1.5 # Spring constant - gamma = b / (2 * m) # Dampening constant - omega0 = Math.sqrt(k / m) - omega1 = Math.sqrt(omega0 * omega0 - gamma * gamma) - elapsed = Qt::Time.currentTime().msec() - @animationStart - t = (4 * Math::PI) * (elapsed / runTime) - val = 1 + exp(-gamma * t) * -Math.cos(omega1 * t) - - if elapsed > runTime - @secondHandUpdateTimer.stop - else - seconds += -anglePerSec + (anglePerSec * val) - end - end - end - end - - if @theme.hasElement("HourHandShadow") - p.translate(1,3) - - drawHand(p, hours, "HourHandShadow") - drawHand(p, minutes, "MinuteHandShadow") - - if @showSecondHand - drawHand(p, seconds, "SecondHandShadow") - end - - p.translate(-1,-3) - end - - drawHand(p, hours, "HourHand") - drawHand(p, minutes, "MinuteHand") - if @showSecondHand - drawHand(p, seconds, "SecondHand") - end - - p.save - @theme.resize(boundSize) - elementSize = Qt::SizeF.new(@theme.elementSize("HandCenterScrew")) - tempRect.size = elementSize - p.translate(boundSize.width / 2.0 - elementSize.width / 2.0, boundSize.height / 2.0 - elementSize.height / 2.0) - @theme.paint(p, tempRect, "HandCenterScrew") - p.restore - - @theme.paint(p, Qt::RectF.new(rect), "Glass") - end -end - -end diff --git a/plasma/ruby/applets/clock/contents/code/timezones_config.rb b/plasma/ruby/applets/clock/contents/code/timezones_config.rb deleted file mode 100644 index f36e9d5..0000000 --- a/plasma/ruby/applets/clock/contents/code/timezones_config.rb +++ /dev/null @@ -1,61 +0,0 @@ -=begin -** Form generated from reading ui file 'timezonesConfig.ui' -** -** Created: Wed Aug 6 19:25:39 2008 -** by: Qt User Interface Compiler version 4.4.1 -** -** WARNING! All changes made in this file will be lost when recompiling ui file! -=end - -class Ui_TimezonesConfig - attr_reader :vboxLayout - attr_reader :localTimeZone - attr_reader :timeZones - - def setupUi(timezonesConfig) - if timezonesConfig.objectName.nil? - timezonesConfig.objectName = "timezonesConfig" - end - timezonesConfig.resize(308, 227) - @vboxLayout = Qt::VBoxLayout.new(timezonesConfig) - @vboxLayout.objectName = "vboxLayout" - @localTimeZone = Qt::CheckBox.new(timezonesConfig) - @localTimeZone.objectName = "localTimeZone" - - @vboxLayout.addWidget(@localTimeZone) - - @timeZones = KDE::TimeZoneWidget.new(timezonesConfig) - @timeZones.objectName = "timeZones" - @timeZones.minimumSize = Qt::Size.new(300, 150) - - @vboxLayout.addWidget(@timeZones) - - - retranslateUi(timezonesConfig) - Qt::Object.connect(@localTimeZone, SIGNAL('toggled(bool)'), @timeZones, SLOT('setDisabled(bool)')) - - Qt::MetaObject.connectSlotsByName(timezonesConfig) - end # setupUi - - def setup_ui(timezonesConfig) - setupUi(timezonesConfig) - end - - def retranslateUi(timezonesConfig) - @localTimeZone.text = Qt::Application.translate("timezonesConfig", "Use &local time zone", nil, Qt::Application::UnicodeUTF8) - @timeZones.headerItem.setText(0, Qt::Application.translate("timezonesConfig", "Area", nil, Qt::Application::UnicodeUTF8)) - @timeZones.headerItem.setText(1, Qt::Application.translate("timezonesConfig", "Region", nil, Qt::Application::UnicodeUTF8)) - @timeZones.headerItem.setText(2, Qt::Application.translate("timezonesConfig", "Comment", nil, Qt::Application::UnicodeUTF8)) - end # retranslateUi - - def retranslate_ui(timezonesConfig) - retranslateUi(timezonesConfig) - end - -end - -module Ui - class TimezonesConfig < Ui_TimezonesConfig - end -end # module Ui - diff --git a/plasma/ruby/applets/clock/contents/ui/analog_clock_config.ui b/plasma/ruby/applets/clock/contents/ui/analog_clock_config.ui deleted file mode 100644 index b4eb157..0000000 --- a/plasma/ruby/applets/clock/contents/ui/analog_clock_config.ui +++ /dev/null @@ -1,141 +0,0 @@ - - AnalogClockConfig - - - - 0 - 0 - 400 - 300 - - - - - 400 - 300 - - - - - - - - - Appearance - - - true - - - - - - - - Show the seconds - - - Check this if you want to show the seconds. - - - Show &seconds - - - - - - - Show the time in text - - - Check this if you want to show the time as a text within the clock. - - - Also show the time in text - - - - - - - - - - - - Timezones - - - true - - - - - - - - Use &local timezone - - - - - - - - 300 - 150 - - - - - Area - - - - - Region - - - - - Comment - - - - - - - - - - - - - - - - KTimeZoneWidget - QTreeWidget -
ktimezonewidget.h
-
-
- - - - localTimeZone - toggled(bool) - timeZones - setDisabled(bool) - - - 20 - 20 - - - 20 - 20 - - - - -
diff --git a/plasma/ruby/applets/clock/contents/ui/calendar.ui b/plasma/ruby/applets/clock/contents/ui/calendar.ui deleted file mode 100644 index 0589c48..0000000 --- a/plasma/ruby/applets/clock/contents/ui/calendar.ui +++ /dev/null @@ -1,42 +0,0 @@ - - calendar - - - - 0 - 0 - 276 - 255 - - - - - - - - 0 - - - 0 - - - - - true - - - - - - - - KDatePicker - QFrame -
kdatepicker.h
-
-
- - - - -
diff --git a/plasma/ruby/applets/clock/contents/ui/timezonesConfig.ui b/plasma/ruby/applets/clock/contents/ui/timezonesConfig.ui deleted file mode 100644 index 38e3f69..0000000 --- a/plasma/ruby/applets/clock/contents/ui/timezonesConfig.ui +++ /dev/null @@ -1,73 +0,0 @@ - - timezonesConfig - - - - 0 - 0 - 308 - 227 - - - - - - - Use &local time zone - - - - - - - - 300 - 150 - - - - - Area - - - - - Region - - - - - Comment - - - - - - - - - KTimeZoneWidget - QTreeWidget -
ktimezonewidget.h
-
-
- - - - localTimeZone - toggled(bool) - timeZones - setDisabled(bool) - - - 209 - 53 - - - 209 - 239 - - - - -
diff --git a/plasma/ruby/applets/clock/metadata.desktop b/plasma/ruby/applets/clock/metadata.desktop deleted file mode 100644 index d4f5886..0000000 --- a/plasma/ruby/applets/clock/metadata.desktop +++ /dev/null @@ -1,150 +0,0 @@ -[Desktop Entry] -Name=Ruby Analog Clock -Name[ar]=ساعة تناظرية بلغة روبي -Name[be@latin]=Analahavy hadzińnik u movie „Ruby” -Name[bg]=Аналогов часовник Ruby -Name[ca]=Rellotge analògic en Ruby -Name[ca@valencia]=Rellotge analògic en Ruby -Name[cs]=Analogové hodiny v Ruby -Name[csb]=Analogòwi zédżer Ruby -Name[da]=Analogt ur i Ruby -Name[de]=Ruby - Analoge Uhr -Name[el]=Αναλογικό ρολόι Ruby -Name[en_GB]=Ruby Analogue Clock -Name[es]=Reloj analógico Ruby -Name[et]=Ruby analoogkell -Name[eu]=Ruby erloju analogikoa -Name[fi]=Ruby-pohjainen analoginen kello -Name[fr]=Horloge analogique Ruby -Name[fy]=Ruby analoge klok -Name[ga]=Clog Analógach Ruby -Name[gl]=Reloxo analóxico escrito en Ruby -Name[gu]=રૂબી સાદી ઘડિયાળ -Name[he]=שעון אנלוגי ברובי -Name[hi]=रूबी एनॉलॉग घड़ी -Name[hne]=रूबी एनालाग घड़ी -Name[hr]=Ruby Analogni sat -Name[hu]=Mutatós óra Ruby nyelven -Name[id]=Jam Analog Ruby -Name[is]=Ruby skífuklukka -Name[it]=Orologio a lancette Ruby -Name[ja]=Ruby アナログ時計 -Name[kk]=Ruby-дегі аналогты сағат -Name[km]=នាឡិកា​អាណាឡូក​ -Name[ko]=루비 아날로그 시계 -Name[ku]=Ruby Demjimêra Analog -Name[lt]=Ruby analoginis laikrodis -Name[lv]=Ruby rādītāju pulkstenis -Name[ml]=റൂബി അനലോഗ് ഘടികാരം -Name[mr]=Ruby एनलॉग क्लॉक -Name[nb]=Ruby analog klokke -Name[nds]=Analoog Klock för Ruby -Name[nl]=Ruby Analoge klok -Name[nn]=Analog klokke for Ruby -Name[or]=ରୁବି ଅନୁରୂପ ଘଣ୍ଟା -Name[pa]=ਰੂਬੀ ਐਨਾਲਾਗ ਘੜੀ -Name[pl]=Zegar analogowy w języku Ruby -Name[pt]=Relógio Analógico em Ruby -Name[pt_BR]=Relógio analógico em Ruby -Name[ro]=Ceas analog Ruby -Name[ru]=Часы с циферблатом на Ruby -Name[si]=Ruby Analog Clock -Name[sk]=Ruby analógové hodiny -Name[sl]=Ruby analogna ura -Name[sr]=рубијевски аналогни сат -Name[sr@latin]=ruby analogni sat -Name[sv]=Ruby analog klocka -Name[ta]=Ruby Analog Clock -Name[tg]=Циферблат аналоговых часов -Name[th]=นาฬิกาอะนาล็อกภาษารูบี้ -Name[tr]=Ruby Analog Saat -Name[uk]=Аналоговий годинник на Ruby -Name[x-test]=xxRuby Analog Clockxx -Name[zh_CN]=Ruby 模拟时钟 -Name[zh_TW]=Ruby 類比時鐘 -Comment=An SVG themable clock -Comment[af]='n Horlosie met SVG temas -Comment[ar]=ساعة متجهة -Comment[be@latin]=Hadzińnik z matyvami „SVG” -Comment[bg]=Часовник с SVG тема -Comment[ca]=Un rellotge que permet temes SVG -Comment[ca@valencia]=Un rellotge que permet temes SVG -Comment[cs]=Hodiny se SVG motivem -Comment[da]=Et SVG-tematisérbart ur -Comment[de]=Eine Uhr mit SVG-fähigem Design -Comment[el]=Ένα ρολόι με θέματα SVG -Comment[en_GB]=An SVG themable clock -Comment[eo]=SVG-etosigebla horloĝo -Comment[es]=Un reloj con temas en formato SVG -Comment[et]=SVG teemaga kell -Comment[fa]=ساعت چهره‌پذیر SVG -Comment[fi]=SVG-teemoitettava kello -Comment[fr]=Une horloge avec des thèmes SVG -Comment[fy]=In SVG tema klok -Comment[ga]=Clog le téamaí SVG -Comment[gl]=Un reloxo con temas SVG -Comment[gu]=SVG થીમ વાપરી શકાય તેવી ઘડિયાળ -Comment[he]=שעון SVG הניתן להתאמה על ידי ערכות נושא -Comment[hi]=एक एसवीजी घड़ी जिसका रूपाकार परिवर्तित किया जा सकता है -Comment[hne]=एक एसवीजी घड़ी जेखर रूपाकार बदले जा सकथे -Comment[hr]=Sat s podrškom za razne SVG teme -Comment[hsb]=SVG-časnik z temami -Comment[hu]=SVG felületű óra -Comment[id]=Jam bertema SVG -Comment[is]=SVG klukka með þemum -Comment[it]=Un orologio con temi SVG -Comment[ja]=SVG テーマを使った時計 -Comment[kk]=SVG нақышты сағат -Comment[km]=នាឡិកា​ដែល​អាច​ប្ដូរ​ស្បែក​បាន SVG -Comment[kn]=SVG ಆಧಾರಿತ ಪರಿಸರವಿನ್ಯಾಸಾರ್ಹ (ಥೀಮಬಲ್)ಗಡಿಯಾರ -Comment[ko]=SVG 테마를 사용하는 시계 -Comment[lt]=SVG grafikos laikrodis keičiamomis išvaizdos temomis -Comment[lv]=Ar SVG tēmojams pulkstenis -Comment[mai]=एकटा एसवीजी घडी जकर रूपाकार परिवर्तित कएल जाए सकैत अछि -Comment[ml]=SVG തീമിടാവുന്ന ഘടികാരം -Comment[mr]=SVG परिवर्तनजोगी घड्याळ -Comment[nb]=En SVG-klokke med temaer -Comment[nds]=En Klock mit SVG-Mustern -Comment[ne]=एउटा एसभीजी थेमेबल घडी -Comment[nl]=Een klok met SVG-themamogelijkheden -Comment[nn]=SVG-basert klokke med fleire tema -Comment[pa]=ਇੱਕ SVG ਥੀਮ-ਯੋਗ ਕਲਾਕ -Comment[pl]=Zegar z motywami SVG -Comment[pt]=Um relógio com temas em SVG -Comment[pt_BR]=Um relógio com temas em SVG -Comment[ro]=Un ceas SVG cu teme -Comment[ru]=Часы с циферблатом, поддерживающие темы SVG -Comment[se]=Diibma maid sáhttá hervet SVG-fiillaiguin -Comment[si]=An SVG themable clock -Comment[sk]=SVG témovateľné hodiny -Comment[sl]=Ura, ki podpira vektorske teme SVG -Comment[sr]=Сат са СВГ темама -Comment[sr@latin]=Sat sa SVG temama -Comment[sv]=En SVG-temabaserad klocka -Comment[ta]=An SVG themable clock -Comment[te]=SVG థీమబుల్ గడియారం -Comment[tg]=Часы, поддерживающие темы SVG -Comment[th]=นาฬิกาแบบปรับชุดตกแต่งด้วยแฟ้มภาพ SVG ได้ -Comment[tr]=SVG temalandırılabilir saat -Comment[uk]=Годинник SVG з темами -Comment[vi]=Một đồng hồ chấp nhận sắc thái SVG -Comment[wa]=Ene ôrlodje SVG avou tinmes -Comment[x-test]=xxAn SVG themable clockxx -Comment[zh_CN]=SVG 主题的时钟 -Comment[zh_TW]=SVG 可調整外觀時鐘 -Icon=chronometer -Type=Service -ServiceTypes=Plasma/Applet -X-Plasma-API=ruby-script -X-Plasma-MainScript=code/main.rb -X-Plasma-DefaultSize=125,125 - -X-KDE-PluginInfo-Author=Richard Dale -X-KDE-PluginInfo-Email=richard.j.dale@gmail.com -X-KDE-PluginInfo-Name=ruby-clock -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Date and Time -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/ruby/applets/ruby-extender-tutorial/contents/code/extender_tutorial.rb b/plasma/ruby/applets/ruby-extender-tutorial/contents/code/extender_tutorial.rb deleted file mode 100644 index 68a3686..0000000 --- a/plasma/ruby/applets/ruby-extender-tutorial/contents/code/extender_tutorial.rb +++ /dev/null @@ -1,88 +0,0 @@ -require 'plasma_applet' - -module RubyExtenderTutorial - class ExtenderTutorial < PlasmaScripting::PopupApplet - slots 'sourceAdded(QString)' - - def initialize(parent, args = nil) - super - - # We want to collapse into an icon when put into a panel. - # If you don't call this function, you can display another - # widget, or draw something yourself. - setPopupIcon("extendertutorial") - end - - def init - # Calling extender() instantiates an extender for you if you - # haven't already done so. Never instantiate an extender - # before init() since Extender needs access to applet->config() - # to work. - - # The message to be shown when there are no ExtenderItems in - # this extender. - extender.emptyExtenderMessage = KDE::i18n("no running jobs...") - - # Notify ourself whenever a new job is created. - connect(dataEngine("applicationjobs"), SIGNAL('sourceAdded(QString)'), - self, SLOT('sourceAdded(QString)')) - end - - def initExtenderItem(item) - # Create a Meter widget and wrap it in the ExtenderItem - meter = Plasma::Meter.new(item) do |m| - m.meterType = Plasma::Meter::BarMeterHorizontal - m.svg = "widgets/bar_meter_horizontal" - m.maximum = 100 - m.value = 0 - - m.minimumSize = Qt::SizeF.new(250, 45) - m.preferredSize = Qt::SizeF.new(250, 45) - end - - # often, you'll want to connect dataengines or set properties - # depending on information contained in item->config(). - # In this situation that won't be necessary though. - item.widget = meter - - # Job names are not unique across plasma restarts (kuiserver - # engine just starts with Job1 again), so avoid problems and - # just don't give reinstantiated items a name. - item.name = "" - - # Show a close button. - item.showCloseButton - end - - def sourceAdded(source) - # Add a new ExtenderItem - item = Plasma::ExtenderItem.new(extender) - initExtenderItem(item) - - # We give this item a name, which we don't use in this - # example, but allows us to look up extenderItems by calling - # extenderItem(name). That function is useful to avoid - # duplicating detached ExtenderItems between session, because - # you can check if a certain item already exists. - item.name = source - - # And we give this item a title. Titles, along with icons and - # names are persistent between sessions. - item.title = source - - # Connect a dataengine. If this applet would display data where - # datasources would have unique names, even between sessions, - # you should do this in initExtenderItem, so that after a plasma - # restart, datasources would still get connected to the - # appropriate sources. Kuiserver jobs are not persistent however, - # so we connect them here. - dataEngine("applicationjobs").connectSource(source, item.widget, 200) - - # Show the popup for 5 seconds if in panel, so the user notices - # that there's a new job running. - showPopup(5000) - end - end -end - -# kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off; diff --git a/plasma/ruby/applets/ruby-extender-tutorial/metadata.desktop b/plasma/ruby/applets/ruby-extender-tutorial/metadata.desktop deleted file mode 100644 index 3309e7f..0000000 --- a/plasma/ruby/applets/ruby-extender-tutorial/metadata.desktop +++ /dev/null @@ -1,61 +0,0 @@ -[Desktop Entry] -Name=Ruby Extender Tutorial -Name[da]=Vejledning til Ruby Extender -Name[de]=Einführung zu Ruby Extender -Name[en_GB]=Ruby Extender Tutorial -Name[es]=Tutorial del extensor Ruby -Name[et]=Ruby laienduse algtutvustus -Name[gl]=Tutorial do extensor en Ruby -Name[hr]=Ruby primjer s izvlačnikom -Name[id]=Tutorial Pemuai Ruby -Name[nb]=Veiledning for Ruby-utvider -Name[nds]=Ruby-Extender-Inföhren -Name[nl]=Ruby Extender inleiding -Name[nn]=Innføring i utvidar for Ruby -Name[pt]=Tutorial de Extensão do Ruby -Name[pt_BR]=Tutorial de extensão do Ruby -Name[sl]=Vodnik Ruby razširitelj -Name[sr]=рубијевски продужетак (туторијал) -Name[sr@latin]=ruby produžetak (tutorijal) -Name[sv]=Handledning för utökning i Ruby -Name[tr]=Ruby Genişletici Belgesi -Name[uk]=Посібник з розширювача мовою Ruby -Name[x-test]=xxRuby Extender Tutorialxx -Name[zh_TW]=Ruby Extender 教學 -Comment=An example of a popup applet with extender -Comment[da]=Et eksempel på en pop-op-applet med extender -Comment[de]=Ein beispielhaftes Miniprogramm mit Extender -Comment[en_GB]=An example of a popup applet with extender -Comment[es]=Un ejemplo de applet emergente con extensor -Comment[et]=Laiendusega hüpikapleti näidis -Comment[gl]=Un exemplo dunha aplet emerxente cun extensor -Comment[hr]=Primjer iskočnog programčića s izvlačnikom -Comment[id]=Sebuah contoh applet popup dengan pemuai -Comment[nb]=Et eksempel på et oppsprett-miniprogram med utvider -Comment[nds]=En Bispill för en Opduk-Lüttprogramm mit Extender -Comment[nl]=Een voorbeeld van een popup-applet met extender -Comment[nn]=Eit eksempel med eit sprettoppvindauge med utvidar -Comment[pt]=Um exemplo de uma 'applet' com uma extensão -Comment[pt_BR]=Um exemplo de um miniaplicativo de mensagens instantâneas com extensão -Comment[sl]=Primer pojavnega programčka z razširiteljem -Comment[sr]=Пример искачућег аплета са продужетком -Comment[sr@latin]=Primer iskačućeg apleta sa produžetkom -Comment[sv]=Ett exempel på ett miniprogram med utökning -Comment[tr]=Bir örnek genişletileticili açılabilir programcık -Comment[uk]=Приклад контекстного аплету з розширювачем -Comment[x-test]=xxAn example of a popup applet with extenderxx -Comment[zh_TW]=彈出含延長器的小程式的範例 -Type=Service -ServiceTypes=Plasma/Applet - -X-KDE-PluginInfo-Author=The Plasma Team -X-KDE-PluginInfo-Email=plasma-devel@kde.org -X-KDE-PluginInfo-Name=ruby-extender-tutorial -X-KDE-PluginInfo-Version=pre0.1 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category= -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=ruby-script -X-Plasma-MainScript=code/extender_tutorial.rb diff --git a/plasma/ruby/applets/ruby_tiger/contents/code/main.rb b/plasma/ruby/applets/ruby_tiger/contents/code/main.rb deleted file mode 100644 index afa82b0..0000000 --- a/plasma/ruby/applets/ruby_tiger/contents/code/main.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'plasma_applet' - -module RubyTiger - class Main < PlasmaScripting::Applet - def initialize(parent, args = nil) - super - end - - def init - @svg = Plasma::Svg.new(self) - @svg.imagePath = package.filePath("images", "tiger.svg") - end - - def paintInterface(painter, option, contentsRect) - @svg.resize(size()) - @svg.paint(painter, 0, 0) - end - end -end diff --git a/plasma/ruby/applets/ruby_tiger/contents/images/tiger.svg b/plasma/ruby/applets/ruby_tiger/contents/images/tiger.svg deleted file mode 100644 index 983e570..0000000 --- a/plasma/ruby/applets/ruby_tiger/contents/images/tiger.svg +++ /dev/null @@ -1,730 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plasma/ruby/applets/ruby_tiger/metadata.desktop b/plasma/ruby/applets/ruby_tiger/metadata.desktop deleted file mode 100644 index d5060fc..0000000 --- a/plasma/ruby/applets/ruby_tiger/metadata.desktop +++ /dev/null @@ -1,142 +0,0 @@ -[Desktop Entry] -Name=Tiger -Name[ar]=النمر -Name[be@latin]=Tyhra -Name[bg]=Tiger -Name[bn]=টাইগার -Name[bn_IN]=Tiger -Name[ca]=Tiger -Name[ca@valencia]=Tiger -Name[cs]=Tiger -Name[csb]=Tiger -Name[da]=Tiger -Name[de]=Tiger -Name[el]=Τίγρης -Name[en_GB]=Tiger -Name[es]=Tigre -Name[et]=Tiger -Name[eu]=Tiger -Name[fi]=Tiikeri -Name[fr]=Tigre -Name[fy]=Tiger -Name[ga]=Tiger -Name[gl]=Tigre -Name[gu]=વાઘ -Name[he]=נמר -Name[hi]=शेर -Name[hne]=टाइगर -Name[hr]=Tigar -Name[hu]=Tiger -Name[id]=Harimau -Name[is]=Tiger -Name[it]=Tigre -Name[ja]=タイガー -Name[kk]=Жолбарыс -Name[km]=ខ្លា -Name[ko]=Tiger -Name[ku]=Piling -Name[lt]=Tigras -Name[lv]=Tīģeris -Name[mai]=बाघ -Name[mk]=Тигар -Name[ml]=ടൈഗര്‍ -Name[mr]=Tiger -Name[nb]=Tiger -Name[nds]=Tiger -Name[nl]=Tijger -Name[nn]=Tiger -Name[or]=ଟାଇଗର -Name[pa]=ਟਾਈਗਰ -Name[pl]=Tygrys -Name[pt]=Tigre -Name[pt_BR]=Tigre -Name[ro]=Tigru -Name[ru]=Тигр -Name[sk]=Tiger -Name[sl]=Tiger -Name[sr]=тигар -Name[sr@latin]=tigar -Name[sv]=Tiger -Name[ta]=Tiger -Name[tg]=Паланг -Name[th]=เสือโคร่ง -Name[tr]=Kaplan -Name[uk]=Тигр -Name[wa]=Tigue -Name[x-test]=xxTigerxx -Name[zh_CN]=虎 -Name[zh_TW]=老虎 -Comment=An example of displaying an SVG -Comment[ar]=مثال لعرض SVG -Comment[be@latin]=Uzro vyjaŭleńnia „SVG” -Comment[bg]=Пример за показване на SVG -Comment[ca]=Un exemple de visualització d'un SVG -Comment[ca@valencia]=Un exemple de visualització d'un SVG -Comment[cs]=Příklad zobrazení SVG -Comment[da]=En eksempel på visning af en SVG -Comment[de]=Ein Beispiel zur Anzeige von SVG -Comment[el]=Ένα παράδειγμα εμφάνισης μιας SVG -Comment[en_GB]=An example of displaying an SVG -Comment[es]=Un ejemplo de mostrar un SVG -Comment[et]=SVG-d näitav näidis -Comment[fi]=Esimerkki SVG-tiedostojen näyttämisestä -Comment[fr]=Un exemple d'affichage d'un SVG -Comment[fy]=In foarbyld fan it werjaan fan in SVG -Comment[ga]=Sampla a thaispeánann SVG -Comment[gl]=Un exemplo de como mostrar un SVG -Comment[gu]=SVG દર્શાવતું ઉદાહરણ -Comment[hi]=एसवीजी प्रदर्शित करने का उदाहरण -Comment[hne]=एसवीजी देखाय के एक उदाहरन -Comment[hr]=Primjer prikazivanja SVG-a -Comment[hu]=Példa SVG-alapú megjelenítésre -Comment[id]=Sebuah contoh cara menampilkan SVG -Comment[is]=Dæmi um birtingu SVG -Comment[it]=Un esempio di visualizzazione di un SVG -Comment[ja]=SVG を表示する例 -Comment[kk]=SVG көрсету мысалы -Comment[km]=ឧទាហរណ៍​នៃ​ការ​បង្ហាញ​ SVG -Comment[ko]=SVG 표시 예제 -Comment[lt]=SVG rodymo pavyzdys -Comment[lv]=Piemērs SVG attēlošanai -Comment[ml]=ഒരു എസ്‌വിജി പ്രദര്‍ശിപ്പിയ്ക്കുന്ന ഉദാഹരണം -Comment[mr]=SVG दर्शविणारे उदाहरण -Comment[nb]=Et eksempel på å vise en SVG-fil -Comment[nds]=En Bispill för en SVG -Comment[nl]=Een voorbeeld van het weergeven van een SVG -Comment[nn]=Eit eksempel på SVG-vising -Comment[or]=SVG ଦର୍ଶାଇବା ପାଇଁ ଗୋଟିଏ ଉଦାହରଣ -Comment[pa]=SVG ਵੇਖਾਉਣ ਦੀ ਉਦਾਹਰਨ -Comment[pl]=Przykład wyświetlania SVG -Comment[pt]=Um exemplo de visualização de um SVG -Comment[pt_BR]=Um exemplo de visualização em SVG -Comment[ro]=Exemplu de afișare a unui SVG -Comment[ru]=Пример показа SVG -Comment[si]=An example of displaying an SVG -Comment[sk]=Príklad zobrazenia SVG obrázku -Comment[sl]=Primer prikazovanja SVG -Comment[sr]=Пример приказивања СВГ‑а -Comment[sr@latin]=Primer prikazivanja SVG‑a -Comment[sv]=Ett exempel på att visa en SVG -Comment[ta]=An example of displaying an SVG -Comment[te]=SVG ప్రదర్శించుట యొక్క ఉదాహరణ -Comment[tg]=Часы, поддерживающие темы SVG -Comment[th]=ตัวอย่างการแสดงภาพเวกเตอร์แบบ SVG -Comment[tr]=Bir SVG resim gösteriminin bir örneği -Comment[uk]=Приклад показу SVG -Comment[x-test]=xxAn example of displaying an SVGxx -Comment[zh_CN]=一个显示 SVG 图形的示例 -Comment[zh_TW]=展示 SVG 的範例 -Type=Service -ServiceTypes=Plasma/Applet - -X-KDE-PluginInfo-Author=Richard Dale -X-KDE-PluginInfo-Email=richard.j.dale@gmail.com -X-KDE-PluginInfo-Name=ruby-tiger -X-KDE-PluginInfo-Version=pre0.1 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=ruby-script -X-Plasma-MainScript=code/main.rb diff --git a/plasma/ruby/applets/webapplet/contents/code/main.rb b/plasma/ruby/applets/webapplet/contents/code/main.rb deleted file mode 100644 index 0ebfc63..0000000 --- a/plasma/ruby/applets/webapplet/contents/code/main.rb +++ /dev/null @@ -1,91 +0,0 @@ -=begin -/* -Copyright (c) 2007 Zack Rusin - -Translated to Ruby by Richard Dale * - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - */ -=end - -require 'plasma_applet' - -module RubyWebapplet - -class Main < PlasmaScripting::Applet - - slots 'dataUpdated(QString,Plasma::DataEngine::Data)', - 'load(QUrl)', - 'setHtml(QByteArray)', - 'loadHtml(QUrl)', - 'loadFinished(bool)' - - def initialize(parent, args = nil) - super - end - - def init - @page = Plasma::WebView.new(self) - @page.page = Qt::WebPage.new(@page) - @page.page.linkDelegationPolicy = Qt::WebPage::DelegateAllLinks - @page.page.settings.setAttribute(Qt::WebSettings::LinksIncludedInFocusChain, true) - - connect(@page, SIGNAL('loadFinished(bool)'), self, SLOT('loadFinished(bool)')) - connect(@page.page, SIGNAL('linkClicked(QUrl)'), self, SLOT('load(QUrl)')) - - @page.mainFrame.setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff) - @page.mainFrame.setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff) - - @page.url = Qt::Url.new("http://dot.kde.org/") - end - - def paintInterface(p, option, rect) - end - - def load(url) - puts "Loading #{url.toString}" - @page.url = url - end - - def view - @page - end - - def loadFinished(success) - puts "page loaded #{@page.page.currentFrame.url.toString}" - end - - def constraintsEvent(constraints) - if constraints.to_i & Plasma::SizeConstraint.to_i - @page.resize(size()) - end - end - - def setHtml(html, baseUrl = Qt::Url.new) - puts "loading #{baseUrl.toString}" - @page.mainFrame.setHtml(html, baseUrl) - end - - def loadHtml(url = Qt::Url.new) - puts "loading #{url.toString}" - @page.mainFrame.load(url) - end -end - -end diff --git a/plasma/ruby/applets/webapplet/metadata.desktop b/plasma/ruby/applets/webapplet/metadata.desktop deleted file mode 100644 index bc98e9c..0000000 --- a/plasma/ruby/applets/webapplet/metadata.desktop +++ /dev/null @@ -1,82 +0,0 @@ -[Desktop Entry] -Name=Ruby Web Browser -Name[ar]=متصفح ويب بلغة روبي -Name[be@latin]=Hartač sieciva ŭ movie „Ruby” -Name[bg]=Уеб браузър Ruby -Name[bn]=রুবি ওয়েব ব্রাউজার -Name[bn_IN]=Ruby ওয়েব ব্রাউজার -Name[ca]=Navegador web en Ruby -Name[ca@valencia]=Navegador web en Ruby -Name[cs]=Webový prohlížeč v Ruby -Name[csb]=Przezérnik WWW Ruby -Name[da]=Ruby webbrowser -Name[de]=Ruby - Webbrowser -Name[el]=Περιηγητής ιστού Ruby -Name[en_GB]=Ruby Web Browser -Name[es]=Navegador Web Ruby -Name[et]=Ruby veebibrauser -Name[eu]=Ruby web arakatzailea -Name[fi]=Ruby-pohjainen WWW-selain -Name[fr]=Navigateur Web Ruby -Name[fy]=Ruby webblêder -Name[ga]=Brabhsálaí Gréasáin Ruby -Name[gl]=Navegador web escrito en Ruby -Name[gu]=રૂબી વેબ બ્રાઉઝર -Name[he]=דפדפן רשת הכתוב ב־Ruby -Name[hi]=रूबी वेब ब्राउज़र -Name[hne]=रूबी वेब ब्राउजर -Name[hr]=Ruby Web preglednik -Name[hu]=Webböngésző Ruby nyelven -Name[id]=Peramban Web Ruby -Name[is]=Ruby vafri -Name[it]=Browser web Ruby -Name[ja]=Ruby ウェブブラウザ -Name[kk]=Ruby-дегі Веб шолғышы -Name[km]=កម្មវិធី​រុករក​បណ្ដាញ -Name[ko]=루비 웹 브라우저 -Name[ku]=Ruby Geroka Torê -Name[lt]=Ruby žiniatinklio naršyklė -Name[lv]=Ruby tīmekļa pārlūks -Name[ml]=റൂബി വെബ് ബ്രൌസര്‍ -Name[mr]=Ruby वेब ब्राउजर -Name[nb]=Ruby nettleser -Name[nds]=Nettkieker för Ruby -Name[nl]=Ruby Webbrowser -Name[nn]=Ruby-nettlesar -Name[or]=ରୁବି ୱେବ ବ୍ରାଉଜର -Name[pa]=ਰੂਬੀ ਵੈੱਬ ਬਰਾਊਜ਼ਰ -Name[pl]=Przeglądarka WWW w języku Ruby -Name[pt]=Navegador Web em Ruby -Name[pt_BR]=Navegador da Internet em Ruby -Name[ro]=Navigator de web Ruby -Name[ru]=Веб-браузер, написанный на языке Ruby -Name[si]=Ruby Web Browser -Name[sk]=Ruby webový prehliadač -Name[sl]=Ruby spletni brskalnik -Name[sr]=рубијевски веб прегледач -Name[sr@latin]=ruby veb pregledač -Name[sv]=Ruby webbläsare -Name[ta]=Ruby Web Browser -Name[tg]=Веб-браузери Ruby -Name[th]=เว็บเบราว์เซอร์ภาษารูบี้ -Name[tr]=Ruby Web Tarayıcı -Name[uk]=Навігатор Тенет на Ruby -Name[x-test]=xxRuby Web Browserxx -Name[zh_CN]=Ruby 网络浏览器 -Name[zh_TW]=Ruby 網頁瀏覽器 - -Type=Service -ServiceTypes=Plasma/Applet - -X-KDE-PluginInfo-Author=Richard Dale -X-KDE-PluginInfo-Email=richard.j.dale@gmail.com -X-KDE-PluginInfo-Name=ruby-webapplet -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -X-Plasma-API=ruby-script -X-Plasma-MainScript=code/main.rb -X-Plasma-DefaultSize=600,400 diff --git a/plasma/ruby/dataengines/dbpedia_albums/contents/code/main.rb b/plasma/ruby/dataengines/dbpedia_albums/contents/code/main.rb deleted file mode 100644 index a15acdc..0000000 --- a/plasma/ruby/dataengines/dbpedia_albums/contents/code/main.rb +++ /dev/null @@ -1,197 +0,0 @@ -=begin -/* - * Copyright 2008 Richard Dale - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -=end - -require 'plasma_applet' -require 'cgi' -require 'rexml/document' -require 'soprano' - -# Parser for SPARQL XML result set. Derived from the parser in the -# ActiveRDF SPARQL adapter code. Produces an Array of Hashes, each -# hash contains keys for each of the variables in the query, and -# values which are Soprano nodes. -# -class SparqlResultParser - attr_reader :result - - def initialize - @result = [] - @vars = [] - @current_type = nil - end - - def tag_start(name, attrs) - case name - when 'variable' - @vars << attrs['name'] - when 'result' - @current_result = {} - when 'binding' - @current_binding = attrs['name'] - when 'bnode', 'uri' - @current_type = name - when 'literal', 'typed-literal' - @current_type = name - @datatype = attrs['datatype'] - @xmllang = attrs['xml:lang'] - end - end - - def tag_end(name) - if name == "result" - @result << @current_result - elsif name == 'bnode' || name == 'literal' || name == 'typed-literal' || name == 'uri' - @current_type = nil - elsif name == "sparql" - end - end - - def text(text) - if !@current_type.nil? - @current_result[@current_binding] = create_node(@current_type, @datatype, @xmllang, text) - end - end - - # create ruby objects for each RDF node - def create_node(type, datatype, xmllang, value) - case type - when 'uri' - Soprano::Node.new(Qt::Url.new(value)) - when 'bnode' - Soprano::Node.new(value) - when 'literal', 'typed-literal' - if xmllang - Soprano::Node.new(Soprano::LiteralValue.new(value), xmllang) - elsif datatype - Soprano::Node.new(Soprano::LiteralValue.fromString(value, Qt::Url.new(datatype))) - else - Soprano::Node.new(Soprano::LiteralValue.new(value)) - end - end - end - - def method_missing (*args) - end -end - -# There is a Soprano::Client::SparqlModel class in Soprano, but it -# appears to make queries synchronously and so it wouldn't be -# suitable for a Plasma data engine like this one. Here we use KIO -# to retrieve the query results asynchronously. -# -class SparqlDataEngine < PlasmaScripting::DataEngine - slots 'queryData(KIO::Job*, QByteArray)', - 'queryCompleted(KJob*)' - - def initialize(parent, args, endpoint, query, primary_value) - super(parent) - @endpoint = endpoint - @query = query - @primary_value = primary_value - end - - def init - setMinimumPollingInterval(120 * 1000) - end - - def sourceRequestEvent(source_name) - # puts "sourceRequested(#{source_name})" - if @job - return false - end - - @source_name = source_name - @sparql_results_xml = "" - query_url = KDE::Url.new("#{@endpoint}?query=#{CGI.escape(@query % @source_name.gsub(' ', '_'))}") - @job = KIO::get(query_url, KIO::Reload, KIO::HideProgressInfo) - @job.addMetaData("accept", "application/sparql-results+xml" ) - connect(@job, SIGNAL('data(KIO::Job*, QByteArray)'), self, - SLOT('queryData(KIO::Job*, QByteArray)')) - connect(@job, SIGNAL('result(KJob*)'), self, SLOT('queryCompleted(KJob*)')) - # setData(@source_name, {}) - return true - end - - def queryData(job, data) - # puts "queryData(#{job})" - @sparql_results_xml += data.to_s - end - - def queryCompleted(job) - # puts "queryCompleted(#{job})" - # puts @sparql_results_xml - - @job.doKill - @job = nil - parser = SparqlResultParser.new - REXML::Document.parse_stream(@sparql_results_xml, parser) - parser.result.each do |binding| - binding.each_pair do |key, value| - puts "#{key} --> #{value.inspect}" - setData(binding[@primary_value].literal.variant.toString, key, value) - end - end - end - - def updateSourceEvent(source_name) - # puts "updateSource(#{source_name})" - - sourceRequestEvent(source_name) - return true - end -end - -# In this query the properties are hard wired. It would be possible to -# make a query at start up to find all the properties for a given RDF -# type by retrieving the RDFS:domain properties specified in the -# ontology: -# -# SELECT DISTINCT ?p WHERE { -# ?p . -# } -# -# Then dynamically construct a query like the one below with the properties. -# -SPARQL_QUERY = <<-EOS -PREFIX p: -PREFIX rdf: -SELECT * WHERE { - ?album p:artist . - ?album rdf:type . - OPTIONAL {?album p:cover ?cover}. - OPTIONAL {?album p:name ?name}. - OPTIONAL {?album p:released ?dateofrelease}. - } -EOS - -module DbpediaAlbums - # - # Customize the use of the SparqlDataEngine by giving it the url of an endpoint, - # a query to execute, and the name of the most important (or primary) value. - # The '%s' in the query text above is replaced with the source name, with any - # spaces replaced by underscores. - # - class Main < SparqlDataEngine - def initialize(parent, args = nil) - super(parent, args, 'http://dbpedia.org/sparql', SPARQL_QUERY, 'name') - end - end -end \ No newline at end of file diff --git a/plasma/ruby/dataengines/dbpedia_albums/metadata.desktop b/plasma/ruby/dataengines/dbpedia_albums/metadata.desktop deleted file mode 100644 index adf588f..0000000 --- a/plasma/ruby/dataengines/dbpedia_albums/metadata.desktop +++ /dev/null @@ -1,138 +0,0 @@ -[Desktop Entry] -Name=DBpedia queries -Name[ar]=استعلامات DBpedia -Name[be@latin]=Zapyty ŭ „DBpedia” -Name[bg]=Търсене в DBpedia -Name[ca]=Consultes a la DBpedia -Name[ca@valencia]=Consultes a la DBpedia -Name[cs]=Dotazy do DBpedie -Name[da]=DBpedia-forespørgsler -Name[de]=DBpedia-Abfragen -Name[el]=Ερωτήματα DBpedia -Name[en_GB]=DBpedia queries -Name[es]=Consultas DBpedia -Name[et]=DBpedia päringud -Name[eu]=DBpedia kontsultak -Name[fi]=DBpedia-haut -Name[fr]=Requêtes DBpedia -Name[fy]=DBpedia queries -Name[ga]=Iarratais DBpedia -Name[gl]=Procuras na DBpedia -Name[gu]=DBpedia પ્રશ્નો -Name[hi]=डीबीपीडिया क्वैरी -Name[hne]=डीबीपेडिया क्वेरी -Name[hr]=DBpedia upiti -Name[hu]=Lekérdező a DBpedia enciklopédiához -Name[id]=Lema DBpedia -Name[is]=DBpedia fyrirspurnir -Name[it]=Query DBpedia -Name[ja]=DBpedia クエリ -Name[kk]=DBpedia сұраныстары -Name[km]=សំណួរ DBpedia -Name[ko]=DBpedia 쿼리 -Name[lt]=DBpedia užklausos -Name[lv]=DBpedia vaicājumi -Name[ml]=ഡിബിപീഡിയ അന്വേഷണങ്ങള്‍ -Name[mr]=DBpedia प्रश्न -Name[nb]=DBpedia-forespørsler -Name[nds]=DBpedia-Affragen -Name[nl]=DBpedia-queries -Name[nn]=DBpedia-spørjingar -Name[or]=DBpedia ପ୍ରଶ୍ନଗୁଡ଼ିକ -Name[pa]=DBpedia ਕਿਊਰੀਆਂ -Name[pl]=Zapytania DBpedii -Name[pt]=Pesquisas no DBpedia -Name[pt_BR]=Pesquisas no DBpedia -Name[ro]=Interogări DBpedia -Name[ru]=Запросы к DBpedia -Name[si]=DBpedia queries -Name[sk]=DBpedia dopyty -Name[sl]=Poizvedbe DBpedia -Name[sr]=упити ДБ‑педије -Name[sr@latin]=upiti DBpedije -Name[sv]=Förfrågningar till DBpedia -Name[ta]=DBpedia queries -Name[te]=DBpedia క్వరీలు -Name[tg]=Дархостҳои DBpedia -Name[th]=ค้นข้อมูล DBpedia -Name[tr]=DBpedia sorguları -Name[uk]=Запити DBpedia -Name[x-test]=xxDBpedia queriesxx -Name[zh_CN]=DBpedia 查询 -Name[zh_TW]=DBpedia 查詢 -Comment=DBpedia data for Plasmoids -Comment[ar]=بيانات DBpedia للبلازمويدات -Comment[be@latin]=Źviestki „DBpedia” dla widžetaŭ „Plasma” -Comment[bg]=Информация за плазмоиди от DBpedia -Comment[bn_IN]=Plasmoids-র জন্য DBpedia-র তথ্য -Comment[ca]=Dades de la DBpedia per als Plasmoides -Comment[ca@valencia]=Dades de la DBpedia per als Plasmoides -Comment[cs]=Data DBpedie pro plasmoidy -Comment[csb]=Pòdôwczi DBpedia dlô plazmoidów -Comment[da]=DBpedia-data til plasmoids -Comment[de]=DBpedia-Daten für Plasmoide -Comment[el]=Δεδομένα DBpedia για πλασμοειδή -Comment[en_GB]=DBpedia data for Plasmoids -Comment[es]=Datos DBpedia para los plasmoides -Comment[et]=DBpedia andmed plasmoididele -Comment[eu]=DBpedia datuak Plasmoidentzako -Comment[fr]=Données de DBpedia pour les plasmoïdes -Comment[fy]=DBpedia gegevens foar Plasmoids -Comment[ga]=Sonraí DBpedia le haghaidh Plasmóidí -Comment[gl]=Datos de DBPedia para os Plasmoides -Comment[gu]=પ્લાઝમોઇડ માટે DBpedia માહિતી -Comment[hi]=प्लाज्माइड्स के लिए डीबीपीडिया डाटा -Comment[hne]=प्लाज्माइड्स बर डीबीपेडिया डाटा -Comment[hr]=DBpedia podaci za plasmoide -Comment[hu]=DBpedia-adatok plazmoidokhoz -Comment[id]=Data DBpedia untuk Plasmoids -Comment[is]=DBpedia gögn fyrir Plasmadót -Comment[it]=Dati di DBpedia per i plasmoidi -Comment[ja]=プラズモイドのための DBpedia データ -Comment[kk]=Плазмоидтерге DBpedia деректері -Comment[km]=ទិន្នន័យ DBpedia សម្រាប់ Plasmoids -Comment[ko]=Plasmoid를 위한 DBpedia 데이터 -Comment[ku]=Dane yên DBpedia ji bo Plasmoidan -Comment[lt]=Plazmoidams skirti DBpedia duomenys -Comment[lv]=DBpedia dati priekš Plazmoīdiem -Comment[ml]=പ്ലാസ്മോയിഡ്സിനുള്ള ഡിബിപീഡിയ ഡാറ്റ -Comment[mr]=Plasmoids करीता DBpedia माहिती -Comment[nb]=DBpediadata for plasmoider -Comment[nds]=DBpedia-Daten för Lüttprogrammen -Comment[nl]=DBpediagegevens voor Plasmoids -Comment[nn]=DBpedia-data for plasmoidar -Comment[or]=Plasmoids ପାଇଁ DBpedia ତଥ୍ୟ -Comment[pa]=ਪਲਾਜਮੋਡੀਸ ਲਈ DBpedia ਡਾਟਾ -Comment[pl]=Dane DBpedii dla plazmoidów -Comment[pt]=Dados do DBpedia para os Plasmóides -Comment[pt_BR]=Dados do DBpedia para os Plasmoids -Comment[ro]=Date DBpedia pentru plasmoizi -Comment[ru]=Данные DBpedia для виджетов -Comment[si]=DBpedia data for Plasmoids -Comment[sk]=DBpedia údaje pre plazmoidy -Comment[sl]=Podatki DBpedia za gradnike -Comment[sr]=Подаци из ДБ‑педије за плазмоиде -Comment[sr@latin]=Podaci iz DBpedije za plazmoide -Comment[sv]=Data från DBpedia för Plasmoider -Comment[ta]=DBpedia data for Plasmoids -Comment[tg]=Маълумоти DBpedia барои плазмоидҳо -Comment[th]=ข้อมูล DBpedia สำหรับ Plasmoids -Comment[tr]=Plasma programcıkları için DBpedia verileri -Comment[uk]=Дані DBPedia для Плазмоїдів -Comment[x-test]=xxDBpedia data for Plasmoidsxx -Comment[zh_CN]=Plasma 部件的 DBpedia 数据 -Comment[zh_TW]=Plasmoids 的 DBpedia 資料 -Type=Service -ServiceTypes=Plasma/DataEngine -X-Plasma-API=ruby-script -X-Plasma-MainScript=code/main.rb - -X-KDE-PluginInfo-Author=Richard Dale -X-KDE-PluginInfo-Email=richard.j.dale@gmail.com -X-KDE-PluginInfo-Name=dbpedia-albums -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Semantic Web -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/ruby/dataengines/time/contents/code/main.rb b/plasma/ruby/dataengines/time/contents/code/main.rb deleted file mode 100644 index 849cdd0..0000000 --- a/plasma/ruby/dataengines/time/contents/code/main.rb +++ /dev/null @@ -1,85 +0,0 @@ -=begin -/* - * Copyright 2007 Aaron Seigo - * - * Translated to Ruby by Richard Dale - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -=end - -require 'plasma_applet' - -module RubyTime - -class Main < PlasmaScripting::DataEngine - - def initialize(parent, args = nil) - super(parent) - setMinimumPollingInterval(333) - - # To have translated timezone names - # (effectively a noop if the catalog is already present). - KDE::Global.locale.insertCatalog("timezones4") - end - - def init - dbus = Qt::DBusConnection.sessionBus - dbus.connect("", "", "org.kde.KTimeZoned", "configChanged", self, SLOT(:updateAllSources)) - end - - def sources - timezones = KDE::SystemTimeZones.zones.keys - timezones << "Local" - return timezones - end - - def sourceRequestEvent(name) - return updateSourceEvent(name) - end - - def updateSourceEvent(tz) - # puts "TimeEngine#updateTime" - localName = I18N_NOOP("Local") - if tz == localName - setData(localName, I18N_NOOP("Time"), Qt::Time.currentTime) - setData(localName, I18N_NOOP("Date"), Qt::Date.currentDate) - # this is relatively cheap - KSTZ.local is cached - timezone = KDE::SystemTimeZones.local.name - else - newTz = KDE::SystemTimeZones.zone(tz) - unless newTz.valid? - return false - end - - dt = KDE::DateTime.currentDateTime(KDE::DateTime::Spec.new(newTz)) - setData(tz, I18N_NOOP("Time"), dt.time) - setData(tz, I18N_NOOP("Date"), dt.date) - timezone = tz - end - - trTimezone = i18n(timezone) - setData(tz, I18N_NOOP("Timezone"), trTimezone) - tzParts = trTimezone.split("/") - - setData(tz, I18N_NOOP("Timezone Continent"), tzParts[0]) - setData(tz, I18N_NOOP("Timezone City"), tzParts[1]) - - return true - end -end - -end diff --git a/plasma/ruby/dataengines/time/metadata.desktop b/plasma/ruby/dataengines/time/metadata.desktop deleted file mode 100644 index 9b484cc..0000000 --- a/plasma/ruby/dataengines/time/metadata.desktop +++ /dev/null @@ -1,156 +0,0 @@ -[Desktop Entry] -Name=Date and Time -Name[ar]=التاريخ و الوقت -Name[as]=তাৰিখ আৰু সময় -Name[be@latin]=Data j čas -Name[bg]=Дата и час -Name[bn]=তারিখ এবং সময় -Name[bn_IN]=তারিখ ও সময় -Name[ca]=Data i hora -Name[ca@valencia]=Data i hora -Name[cs]=Datum a čas -Name[csb]=Datum ë czas -Name[da]=Dato og tid -Name[de]=Datum und Zeit -Name[el]=Ημερομηνία και ώρα -Name[en_GB]=Date and Time -Name[es]=Fecha y hora -Name[et]=Kuupäev ja kellaaeg -Name[eu]=Data eta ordua -Name[fi]=Päivämäärä ja aika -Name[fr]=Date et Heure -Name[fy]=Datum en tiid -Name[ga]=Dáta agus Am -Name[gl]=Data e hora -Name[gu]=તારીખ અને સમય -Name[he]=תאריך ושעה -Name[hi]=तारीख़ और समय -Name[hne]=तारीक अउ समय -Name[hr]=Datum i vrijeme -Name[hu]=Dátum és idő -Name[id]=Tanggal dan Waktu -Name[is]=Dagur og tími -Name[it]=Data e ora -Name[ja]=日付と時間 -Name[kk]=Күні мен уақыты -Name[km]=កាល​បរិច្ឆេទ និង​ពេលវេលា -Name[kn]=ದಿನಾಂಕ ಮತ್ತು ಸಮಯ -Name[ko]=날짜와 시간 -Name[ku]=Dîrok û Dem -Name[lt]=Data ir laikas -Name[lv]=Datums un laiks -Name[mai]=दिनाँक आ समय -Name[mk]=Датум и време -Name[ml]=തീയതിയും സമയവും -Name[mr]=दिनांक व वेळ -Name[nb]=Dato og klokkeslett -Name[nds]=Datum un Tiet -Name[nl]=Datum en tijd -Name[nn]=Dato og klokkeslett -Name[or]=ତାରିଖ ଏବଂ ସମୟ -Name[pa]=ਮਿਤੀ ਅਤੇ ਟਾਈਮ -Name[pl]=Data i czas -Name[pt]=Data e Hora -Name[pt_BR]=Data e hora -Name[ro]=Data și ora -Name[ru]=Дата и время -Name[si]=දිනය සහ වේලාව -Name[sk]=Dátum a čas -Name[sl]=Datum in čas -Name[sr]=датум и време -Name[sr@latin]=datum i vreme -Name[sv]=Datum och tid -Name[ta]=Date and Time -Name[tg]=Сана ва вақт -Name[th]=วันและเวลา -Name[tr]=Tarih ve Saat -Name[uk]=Дата і час -Name[x-test]=xxDate and Timexx -Name[zh_CN]=日期和时间 -Name[zh_TW]=日期與時間 -Comment=Time data for Plasmoids -Comment[ar]=محرك بيانات الوقت للبلازمويدات -Comment[be@latin]=Źviestki pra čas dla widžetaŭ „Plasma” -Comment[bg]=Време (плазмоиди) -Comment[bn_IN]=Plasmoids-র জন্য সময় সংক্রান্ত তথ্য -Comment[ca]=Dades d'hora pels Plasmoides -Comment[ca@valencia]=Dades d'hora pels Plasmoides -Comment[cs]=Časová data pro plasmoidy -Comment[csb]=Czérownik czasu ë datuma dlô plazmoidów -Comment[da]=Tiddata til plasmoids -Comment[de]=Zeitdaten für Plasmoide -Comment[el]=Δεδομένα χρόνου για πλασμοειδή -Comment[en_GB]=Time data for Plasmoids -Comment[eo]=Tempaj datumoj por Plasmoidoj -Comment[es]=Datos horarios para los plasmoides -Comment[et]=Ajaandmed plasmoididele -Comment[eu]=Plasmoiden denboraren datuak -Comment[fa]=داده زمان برای Plasmoids -Comment[fi]=Aikatietoa Plasmoideille -Comment[fr]=Données temporelles pour les plasmoïdes -Comment[fy]=Tiid gegevens foar Plasmoids -Comment[ga]=Sonraí ama le haghaidh Plasmóidí -Comment[gl]=Datos de tempo para os Plasmoides -Comment[gu]=પ્લાઝમોઇડ માટે સમય માહિતી -Comment[he]=נתוני זמן עבור פלסמואידים -Comment[hi]=प्लाज्माइड्स के लिए समय डाटा -Comment[hne]=प्लाज्माइड्स बर समय डाटा -Comment[hr]=Podaci o vremenu za plasmoide -Comment[hu]=Időadatok plazmoidokhoz -Comment[id]=Data waktu untuk Plasmoids -Comment[is]=Tímaupplýsingar fyrir Plasmadót -Comment[it]=Dati temporali per i plasmoidi -Comment[ja]=プラズモイドのための時間データ -Comment[kk]=Плазмоидтерге уақыт деректері -Comment[km]=ទិន្នន័យ​ពេល​វេលា​សម្រាប់ Plasmoids -Comment[kn]=ಪ್ಲಾಸ್ಮಾಯ್ಡ್ ಗಳಿಗೆ ಸಮಯ ದತ್ತ -Comment[ko]=Plasmoid를 위한 시간 데이터 -Comment[lt]=Laiko informacija plazmoidams -Comment[lv]=Laika dati Plazmoīdiem -Comment[mai]=प्लाज्माइड्स क' लेल समय डाटा -Comment[ml]=പ്ലാസ്മോയിഡ്സിനുള്ള സമയത്തിന്റെ ഡാറ്റ -Comment[mr]=Plasmoids करीता वेळ माहिती -Comment[nb]=Tidsdata for plasmoider -Comment[nds]=Tietdaten för Lüttprogrammen -Comment[ne]=प्लासमोइड्सका लागि समय डेटा -Comment[nl]=Tijdgegevens voor Plasmoids -Comment[nn]=Tidsdata for plasmoidar -Comment[or]=Plasmoids ପାଇଁ ସମୟ ତଥ୍ୟ -Comment[pa]=ਪਲਾਜਮੋਡੀਸ ਲਈ ਟਾਈਮ ਡਾਟਾ -Comment[pl]=Dane o czasie dla plazmoidów -Comment[pt]=Dados de data/hora para os Plasmóides -Comment[pt_BR]=Dados de tempo para os plasmoides -Comment[ro]=Date despre oră pentru plasmoizi -Comment[ru]=Данные о времени для виджетов -Comment[se]=Áigedáhtat plasmoidaide -Comment[si]=Time data for Plasmoids -Comment[sk]=Časové údaje pre plazmoidy -Comment[sl]=Podatki o času za Plazmoide -Comment[sr]=Датум и време за плазмоиде -Comment[sr@latin]=Datum i vreme za plazmoide -Comment[sv]=Tiddata för Plasmoider -Comment[ta]=Time data for Plasmoids -Comment[te]=Plasmoids కొరకు టైమ్ డాటా -Comment[tg]=Временные данные для плазмоидов -Comment[th]=ข้อมูลเวลาสำหรับพลาสมอยด์ -Comment[tr]=Plasma programcıkları için saat verisi -Comment[uk]=Дані часу для Плазмоїдів -Comment[vi]=Dữ liệu thời gian cho Plasmoids -Comment[wa]=Dinêyes d' eures po Plasmoids -Comment[x-test]=xxTime data for Plasmoidsxx -Comment[zh_CN]=Plasmoids 的时间数据 -Comment[zh_TW]=電漿時鐘的時間資料 -Type=Service -ServiceTypes=Plasma/DataEngine -X-Plasma-API=ruby-script -X-Plasma-MainScript=code/main.rb - -X-KDE-PluginInfo-Author=Richard Dale -X-KDE-PluginInfo-Email=richard.j.dale@gmail.com -X-KDE-PluginInfo-Name=ruby-time -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://plasma.kde.org/ -X-KDE-PluginInfo-Category=Date and Time -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/webkit/plasmoids/dataengines/contents/code/main.html b/plasma/webkit/plasmoids/dataengines/contents/code/main.html deleted file mode 100644 index a03e1a1..0000000 --- a/plasma/webkit/plasmoids/dataengines/contents/code/main.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - -
Hello, World!
-
-
Hello, World!
-
-
Hello, World!
- - - diff --git a/plasma/webkit/plasmoids/dataengines/metadata.desktop b/plasma/webkit/plasmoids/dataengines/metadata.desktop deleted file mode 100644 index 966132c..0000000 --- a/plasma/webkit/plasmoids/dataengines/metadata.desktop +++ /dev/null @@ -1,18 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=DataEngines from Webkit -Description=Example showing how to use a DataEngine in a web based Plasmoid -Type=Service -ServiceTypes=Plasma/Applet -Icon=plasma - -X-Plasma-API=webkit -X-KDE-PluginInfo-Author=Aaron Seigo -X-KDE-PluginInfo- Email=aseigo@kde.org -X-KDE-PluginInfo-Name=webkit-dataengine-example -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://techbase.kde.org/Development/Tutorials/Plasma/Web/GettingStarted -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasma/webkit/plasmoids/hello-web/contents/code/main.html b/plasma/webkit/plasmoids/hello-web/contents/code/main.html deleted file mode 100644 index 2bd0e80..0000000 --- a/plasma/webkit/plasmoids/hello-web/contents/code/main.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - Hello World - - - Hello World! - - diff --git a/plasma/webkit/plasmoids/hello-web/metadata.desktop b/plasma/webkit/plasmoids/hello-web/metadata.desktop deleted file mode 100644 index a1a241e..0000000 --- a/plasma/webkit/plasmoids/hello-web/metadata.desktop +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Hello Web Example -Name[nl]=Hallo Web -Description=Example showing how to create a very basic "Hellow World" Plasmoid using web technology -Type=Service -ServiceTypes=Plasma/Applet -Icon=chronometer -X-Plasma-API=webkit -X-Plasma-MainScript=code/main.html -X-KDE-PluginInfo-Author=Patrick Aljord -X-KDE-PluginInfo- Email=patcito@gmail.com -X-KDE-PluginInfo-Name=hello-web -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=http://techbase.kde.org/Development/Tutorials/Plasma/Web/GettingStarted -X-KDE-PluginInfo-Category=Examples -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff --git a/solid/CMakeLists.txt b/solid/CMakeLists.txt deleted file mode 100644 index 9f8b34f..0000000 --- a/solid/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR) - -install(FILES README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/solid) - -add_subdirectory(hardwareinfo) -add_subdirectory(minibrowser) -add_subdirectory(notifierdemo) -add_subdirectory(soliddemo) -add_subdirectory(tutorial1) -add_subdirectory(tutorial2) -add_subdirectory(tutorial3) -add_subdirectory(tutorial4) -add_subdirectory(tutorial5) -add_subdirectory(tutorial6) -add_subdirectory(tutorial7) diff --git a/solid/README b/solid/README deleted file mode 100644 index 0256f27..0000000 --- a/solid/README +++ /dev/null @@ -1,3 +0,0 @@ -Hardware Interaction in KDE is done through Solid. - -Solid provides access to hardware information with the necessary abstraction to support multiple platforms. diff --git a/solid/hardwareinfo/CMakeLists.txt b/solid/hardwareinfo/CMakeLists.txt deleted file mode 100644 index aa5a65f..0000000 --- a/solid/hardwareinfo/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(hardwareinfo) - -set(SRCS main.cpp mainwindow.cpp) - -include_directories(${KDE4_INCLUDES} ${QT_INCLUDES}) -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) - -kde4_add_executable(hardwareinfo ${SRCS}) -target_link_libraries(hardwareinfo ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS}) -install(TARGETS hardwareinfo ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/solid/hardwareinfo/main.cpp b/solid/hardwareinfo/main.cpp deleted file mode 100644 index 6ddeda5..0000000 --- a/solid/hardwareinfo/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("hardwareinfo", 0, - ki18n("Hardware Information Demo"), "1.0", - ki18n("This application shows information of various hardware devices."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/solid/hardwareinfo/mainwindow.cpp b/solid/hardwareinfo/mainwindow.cpp deleted file mode 100644 index 4800f26..0000000 --- a/solid/hardwareinfo/mainwindow.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mainwindow.h" - -#include -#include -#include -#include - -#include - -#include - -MainWindow::MainWindow(QWidget *parent) - : KMainWindow(parent) -{ - processors = Solid::Device::listFromType(Solid::DeviceInterface::Processor); - - QGroupBox *groupBox = new QGroupBox(i18n("Processors"), this); - QVBoxLayout *layout = new QVBoxLayout(groupBox); - - QLabel *text = new QLabel("" + i18n("Processor: ") + "", groupBox); - QComboBox *comboBox = new QComboBox(groupBox); - for (int i = 0; i < processors.count(); ++i) - comboBox->addItem(QString::number(i)); - QHBoxLayout *hLayout = new QHBoxLayout(groupBox); - hLayout->addWidget(text); - hLayout->addWidget(comboBox); - layout->addLayout(hLayout); - - hLayout = new QHBoxLayout(groupBox); - hLayout->addWidget(new QLabel(i18n("Maximum speed: "), groupBox)); - hLayout->addWidget(proccessor_speed = new QLabel(groupBox)); - layout->addLayout(hLayout); - - hLayout = new QHBoxLayout(groupBox); - hLayout->addWidget(new QLabel(i18n("Frequency change: "), groupBox)); - hLayout->addWidget(freq_change = new QLabel(groupBox)); - layout->addLayout(hLayout); - - hLayout = new QHBoxLayout(groupBox); - hLayout->addWidget(new QLabel(i18n("Intel MMX: "), groupBox)); - hLayout->addWidget(mmx = new QLabel(groupBox)); - layout->addLayout(hLayout); - - hLayout = new QHBoxLayout(groupBox); - hLayout->addWidget(new QLabel(i18n("Intel SSE: "), groupBox)); - hLayout->addWidget(see = new QLabel(groupBox)); - layout->addLayout(hLayout); - - hLayout = new QHBoxLayout(groupBox); - hLayout->addWidget(new QLabel(i18n("Intel SSE2: "), groupBox)); - hLayout->addWidget(see2 = new QLabel(groupBox)); - layout->addLayout(hLayout); - - hLayout = new QHBoxLayout(groupBox); - hLayout->addWidget(new QLabel(i18n("Intel SSE3: "), groupBox)); - hLayout->addWidget(see3 = new QLabel(groupBox)); - layout->addLayout(hLayout); - - hLayout = new QHBoxLayout(groupBox); - hLayout->addWidget(new QLabel(i18n("Intel SSE4: "), groupBox)); - hLayout->addWidget(see4 = new QLabel(groupBox)); - layout->addLayout(hLayout); - - hLayout = new QHBoxLayout(groupBox); - hLayout->addWidget(new QLabel(i18n("AMD 3DNOW: "), groupBox)); - hLayout->addWidget(amd = new QLabel(groupBox)); - layout->addLayout(hLayout); - - hLayout = new QHBoxLayout(groupBox); - hLayout->addWidget(new QLabel(i18n("PPC AltiVec: "), groupBox)); - hLayout->addWidget(ppc = new QLabel(groupBox)); - layout->addLayout(hLayout); - - connect(comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(processorChanged(int))); - processorChanged(0); - - groupBox->setLayout(layout); - setCentralWidget(groupBox); -} - -void MainWindow::processorChanged(int num) -{ - static QString yes = i18n("yes"); - static QString no = i18n("no"); - - Solid::Processor *processor = processors[num].as(); - - proccessor_speed->setText(QString::number(processor->maxSpeed())); - - freq_change->setText(QString(processor->canChangeFrequency() ? yes:no)); - - Solid::Processor::InstructionSets extensions = processor->instructionSets(); - mmx->setText(QString(extensions & Solid::Processor::IntelMmx ? yes:no)); - see->setText(QString(extensions & Solid::Processor::IntelSse ? yes:no)); - see2->setText(QString(extensions & Solid::Processor::IntelSse2 ? yes:no)); - see3->setText(QString(extensions & Solid::Processor::IntelSse3 ? yes:no)); - see4->setText(QString(extensions & Solid::Processor::IntelSse4 ? yes:no)); - amd->setText(QString(extensions & Solid::Processor::Amd3DNow ? yes:no)); - ppc->setText(QString(extensions & Solid::Processor::AltiVec ? yes:no)); -} diff --git a/solid/hardwareinfo/mainwindow.h b/solid/hardwareinfo/mainwindow.h deleted file mode 100644 index 4e2986f..0000000 --- a/solid/hardwareinfo/mainwindow.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -#include - -class QLabel; - -class MainWindow : public KMainWindow -{ - Q_OBJECT - - public: - MainWindow(QWidget *parent = 0); - - private Q_SLOTS: - void processorChanged(int num); - - private: - QList processors; - - QLabel *proccessor_speed; - QLabel *freq_change; - QLabel *mmx, *see, *see2, *see3, *see4, *amd, *ppc; -}; - -#endif // MAINWINDOW_H diff --git a/solid/minibrowser/CMakeLists.txt b/solid/minibrowser/CMakeLists.txt deleted file mode 100644 index 84336d1..0000000 --- a/solid/minibrowser/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(minibrowser) - -include_directories(${KDE4_INCLUDE_DIR} ${QT_INCLUDES}) -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) - -kde4_add_executable(minibrowser main.cpp) - -target_link_libraries(minibrowser ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS}) - -install(TARGETS minibrowser ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/solid/minibrowser/main.cpp b/solid/minibrowser/main.cpp deleted file mode 100644 index d997289..0000000 --- a/solid/minibrowser/main.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2009 Harald Fernengel - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -class SolidItem : public QTreeWidgetItem -{ -public: - enum SolidItemType { SolidType = UserType + 42 }; - - SolidItem(const Solid::Device &device) - : QTreeWidgetItem(SolidType) - { - setText(0, device.udi()); - QString icon = device.icon(); - if (!icon.isEmpty()) - setIcon(0, KIcon(icon)); - } -}; - -class SolidBrowser : public QMainWindow -{ - Q_OBJECT -public: - SolidBrowser(QWidget *parent = 0) - : QMainWindow(parent) - { - QWidget *central = new QWidget; - QVBoxLayout *layout = new QVBoxLayout(central); - - view = new QTreeWidget; - view->setColumnCount(1); - view->setHeaderLabel("Solid UDI"); - connect(view, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), - SLOT(currentItemChanged(QTreeWidgetItem*))); - - details = new KTextBrowser; - - filterCombo = new KComboBox; - QStringList filters = QStringList() - << "No filter" - << "Unknown" - << "GenericInterface" - << "Processor" - << "Block" - << "StorageAccess" - << "StorageDrive" - << "OpticalDrive" - << "StorageVolume" - << "OpticalDisc" - << "Camera" - << "PortableMediaPlayer" - << "NetworkInterface" - << "AcAdapter" - << "Battery" - << "Button" - << "AudioInterface" - << "DvbInterface" - << "Video" - << "SerialInterface" - << "SmartCardReader"; - filterCombo->addItems(filters); - connect(filterCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(populate())); - - QHBoxLayout *devicesLayout = new QHBoxLayout; - devicesLayout->addWidget(new QLabel("Devices:")); - devicesLayout->addStretch(); - devicesLayout->addWidget(new QLabel("Filter:")); - devicesLayout->addWidget(filterCombo); - - layout->addLayout(devicesLayout); - layout->addWidget(view); - layout->addWidget(new QLabel("Details:")); - layout->addWidget(details); - - QMenu *editMenu = menuBar()->addMenu("&Edit"); - QAction *reloadAction = editMenu->addAction("&Refresh", this, SLOT(populate())); - reloadAction->setShortcut(QKeySequence::Refresh); - - setCentralWidget(central); - } - -public Q_SLOTS: - void populate(); - -private Q_SLOTS: - void currentItemChanged(QTreeWidgetItem *current); - -private: - QTreeWidget *view; - QTextBrowser *details; - QComboBox *filterCombo; -}; - -void SolidBrowser::currentItemChanged(QTreeWidgetItem *current) -{ - details->clear(); - - // 0 pointer means selection was cleared, no more current item. - if (!current || current->type() != SolidItem::SolidType) - return; - - SolidItem *item = static_cast(current); - const QString udi = item->text(0); - details->append("

Details for " + udi + "

"); - - Solid::Device device(udi); - if (!device.isValid()) { - details->append("

Invalid Device (it might have been removed?)

"); - return; - } - - if (Solid::GenericInterface *iface = device.as()) { - QString out = "\n"; - const QMap allProperties = iface->allProperties(); - for (QMap::const_iterator it = allProperties.constBegin(); - it != allProperties.constEnd(); ++it) { - QString row; - QVariant val = it.value(); - row += "\n"; - out += row; - } - out += "
PropertyValue
"; - row += Qt::escape(it.key()); - row += ": "; - if (val.type() == QVariant::ByteArray) { - // byte arrays are usually only used as arrays of bytes, - // not 8-bit strings. Output them as hex - row += val.toByteArray().toHex(); - } else { - row += Qt::escape(it.value().toString()); - } - row += "
\n"; - details->append(out); - } -} - -static SolidItem *addParentItems(const Solid::Device &device, QHash &deviceHash, - QTreeWidget *view) -{ - const QString parentUdi = device.parentUdi(); - - if (deviceHash.contains(parentUdi)) - return deviceHash.value(parentUdi); - - Solid::Device parentDevice = device.parent(); - SolidItem *parentItem = new SolidItem(parentDevice); - deviceHash[parentUdi] = parentItem; - - const QString grandParentUdi = parentDevice.parentUdi(); - if (grandParentUdi.isEmpty()) { - view->invisibleRootItem()->addChild(parentItem); - } else { - // add the grandparents recursively. - SolidItem *grandParentItem = addParentItems(parentDevice, deviceHash, view); - grandParentItem->addChild(parentItem); - } - return parentItem; -} - -void SolidBrowser::populate() -{ - // wipe out all data - view->clear(); - - QHash deviceHash; - - // get a list of devices to show - QList allDevices; - if (filterCombo->currentIndex() <= 0) { - // show all devices - allDevices = Solid::Device::allDevices(); - } else { - // populate with all devices of the given type - allDevices = Solid::Device::listFromType( - Solid::DeviceInterface::stringToType(filterCombo->currentText())); - } - - // create one QTreeWidgetItem per device - foreach (const Solid::Device &device, allDevices) { - deviceHash[device.udi()] = new SolidItem(device); - } - - // sort them - foreach (const Solid::Device &device, allDevices) { - SolidItem *item = deviceHash[device.udi()]; - const QString parentUdi = device.parentUdi(); - if (parentUdi.isEmpty()) { - view->invisibleRootItem()->addChild(item); - } else { - SolidItem *parentItem = deviceHash.value(parentUdi); - if (!parentItem) - parentItem = addParentItems(device, deviceHash, view); - parentItem->addChild(item); - } - } - - view->expandAll(); -} - -int main (int argc, char *argv[]) -{ - KAboutData aboutData("solid-browser", - 0, - ki18n("Solid Browser"), - "0.1", - ki18n("Displays a Solid Device Tree"), - KAboutData::License_GPL, - ki18n("(c) 2009 Harald Fernengel"), - ki18n("Simple and quick hack for showing a solid device tree"), - "http://www.kde.org/", - "submit@bugs.kde.org"); - - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - SolidBrowser browser; - browser.populate(); - browser.show(); - - return app.exec(); -} - -#include "main.moc" diff --git a/solid/notifierdemo/CMakeLists.txt b/solid/notifierdemo/CMakeLists.txt deleted file mode 100644 index 1aed9a9..0000000 --- a/solid/notifierdemo/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(solidnotifierdemo) - -set(SRCS main.cpp mainwindow.cpp) - -include_directories(${KDE4_INCLUDES} ${QT_INCLUDES}) -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) - -kde4_add_executable(solidnotifierdemo ${SRCS}) -target_link_libraries(solidnotifierdemo ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS}) -install(TARGETS solidnotifierdemo ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/solid/notifierdemo/main.cpp b/solid/notifierdemo/main.cpp deleted file mode 100644 index 80040f1..0000000 --- a/solid/notifierdemo/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("solidnotifierdemo", 0, - ki18n("Solid Notifier Demo"), "1.0", - ki18n("Application that notifies when a device is added or removed."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/solid/notifierdemo/mainwindow.cpp b/solid/notifierdemo/mainwindow.cpp deleted file mode 100644 index 51cad7a..0000000 --- a/solid/notifierdemo/mainwindow.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mainwindow.h" - -#include - -#include - -#include -#include - -MainWindow::MainWindow(QWidget *parent) - : KMainWindow(parent) -{ - central = new QLabel(this); - connect(Solid::DeviceNotifier::instance(), SIGNAL(deviceAdded(QString)), this, SLOT(deviceAdded(QString))); - connect(Solid::DeviceNotifier::instance(), SIGNAL(deviceRemoved(QString)), this, SLOT(deviceRemoved(QString))); - central->setText(i18n("Add or remove a device")); - setCentralWidget(central); -} - -void MainWindow::deviceAdded(const QString &udi) -{ - QString text = "" + i18n("Device Added: ") + " " + udi + "
"; - - Solid::Device device(udi); - text += "" + i18n("Description: ") + " " + device.description(); - - central->setText(text); -} - -void MainWindow::deviceRemoved(const QString &udi) -{ - central->setText("" + i18n("Device Removed: ") + " " + udi); -} diff --git a/solid/notifierdemo/mainwindow.h b/solid/notifierdemo/mainwindow.h deleted file mode 100644 index ef1a7e5..0000000 --- a/solid/notifierdemo/mainwindow.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class QLabel; - -class MainWindow : public KMainWindow -{ - Q_OBJECT - - public: - MainWindow(QWidget *parent = 0); - - private Q_SLOTS: - void deviceAdded(const QString &udi); - void deviceRemoved(const QString &udi); - - private: - QLabel *central; -}; - -#endif // MAINWINDOW_H diff --git a/solid/soliddemo/CMakeLists.txt b/solid/soliddemo/CMakeLists.txt deleted file mode 100644 index d869582..0000000 --- a/solid/soliddemo/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(soliddemo) - -set(SRCS main.cpp mainwindow.cpp) - -include_directories(${KDE4_INCLUDES} ${QT_INCLUDES}) -add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) - -kde4_add_executable(soliddemo ${SRCS}) -target_link_libraries(soliddemo ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS}) -install(TARGETS soliddemo ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/solid/soliddemo/main.cpp b/solid/soliddemo/main.cpp deleted file mode 100644 index 8155e67..0000000 --- a/solid/soliddemo/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * Copyright 2009 Harald Fernengel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("soliddemo", 0, - ki18n("Solid Demo"), "1.0", - ki18n("Basic Solid (KDE's hardware abstraction layer) demo."), - KAboutData::License_GPL, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/solid/soliddemo/mainwindow.cpp b/solid/soliddemo/mainwindow.cpp deleted file mode 100644 index 56ead6f..0000000 --- a/solid/soliddemo/mainwindow.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * Copyright 2009 Harald Fernengel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "mainwindow.h" - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -MainWindow::MainWindow(QWidget *parent) - : KMainWindow(parent) -{ - QWidget *central = new QWidget(this); - QVBoxLayout *layout = new QVBoxLayout(central); - - view = new KListWidget(this); - connect(view, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), - this, SLOT(currentItemChanged(QListWidgetItem*))); - - details = new KTextBrowser; - - filterCombo = new KComboBox; - QStringList filters; - filters << "No filter" - << "Unknown" - << "GenericInterface" - << "Processor" - << "Block" - << "StorageAccess" - << "StorageDrive" - << "OpticalDrive" - << "StorageVolume" - << "OpticalDisc" - << "Camera" - << "PortableMediaPlayer" - << "NetworkInterface" - << "AcAdapter" - << "Battery" - << "Button" - << "AudioInterface" - << "DvbInterface" - << "Video" - << "SerialInterface" - << "SmartCardReader" - << "InternetGateway" - << "NetworkShare"; - filterCombo->addItems(filters); - connect(filterCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(populate())); - populate(); - - QHBoxLayout *devicesLayout = new QHBoxLayout(this); - devicesLayout->addWidget(new QLabel(i18n("Devices:"),this)); - devicesLayout->addStretch(); - devicesLayout->addWidget(new QLabel(i18n("Filter:"),this)); - devicesLayout->addWidget(filterCombo); - - layout->addLayout(devicesLayout); - layout->addWidget(view); - layout->addWidget(new QLabel(i18n("Properties:"),this)); - layout->addWidget(details); - - view->setMinimumSize(600, 300); - details->setMaximumHeight(250); - setCentralWidget(central); -} - -void MainWindow::currentItemChanged(QListWidgetItem *current) -{ - details->clear(); - - if (!current) - return; - - const QString udi = current->text(); - details->append("

" + udi + "

"); - - Solid::Device device(udi); - if (!device.isValid()) { - details->append(i18n("Invalid Device (it might have been removed?)")); - return; - } - - if (Solid::GenericInterface *iface = device.as()) { - const QMap allProperties = iface->allProperties(); - if (allProperties.isEmpty()) - return; - QString out = "\n"; - QMap::const_iterator it; - for (it = allProperties.constBegin(); it != allProperties.constEnd(); ++it) { - QVariant val = it.value(); - out += "\n"; - } - out += "
" + i18n("Property") + "" + i18n("Value") + "
"; - out += Qt::escape(it.key()); - out += ": "; - if (val.type() == QVariant::ByteArray) { - // byte arrays are usually only used as arrays of bytes, - // not 8-bit strings. Output them as hex - out += val.toByteArray().toHex(); - } else { - out += Qt::escape(it.value().toString()); - } - out += "
\n"; - details->append(out); - } -} - -void MainWindow::populate() -{ - view->clear(); - - QList devices; - if (filterCombo->currentIndex() <= 0) { - devices = Solid::Device::allDevices(); - } else { - devices = Solid::Device::listFromType(Solid::DeviceInterface::stringToType(filterCombo->currentText())); - } - - foreach (const Solid::Device &device, devices) { - new QListWidgetItem(KIcon(device.icon()), device.udi(), view); - } -} diff --git a/solid/soliddemo/mainwindow.h b/solid/soliddemo/mainwindow.h deleted file mode 100644 index 146fc32..0000000 --- a/solid/soliddemo/mainwindow.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * Copyright 2009 Harald Fernengel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class QListWidgetItem; - -class KComboBox; -class KListWidget; -class KTextBrowser; - -class MainWindow : public KMainWindow -{ - Q_OBJECT - - public: - MainWindow(QWidget *parent = 0); - - private Q_SLOTS: - void populate(); - void currentItemChanged(QListWidgetItem *current); - - private: - KListWidget *view; - KTextBrowser *details; - KComboBox *filterCombo; -}; - -#endif // MAINWINDOW_H diff --git a/solid/tutorial1/CMakeLists.txt b/solid/tutorial1/CMakeLists.txt deleted file mode 100644 index 64e0e73..0000000 --- a/solid/tutorial1/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -project(tutorial1) - -include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) -add_definitions(${QT_DEFINITIONS} ${QDBUS_DEFINITIONS} ${KDE4_DEFINITIONS}) - -kde4_add_executable(tutorial1 tutorial1.cpp ) - -target_link_libraries(tutorial1 ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ) diff --git a/solid/tutorial1/tutorial1.cpp b/solid/tutorial1/tutorial1.cpp deleted file mode 100644 index 3aa50a5..0000000 --- a/solid/tutorial1/tutorial1.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -//QT specific includes -#include -#include - -//solid specific includes -#include -#include - -//kde specific includes -#include -#include -#include -#include - -using namespace std; - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - KComponentData componentData("tutorial1"); - - foreach (const Solid::Device &device, Solid::Device::allDevices()) - { - kDebug() << device.udi().toLatin1().constData(); - } - return 0; -} - diff --git a/solid/tutorial1/tutorial1.h b/solid/tutorial1/tutorial1.h deleted file mode 100644 index 0501ebd..0000000 --- a/solid/tutorial1/tutorial1.h +++ /dev/null @@ -1,18 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ diff --git a/solid/tutorial2/CMakeLists.txt b/solid/tutorial2/CMakeLists.txt deleted file mode 100644 index e89fc1a..0000000 --- a/solid/tutorial2/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(tutorial2) - -include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) -add_definitions(${QT_DEFINITIONS} ${QDBUS_DEFINITIONS} ${KDE4_DEFINITIONS}) - -set(tutorial2_SRCS tutorial2.cpp ) - -kde4_add_executable(tutorial2 ${tutorial2_SRCS}) - -target_link_libraries(tutorial2 ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ) diff --git a/solid/tutorial2/tutorial2.cpp b/solid/tutorial2/tutorial2.cpp deleted file mode 100644 index e6b6d93..0000000 --- a/solid/tutorial2/tutorial2.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -//QT specific includes -#include -#include - -//solid specific includes -#include -#include -#include - -//kde specific includes -#include -#include -#include -#include - -#include - -using namespace std; - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - KComponentData componentData("tutorial2"); - - //get a list of all devices that are AudioInterface - foreach (const Solid::Device &device, Solid::Device::listFromType(Solid::DeviceInterface::AudioInterface, QString())) - { - kDebug() << device.udi().toLatin1().constData(); - } - return 0; -} - diff --git a/solid/tutorial2/tutorial2.h b/solid/tutorial2/tutorial2.h deleted file mode 100644 index 674b52e..0000000 --- a/solid/tutorial2/tutorial2.h +++ /dev/null @@ -1,19 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - diff --git a/solid/tutorial3/CMakeLists.txt b/solid/tutorial3/CMakeLists.txt deleted file mode 100644 index 04f8856..0000000 --- a/solid/tutorial3/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(tutorial3) - -include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) -add_definitions(${QT_DEFINITIONS} ${QDBUS_DEFINITIONS} ${KDE4_DEFINITIONS}) - -set(tutorial3_SRCS tutorial3.cpp ) - -kde4_add_executable(tutorial3 ${tutorial3_SRCS}) - -target_link_libraries(tutorial3 ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ) diff --git a/solid/tutorial3/tutorial3.cpp b/solid/tutorial3/tutorial3.cpp deleted file mode 100644 index 3246da5..0000000 --- a/solid/tutorial3/tutorial3.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -//QT specific includes -#include -#include - -//solid specific includes -#include -#include -#include -#include - -//kde specific includes -#include -#include -#include -#include - -#include - -using namespace std; - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - KComponentData componentData("tutorial3"); - - //get a Processor - QList list = Solid::Device::listFromType(Solid::DeviceInterface::Processor, QString()); - - //take the first processor - Solid::Device device = list[0]; - if(device.is()) kDebug() << "We've got a processor!" << list.count() << "to be exact..."; - else kDebug() << "Device is not a processor."; - - Solid::Processor *processor = device.as(); - kDebug() << "This processors maximum speed is: " << processor->maxSpeed(); - - Solid::Processor::InstructionSets extensions = processor->instructionSets(); - kDebug() << "Intel MMX supported:" << (bool)(extensions & Solid::Processor::IntelMmx); - kDebug() << "Intel SSE supported:" << (bool)(extensions & Solid::Processor::IntelSse); - kDebug() << "Intel SSE2 supported:" << (bool)(extensions & Solid::Processor::IntelSse2); - kDebug() << "Intel SSE3 supported:" << (bool)(extensions & Solid::Processor::IntelSse3); - kDebug() << "Intel SSE4 supported:" << (bool)(extensions & Solid::Processor::IntelSse4); - kDebug() << "AMD 3DNOW supported:" << (bool)(extensions & Solid::Processor::Amd3DNow); - kDebug() << "PPC AltiVec supported:" << (bool)(extensions & Solid::Processor::AltiVec); - - return 0; -} - diff --git a/solid/tutorial3/tutorial3.h b/solid/tutorial3/tutorial3.h deleted file mode 100644 index 674b52e..0000000 --- a/solid/tutorial3/tutorial3.h +++ /dev/null @@ -1,19 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - diff --git a/solid/tutorial4/CMakeLists.txt b/solid/tutorial4/CMakeLists.txt deleted file mode 100644 index 94a9c2d..0000000 --- a/solid/tutorial4/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(tutorial4) - -include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) -add_definitions(${QT_DEFINITIONS} ${QDBUS_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1) - -set(tutorial4_SRCS tutorial4.cpp ) - -kde4_add_executable(tutorial4 ${tutorial4_SRCS}) - -target_link_libraries(tutorial4 ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ) diff --git a/solid/tutorial4/tutorial4.cpp b/solid/tutorial4/tutorial4.cpp deleted file mode 100644 index 7872812..0000000 --- a/solid/tutorial4/tutorial4.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -//QT specific includes -#include -#include - -//solid specific includes -#include -#include - -//kde specific includes -#include -#include -#include -#include - -#include - -using namespace std; - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - KComponentData data("tutorial4"); - - //test to see if networking is enabled on the system - if(Solid::Networking::status() == Solid::Networking::Connected) - { - kDebug() << "Networking is enabled. Feel free to go online!"; - } - else - { - kDebug() << "Network not available."; - } - return 0; -} - diff --git a/solid/tutorial4/tutorial4.h b/solid/tutorial4/tutorial4.h deleted file mode 100644 index 674b52e..0000000 --- a/solid/tutorial4/tutorial4.h +++ /dev/null @@ -1,19 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - diff --git a/solid/tutorial5/CMakeLists.txt b/solid/tutorial5/CMakeLists.txt deleted file mode 100644 index a36cf95..0000000 --- a/solid/tutorial5/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -project(tutorial5) - -include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) -add_definitions(${QT_DEFINITIONS} ${QDBUS_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1) - -set(tutorial5_SRCS tutorial5.cpp ) - -kde4_add_executable(tutorial5 ${tutorial5_SRCS}) - -target_link_libraries(tutorial5 ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ) diff --git a/solid/tutorial5/tutorial5.cpp b/solid/tutorial5/tutorial5.cpp deleted file mode 100644 index 1731497..0000000 --- a/solid/tutorial5/tutorial5.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -//QT specific includes -#include -#include - -//solid specific includes -#include -#include -#include -#include - -//kde specific includes -#include -#include -#include -#include - -#include - -using namespace std; - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - KComponentData data("tutorial5"); - - //get a Network Device - QList netlist = Solid::Device::listFromType(Solid::DeviceInterface::NetworkInterface, QString()); - - //check to see if no network devices were found - if(netlist.empty()) - { - kDebug() << "No network devices found!"; - return 0; - } - - Solid::Device device = netlist[0]; - Solid::NetworkInterface *netdev = device.as(); - //keep the program from crashing in the event that there's a bug in solid - if(!netdev) - { - kDebug() << "Device could not be converted. There is a bug."; - return 0; - } - - kDebug() << "The iface of " << device.udi() << " is " << netdev->ifaceName(); - - return 0; -} - diff --git a/solid/tutorial5/tutorial5.h b/solid/tutorial5/tutorial5.h deleted file mode 100644 index 674b52e..0000000 --- a/solid/tutorial5/tutorial5.h +++ /dev/null @@ -1,19 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - diff --git a/solid/tutorial6/CMakeLists.txt b/solid/tutorial6/CMakeLists.txt deleted file mode 100644 index fba4354..0000000 --- a/solid/tutorial6/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -project(tutorial6) - -include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) -add_definitions(${QT_DEFINITIONS} ${QDBUS_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1) - -set(tutorial6_SRCS tutorial6.cpp webcamwatcher.cpp ) - -kde4_add_executable(tutorial6 ${tutorial6_SRCS}) -target_link_libraries(tutorial6 ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ) diff --git a/solid/tutorial6/tutorial6.cpp b/solid/tutorial6/tutorial6.cpp deleted file mode 100644 index ece1a6e..0000000 --- a/solid/tutorial6/tutorial6.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Will Stephenson - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License or ( at - your option ) version 3 or, at the discretion of KDE e.V. ( which shall - act as a proxy as in section 14 of the GPLv3 ), any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include -#include -#include -#include - -#include "webcamwatcher.h" - -int main(int argc, char **argv) -{ - KComponentData componentData("tutorial6"); - QApplication app( argc, argv ); - WebcamWatcher wtch( 0 ); - return app.exec(); -} - - diff --git a/solid/tutorial6/webcamwatcher.cpp b/solid/tutorial6/webcamwatcher.cpp deleted file mode 100644 index 9f4afe0..0000000 --- a/solid/tutorial6/webcamwatcher.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Will Stephenson - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License or ( at - your option ) version 3 or, at the discretion of KDE e.V. ( which shall - act as a proxy as in section 14 of the GPLv3 ), any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include "webcamwatcher.h" - -#include -#include -#include -#include - -#include -#include - -WebcamWatcher::WebcamWatcher( QObject * parent ) : QObject( parent ) -{ - // get a list of all the webcams in the system - int found = 0; - foreach (const Solid::Device &device, Solid::Device::listFromType(Solid::DeviceInterface::Video, QString())) - { - m_videoDevices << device.udi(); - getDetails( device ); - found++; - } - if ( found == 0 ) - { - kDebug() << "No video devices found"; - } - // on deviceAdded, check to see if the device was added - connect( Solid::DeviceNotifier::instance(), SIGNAL(deviceAdded(const QString&)), SLOT(deviceAdded(const QString &)) ); - // likewise if removed - connect( Solid::DeviceNotifier::instance(), SIGNAL(deviceRemoved(const QString&)), SLOT(deviceRemoved(const QString &)) ); -} - -WebcamWatcher::~WebcamWatcher() -{ - -} - -void WebcamWatcher::deviceAdded( const QString & udi ) -{ - Solid::Device dev( udi ); - if ( dev.is() ) - { - m_videoDevices << udi; - getDetails( dev ); - } -} - -void WebcamWatcher::getDetails( const Solid::Device & dev ) -{ - kDebug() << "New video device at " << dev.udi(); - const Solid::Device * vendorDevice = &dev; - while ( vendorDevice->isValid() && vendorDevice->vendor().isEmpty() ) - { - vendorDevice = new Solid::Device( vendorDevice->parentUdi() ); - } - if ( vendorDevice->isValid() ) - { - kDebug() << "vendor: " << vendorDevice->vendor() << ", product: " << vendorDevice->product(); - } - QStringList protocols = dev.as()->supportedProtocols(); - if ( protocols.contains( "video4linux" ) ) - { - QStringList drivers = dev.as()->supportedDrivers( "video4linux" ); - if ( drivers.contains( "video4linux" ) ) - { - kDebug() << "V4L device path is" << dev.as()->driverHandle( "video4linux" ).toString(); - } - } -} - -void WebcamWatcher::deviceRemoved( const QString & udi ) -{ - Solid::Device dev = Solid::Device( udi ); - int i; - if ( ( i = m_videoDevices.indexOf( udi ) ) != - 1 ) { - kDebug() << udi; - m_videoDevices.removeAt( i ); - } -} -#include "webcamwatcher.moc" diff --git a/solid/tutorial6/webcamwatcher.h b/solid/tutorial6/webcamwatcher.h deleted file mode 100644 index b5bac8d..0000000 --- a/solid/tutorial6/webcamwatcher.h +++ /dev/null @@ -1,46 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Will Stephenson - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License or ( at - your option ) version 3 or, at the discretion of KDE e.V. ( which shall - act as a proxy as in section 14 of the GPLv3 ), any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#ifndef WEBCAMWATCHER_H -#define WEBCAMWATCHER_H - -#include -#include - -namespace Solid -{ - class Device; -} // namespace Solid - -class WebcamWatcher : public QObject -{ - Q_OBJECT - public: - WebcamWatcher( QObject * parent = 0 ); - ~WebcamWatcher(); - protected: - void getDetails( const Solid::Device & dev ); - protected Q_SLOTS: - void deviceAdded( const QString& udi ); - void deviceRemoved( const QString& udi ); - private: - QStringList m_videoDevices; -}; - -#endif diff --git a/solid/tutorial7/CMakeLists.txt b/solid/tutorial7/CMakeLists.txt deleted file mode 100644 index 2113517..0000000 --- a/solid/tutorial7/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -project(tutorial7) - -set(tutorial7_SRCS - tutorial7.cpp -) - -# search packages used by KDE -include(MacroLibrary) -find_package(Perl REQUIRED) -find_package(ZLIB REQUIRED) - -include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} - ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) -add_definitions(${QT_DEFINITIONS} ${QDBUS_DEFINITIONS} ${KDE4_DEFINITIONS}) -link_directories(${KDE4_LIB_DIR}) - - -kde4_add_executable(tutorial7 ${tutorial7_SRCS}) - -target_link_libraries(tutorial7 ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ) diff --git a/solid/tutorial7/tutorial7.cpp b/solid/tutorial7/tutorial7.cpp deleted file mode 100644 index f6ad94e..0000000 --- a/solid/tutorial7/tutorial7.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - -//QT specific includes -#include -#include - -//solid specific includes -#include -#include -#include -#include - -//kde specific includes -#include -#include -#include -#include - -#include - -using namespace std; - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - KComponentData componentData("tutorial7"); - - //make a predicate - Solid::Predicate defaultPredicate = Solid::Predicate(Solid::DeviceInterface::StorageVolume); - kDebug() << "First Predicate: " << defaultPredicate.toString(); - - Solid::Predicate testPredicate = defaultPredicate; - - defaultPredicate = defaultPredicate & Solid::Predicate(Solid::DeviceInterface::OpticalDisc); - kDebug() << "Second Predicate: " << defaultPredicate.toString(); - - testPredicate &= Solid::Predicate(Solid::DeviceInterface::OpticalDisc); - kDebug() << "Test Predicate: " << testPredicate.toString(); - - if(testPredicate.toString() != defaultPredicate.toString()) { - kDebug() << "Danger Will Robinson."; - } else { - kDebug() << "Nothing to see here. Move along!"; - } - - //test for devices - QList devicelist = Solid::Device::listFromQuery(defaultPredicate); - if (!devicelist.empty()) { - kDebug() << "Devices that match your query."; - foreach (const Solid::Device device, devicelist) { - kDebug() << device.udi(); - } - } else { - kDebug() << "No devices matched your query."; - } - - return 0; -} diff --git a/solid/tutorial7/tutorial7.h b/solid/tutorial7/tutorial7.h deleted file mode 100644 index 674b52e..0000000 --- a/solid/tutorial7/tutorial7.h +++ /dev/null @@ -1,19 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 Christopher Blauvelt - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - -*/ - diff --git a/sonnet/CMakeLists.txt b/sonnet/CMakeLists.txt deleted file mode 100644 index a8c6cce..0000000 --- a/sonnet/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -project(sonnet-examples) - -include_directories(${KDE4_INCLUDES}) - -install(FILES README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/sonnet) - -add_subdirectory(dialog) diff --git a/sonnet/README b/sonnet/README deleted file mode 100644 index 1c11c1f..0000000 --- a/sonnet/README +++ /dev/null @@ -1 +0,0 @@ -Sonnet is a multilingual spell check program. diff --git a/sonnet/dialog/CMakeLists.txt b/sonnet/dialog/CMakeLists.txt deleted file mode 100644 index c16976e..0000000 --- a/sonnet/dialog/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -project(sonnet-dialog) - -set(SRCS main.cpp mainwindow.cpp) - -kde4_add_executable(sonnet-dialog ${SRCS}) -target_link_libraries(sonnet-dialog ${KDE4_KDEUI_LIBS}) -install(TARGETS sonnet-dialog ${INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES ${SRCS} mainwindow.h README DESTINATION ${DATA_INSTALL_DIR}/kdeexamples/sonnet/sonnet-dialog) diff --git a/sonnet/dialog/README b/sonnet/dialog/README deleted file mode 100644 index 5707b80..0000000 --- a/sonnet/dialog/README +++ /dev/null @@ -1 +0,0 @@ -This example shows Sonnet::Dialog. diff --git a/sonnet/dialog/main.cpp b/sonnet/dialog/main.cpp deleted file mode 100644 index a45bd4e..0000000 --- a/sonnet/dialog/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "mainwindow.h" - -int main(int argc, char *argv[]) -{ - KAboutData aboutData("sonnet-dialog", 0, - ki18n("Sonnet Dialog Example"), "1.0", - ki18n("Basic example that shows the use of Sonnet::Dialog."), - KAboutData::License_BSD, - ki18n("Copyright (c) 2011 Jon Ander Peñalba ")); - KCmdLineArgs::init(argc, argv, &aboutData); - KApplication app; - - MainWindow *window = new MainWindow(); - window->show(); - - return app.exec(); -} diff --git a/sonnet/dialog/mainwindow.cpp b/sonnet/dialog/mainwindow.cpp deleted file mode 100644 index 85f1dcb..0000000 --- a/sonnet/dialog/mainwindow.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "mainwindow.h" - -#include -#include - -#include -#include - -#include -#include - -MainWindow::MainWindow(QWidget *parent) - : KMainWindow(parent) -{ - dialog = new Sonnet::Dialog(new Sonnet::BackgroundChecker(this), this); - - QWidget *central_widget = new QWidget(this); - QVBoxLayout *layout = new QVBoxLayout(central_widget); - - text = new KTextEdit("Helo world!", this); - button = new KPushButton("Spell Check", this); - layout->addWidget(text); - layout->addWidget(button); - - connect(button, SIGNAL(pressed()), this, SLOT(checkSpelling())); - connect(dialog, SIGNAL(done(QString)), text, SLOT(setPlainText(QString))); - - setMinimumSize(300,270); - setCentralWidget(central_widget); -} - -void MainWindow::checkSpelling() -{ - dialog->setBuffer(text->toPlainText()); - dialog->show(); -} diff --git a/sonnet/dialog/mainwindow.h b/sonnet/dialog/mainwindow.h deleted file mode 100644 index 020f75f..0000000 --- a/sonnet/dialog/mainwindow.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2011 Jon Ander Peñalba - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -class KTextEdit; -class KPushButton; - -namespace Sonnet { -class Dialog; -} - -class MainWindow : public KMainWindow -{ - Q_OBJECT - -public: - MainWindow(QWidget *parent=0); - -public Q_SLOTS: - void checkSpelling(); - -private: - KTextEdit *text; - KPushButton *button; - - Sonnet::Dialog *dialog; -}; - -#endif // MAINWINDOW_H diff --git a/sqlite/main.cpp b/sqlite/main.cpp deleted file mode 100644 index a58acdb..0000000 --- a/sqlite/main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include - -int main(int argc, char *argv[]) -{ - QSqlDatabase db; - db = QSqlDatabase::addDatabase("QSQLITE"); - db.setDatabaseName("sqlite.dat"); - - if (db.open()) - qDebug() << "success"; - else - qDebug() << "failed"; - QSqlQuery query; - query.exec("create table stocks(id int primary key, name varchar(20))"); - db.commit(); - db.close(); -} diff --git a/sqlite/sqlite.pro b/sqlite/sqlite.pro deleted file mode 100644 index c0f7579..0000000 --- a/sqlite/sqlite.pro +++ /dev/null @@ -1,7 +0,0 @@ -QT += sql - -TARGET = sqlite -TEMPLATE = app - -SOURCES += main.cpp -