./PaxHeaders.5990/plasmate-1.00000644000175000001440000000013112115142014014177 xustar000000000000000030 mtime=1362412556.008574342 29 atime=1362412560.66053227 30 ctime=1362412556.008574342 plasmate-1.0/0000755000175000001440000000000012115142014014555 5ustar00kokeroulisusers00000000000000plasmate-1.0/PaxHeaders.5990/plasmoidviewer0000644000175000001440000000013212115142004017074 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.635641037 30 ctime=1362412548.623641145 plasmate-1.0/plasmoidviewer/0000755000175000001440000000000012115142004017606 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmoidviewer/PaxHeaders.5990/fullview.h0000644000175000001440000000013212115142004021157 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412650.304721383 30 ctime=1362412548.622641154 plasmate-1.0/plasmoidviewer/fullview.h0000644000175000001440000000557212115142004021625 0ustar00kokeroulisusers00000000000000/* * Copyright 2007 Aaron Seigo #include #include class QTimer; namespace Plasma { class AccessAppletJob; } class FullView : public QGraphicsView { Q_OBJECT public: explicit FullView(const QString &formfactor = "planar", const QString &location = "floating", bool persistentConfig = false, QWidget *parent = 0); ~FullView(); void addApplet(const QString &name, const QString& containment, const QString& wallpaper, const QVariantList &args = QVariantList()); void screenshotAll(); void setResizeToApplet(bool resize); protected: void showEvent(QShowEvent *event); private Q_SLOTS: void appletTransformedItself(); void sceneRectChanged(const QRectF &rect); void resizeEvent(QResizeEvent *event); void closeEvent(QCloseEvent *event); void appletRemoved(Plasma::Applet *applet); void plasmoidAccessFinished(Plasma::AccessAppletJob *job); void screenshotPlasmoid(); private: void shootNextPlasmoid(); bool checkShotTimer(); KConfigGroup storageGroup(Plasma::Applet *applet) const; bool hasStorageGroupFor(Plasma::Applet *applet) const; void storeCurrentApplet(); Plasma::Corona m_corona; Plasma::FormFactor m_formfactor; Plasma::Location m_location; Plasma::Containment *m_containment; Plasma::Applet *m_applet; QStringList m_appletsToShoot; QTimer *m_appletShotTimer; // passed through cli by default, config files // are non-persistent in plasmoidviewer. bool m_persistentConfig; bool m_resizeToApplet; }; #endif plasmate-1.0/plasmoidviewer/PaxHeaders.5990/Messages.sh0000644000175000001440000000013212115142004021254 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412650.304721383 30 ctime=1362412548.622641154 plasmate-1.0/plasmoidviewer/Messages.sh0000755000175000001440000000010212115142004021705 0ustar00kokeroulisusers00000000000000#! /usr/bin/env bash $XGETTEXT *.cpp -o $podir/plasmoidviewer.pot plasmate-1.0/plasmoidviewer/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004021711 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412650.304721383 30 ctime=1362412548.622641154 plasmate-1.0/plasmoidviewer/CMakeLists.txt0000644000175000001440000000064612115142004022354 0ustar00kokeroulisusers00000000000000set(plasmoidviewer_SRCS fullview.cpp main.cpp ) kde4_add_executable(plasmoidviewer ${plasmoidviewer_SRCS}) target_link_libraries(plasmoidviewer ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${KDECLARATIVE_LIBRARIES} ${QT_QTDECLARATIVE_LIBRARY} ) install(TARGETS plasmoidviewer ${INSTALL_TARGETS_DEFAULT_ARGS}) kde4_create_manpage(man-plasmoidviewer.1.docbook 1 INSTALL_DESTINATION ${MAN_INSTALL_DIR}) plasmate-1.0/plasmoidviewer/PaxHeaders.5990/main.cpp0000644000175000001440000000013212115142004020601 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412650.304721383 30 ctime=1362412548.623641145 plasmate-1.0/plasmoidviewer/main.cpp0000644000175000001440000002772112115142004021247 0ustar00kokeroulisusers00000000000000/* * Copyright 2007 Frerich Raabe * Copyright 2007-2008 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 "fullview.h" #include #include #include #include #include #include #include #include #include #include #include // for --list #include #include #include #include #include using namespace Plasma; static const char description[] = I18N_NOOP("Run Plasma widgets in their own window"); class RemotePlasmoidWatcher : public QObject { Q_OBJECT public: RemotePlasmoidWatcher(AccessManager *manager) : QObject(manager) { kDebug(); connect(manager, SIGNAL(remoteAppletAnnounced(Plasma::PackageMetadata)), this, SLOT(slotServiceAdded(Plasma::PackageMetadata))); connect(manager, SIGNAL(remoteAppletUnannounced(Plasma::PackageMetadata)), this, SLOT(slotServiceRemoved(Plasma::PackageMetadata))); } ~RemotePlasmoidWatcher() {} public Q_SLOTS: void slotServiceAdded(Plasma::PackageMetadata metadata) { std::cout << "New service published:" << std::endl; std::cout << metadata.remoteLocation().prettyUrl().toLocal8Bit().data() << std::endl; std::cout << metadata.name().toLocal8Bit().data() << " - " << metadata.description().toLocal8Bit().data() << std::endl; } void slotServiceRemoved(Plasma::PackageMetadata metadata) { std::cout << "Service removed:" << std::endl; std::cout << metadata.remoteLocation().prettyUrl().toLocal8Bit().data() << std::endl; } }; void listPlugins(const KPluginInfo::List & plugins) { int maxLen = 0; QMap applets; foreach (const KPluginInfo &info, plugins) { if (info.property("NoDisplay").toBool()) { continue; } int len = info.pluginName().length(); if (len > maxLen) { maxLen = len; } QString name = info.pluginName(); QString comment = info.comment(); if (comment.isEmpty()) { comment = i18n("No description available"); } applets.insert(name, comment); } QMap::const_iterator it; for (it = applets.constBegin(); it != applets.constEnd(); ++it) { QString applet("%1 - %2"); applet = applet.arg(it.key().leftJustified(maxLen, ' ')).arg(it.value()); std::cout << applet.toLocal8Bit().data() << std::endl; } } int main(int argc, char **argv) { KAboutData aboutData("plasmoidviewer", 0, ki18n("Plasma Widget Viewer"), "1.0", ki18n(description), KAboutData::License_BSD, ki18n("2007-2008, Frerich Raabe")); aboutData.setProgramIconName("plasma"); aboutData.addAuthor(ki18n("Frerich Raabe"), ki18n("Original author"), "raabe@kde.org"); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineOptions options; options.add("c"); options.add("containment ", ki18n("Name of the containment plugin"), "null"); options.add("f"); options.add("formfactor ", ki18nc("Do not translate horizontal, vertical, mediacenter nor planar", "The formfactor to use (horizontal, vertical, mediacenter, planar or application)"), "planar"); options.add("la"); options.add("list", ki18n("Displays a list of known applets")); options.add("lw"); options.add("list-wallpapers", ki18n("Displays a list of known wallpapers")); options.add("lc"); options.add("list-containments", ki18n("Displays a list of known containments")); options.add("lt"); options.add("list-themes", ki18n("Displays a list of known themes")); options.add("nosaveconfig", ki18n("Disables save and restore of the config between runs")); options.add("l"); options.add("location ", ki18nc("Do not translate floating, desktop, fullscreen, top, bottom, left nor right", "The location constraint to start the Containment with (floating, desktop, fullscreen, top, bottom, left, right)"), "floating"); options.add("p"); options.add("pixmapcache ", ki18n("The size in kB to set the pixmap cache to")); options.add("s"); options.add("screenshot", ki18n("Takes a screenshot of the widget and saves it the working directory as .png")); options.add("sa"); options.add("screenshot-all", ki18n("Takes a screenshot of each widget and saves it the working directory as .png")); options.add("t"); options.add("theme ", ki18n("Desktop SVG theme to use")); options.add("w"); options.add("size x", ki18n("Initial size")); options.add("z"); options.add("wallpaper ", ki18n("Name of the wallpaper plugin. Requires a containment plugin to be specified."), QByteArray()); options.add("+applet", ki18n("Name of applet to view; may refer to the plugin name or be a path " "(absolute or relative) to a package. If not provided, then an " "attempt is made to load a package from the current directory.")); options.add("+[args]", ki18n("Optional arguments of the applet to add")); options.add("list-remote", ki18n("List zeroconf announced remote widgets")); KCmdLineArgs::addCmdLineOptions(options); KApplication app; KCmdLineArgs *args = KCmdLineArgs::parsedArgs() ; #if KDE_IS_VERSION(4, 9, 2) KDeclarative::setupQmlJsDebugger(); #endif if (args->isSet("list")) { listPlugins(Plasma::Applet::listAppletInfo()); return 0; } if (args->isSet("list-wallpapers")) { listPlugins(Plasma::Wallpaper::listWallpaperInfo()); return 0; } if (args->isSet("list-containments")) { listPlugins(Plasma::Containment::listContainments()); return 0; } if (args->isSet("list-themes")) { listPlugins(Plasma::Theme::listThemeInfo()); return 0; } QString pluginName; if (args->count() > 0) { pluginName = args->arg(0); kDebug() << "setting applet to" << pluginName; if (!QFile::exists(pluginName + "/metadata.desktop")) { KPluginInfo::List appletList = Plasma::Applet::listAppletInfo(); bool appletFound = false; foreach (const KPluginInfo& info, appletList) { if (info.pluginName() == pluginName) { appletFound = true; break; } } if (!appletFound) { kError() << "Fatal error. Applet: " + pluginName + " is invalid. Did you run kbuildsycoca4? List known containments through --list"; kError() << "Note: only accepts applet Plugin Name (visible through --list), not user-visible name"; return 1; } } } QString formfactor = args->getOption("formfactor"); kDebug() << "setting FormFactor to" << args->getOption("formfactor"); QString location = args->getOption("location"); kDebug() << "setting Location to" << args->getOption("location"); bool resizeToApplet = true; QString containment = args->getOption("containment"); if (args->isSet("containment")) { kDebug() << "setting containment to" << containment; KPluginInfo::List containmentList = Plasma::Containment::listContainments(); bool containmentFound = false; foreach (const KPluginInfo& info, containmentList) { if (info.pluginName() == containment) { containmentFound = true; resizeToApplet = false; break; } } if (!containmentFound) { kError() << "Fatal error. Containment: " + containment + " is invalid. Did you run kbuildsycoca4? List known containments through --list-containments"; kError() << "Note: only accepts containment Plugin Name (visible through --list-containments), not user-visible name"; return 1; } } if (args->isSet("theme")) { QString themeName = args->getOption("theme"); kDebug() << "setting theme to" << themeName; KPluginInfo::List themeList = Plasma::Theme::listThemeInfo(); bool themeFound = false; foreach (const KPluginInfo& info, themeList) { if (info.pluginName() == themeName) { Plasma::Theme *defaultTheme = Plasma::Theme::defaultTheme(); defaultTheme->setUseGlobalSettings(false); defaultTheme->setThemeName(themeName); themeFound = true; } } if (!themeFound) { kError() << "Fatal error. Theme: " + themeName + " is invalid. Did you run kbuildsycoca4? List known themes through --list-themes"; kError() << "Note: only accepts theme Plugin Name (visible through --list-themes), not user-visible name"; return 1; } } QString wallpaper; if (args->isSet("wallpaper")) { wallpaper = args->getOption("wallpaper"); kDebug() << "setting wallpaper to" << wallpaper; } if (args->isSet("pixmapcache")) { kDebug() << "setting pixmap cache to" << args->getOption("pixmapcache").toInt(); QPixmapCache::setCacheLimit(args->getOption("pixmapcache").toInt()); } QVariantList appletArgs; for (int i = 1; i < args->count(); ++i) { appletArgs << args->arg(i); } kDebug() << "setting auth policy"; Plasma::AuthorizationManager::self()->setAuthorizationPolicy(Plasma::AuthorizationManager::PinPairing); const bool persistentConfig = args->isSet("saveconfig"); if (!persistentConfig) { kWarning() << "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& WARNING: Applet configuration will not be restored or saved."; } FullView view(formfactor, location, persistentConfig); view.setResizeToApplet(resizeToApplet); if (args->isSet("list-remote")) { kDebug() << "list remote..."; /** QList list = AccessManager::self()->remotePlasmoids(); foreach (const KUrl &url, list) { std::cout << url.prettyUrl().toLocal8Bit().data() << std::endl; } */ new RemotePlasmoidWatcher(AccessManager::self()); } else if (args->isSet("screenshot-all")) { view.show(); view.screenshotAll(); } else { kDebug() << "just load applet"; view.addApplet(pluginName, containment, wallpaper, appletArgs); view.show(); } QAction *action = KStandardAction::quit(&app, SLOT(quit()), &view); view.addAction(action); return app.exec(); } #include "main.moc" plasmate-1.0/plasmoidviewer/PaxHeaders.5990/man-plasmoidviewer.1.docbook0000644000175000001440000000013212115142004024455 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412650.304721383 30 ctime=1362412548.623641145 plasmate-1.0/plasmoidviewer/man-plasmoidviewer.1.docbook0000644000175000001440000001253212115142004025115 0ustar00kokeroulisusers00000000000000 ]> KDE User's Manual 2010-10-21 K Desktop Environment plasmoidviewer 1 plasmoidviewer Run Plasma widgets in their own window plasmoidviewer name name name size name name applet args --list-remote KDE Generic Options Qt Generic Options Description plasmoidviewer is a graphical tool allowing developers to test Plasma applets. Only installed applets will be found. kbuildsycoca4 may need to be run for newly-installed applets to be found. Options Name of the containment plugin [null]. The formfactor to use (horizontal, vertical, mediacenter or planar) [planar]. Displays a list of known applets. Displays a list of known wallpapers. Displays a list of known containments. The location constraint to start the Containment with (floating, desktop, fullscreen, top, bottom, left, right) [floating]. The size in KB to set the pixmap cache to. Takes a screenshot of the widget and saves it the working directory as <pluginname>.png. Takes a screenshot of each widget and saves it the working directory as <pluginname>.png. Desktop SVG theme to use. Name of the wallpaper plugin. Requires a containment plugin to be specified. Name of applet to view; may refer to the plugin name or be a path (absolute or relative) to a package. If not provided, then an attempt is made to load a package from the current directory. Optional arguments of the applet to add. List zeroconf announced remote widgets. See Also More detailed user documentation is available from help:/plasma-desktop (either enter this URL into &konqueror;, or run khelpcenter help:/plasma-desktop). Authors plasmoidviewer was written by AaronSeigo aseigo@kde.org. plasmate-1.0/plasmoidviewer/PaxHeaders.5990/fullview.cpp0000644000175000001440000000013212115142004021512 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412650.304721383 30 ctime=1362412548.622641154 plasmate-1.0/plasmoidviewer/fullview.cpp0000644000175000001440000003137412115142004022157 0ustar00kokeroulisusers00000000000000/* * Copyright 2007 Frerich Raabe * Copyright 2007 Aaron Seigo * Copyright 2008 Aleix Pol * * 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 "fullview.h" #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace Plasma; FullView::FullView(const QString &ff, const QString &loc, bool persistent, QWidget *parent) : QGraphicsView(parent), m_formfactor(Plasma::Planar), m_location(Plasma::Floating), m_containment(0), m_applet(0), m_appletShotTimer(0), m_persistentConfig(persistent), m_resizeToApplet(true) { setFrameStyle(QFrame::NoFrame); QString formfactor = ff.toLower(); if (formfactor.isEmpty() || formfactor == "planar") { m_formfactor = Plasma::Planar; } else if (formfactor == "vertical") { m_formfactor = Plasma::Vertical; } else if (formfactor == "horizontal") { m_formfactor = Plasma::Horizontal; } else if (formfactor == "mediacenter") { m_formfactor = Plasma::MediaCenter; } else if (formfactor == "application") { m_formfactor = Plasma::Application; } QString location = loc.toLower(); if (loc.isEmpty() || loc == "floating") { m_location = Plasma::Floating; } else if (loc == "desktop") { m_location = Plasma::Desktop; } else if (loc == "fullscreen") { m_location = Plasma::FullScreen; } else if (loc == "top") { m_location = Plasma::TopEdge; } else if (loc == "bottom") { m_location = Plasma::BottomEdge; } else if (loc == "right") { m_location = Plasma::RightEdge; } else if (loc == "left") { m_location = Plasma::LeftEdge; } Plasma::ContainmentActionsPluginsConfig containmentActionPlugins; containmentActionPlugins.addPlugin(Qt::NoModifier, Qt::RightButton, "contextmenu"); m_corona.setContainmentActionsDefaults(Plasma::Containment::DesktopContainment, containmentActionPlugins); m_corona.setContainmentActionsDefaults(Plasma::Containment::CustomContainment, containmentActionPlugins); m_corona.setContainmentActionsDefaults(Plasma::Containment::PanelContainment, containmentActionPlugins); m_corona.setContainmentActionsDefaults(Plasma::Containment::CustomPanelContainment, containmentActionPlugins); setScene(&m_corona); connect(&m_corona, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(sceneRectChanged(QRectF))); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setAlignment(Qt::AlignLeft | Qt::AlignTop); } FullView::~FullView() { storeCurrentApplet(); } void FullView::addApplet(const QString &name, const QString &containment, const QString& wallpaper, const QVariantList &args) { kDebug() << "adding applet" << name << "in" << containment; if (!m_containment || m_containment->pluginName() != containment) { delete m_containment; m_containment = m_corona.addContainment(containment); connect(m_containment, SIGNAL(appletRemoved(Plasma::Applet*)), this, SLOT(appletRemoved(Plasma::Applet*))); } if (!wallpaper.isEmpty()) { m_containment->setWallpaper(wallpaper); } m_containment->setFormFactor(m_formfactor); m_containment->setLocation(m_location); m_containment->resize(size()); setScene(m_containment->scene()); if (name.startsWith("plasma:") || name.startsWith("zeroconf:")) { kDebug() << "accessing remote: " << name; AccessManager::self()->accessRemoteApplet(KUrl(name)); connect(AccessManager::self(), SIGNAL(finished(Plasma::AccessAppletJob*)), this, SLOT(plasmoidAccessFinished(Plasma::AccessAppletJob*))); return; } if (m_applet) { // we already have an applet! storeCurrentApplet(); disconnect(m_applet); m_applet->destroy(); } QFileInfo info(name); if (!info.isAbsolute()) { info = QFileInfo(QDir::currentPath() + "/" + name); } if (info.exists()) { m_applet = Applet::loadPlasmoid(info.absoluteFilePath()); } if (m_applet && m_resizeToApplet) { m_containment->addApplet(m_applet, QPointF(-1, -1), false); } else if (m_applet && !m_resizeToApplet) { m_containment->addApplet(m_applet, QPointF(48, 48), false); } else if (name.isEmpty()) { return; } else { m_applet = m_containment->addApplet(name, args, QRectF(0, 0, -1, -1)); } if (!m_applet) { return; } if (hasStorageGroupFor(m_applet) && m_persistentConfig) { KConfigGroup cg = m_applet->config(); KConfigGroup storage = storageGroup(m_applet); cg.deleteGroup(); storage.copyTo(&cg); m_applet->configChanged(); } if (m_resizeToApplet) { setSceneRect(m_applet->sceneBoundingRect()); setWindowTitle(m_applet->name()); setWindowIcon(SmallIcon(m_applet->icon())); } else { setSceneRect(geometry()); setWindowTitle(m_applet->name() + ": " + m_containment->name()); setWindowIcon(SmallIcon(m_containment->icon())); } m_applet->setFlag(QGraphicsItem::ItemIsMovable, false); if (m_resizeToApplet) { resize(m_applet->size().toSize()); connect(m_applet, SIGNAL(appletTransformedItself()), this, SLOT(appletTransformedItself())); kDebug() << "connecting ----------------"; } checkShotTimer(); KCmdLineArgs *cliArgs = KCmdLineArgs::parsedArgs() ; if (cliArgs->isSet("size")) { const QStringList dimensions = cliArgs->getOption("size").split("x"); if (dimensions.size() == 2) { QSize s(dimensions.at(0).toInt(), dimensions.at(1).toInt()); m_applet->resize(s); if (m_resizeToApplet) { resize(s); } } } } bool FullView::checkShotTimer() { KCmdLineArgs *cliArgs = KCmdLineArgs::parsedArgs(); if (cliArgs->isSet("screenshot") || cliArgs->isSet("screenshot-all")) { if (!m_appletShotTimer) { m_appletShotTimer = new QTimer(this); m_appletShotTimer->setSingleShot(true); m_appletShotTimer->setInterval(3000); connect(m_appletShotTimer, SIGNAL(timeout()), this, SLOT(screenshotPlasmoid())); } m_appletShotTimer->start(); return true; } return false; } void FullView::screenshotAll() { KPluginInfo::List infoList = Plasma::Applet::listAppletInfo(); foreach (const KPluginInfo &info, infoList) { m_appletsToShoot.append(info.pluginName()); } shootNextPlasmoid(); } void FullView::shootNextPlasmoid() { if (m_appletsToShoot.isEmpty()) { QApplication::quit(); return; } if (m_applet) { m_applet->destroy(); m_applet = 0; } resize(512, 512); QString next = m_appletsToShoot.takeFirst(); addApplet(next, "null", QString(), QVariantList()); if (!m_applet) { shootNextPlasmoid(); } else if (m_applet->size().width() < 256 && m_applet->size().height() < 256) { resize(512, 512); } } void FullView::screenshotPlasmoid() { if (!m_applet) { shootNextPlasmoid(); return; } if (m_applet->hasFailedToLaunch()) { m_applet->destroy(); return; } else if (m_applet->configurationRequired()) { QTimer::singleShot(3000, this, SLOT(screenshotPlasmoid())); return; } QStyleOptionGraphicsItem opt; opt.initFrom(this); opt.exposedRect = m_applet->boundingRect(); QPixmap p(size()); p.fill(Qt::transparent); { QPainter painter(&p); render(&painter); //m_applet->paint(&painter, &opt, this); } p.save(m_applet->pluginName() + ".png"); shootNextPlasmoid(); } void FullView::plasmoidAccessFinished(Plasma::AccessAppletJob *job) { kDebug() << "!!!! PLASMOID ACCESS FINISHED!"; if (!job->error() && job->applet()) { m_applet = job->applet(); if (m_resizeToApplet) { m_containment->addApplet(m_applet, QPointF(-1, -1), false); m_applet->setFlag(QGraphicsItem::ItemIsMovable, false); setSceneRect(m_applet->sceneBoundingRect()); setWindowTitle(m_applet->name()); setWindowIcon(SmallIcon(m_applet->icon())); } else { m_containment->addApplet(m_applet, QPointF(48, 48), false); setWindowTitle(m_applet->name() + ": " + m_containment->name()); setWindowIcon(SmallIcon(m_containment->icon())); } } else { //TODO: some nice userfriendly error. kDebug() << "plasmoid access failed: " << job->errorString(); } } void FullView::appletRemoved(Plasma::Applet *applet) { if (m_applet == applet) { m_applet = 0; if (!checkShotTimer()) { close(); } } } void FullView::showEvent(QShowEvent *) { if (size().width() < 10 && size().height() < 10) { resize(400, 500); } } void FullView::setResizeToApplet(bool resize) { m_resizeToApplet = resize; } void FullView::resizeEvent(QResizeEvent *event) { QGraphicsView::resizeEvent(event); if (!m_containment) { return; } m_containment->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); m_containment->setMinimumSize(size()); m_containment->setMaximumSize(size()); m_containment->resize(size()); if (m_containment->layout()) { return; } if (!m_applet) { return; } //kDebug() << size(); qreal newWidth = 0; qreal newHeight = 0; if (m_resizeToApplet) { newWidth = size().width(); newHeight = size().height(); } else { newWidth = m_applet->size().width(); newHeight = m_applet->size().height(); } QSizeF newSize(newWidth, newHeight); // check if the rect is valid, or else it seems to try to allocate // up to infinity memory in exponential increments //m_applet->setGeometry(QRectF(40, 40, geometry().width(), geometry().height())); if (newSize.isValid()) { m_applet->resize(QSizeF(newWidth, newHeight)); if (m_resizeToApplet) { setSceneRect(m_applet->sceneBoundingRect()); } } } void FullView::closeEvent(QCloseEvent *event) { Q_UNUSED(event) qApp->quit(); } void FullView::appletTransformedItself() { resize(m_applet->size().toSize()); if (m_resizeToApplet) { setSceneRect(m_applet->sceneBoundingRect()); } } void FullView::sceneRectChanged(const QRectF &rect) { Q_UNUSED(rect) if (m_applet && m_resizeToApplet) { setSceneRect(QRectF(QPointF(0, 0), geometry().size())); } } bool FullView::hasStorageGroupFor(Plasma::Applet *applet) const { KConfigGroup stored = KConfigGroup(KGlobal::config(), "StoredApplets"); return stored.groupList().contains(applet->pluginName()); } KConfigGroup FullView::storageGroup(Plasma::Applet *applet) const { KConfigGroup stored = KConfigGroup(KGlobal::config(), "StoredApplets"); return KConfigGroup(&stored, applet->pluginName()); } void FullView::storeCurrentApplet() { if (m_applet && m_persistentConfig) { KConfigGroup cg; m_applet->save(cg); cg = m_applet->config(); KConfigGroup storage = storageGroup(m_applet); storage.deleteGroup(); cg.copyTo(&storage); KGlobal::config()->sync(); } } #include "fullview.moc" plasmate-1.0/PaxHeaders.5990/COPYING0000644000175000001440000000013212115142004015152 xustar000000000000000030 mtime=1362412548.609641275 30 atime=1362412650.304721383 30 ctime=1362412548.609641275 plasmate-1.0/COPYING0000644000175000001440000004353612115142004015622 0ustar00kokeroulisusers00000000000000NOTE! The GPL below is copyrighted by the Free Software Foundation, but the instance of code that it refers to (the kde programs) are copyrighted by the authors who actually wrote it. --------------------------------------------------------------------------- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. plasmate-1.0/PaxHeaders.5990/plasmate0000644000175000001440000000013112115142004015647 xustar000000000000000030 mtime=1362412548.622641154 29 atime=1362412560.66053227 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/0000755000175000001440000000000012115142004016362 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/PaxHeaders.5990/mocks0000644000175000001440000000013212115142004016764 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412548.618641191 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/mocks/0000755000175000001440000000000012115142004017476 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/mocks/PaxHeaders.5990/plasmate.svg-rect27156-740.png0000644000175000001440000000013212115142004024023 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412650.305721378 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/mocks/plasmate.svg-rect27156-740.png0000644000175000001440000001027212115142004024462 0ustar00kokeroulisusers00000000000000‰PNG  IHDRÞ†}IœÅsBIT|dˆ pHYs × ×B(›xtEXtSoftwarewww.inkscape.org›î<7IDATxœíÜMŽY’…Ñk )ÊD÷Bz½¤Þe-¨$è‡A·„T5)eÎnPçNÎÙƒ=Ÿÿù¿¿ýïN~O®'ù53ï®ÍËœs›kON’Íø×&›+Ù3×^×óLÙýv%Ÿ“ói6¿çœß6û_'ç÷Í~ØÝ_rn/ÉÞ¯ìÉÎ$Â~j³Éî$WÎy½®çcf¾LæÓ•¹ÏÌÞw_;s~Oö¿³óÛÉüzmÞíîËÌœd…7ü±ÍÌîµWf'çÛn>göå$Ù}¾ÞÏœ_ž™g¯ß2óû^ûafÞeæevo;3VMàLvv73Ï$Ýý–3÷ìæšó¸Íù|OÎûÙë—Íü:ÙÉ~Hò>³/ÙÜL¼àOm’Íì3;d¿¾}9¯³û9sÞ߳ϗLÞÍîûä¼ÏÉûÝý%™—$·$“á ?µ»o/ÏìÞæL’y\ïwò.û|¹ï9·½ö–ä>É=›—L^’}—É-«&ðGfß&ÞÉ33Éæ™É}3÷ݹí™Û}®=“939³{KrËæ–Ém6·Mæûº ð¯lvöû¸zs›ä–Ý[fNvÎ\{î™L²'Éì÷™x2“ÙÙ\câ bÞÆÝ™3ÉÌþãœäNæ­µïÿüõ~ìÌ™·Çþˆn;ÞðS»?Þ¿7ôõaö甜¿îîà?‡ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á  „7o(ÞP ¼ @x@ð€á ÷~œÍÌ&߯Éfw3Ivÿ²€{“Íæ­§w6s6É+IrÏf“¹2»³×&ÙÍl²;+¹àO½åön®ÍÎÎ[Fï¾…ø•ìÞ÷̵×^Ù½2óÌîs'Ï$ÏL’Édgþâ¿ÿ¾fwßöDž™<³yfæ¹»×&מ¹îs]Ï™íÞðso›&;Ï$d¾%óir}¾æ|I®¯÷k¯/gΧ̼d“™y½’wÙ}ÉÌIv2ÂþÀîÌîÛ¹ÉÇ™ù¶›Ï™ùx²Ÿ®½¾Ügî¯ìý$ÉìãÚýœ¹½ÌÌ}¯=oø›Ý3×&¯×^™ù’̧+ó÷3÷÷\×Ç™Ìæz=É—™yw]×Kιä¼=Ç[xÀOM6;ÙÌ•ëzž™Gv¿]ÙÏ“ó)»ÿcÍάç<>RIEND®B`‚plasmate-1.0/plasmate/mocks/PaxHeaders.5990/plasmate.svg0000644000175000001440000000013212115142004021370 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412650.305721378 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/mocks/plasmate.svg0000644000175000001440000115637512115142004022047 0ustar00kokeroulisusers00000000000000 image/svg+xml Start page Preview Edit Publish Continue working on... Create new... Plasmoid Data Engine Theme /home/user/cool-plasmoid /home/user/rtm-dataengine /home/user/nitrogen /home/user/cockoo-clock Open existing project... Plasma Studio Runner Plasma Studio Start page Preview Edit Publish Save Timeline BrowseAPI doc File Help File Help plasmate-1.0/plasmate/PaxHeaders.5990/startpage.cpp0000644000175000001440000000013212115142004020423 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/startpage.cpp0000644000175000001440000006336612115142004021076 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Riccardo Iaconelli 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 . */ #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 #include #include "packagemodel.h" #include "startpage.h" #include "mainwindow.h" #include "projectmanager/projectmanager.h" StartPage::StartPage(MainWindow *parent) // TODO set a palette so it will look identical with any color scheme. : QWidget(parent), m_parent(parent) { setupWidgets(); refreshRecentProjectsList(); } StartPage::~StartPage() { } void StartPage::setupWidgets() { m_projectManager = new ProjectManager(this); m_ui.setupUi(this); m_ui.invalidPlasmagikLabelEmpty->setVisible(false); m_ui.invalidPlasmagikLabelNoMetadataDesktop->setVisible(false); // Set some default parameters, like username/email and preferred scripting language KConfigGroup cg(KGlobal::config(), ("NewProjectDefaultPreferences")); KUser user = KUser(KUser::UseRealUserID); QString userName = cg.readEntry("Username", user.loginName()); QString userEmail = cg.readEntry("Email", userName+"@none.org"); // If username or email are empty string, i.e. in the previous project the // developer deleted it, restore the default values if (userName.isEmpty()) { userName = user.loginName(); } if (userEmail.isEmpty()) { userEmail.append(user.loginName()+"@none.org"); } m_ui.authorTextField->setText(userName); m_ui.emailTextField->setText(userEmail); const QString radioButtonChecked = cg.readEntry("radioButtonChecked"); if (radioButtonChecked == "Js") { m_ui.radioButtonJs->setChecked(true); } else if (radioButtonChecked == "Py") { m_ui.radioButtonPy->setChecked(true); } else if (radioButtonChecked == "Rb") { m_ui.radioButtonRb->setChecked(true); } else if (radioButtonChecked == "De") { m_ui.radioButtonDe->setChecked(true); } m_ui.cancelNewProjectButton->setIcon(KIcon("draw-arrow-back")); m_ui.newProjectButton->setIcon(KIcon("dialog-ok")); m_ui.loadLocalProject->setEnabled(false); m_ui.importPackageButton->setEnabled(false); // Enforce the security restriction from package.cpp in the input field connect(m_ui.projectName, SIGNAL(textEdited(const QString&)), this, SLOT(checkProjectName(const QString&))); connect(m_ui.recentProjects, SIGNAL(clicked(const QModelIndex)), this, SLOT(recentProjectSelected(const QModelIndex))); // Enforce the security restriction from package.cpp in the input field connect(m_ui.localProject, SIGNAL(textChanged(const QString&)), this, SLOT(checkLocalProjectPath(const QString&))); connect(m_ui.loadLocalProject, SIGNAL(clicked()), this, SLOT(loadLocalProject())); connect(m_ui.importPackage, SIGNAL(textChanged(const QString&)), this, SLOT(checkPackagePath(const QString&))); connect(m_ui.importPackageButton, SIGNAL(clicked()), this, SLOT(importPackage())); // When there will be a good API for js and rb dataengines and runners, remove the // first connect() statement and uncomment the one below :) connect(m_ui.contentTypes, SIGNAL(clicked(const QModelIndex)), this, SLOT(validateProjectType(const QModelIndex))); /*connect(m_ui.contentTypes, SIGNAL(clicked(const QModelIndex)), m_ui.projectName, SLOT(setFocus()));*/ connect(m_ui.newProjectButton, SIGNAL(clicked()), this, SLOT(createNewProject())); connect(m_ui.cancelNewProjectButton, SIGNAL(clicked()), this, SLOT(cancelNewProject())); connect(m_ui.importGHNSButton, SIGNAL(clicked()), this, SLOT(doGHNSImport())); // connect up the project manager to our signals and slots connect(this, SIGNAL(projectSelected(QString)), m_projectManager, SLOT(addRecentProject(QString))); connect(m_projectManager, SIGNAL(projectSelected(QString)), this, SIGNAL(projectSelected(QString))); connect(m_projectManager, SIGNAL(requestRefresh()), this, SLOT(refreshRecentProjectsList())); new QListWidgetItem(KIcon("application-x-plasma"), i18n("Plasma Widget"), m_ui.contentTypes); new QListWidgetItem(KIcon("kexi"), i18n("Data Engine"), m_ui.contentTypes); new QListWidgetItem(KIcon("system-run"), i18n("Runner"), m_ui.contentTypes); new QListWidgetItem(KIcon("inkscape"), i18n("Theme"), m_ui.contentTypes); new QListWidgetItem(KIcon("window-duplicate"), i18n("Window Switcher"), m_ui.contentTypes); new QListWidgetItem(KIcon("preferences-system-windows-actions"), i18n("KWin Script"), m_ui.contentTypes); new QListWidgetItem(KIcon("preferences-system-windows-effect"), i18n("KWin Effect"), m_ui.contentTypes); // connect(m_ui.newProjectButton, SIGNAL(clicked()), this, SLOT(launchNewProjectWizard())); } // Convert FooBar to foo_bar QString StartPage::camelToSnakeCase(const QString& name) { QString result(name); return result.replace(QRegExp("([A-Z])"), "_\\1").toLower().replace(QRegExp("^_"), ""); } void StartPage::checkProjectName(const QString& name) { QRegExp validatePluginName("[a-zA-Z0-9_.]*"); if (!validatePluginName.exactMatch(name)) { int pos = 0; for (int i = 0; i < name.size(); i++) { if (validatePluginName.indexIn(name, pos, QRegExp::CaretAtZero) == -1) break; pos += validatePluginName.matchedLength(); } m_ui.projectName->setText(QString(name).remove(pos, 1)); } m_ui.newProjectButton->setEnabled(!m_ui.projectName->text().isEmpty()); } void StartPage::validateProjectType(const QModelIndex &sender) { m_ui.languageLabel->show(); m_ui.frame->show(); m_ui.radioButtonJs->setEnabled(true); m_ui.radioButtonPy->setEnabled(true); if (sender.row() == DataEngineRow) { m_ui.radioButtonDe->setEnabled(false); m_ui.radioButtonJs->setChecked(true); m_ui.radioButtonRb->setEnabled(true); } else if (sender.row() == RunnerRow) { m_ui.radioButtonDe->setEnabled(false); m_ui.radioButtonJs->setChecked(true); m_ui.radioButtonRb->setEnabled(false); } else if (sender.row() == ThemeRow) { m_ui.languageLabel->hide(); m_ui.frame->hide(); } else if (sender.row() == PlasmoidRow) { m_ui.radioButtonDe->setEnabled(true); m_ui.radioButtonDe->setChecked(true); m_ui.radioButtonRb->setEnabled(true); } else if (sender.row() == WindowSwitcherRow) { m_ui.radioButtonDe->setEnabled(true); m_ui.radioButtonRb->setEnabled(false); m_ui.radioButtonJs->setEnabled(false); m_ui.radioButtonPy->setEnabled(false); m_ui.radioButtonDe->setChecked(true); } else if (sender.row() == KWinScriptRow) { m_ui.radioButtonPy->setEnabled(false); m_ui.radioButtonRb->setEnabled(false); m_ui.radioButtonDe->setEnabled(true); m_ui.radioButtonJs->setChecked(true); } else if (sender.row() == KWinEffectRow) { m_ui.radioButtonPy->setEnabled(false); m_ui.radioButtonJs->setChecked(true); m_ui.radioButtonRb->setEnabled(false); } m_ui.newProjectButton->setEnabled(!m_ui.projectName->text().isEmpty()); m_ui.layoutHackStackedWidget->setCurrentIndex(1); m_ui.projectName->setFocus(); } QString StartPage::userName() { return m_ui.authorTextField->text(); } QString StartPage::userEmail() { return m_ui.emailTextField->text(); } bool StartPage::selectedJsRadioButton() { return m_ui.radioButtonJs->isChecked(); } bool StartPage::selectedRbRadioButton() { return m_ui.radioButtonRb->isChecked(); } bool StartPage::selectedPyRadioButton() { return m_ui.radioButtonPy->isChecked(); } bool StartPage::selectedDeRadioButton() { return m_ui.radioButtonDe->isChecked(); } void StartPage::resetStatus() { kDebug() << "Reset status!"; m_ui.layoutHackStackedWidget->setCurrentIndex(0); refreshRecentProjectsList(); } void StartPage::refreshRecentProjectsList() { m_ui.recentProjects->clear(); m_projectManager->clearProjects(); const QStringList recentProjects = m_parent->recentProjects(); if (recentProjects.isEmpty()) { m_ui.recentProjectsLabel->hide(); m_ui.recentProjects->hide(); return; } int counter = 0; foreach (const QString &file, recentProjects) { // Specify path + filename as well to avoid mistaking .gitignore // as being the metadata file. QDir pDir(file); QString pPath = file + "/metadata.desktop"; kDebug() << "RECENT FILE::: " << file; if (pDir.isRelative()) { kDebug() << "NOT LOCAL"; pPath = KStandardDirs::locateLocal("appdata", file + "/metadata.desktop"); } if (!QFile::exists(pPath)) { continue; } KPluginInfo metadata(pPath); // Do not expose the idea of a 'folder name' to the user - // we keep the folder hidden and name it whatever we want as // long as it's unique. Only the plasmoid name, which the user // sets in the metadata editor, will ever be visible in the UI. const QString projectName = metadata.name(); kDebug() << "adding" << projectName << "to the list of recent projects..."; QListWidgetItem *item = new QListWidgetItem(projectName); // show the user-set plasmoid name in the UI counter++; // the loading code uses this to find the project to load. // since folder name and plasmoid name can be different, this // should be set to the folder name, which the loading code expects. item->setData(FullPathRole, file); // set a tooltip for extra info and to help differentiating similar projects QString tooltip = i18n("Project: %1", projectName) + "\n\n"; if (!metadata.comment().isEmpty()) { tooltip += "\"" + metadata.comment() + "\"\n---\n"; } if (!metadata.author().isEmpty()) { tooltip += i18n("Author: %1", metadata.author()); if (!metadata.email().isEmpty()) { tooltip += " <" + metadata.email() + '>'; } tooltip += "\n"; } if (!metadata.version().isEmpty()) { tooltip += i18n("Version: %1", metadata.version()) + "\n"; } KService service(pPath); tooltip += i18n("API: %1", service.property("X-Plasma-API").toString()) + "\n"; item->setToolTip(tooltip); const QStringList serviceTypes = service.serviceTypes(); QString defaultIconName; if (serviceTypes.contains("KWin/WindowSwitcher")) { defaultIconName = "window-duplicate"; tooltip += i18n("Project Type: Window Switcher"); } else if (serviceTypes.contains("Plasma/Applet")) { defaultIconName = "plasma"; tooltip += i18n("Project type: Plasmoid"); } else if (serviceTypes.contains("Plasma/DataEngine")) { defaultIconName = "server-database"; tooltip += i18n("Project type: Data Engine"); } else if (serviceTypes.contains("Plasma/Theme")) { defaultIconName = "preferences-desktop-theme"; tooltip += i18n("Project type: Theme"); } else if (serviceTypes.contains("Plasma/Runner")) { defaultIconName = "system-run"; tooltip += i18n("Project type: Runner"); } else if (serviceTypes.contains("KWin/Script")) { defaultIconName = "preferences-system-windows-actions"; tooltip += i18n("Project type: KWin Script"); } else if (serviceTypes.contains("KWin/Effect")) { defaultIconName = "preferences-system-windows-effect"; tooltip += i18n("Project type: KWin Script"); } else { kWarning() << "Unknown service type" << serviceTypes; } if (metadata.icon().isEmpty()) { item->setIcon(KIcon(defaultIconName)); } else { item->setIcon(KIcon(metadata.icon())); } m_projectManager->addProject(item); // limit to 5 projects to display up front if (m_ui.recentProjects->count() < 5) { m_ui.recentProjects->addItem(new QListWidgetItem(*item)); } } QListWidgetItem *more; if (counter >= 0 && counter <= 4) { more = new QListWidgetItem(i18n("Manage Projects...")); } else { more = new QListWidgetItem(i18n("More projects...")); } more->setIcon(KIcon("window-new")); m_ui.recentProjects->addItem(more); } void StartPage::createNewProject() { // packagePath -> projectPath const QString projectName = m_ui.projectName->text(); if (projectName.isEmpty()) { return; } kDebug() << "Creating simple folder structure for the project " << projectName; const QString projectNameLowerCase = projectName.toLower(); QString projectFileExtension; QString templateFilePath = KStandardDirs::locate("appdata", "templates/"); // type -> serviceTypes QString serviceTypes; if (m_ui.contentTypes->currentRow() == 0) { serviceTypes = "Plasma/Applet"; templateFilePath.append("mainPlasmoid"); } else if (m_ui.contentTypes->currentRow() == 1) { serviceTypes = "Plasma/DataEngine"; templateFilePath.append("mainDataEngine"); } else if (m_ui.contentTypes->currentRow() == 2) { serviceTypes = "Plasma/Runner"; templateFilePath.append("mainRunner"); } else if (m_ui.contentTypes->currentRow() == 3) { serviceTypes = "Plasma/Theme"; } else if (m_ui.contentTypes->currentRow() == 4) { serviceTypes = "KWin/WindowSwitcher"; templateFilePath.append("mainTabbox"); } else if (m_ui.contentTypes->currentRow() == 5) { serviceTypes = "KWin/Script"; templateFilePath.append("mainKWinScript"); } else if (m_ui.contentTypes->currentRow() == 6) { serviceTypes = "KWin/Effect"; templateFilePath.append("mainKWinEffect"); } QString projectFolderName; QString mainScriptName; QString api; // Append the desired extension if (m_ui.radioButtonPy->isChecked()) { api = "python"; projectFolderName = generateProjectFolderName(projectNameLowerCase); projectFileExtension = ".py"; mainScriptName = projectNameLowerCase + projectFileExtension; } else if (m_ui.radioButtonRb->isChecked()) { const QString projectNameSnakeCase = camelToSnakeCase(projectName); api = "ruby-script"; projectFolderName = generateProjectFolderName(projectNameSnakeCase); projectFileExtension = ".rb"; mainScriptName = QString("main_") + projectNameSnakeCase + projectFileExtension; } else if (m_ui.radioButtonDe->isChecked()) { api = "declarativeappletscript"; projectFolderName = generateProjectFolderName(projectNameLowerCase); projectFileExtension = ".qml"; mainScriptName = projectNameLowerCase + projectFileExtension; } else { api = "javascript"; projectFolderName = generateProjectFolderName(projectNameLowerCase); projectFileExtension = ".js"; mainScriptName = projectNameLowerCase + projectFileExtension; } // Creating the corresponding folder // The correct directory structure is, // / // NOTES // .git/ // .gitignore // contents/... QString projectPath = KStandardDirs::locateLocal("appdata", projectFolderName); QDir packageSubDirs(projectPath); packageSubDirs.mkpath("contents/code"); //create the necessary subdirs // Create a QFile object that points to the template we need to copy QFile sourceFile(templateFilePath + projectFileExtension); QFile destinationFile(projectPath + "/contents/code/" + mainScriptName);//our dest // Now open these files, and substitute the main class, author, email and date fields sourceFile.open(QIODevice::ReadOnly); destinationFile.open(QIODevice::ReadWrite); QByteArray rawData = sourceFile.readAll(); QByteArray replacedString("$PLASMOID_NAME"); if (rawData.contains(replacedString)) { rawData.replace(replacedString, projectName.toAscii()); } replacedString.clear(); replacedString.append("$DATAENGINE_NAME"); if (rawData.contains(replacedString)) { rawData.replace(replacedString, projectName.toAscii()); } replacedString.clear(); replacedString.append("$RUNNER_NAME"); if (rawData.contains(replacedString)) { rawData.replace(replacedString, projectName.toAscii()); } replacedString.clear(); replacedString.append("$AUTHOR"); if (rawData.contains(replacedString)) { rawData.replace(replacedString, m_ui.authorTextField->text().toAscii()); } replacedString.clear(); replacedString.append("$EMAIL"); if (rawData.contains(replacedString)) { rawData.replace(replacedString, m_ui.emailTextField->text().toAscii()); } replacedString.clear(); replacedString.append("$DATE"); QDate date = QDate::currentDate(); QByteArray datetime(date.toString().toUtf8()); QTime time = QTime::currentTime(); datetime.append(", " + time.toString().toUtf8()); if (rawData.contains(replacedString)) { rawData.replace(replacedString, datetime); } destinationFile.write(rawData); destinationFile.close(); // create the metadata.desktop file // TODO: missing but possible entries that could be added: // * Icon // * Comment // * Keywords // * X-KDE-PluginInfo-Website // * X-KDE-PluginInfo-Category // * X-KDE-ParentApp KDesktopFile metaFile(projectPath + "/metadata.desktop"); KConfigGroup metaDataGroup = metaFile.desktopGroup(); metaDataGroup.writeEntry("Name", projectName); //FIXME: the plugin name needs to be globally unique, so should use more than just the project // name metaDataGroup.writeEntry("Type", "Service"); metaDataGroup.writeEntry("X-KDE-PluginInfo-Name", projectNameLowerCase); metaDataGroup.writeEntry("X-KDE-ServiceTypes", serviceTypes); metaDataGroup.writeEntry("X-KDE-PluginInfo-Version", 1); metaDataGroup.writeEntry("X-KDE-PluginInfo-Author", m_ui.authorTextField->text()); metaDataGroup.writeEntry("X-KDE-PluginInfo-Email", m_ui.emailTextField->text()); //FIXME: this must be selectable at creation metaDataGroup.writeEntry("X-KDE-PluginInfo-License", "GPL"); metaDataGroup.writeEntry("X-KDE-PluginInfo-Email", m_ui.emailTextField->text()); metaDataGroup.writeEntry("X-Plasma-API", api); metaDataGroup.writeEntry("X-Plasma-MainScript", "code/" + mainScriptName); metaDataGroup.writeEntry("X-Plasma-DefaultSize", QSize(200, 100)); metaFile.sync(); ensureProjectrcFileExists(projectPath);//create the plasmateProjectrc file saveNewProjectPreferences(projectPath); emit projectSelected(projectPath); // need to clear the project name field here too because startpage is still // accessible after project loads. m_ui.projectName->clear(); } void StartPage::saveNewProjectPreferences(const QString &path) { // Saving NewProject preferences KConfigGroup preferences(KGlobal::config(), "NewProjectDefaultPreferences"); preferences.writeEntry("Username", userName()); preferences.writeEntry("Email", userEmail()); QString radioButtonChecked; if (selectedJsRadioButton()) { radioButtonChecked = "Js"; } else if (selectedPyRadioButton()) { radioButtonChecked = "Py"; } else if (selectedRbRadioButton()) { radioButtonChecked = "Rb"; } else if (selectedDeRadioButton()) { radioButtonChecked = "De"; } preferences.writeEntry("radioButtonChecked", radioButtonChecked); preferences.sync(); KConfig c(path+ '/' + PROJECTRC); KConfigGroup projectrcPreferences(&c, "ProjectDefaultPreferences"); projectrcPreferences.writeEntry("Username", userName()); projectrcPreferences.writeEntry("Email", userEmail()); projectrcPreferences.writeEntry("radioButtonChecked", radioButtonChecked); projectrcPreferences.sync(); } void StartPage::ensureProjectrcFileExists(const QString& projectPath) { if (!QFile::exists(projectPath + '/' + PROJECTRC)) { QFile rcfile(projectPath + '/' + PROJECTRC); rcfile.open(QIODevice::ReadWrite); rcfile.close(); } } void StartPage::cancelNewProject() { m_ui.projectName->clear(); resetStatus(); } void StartPage::checkLocalProjectPath(const QString& name) { m_ui.invalidPlasmagikLabelEmpty->setText(i18n("Your directory is empty")); m_ui.invalidPlasmagikLabelEmpty->setMessageType(KMessageWidget::Error); m_ui.invalidPlasmagikLabelNoMetadataDesktop->setMessageType(KMessageWidget::Error); m_ui.invalidPlasmagikLabelEmpty->setCloseButtonVisible(false); m_ui.invalidPlasmagikLabelNoMetadataDesktop->setCloseButtonVisible(false); m_ui.invalidPlasmagikLabelEmpty->setVisible(false); m_ui.invalidPlasmagikLabelNoMetadataDesktop->setVisible(false); QDir dir(KShell::tildeExpand(name)); QFile metadataDesktop(dir.path() + "/metadata.desktop"); kDebug() << "checking: " << name << dir.exists(); m_ui.loadLocalProject->setEnabled(metadataDesktop.exists()); if (name.isEmpty()) { m_ui.invalidPlasmagikLabelEmpty->setVisible(true); m_ui.invalidPlasmagikLabelNoMetadataDesktop->setVisible(false); } else if (!metadataDesktop.exists()) { m_ui.invalidPlasmagikLabelEmpty->setVisible(false); m_ui.invalidPlasmagikLabelNoMetadataDesktop->setVisible(true); m_ui.invalidPlasmagikLabelNoMetadataDesktop->setText(i18n("metadata.desktop does not exist in %1", dir.path())); } else if (!name.isEmpty()) { m_ui.invalidPlasmagikLabelEmpty->setVisible(false); m_ui.invalidPlasmagikLabelNoMetadataDesktop->setVisible(false); } } void StartPage::loadLocalProject() { const QString path = KShell::tildeExpand(m_ui.localProject->text()); kDebug() << "loading local project from" << path; if (!QFile::exists(path)) { return; } ensureProjectrcFileExists(path); emit projectSelected(path); } void StartPage::recentProjectSelected(const QModelIndex &index) { QAbstractItemModel *m = m_ui.recentProjects->model(); QString url = m->data(index, FullPathRole).value(); if (url.isEmpty()) { m_projectManager->exec(); return; } kDebug() << "Loading project file:" << m->data(index, FullPathRole); emit projectSelected(url); } void StartPage::checkPackagePath(const QString& name) { const QString fullName = KShell::tildeExpand(name); bool valid = QFile::exists(fullName) && KMimeType::findByUrl(fullName)->is("application/x-plasma"); m_ui.importPackageButton->setEnabled(valid); } void StartPage::importPackage() { const KUrl target = m_ui.importPackage->url(); selectProject(target); } void StartPage::doGHNSImport() { KNS3::DownloadDialog *mNewStuffDialog = new KNS3::DownloadDialog("plasmate.knsrc", this); if (mNewStuffDialog->exec() == KDialog::Accepted) { KNS3::Entry::List installed = mNewStuffDialog->installedEntries(); if (!installed.empty()) { KNS3::Entry entry = installed.at(0); QStringList installedFiles = entry.installedFiles(); if (!installedFiles.empty()) { QString file = installedFiles.at(0); KUrl target(file); selectProject(target); } } } } void StartPage::selectProject(const KUrl &target) { if (!target.isLocalFile() || !QFile::exists(target.path()) || QDir(target.path()).exists()) { KMessageBox::error(this, i18n("The file you entered is invalid.")); return; } // we can do this because this is 'under the hood' // the user should never be aware of any 'folder names' // This nicely eliminates the need for a 'conflict resolution' dialog :) QString suggested = QFileInfo(target.path()).completeBaseName(); QString projectFolder = generateProjectFolderName(suggested); QString projectPath = KStandardDirs::locateLocal("appdata", projectFolder + '/'); if (!ProjectManager::importPackage(target, projectPath)) { KMessageBox::information(this, i18n("A problem has occurred during import.")); } emit projectSelected(projectFolder); } /** * Brain-dead way of generating a unique folder name. */ const QString StartPage::generateProjectFolderName(const QString& suggestion) { QString projectFolder = suggestion; int suffix = 1; while (!KStandardDirs::locate("appdata", projectFolder + '/').isEmpty()) { projectFolder = suggestion + QString::number(suffix); suffix++; } return projectFolder; } plasmate-1.0/plasmate/PaxHeaders.5990/sidebaritem.cpp0000644000175000001440000000013212115142004020721 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/sidebaritem.cpp0000644000175000001440000000270512115142004021362 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Aaron Seigo Copyright 2009-2010 Diego '[Po]lentino' Casella 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 "sidebaritem.h" #ifndef SIDEBARITEM_H #define SIDEBARITEM_H static const int SidebarItemType = QTableWidgetItem::UserType + 1; /* List item representing a sidebar entry. */ class SidebarItem : public QTableWidgetItem { public: SidebarItem(const QIcon &icon, const QString &text) : QTableWidgetItem(0, SidebarItemType) { setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); setIcon(icon); setText(text); setToolTip(text); } }; #endif // SIDEBARITEM_H plasmate-1.0/plasmate/PaxHeaders.5990/sidebartablewidget.cpp0000644000175000001440000000013212115142004022256 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/sidebartablewidget.cpp0000644000175000001440000002442712115142004022724 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Diego '[Po]lentino' Casella Copyright 2009-2010 Laurent Montel 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 #include //#include #include "sidebartablewidget.h" #include "sidebaritem.cpp" static const int ITEM_MARGIN_LEFT = 5; static const int ITEM_MARGIN_TOP = 5; static const int ITEM_MARGIN_RIGHT = 5; static const int ITEM_MARGIN_BOTTOM = 5; static const int ITEM_PADDING = 5; SidebarTableWidget::SidebarTableWidget(Qt::DockWidgetArea location, QWidget *parent) : QTableWidget(0,0,parent), m_horizontalSB(0), m_verticalSB(0), m_location(location), m_maxCellDimension(0), m_totalLenght(0) { horizontalHeader()->setVisible(false); verticalHeader()->setVisible(false); setIconSize(QSize(32,32)); setShowGrid(false); setMouseTracking(true); viewport()->setAutoFillBackground(false); setSelectionMode(QAbstractItemView::SingleSelection); m_horizontalSB = horizontalScrollBar(); m_verticalSB = verticalScrollBar(); setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); } SidebarTableWidget::~SidebarTableWidget() { } Qt::DockWidgetArea SidebarTableWidget::location() { return m_location; } void SidebarTableWidget::updateLayout(Qt::DockWidgetArea location) { bool wasVertical = true; // Ensure we REALLY need to update the layout switch(location) { case Qt::LeftDockWidgetArea: if((m_location == Qt::LeftDockWidgetArea)|| (m_location == Qt::RightDockWidgetArea)) { return; } wasVertical = false; break; case Qt::RightDockWidgetArea: if((m_location == Qt::LeftDockWidgetArea)|| (m_location == Qt::RightDockWidgetArea)) { return; } wasVertical = false; break; case Qt::TopDockWidgetArea: if((m_location == Qt::TopDockWidgetArea)|| (m_location == Qt::BottomDockWidgetArea)) { return; } break; case Qt::BottomDockWidgetArea: if((m_location == Qt::TopDockWidgetArea)|| (m_location == Qt::BottomDockWidgetArea)) { return; } break; default: return; } // Before starting swapping, hide the table for a while to avoid flickering and reset // minimum and maximum widget size; hide(); // Store the current position m_location = location; // Compute the number of required iterations int iterations = (wasVertical ? rowCount() : columnCount()); if(wasVertical) { setColumnCount(iterations); } else { setRowCount(iterations); } m_maxCellDimension = 0; m_totalLenght = 0; // Save position of the selected item, if exists int position = 0; QTableWidgetItem *it = currentItem(); if(it) { position = (wasVertical ? it->row() : it->column()); } for(int i=0; isize() : m_horizontalSB->size()); } void SidebarTableWidget::addItem(SidebarItem *item) { // According with the orientation, expand the widget through the first column or row, // then add the item. setRowCount(((m_location == Qt::RightDockWidgetArea)||(m_location == Qt::LeftDockWidgetArea)) ? rowCount()+1 : 1); setColumnCount(((m_location == Qt::RightDockWidgetArea)||(m_location == Qt::LeftDockWidgetArea)) ? 1 : columnCount()+1); setItem(((m_location == Qt::RightDockWidgetArea)||(m_location == Qt::LeftDockWidgetArea)) ? rowCount()-1 : 0, ((m_location == Qt::RightDockWidgetArea)||(m_location == Qt::LeftDockWidgetArea)) ? 0 : columnCount()-1, item); updateSize(item); } int SidebarTableWidget::totalLenght() { return m_totalLenght; } void SidebarTableWidget::clear() { bool vertical = ((m_location == Qt::RightDockWidgetArea)||(m_location == Qt::LeftDockWidgetArea)); for(int i = 0; i < (vertical ? rowCount(): columnCount()); ++i ) { takeItem(vertical ? i: 0, vertical ? 0: i); } setRowCount(0); setColumnCount(0); m_maxCellDimension = 0; m_totalLenght = 0; } /*void SidebarTableWidget::mouseReleaseEvent(QMouseEvent *event) { QModelIndex index = indexAt(event->pos()); if (!index.isValid()) return; if (event->button() == Qt::RightButton) { emit itemClicked(itemFromIndex(index)); } }*/ void SidebarTableWidget::updateSize(SidebarItem *item) { // Now compute the correct row and column size for the current item QFontMetrics font(item->font()); QSize rect(ITEM_MARGIN_LEFT + qMax(iconSize().width(), font.width(item->text() + 2*ITEM_PADDING)) + ITEM_MARGIN_RIGHT, ITEM_MARGIN_TOP + iconSize().height() + ITEM_PADDING + font.boundingRect(item->text()).height() + 2*ITEM_MARGIN_BOTTOM ); //qDebug() << "SidebarTableWidget::updateSize = " << rect; if((m_location == Qt::RightDockWidgetArea) || (m_location == Qt::LeftDockWidgetArea)) { setRowHeight(item->row(),rect.height()); m_totalLenght += rect.height(); if(m_maxCellDimension < rect.width()) { m_maxCellDimension = rect.width(); setColumnWidth(1,m_maxCellDimension); } setMinimumHeight(0); setMaximumHeight(16777215); setColumnWidth(1,m_maxCellDimension); setColumnWidth(0,m_maxCellDimension); setMinimumWidth(m_maxCellDimension+5); setMaximumWidth(m_maxCellDimension+5); } else { setColumnWidth(item->column(),rect.width()); m_totalLenght += rect.width(); if(m_maxCellDimension < rect.height()) { m_maxCellDimension = rect.height(); setRowHeight(1,m_maxCellDimension); } setMinimumWidth(0); setMaximumWidth(16777215); setRowHeight(1,m_maxCellDimension); setRowHeight(0,m_maxCellDimension); setMinimumHeight(m_maxCellDimension+5); setMaximumHeight(m_maxCellDimension+5); } } void SidebarTableWidget::mouseDoubleClickEvent(QMouseEvent *event) { QModelIndex index = indexAt(event->pos()); if (index.isValid() && !(index.flags() & Qt::ItemIsSelectable)) { return; } QTableWidget::mouseDoubleClickEvent(event); } void SidebarTableWidget::mouseMoveEvent(QMouseEvent *event) { QModelIndex index = indexAt(event->pos()); if (index.isValid() && !(index.flags() & Qt::ItemIsSelectable)) { return; } QTableWidget::mouseMoveEvent(event); } void SidebarTableWidget::mousePressEvent(QMouseEvent *event) { QModelIndex index = indexAt(event->pos()); if (index.isValid() && !(index.flags() & Qt::ItemIsSelectable)) { return; } QTableWidget::mousePressEvent(event); } void SidebarTableWidget::mouseReleaseEvent(QMouseEvent *event) { QModelIndex index = indexAt(event->pos()); if (index.isValid() && !(index.flags() & Qt::ItemIsSelectable)) { return; } QTableWidget::mouseReleaseEvent(event); } QModelIndex SidebarTableWidget::moveCursor(QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers) { Q_UNUSED(modifiers) QModelIndex oldindex = currentIndex(); QModelIndex newindex = oldindex; switch (cursorAction) { case MoveUp: case MovePrevious: { int row = oldindex.row() - 1; while (row > -1 && !(model()->index(row, 0).flags() & Qt::ItemIsSelectable)) --row; if (row > -1) newindex = model()->index(row, 0); break; } case MoveDown: case MoveNext: { int row = oldindex.row() + 1; int max = model()->rowCount(); while (row < max && !(model()->index(row, 0).flags() & Qt::ItemIsSelectable)) ++row; if (row < max) newindex = model()->index(row, 0); break; } case MoveHome: case MovePageUp: { int row = 0; while (row < oldindex.row() && !(model()->index(row, 0).flags() & Qt::ItemIsSelectable)) ++row; if (row < oldindex.row()) newindex = model()->index(row, 0); break; } case MoveEnd: case MovePageDown: { int row = model()->rowCount() - 1; while (row > oldindex.row() && !(model()->index(row, 0).flags() & Qt::ItemIsSelectable)) --row; if (row > oldindex.row()) newindex = model()->index(row, 0); break; } // no navigation possible for these case MoveLeft: case MoveRight: break; } // dirty hack to change item when the key cursor changes item if (oldindex != newindex) { emit itemClicked(itemFromIndex(newindex)); } return newindex; } plasmate-1.0/plasmate/PaxHeaders.5990/modeltest0000644000175000001440000000013112115142004017647 xustar000000000000000030 mtime=1362412548.616641211 29 atime=1362412548.61964118 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/modeltest/0000755000175000001440000000000012115142004020362 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/modeltest/PaxHeaders.5990/dynamictreemodel.cpp0000644000175000001440000000013212115142004023756 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412548.616641211 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/modeltest/dynamictreemodel.cpp0000644000175000001440000002023212115142004024412 0ustar00kokeroulisusers00000000000000/**************************************************************************** ** ** Copyright (C) 2009 Stephen Kelly ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite 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$ ** ****************************************************************************/ #include "dynamictreemodel.h" #include #include #include DynamicTreeModel::DynamicTreeModel(QObject *parent) : QAbstractItemModel(parent), nextId(1) { } QModelIndex DynamicTreeModel::index(int row, int column, const QModelIndex &parent) const { // if (column != 0) // return QModelIndex(); if ( column < 0 || row < 0 ) return QModelIndex(); QList > childIdColumns = m_childItems.value(parent.internalId()); const qint64 grandParent = findParentId(parent.internalId()); if (grandParent >= 0) { QList > parentTable = m_childItems.value(grandParent); Q_ASSERT(parent.column() < parentTable.size()); QList parentSiblings = parentTable.at(parent.column()); Q_ASSERT(parent.row() < parentSiblings.size()); } if (childIdColumns.size() == 0) return QModelIndex(); if (column >= childIdColumns.size()) return QModelIndex(); QList rowIds = childIdColumns.at(column); if ( row >= rowIds.size()) return QModelIndex(); qint64 id = rowIds.at(row); return createIndex(row, column, reinterpret_cast(id)); } qint64 DynamicTreeModel::findParentId(qint64 searchId) const { if (searchId <= 0) return -1; QHashIterator > > i(m_childItems); while (i.hasNext()) { i.next(); QListIterator > j(i.value()); while (j.hasNext()) { QList l = j.next(); if (l.contains(searchId)) { return i.key(); } } } return -1; } QModelIndex DynamicTreeModel::parent(const QModelIndex &index) const { if (!index.isValid()) return QModelIndex(); qint64 searchId = index.internalId(); qint64 parentId = findParentId(searchId); // Will never happen for valid index, but what the hey... if (parentId <= 0) return QModelIndex(); qint64 grandParentId = findParentId(parentId); if (grandParentId < 0) grandParentId = 0; int column = 0; QList childList = m_childItems.value(grandParentId).at(column); int row = childList.indexOf(parentId); return createIndex(row, column, reinterpret_cast(parentId)); } int DynamicTreeModel::rowCount(const QModelIndex &index ) const { QList > cols = m_childItems.value(index.internalId()); if (cols.size() == 0 ) return 0; if (index.column() > 0) return 0; return cols.at(0).size(); } int DynamicTreeModel::columnCount(const QModelIndex &index ) const { // Q_UNUSED(index); return m_childItems.value(index.internalId()).size(); } QVariant DynamicTreeModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) return QVariant(); if (Qt::DisplayRole == role) { return m_items.value(index.internalId()); } return QVariant(); } void DynamicTreeModel::clear() { beginResetModel(); m_items.clear(); m_childItems.clear(); nextId = 1; endResetModel(); } ModelChangeCommand::ModelChangeCommand( DynamicTreeModel *model, QObject *parent ) : QObject(parent), m_model(model), m_numCols(1), m_startRow(-1), m_endRow(-1) { } QModelIndex ModelChangeCommand::findIndex(QList rows) { const int col = 0; QModelIndex parent = QModelIndex(); QListIterator i(rows); while (i.hasNext()) { parent = m_model->index(i.next(), col, parent); Q_ASSERT(parent.isValid()); } return parent; } ModelInsertCommand::ModelInsertCommand(DynamicTreeModel *model, QObject *parent ) : ModelChangeCommand(model, parent) { } void ModelInsertCommand::doCommand() { QModelIndex parent = findIndex(m_rowNumbers); m_model->beginInsertRows(parent, m_startRow, m_endRow); qint64 parentId = parent.internalId(); for (int row = m_startRow; row <= m_endRow; row++) { for(int col = 0; col < m_numCols; col++ ) { if (m_model->m_childItems[parentId].size() <= col) { m_model->m_childItems[parentId].append(QList()); } // QString name = QUuid::createUuid().toString(); qint64 id = m_model->newId(); QString name = QString::number(id); m_model->m_items.insert(id, name); m_model->m_childItems[parentId][col].insert(row, id); } } m_model->endInsertRows(); } ModelMoveCommand::ModelMoveCommand(DynamicTreeModel *model, QObject *parent) : ModelChangeCommand(model, parent) { } bool ModelMoveCommand::emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow) { return m_model->beginMoveRows(srcParent, srcStart, srcEnd, destParent, destRow); } void ModelMoveCommand::doCommand() { QModelIndex srcParent = findIndex(m_rowNumbers); QModelIndex destParent = findIndex(m_destRowNumbers); if (!emitPreSignal(srcParent, m_startRow, m_endRow, destParent, m_destRow)) { return; } for (int column = 0; column < m_numCols; ++column) { QList l = m_model->m_childItems.value(srcParent.internalId())[column].mid(m_startRow, m_endRow - m_startRow + 1 ); for (int i = m_startRow; i <= m_endRow ; i++) { m_model->m_childItems[srcParent.internalId()][column].removeAt(m_startRow); } int d; if (m_destRow < m_startRow) d = m_destRow; else { if (srcParent == destParent) d = m_destRow - (m_endRow - m_startRow + 1); else d = m_destRow - (m_endRow - m_startRow) + 1; } foreach(const qint64 id, l) { m_model->m_childItems[destParent.internalId()][column].insert(d++, id); } } emitPostSignal(); } void ModelMoveCommand::emitPostSignal() { m_model->endMoveRows(); } ModelResetCommand::ModelResetCommand(DynamicTreeModel* model, QObject* parent) : ModelMoveCommand(model, parent) { } ModelResetCommand::~ModelResetCommand() { } bool ModelResetCommand::emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow) { Q_UNUSED(srcParent); Q_UNUSED(srcStart); Q_UNUSED(srcEnd); Q_UNUSED(destParent); Q_UNUSED(destRow); return true; } void ModelResetCommand::emitPostSignal() { m_model->reset(); } ModelResetCommandFixed::ModelResetCommandFixed(DynamicTreeModel* model, QObject* parent) : ModelMoveCommand(model, parent) { } ModelResetCommandFixed::~ModelResetCommandFixed() { } bool ModelResetCommandFixed::emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow) { Q_UNUSED(srcParent); Q_UNUSED(srcStart); Q_UNUSED(srcEnd); Q_UNUSED(destParent); Q_UNUSED(destRow); m_model->beginResetModel(); return true; } void ModelResetCommandFixed::emitPostSignal() { m_model->endResetModel(); } plasmate-1.0/plasmate/modeltest/PaxHeaders.5990/modeltest.cpp0000644000175000001440000000013212115142004022431 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412548.616641211 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/modeltest/modeltest.cpp0000644000175000001440000005205712115142004023077 0ustar00kokeroulisusers00000000000000/**************************************************************************** ** ** 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 test suite 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$ ** ****************************************************************************/ #include #include "modeltest.h" #include #undef Q_ASSERT #define Q_ASSERT QVERIFY Q_DECLARE_METATYPE ( QModelIndex ) /*! Connect to all of the models signals. Whenever anything happens recheck everything. */ ModelTest::ModelTest ( QAbstractItemModel *_model, QObject *parent ) : QObject ( parent ), model ( _model ), fetchingMore ( false ) { Q_ASSERT ( model ); connect ( model, SIGNAL ( columnsAboutToBeInserted ( const QModelIndex &, int, int ) ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( columnsAboutToBeRemoved ( const QModelIndex &, int, int ) ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( columnsInserted ( const QModelIndex &, int, int ) ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( columnsRemoved ( const QModelIndex &, int, int ) ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( dataChanged ( const QModelIndex &, const QModelIndex & ) ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( headerDataChanged ( Qt::Orientation, int, int ) ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( layoutAboutToBeChanged () ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( layoutChanged () ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( modelReset () ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( rowsInserted ( const QModelIndex &, int, int ) ), this, SLOT ( runAllTests() ) ); connect ( model, SIGNAL ( rowsRemoved ( const QModelIndex &, int, int ) ), this, SLOT ( runAllTests() ) ); // Special checks for inserting/removing connect ( model, SIGNAL ( layoutAboutToBeChanged() ), this, SLOT ( layoutAboutToBeChanged() ) ); connect ( model, SIGNAL ( layoutChanged() ), this, SLOT ( layoutChanged() ) ); connect ( model, SIGNAL ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ), this, SLOT ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ) ); connect ( model, SIGNAL ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ), this, SLOT ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ) ); connect ( model, SIGNAL ( rowsInserted ( const QModelIndex &, int, int ) ), this, SLOT ( rowsInserted ( const QModelIndex &, int, int ) ) ); connect ( model, SIGNAL ( rowsRemoved ( const QModelIndex &, int, int ) ), this, SLOT ( rowsRemoved ( const QModelIndex &, int, int ) ) ); runAllTests(); } void ModelTest::runAllTests() { if ( fetchingMore ) return; nonDestructiveBasicTest(); rowCount(); columnCount(); hasIndex(); index(); parent(); data(); } /*! nonDestructiveBasicTest tries to call a number of the basic functions (not all) to make sure the model doesn't outright segfault, testing the functions that makes sense. */ void ModelTest::nonDestructiveBasicTest() { Q_ASSERT ( model->buddy ( QModelIndex() ) == QModelIndex() ); model->canFetchMore ( QModelIndex() ); Q_ASSERT ( model->columnCount ( QModelIndex() ) >= 0 ); Q_ASSERT ( model->data ( QModelIndex() ) == QVariant() ); fetchingMore = true; model->fetchMore ( QModelIndex() ); fetchingMore = false; Qt::ItemFlags flags = model->flags ( QModelIndex() ); Q_ASSERT ( flags == Qt::ItemIsDropEnabled || flags == 0 ); model->hasChildren ( QModelIndex() ); model->hasIndex ( 0, 0 ); model->headerData ( 0, Qt::Horizontal ); model->index ( 0, 0 ); model->itemData ( QModelIndex() ); QVariant cache; model->match ( QModelIndex(), -1, cache ); model->mimeTypes(); Q_ASSERT ( model->parent ( QModelIndex() ) == QModelIndex() ); Q_ASSERT ( model->rowCount() >= 0 ); QVariant variant; model->setData ( QModelIndex(), variant, -1 ); model->setHeaderData ( -1, Qt::Horizontal, QVariant() ); model->setHeaderData ( 999999, Qt::Horizontal, QVariant() ); QMap roles; model->sibling ( 0, 0, QModelIndex() ); model->span ( QModelIndex() ); model->supportedDropActions(); } /*! Tests model's implementation of QAbstractItemModel::rowCount() and hasChildren() Models that are dynamically populated are not as fully tested here. */ void ModelTest::rowCount() { // qDebug() << "rc"; // check top row QModelIndex topIndex = model->index ( 0, 0, QModelIndex() ); int rows = model->rowCount ( topIndex ); Q_ASSERT ( rows >= 0 ); if ( rows > 0 ) Q_ASSERT ( model->hasChildren ( topIndex ) == true ); QModelIndex secondLevelIndex = model->index ( 0, 0, topIndex ); if ( secondLevelIndex.isValid() ) { // not the top level // check a row count where parent is valid rows = model->rowCount ( secondLevelIndex ); Q_ASSERT ( rows >= 0 ); if ( rows > 0 ) Q_ASSERT ( model->hasChildren ( secondLevelIndex ) == true ); } // The models rowCount() is tested more extensively in checkChildren(), // but this catches the big mistakes } /*! Tests model's implementation of QAbstractItemModel::columnCount() and hasChildren() */ void ModelTest::columnCount() { // check top row QModelIndex topIndex = model->index ( 0, 0, QModelIndex() ); Q_ASSERT ( model->columnCount ( topIndex ) >= 0 ); // check a column count where parent is valid QModelIndex childIndex = model->index ( 0, 0, topIndex ); if ( childIndex.isValid() ) Q_ASSERT ( model->columnCount ( childIndex ) >= 0 ); // columnCount() is tested more extensively in checkChildren(), // but this catches the big mistakes } /*! Tests model's implementation of QAbstractItemModel::hasIndex() */ void ModelTest::hasIndex() { // qDebug() << "hi"; // Make sure that invalid values returns an invalid index Q_ASSERT ( model->hasIndex ( -2, -2 ) == false ); Q_ASSERT ( model->hasIndex ( -2, 0 ) == false ); Q_ASSERT ( model->hasIndex ( 0, -2 ) == false ); int rows = model->rowCount(); int columns = model->columnCount(); // check out of bounds Q_ASSERT ( model->hasIndex ( rows, columns ) == false ); Q_ASSERT ( model->hasIndex ( rows + 1, columns + 1 ) == false ); if ( rows > 0 ) Q_ASSERT ( model->hasIndex ( 0, 0 ) == true ); // hasIndex() is tested more extensively in checkChildren(), // but this catches the big mistakes } /*! Tests model's implementation of QAbstractItemModel::index() */ void ModelTest::index() { // qDebug() << "i"; // Make sure that invalid values returns an invalid index Q_ASSERT ( model->index ( -2, -2 ) == QModelIndex() ); Q_ASSERT ( model->index ( -2, 0 ) == QModelIndex() ); Q_ASSERT ( model->index ( 0, -2 ) == QModelIndex() ); int rows = model->rowCount(); int columns = model->columnCount(); if ( rows == 0 ) return; // Catch off by one errors Q_ASSERT ( model->index ( rows, columns ) == QModelIndex() ); Q_ASSERT ( model->index ( 0, 0 ).isValid() == true ); // Make sure that the same index is *always* returned QModelIndex a = model->index ( 0, 0 ); QModelIndex b = model->index ( 0, 0 ); Q_ASSERT ( a == b ); // index() is tested more extensively in checkChildren(), // but this catches the big mistakes } /*! Tests model's implementation of QAbstractItemModel::parent() */ void ModelTest::parent() { // qDebug() << "p"; // Make sure the model wont crash and will return an invalid QModelIndex // when asked for the parent of an invalid index. Q_ASSERT ( model->parent ( QModelIndex() ) == QModelIndex() ); if ( model->rowCount() == 0 ) return; // Column 0 | Column 1 | // QModelIndex() | | // \- topIndex | topIndex1 | // \- childIndex | childIndex1 | // Common error test #1, make sure that a top level index has a parent // that is a invalid QModelIndex. QModelIndex topIndex = model->index ( 0, 0, QModelIndex() ); Q_ASSERT ( model->parent ( topIndex ) == QModelIndex() ); // Common error test #2, make sure that a second level index has a parent // that is the first level index. if ( model->rowCount ( topIndex ) > 0 ) { QModelIndex childIndex = model->index ( 0, 0, topIndex ); Q_ASSERT ( model->parent ( childIndex ) == topIndex ); } // Common error test #3, the second column should NOT have the same children // as the first column in a row. // Usually the second column shouldn't have children. QModelIndex topIndex1 = model->index ( 0, 1, QModelIndex() ); if ( model->rowCount ( topIndex1 ) > 0 ) { QModelIndex childIndex = model->index ( 0, 0, topIndex ); QModelIndex childIndex1 = model->index ( 0, 0, topIndex1 ); Q_ASSERT ( childIndex != childIndex1 ); } // Full test, walk n levels deep through the model making sure that all // parent's children correctly specify their parent. checkChildren ( QModelIndex() ); } /*! Called from the parent() test. A model that returns an index of parent X should also return X when asking for the parent of the index. This recursive function does pretty extensive testing on the whole model in an effort to catch edge cases. This function assumes that rowCount(), columnCount() and index() already work. If they have a bug it will point it out, but the above tests should have already found the basic bugs because it is easier to figure out the problem in those tests then this one. */ void ModelTest::checkChildren ( const QModelIndex &parent, int currentDepth ) { // First just try walking back up the tree. QModelIndex p = parent; while ( p.isValid() ) p = p.parent(); // For models that are dynamically populated if ( model->canFetchMore ( parent ) ) { fetchingMore = true; model->fetchMore ( parent ); fetchingMore = false; } int rows = model->rowCount ( parent ); int columns = model->columnCount ( parent ); if ( rows > 0 ) Q_ASSERT ( model->hasChildren ( parent ) ); // Some further testing against rows(), columns(), and hasChildren() Q_ASSERT ( rows >= 0 ); Q_ASSERT ( columns >= 0 ); if ( rows > 0 ) Q_ASSERT ( model->hasChildren ( parent ) == true ); //qDebug() << "parent:" << model->data(parent).toString() << "rows:" << rows // << "columns:" << columns << "parent column:" << parent.column(); Q_ASSERT ( model->hasIndex ( rows + 1, 0, parent ) == false ); for ( int r = 0; r < rows; ++r ) { if ( model->canFetchMore ( parent ) ) { fetchingMore = true; model->fetchMore ( parent ); fetchingMore = false; } Q_ASSERT ( model->hasIndex ( r, columns + 1, parent ) == false ); for ( int c = 0; c < columns; ++c ) { Q_ASSERT ( model->hasIndex ( r, c, parent ) == true ); QModelIndex index = model->index ( r, c, parent ); // rowCount() and columnCount() said that it existed... Q_ASSERT ( index.isValid() == true ); // index() should always return the same index when called twice in a row QModelIndex modifiedIndex = model->index ( r, c, parent ); Q_ASSERT ( index == modifiedIndex ); // Make sure we get the same index if we request it twice in a row QModelIndex a = model->index ( r, c, parent ); QModelIndex b = model->index ( r, c, parent ); Q_ASSERT ( a == b ); // Some basic checking on the index that is returned Q_ASSERT ( index.model() == model ); Q_ASSERT ( index.row() == r ); Q_ASSERT ( index.column() == c ); // While you can technically return a QVariant usually this is a sign // of an bug in data() Disable if this really is ok in your model. // Q_ASSERT ( model->data ( index, Qt::DisplayRole ).isValid() == true ); // If the next test fails here is some somewhat useful debug you play with. if (model->parent(index) != parent) { qDebug() << r << c << currentDepth << model->data(index).toString() << model->data(parent).toString(); qDebug() << index << parent << model->parent(index); // And a view that you can even use to show the model. // QTreeView view; // view.setModel(model); // view.show(); } // Check that we can get back our real parent. // qDebug() << model->parent ( index ) << parent ; Q_ASSERT ( model->parent ( index ) == parent ); // recursively go down the children if ( model->hasChildren ( index ) && currentDepth < 10 ) { //qDebug() << r << c << "has children" << model->rowCount(index); checkChildren ( index, ++currentDepth ); }/* else { if (currentDepth >= 10) qDebug() << "checked 10 deep"; };*/ // make sure that after testing the children that the index doesn't change. QModelIndex newerIndex = model->index ( r, c, parent ); Q_ASSERT ( index == newerIndex ); } } } /*! Tests model's implementation of QAbstractItemModel::data() */ void ModelTest::data() { // Invalid index should return an invalid qvariant Q_ASSERT ( !model->data ( QModelIndex() ).isValid() ); if ( model->rowCount() == 0 ) return; // A valid index should have a valid QVariant data Q_ASSERT ( model->index ( 0, 0 ).isValid() ); // shouldn't be able to set data on an invalid index Q_ASSERT ( model->setData ( QModelIndex(), QLatin1String ( "foo" ), Qt::DisplayRole ) == false ); // General Purpose roles that should return a QString QVariant variant = model->data ( model->index ( 0, 0 ), Qt::ToolTipRole ); if ( variant.isValid() ) { Q_ASSERT ( qVariantCanConvert ( variant ) ); } variant = model->data ( model->index ( 0, 0 ), Qt::StatusTipRole ); if ( variant.isValid() ) { Q_ASSERT ( qVariantCanConvert ( variant ) ); } variant = model->data ( model->index ( 0, 0 ), Qt::WhatsThisRole ); if ( variant.isValid() ) { Q_ASSERT ( qVariantCanConvert ( variant ) ); } // General Purpose roles that should return a QSize variant = model->data ( model->index ( 0, 0 ), Qt::SizeHintRole ); if ( variant.isValid() ) { Q_ASSERT ( qVariantCanConvert ( variant ) ); } // General Purpose roles that should return a QFont QVariant fontVariant = model->data ( model->index ( 0, 0 ), Qt::FontRole ); if ( fontVariant.isValid() ) { Q_ASSERT ( qVariantCanConvert ( fontVariant ) ); } // Check that the alignment is one we know about QVariant textAlignmentVariant = model->data ( model->index ( 0, 0 ), Qt::TextAlignmentRole ); if ( textAlignmentVariant.isValid() ) { int alignment = textAlignmentVariant.toInt(); Q_ASSERT ( alignment == ( alignment & ( Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask ) ) ); } // General Purpose roles that should return a QColor QVariant colorVariant = model->data ( model->index ( 0, 0 ), Qt::BackgroundColorRole ); if ( colorVariant.isValid() ) { Q_ASSERT ( qVariantCanConvert ( colorVariant ) ); } colorVariant = model->data ( model->index ( 0, 0 ), Qt::TextColorRole ); if ( colorVariant.isValid() ) { Q_ASSERT ( qVariantCanConvert ( colorVariant ) ); } // Check that the "check state" is one we know about. QVariant checkStateVariant = model->data ( model->index ( 0, 0 ), Qt::CheckStateRole ); if ( checkStateVariant.isValid() ) { int state = checkStateVariant.toInt(); Q_ASSERT ( state == Qt::Unchecked || state == Qt::PartiallyChecked || state == Qt::Checked ); } } /*! Store what is about to be inserted to make sure it actually happens \sa rowsInserted() */ void ModelTest::rowsAboutToBeInserted ( const QModelIndex &parent, int start, int end ) { // Q_UNUSED(end); // qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << end << "parent=" << model->data ( parent ).toString() // << "current count of parent=" << model->rowCount ( parent ); // << "display of last=" << model->data( model->index(start-1, 0, parent) ); // qDebug() << model->index(start-1, 0, parent) << model->data( model->index(start-1, 0, parent) ); Changing c; c.parent = parent; c.oldSize = model->rowCount ( parent ); c.last = model->data ( model->index ( start - 1, 0, parent ) ); c.next = model->data ( model->index ( start, 0, parent ) ); insert.push ( c ); } /*! Confirm that what was said was going to happen actually did \sa rowsAboutToBeInserted() */ void ModelTest::rowsInserted ( const QModelIndex & parent, int start, int end ) { Changing c = insert.pop(); Q_ASSERT ( c.parent == parent ); // qDebug() << "rowsInserted" << "start=" << start << "end=" << end << "oldsize=" << c.oldSize // << "parent=" << model->data ( parent ).toString() << "current rowcount of parent=" << model->rowCount ( parent ); // for (int ii=start; ii <= end; ii++) // { // qDebug() << "itemWasInserted:" << ii << model->data ( model->index ( ii, 0, parent )); // } // qDebug(); Q_ASSERT ( c.oldSize + ( end - start + 1 ) == model->rowCount ( parent ) ); Q_ASSERT ( c.last == model->data ( model->index ( start - 1, 0, c.parent ) ) ); if (c.next != model->data(model->index(end + 1, 0, c.parent))) { qDebug() << start << end; for (int i=0; i < model->rowCount(); ++i) qDebug() << model->index(i, 0).data().toString(); qDebug() << c.next << model->data(model->index(end + 1, 0, c.parent)); } Q_ASSERT ( c.next == model->data ( model->index ( end + 1, 0, c.parent ) ) ); } void ModelTest::layoutAboutToBeChanged() { for ( int i = 0; i < qBound ( 0, model->rowCount(), 100 ); ++i ) changing.append ( QPersistentModelIndex ( model->index ( i, 0 ) ) ); } void ModelTest::layoutChanged() { for ( int i = 0; i < changing.count(); ++i ) { QPersistentModelIndex p = changing[i]; Q_ASSERT ( p == model->index ( p.row(), p.column(), p.parent() ) ); } changing.clear(); } /*! Store what is about to be inserted to make sure it actually happens \sa rowsRemoved() */ void ModelTest::rowsAboutToBeRemoved ( const QModelIndex &parent, int start, int end ) { qDebug() << "ratbr" << parent << start << end; Changing c; c.parent = parent; c.oldSize = model->rowCount ( parent ); c.last = model->data ( model->index ( start - 1, 0, parent ) ); c.next = model->data ( model->index ( end + 1, 0, parent ) ); remove.push ( c ); } /*! Confirm that what was said was going to happen actually did \sa rowsAboutToBeRemoved() */ void ModelTest::rowsRemoved ( const QModelIndex & parent, int start, int end ) { qDebug() << "rr" << parent << start << end; Changing c = remove.pop(); Q_ASSERT ( c.parent == parent ); Q_ASSERT ( c.oldSize - ( end - start + 1 ) == model->rowCount ( parent ) ); Q_ASSERT ( c.last == model->data ( model->index ( start - 1, 0, c.parent ) ) ); Q_ASSERT ( c.next == model->data ( model->index ( start, 0, c.parent ) ) ); } plasmate-1.0/plasmate/modeltest/PaxHeaders.5990/modeltest.h0000644000175000001440000000013212115142004022076 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412548.616641211 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/modeltest/modeltest.h0000644000175000001440000000512412115142004022535 0ustar00kokeroulisusers00000000000000/**************************************************************************** ** ** 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 test suite 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$ ** ****************************************************************************/ #ifndef MODELTEST_H #define MODELTEST_H #include #include #include class ModelTest : public QObject { Q_OBJECT public: ModelTest( QAbstractItemModel *model, QObject *parent = 0 ); private Q_SLOTS: void nonDestructiveBasicTest(); void rowCount(); void columnCount(); void hasIndex(); void index(); void parent(); void data(); protected Q_SLOTS: void runAllTests(); void layoutAboutToBeChanged(); void layoutChanged(); void rowsAboutToBeInserted( const QModelIndex &parent, int start, int end ); void rowsInserted( const QModelIndex & parent, int start, int end ); void rowsAboutToBeRemoved( const QModelIndex &parent, int start, int end ); void rowsRemoved( const QModelIndex & parent, int start, int end ); private: void checkChildren( const QModelIndex &parent, int currentDepth = 0 ); QAbstractItemModel *model; struct Changing { QModelIndex parent; int oldSize; QVariant last; QVariant next; }; QStack insert; QStack remove; bool fetchingMore; QList changing; }; #endif plasmate-1.0/plasmate/modeltest/PaxHeaders.5990/dynamictreemodel.h0000644000175000001440000000013212115142004023423 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412548.616641211 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/modeltest/dynamictreemodel.h0000644000175000001440000001151112115142004024057 0ustar00kokeroulisusers00000000000000/**************************************************************************** ** ** Copyright (C) 2009 Stephen Kelly ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite 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$ ** ****************************************************************************/ #ifndef DYNAMICTREEMODEL_H #define DYNAMICTREEMODEL_H #include #include #include class DynamicTreeModel : public QAbstractItemModel { Q_OBJECT public: DynamicTreeModel(QObject *parent = 0); QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QModelIndex parent(const QModelIndex &index) const; int rowCount(const QModelIndex &index = QModelIndex()) const; int columnCount(const QModelIndex &index = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; void clear(); protected slots: /** Finds the parent id of the string with id @p searchId. Returns -1 if not found. */ qint64 findParentId(qint64 searchId) const; private: QHash m_items; QHash > > m_childItems; qint64 nextId; qint64 newId() { return nextId++; }; QModelIndex m_nextParentIndex; int m_nextRow; int m_depth; int maxDepth; friend class ModelInsertCommand; friend class ModelMoveCommand; friend class ModelResetCommand; friend class ModelResetCommandFixed; }; class ModelChangeCommand : public QObject { Q_OBJECT public: ModelChangeCommand( DynamicTreeModel *model, QObject *parent = 0 ); virtual ~ModelChangeCommand() {} void setAncestorRowNumbers(QList rowNumbers) { m_rowNumbers = rowNumbers; } QModelIndex findIndex(QList rows); void setStartRow(int row) { m_startRow = row; } void setEndRow(int row) { m_endRow = row; } void setNumCols(int cols) { m_numCols = cols; } virtual void doCommand() = 0; protected: DynamicTreeModel* m_model; QList m_rowNumbers; int m_numCols; int m_startRow; int m_endRow; }; typedef QList ModelChangeCommandList; class ModelInsertCommand : public ModelChangeCommand { Q_OBJECT public: ModelInsertCommand(DynamicTreeModel *model, QObject *parent = 0 ); virtual ~ModelInsertCommand() {} virtual void doCommand(); }; class ModelMoveCommand : public ModelChangeCommand { Q_OBJECT public: ModelMoveCommand(DynamicTreeModel *model, QObject *parent); virtual ~ModelMoveCommand() {} virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); virtual void doCommand(); virtual void emitPostSignal(); void setDestAncestors( QList rows ) { m_destRowNumbers = rows; } void setDestRow(int row) { m_destRow = row; } protected: QList m_destRowNumbers; int m_destRow; }; /** A command which does a move and emits a reset signal. */ class ModelResetCommand : public ModelMoveCommand { Q_OBJECT public: ModelResetCommand(DynamicTreeModel* model, QObject* parent = 0); virtual ~ModelResetCommand(); virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); virtual void emitPostSignal(); }; /** A command which does a move and emits a beginResetModel and endResetModel signals. */ class ModelResetCommandFixed : public ModelMoveCommand { Q_OBJECT public: ModelResetCommandFixed(DynamicTreeModel* model, QObject* parent = 0); virtual ~ModelResetCommandFixed(); virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); virtual void emitPostSignal(); }; #endif plasmate-1.0/plasmate/PaxHeaders.5990/sidebardelegate.cpp0000644000175000001440000000013212115142004021535 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/sidebardelegate.cpp0000644000175000001440000001145112115142004022174 0ustar00kokeroulisusers00000000000000/* Copyright 2007 by Pino Toscano 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 . */ // Stolen from okular :-) #include #include #include #include #include #include #include "sidebardelegate.h" /* A simple delegate to paint the icon of each item */ static const int ITEM_MARGIN_LEFT = 5; static const int ITEM_MARGIN_TOP = 5; static const int ITEM_MARGIN_RIGHT = 5; static const int ITEM_MARGIN_BOTTOM = 5; static const int ITEM_PADDING = 5; SidebarDelegate::SidebarDelegate(QObject *parent) : QAbstractItemDelegate(parent), m_showText(true) { } SidebarDelegate::~SidebarDelegate() { } void SidebarDelegate::setShowText(bool show) { m_showText = show; } bool SidebarDelegate::isTextShown() const { return m_showText; } void SidebarDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { QBrush backBrush; QColor foreColor; bool disabled = false; bool hover = false; if (!(option.state & QStyle::State_Enabled)) { backBrush = option.palette.brush(QPalette::Disabled, QPalette::Base); foreColor = option.palette.color(QPalette::Disabled, QPalette::Text); disabled = true; } else if (option.state & (QStyle::State_HasFocus | QStyle::State_Selected)) { backBrush = option.palette.brush(QPalette::Highlight); foreColor = option.palette.color(QPalette::HighlightedText); } else if (option.state & QStyle::State_MouseOver) { backBrush = option.palette.color(QPalette::Highlight).light(115); foreColor = option.palette.color(QPalette::HighlightedText); hover = true; } else { /*if ( option.state & QStyle::State_Enabled )*/ backBrush = option.palette.brush(QPalette::Base); foreColor = option.palette.color(QPalette::Text); } QStyle *style = QApplication::style(); QStyleOptionViewItemV4 opt(option); // KStyle provides an "hover highlight" effect for free; // but we want that for non-KStyle-based styles too if (!style->inherits("KStyle") && hover) { Qt::BrushStyle bs = opt.backgroundBrush.style(); if (bs > Qt::NoBrush && bs < Qt::TexturePattern) opt.backgroundBrush = opt.backgroundBrush.color().light(115); else opt.backgroundBrush = backBrush; } painter->save(); style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, 0); painter->restore(); QIcon icon = index.data(Qt::DecorationRole).value< QIcon >(); if (!icon.isNull()) { QPoint iconpos( (option.rect.width() - option.decorationSize.width()) / 2, ITEM_MARGIN_TOP ); iconpos += option.rect.topLeft(); QIcon::Mode iconmode = disabled ? QIcon::Disabled : QIcon::Normal; painter->drawPixmap(iconpos, icon.pixmap(option.decorationSize, iconmode)); } if (m_showText) { QString text = index.data(Qt::DisplayRole).toString(); QRect fontBoundaries = QFontMetrics(option.font).boundingRect(text); fontBoundaries.setWidth(fontBoundaries.width() + ITEM_PADDING); QPoint textPos( ITEM_MARGIN_LEFT + (option.rect.width() - ITEM_MARGIN_LEFT - ITEM_MARGIN_RIGHT - fontBoundaries.width()) / 2, ITEM_MARGIN_TOP + option.decorationSize.height() + ITEM_PADDING ); fontBoundaries.translate(-fontBoundaries.topLeft()); fontBoundaries.translate(textPos); fontBoundaries.translate(option.rect.topLeft()); painter->setPen(foreColor); painter->drawText(fontBoundaries, Qt::AlignCenter, text); } } QSize SidebarDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { QSize baseSize(option.decorationSize.width(), option.decorationSize.height()); if (m_showText) { QRect fontBoundaries = QFontMetrics(option.font).boundingRect(index.data(Qt::DisplayRole).toString()); baseSize.setWidth(qMax(fontBoundaries.width(), baseSize.width())); baseSize.setHeight(baseSize.height() + fontBoundaries.height() + ITEM_PADDING); } return baseSize + QSize(ITEM_MARGIN_LEFT + ITEM_MARGIN_RIGHT, ITEM_MARGIN_TOP + ITEM_MARGIN_BOTTOM); } plasmate-1.0/plasmate/PaxHeaders.5990/plasmateui.rc0000644000175000001440000000013212115142004020417 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412548.616641211 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/plasmateui.rc0000644000175000001440000000117712115142004021062 0ustar00kokeroulisusers00000000000000 &File Main Toolbar plasmate-1.0/plasmate/PaxHeaders.5990/startpage.h0000644000175000001440000000013212115142004020070 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/startpage.h0000644000175000001440000000536012115142004020531 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Riccardo Iaconelli 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 . */ #ifndef STARTPAGE_H #define STARTPAGE_H #include #include #include "ui_startpage.h" class QLabel; class QComboBox; class QListWidget; class QVBoxLayout; class QModelIndex; class KPushButton; class KLineEdit; class MainWindow; class ProjectManager; static const QString PROJECTRC(".plasmateprojectrc"); class StartPage : public QWidget { Q_OBJECT enum Roles { FullPathRole = Qt::UserRole + 1 }; friend class ProjectManager; public: StartPage(MainWindow *parent); ~StartPage(); QString userName(); QString userEmail(); bool selectedJsRadioButton(); bool selectedRbRadioButton(); bool selectedDeRadioButton(); bool selectedPyRadioButton(); void resetStatus(); enum ProjectTypes { Theme = 1, Plasmoid = 2, DataEngine = 4, Runner = 8 }; Q_DECLARE_FLAGS(ProjectType, ProjectTypes) signals: void projectSelected(const QString &name); public Q_SLOTS: void cancelNewProject(); private Q_SLOTS: void recentProjectSelected(const QModelIndex &); void validateProjectType(const QModelIndex &sender); void createNewProject(); void checkProjectName(const QString &name); void checkLocalProjectPath(const QString &path); void checkPackagePath(const QString &path); void importPackage(); void doGHNSImport(); void refreshRecentProjectsList(); void loadLocalProject(); void saveNewProjectPreferences(const QString &path); private: enum NewProjectRows { PlasmoidRow = 0, DataEngineRow = 1, RunnerRow = 2, ThemeRow = 3, WindowSwitcherRow = 4, KWinScriptRow = 5, KWinEffectRow = 6 }; void setupWidgets(); static QString camelToSnakeCase(const QString& name); const QString generateProjectFolderName(const QString& suggestion); void selectProject(const KUrl &target); void ensureProjectrcFileExists(const QString& projectPath); Ui::StartPage m_ui; MainWindow *m_parent; ProjectManager *m_projectManager; }; #endif // STARTPAGE_H plasmate-1.0/plasmate/PaxHeaders.5990/projectmanager0000644000175000001440000000013212115142004020651 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.623641145 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/projectmanager/0000755000175000001440000000000012115142004021363 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/projectmanager/PaxHeaders.5990/projectmanager.h0000644000175000001440000000013212115142004024100 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/projectmanager/projectmanager.h0000644000175000001440000000414612115142004024542 0ustar00kokeroulisusers00000000000000/* * Copyright 2009 Lim Yuen Hoe * * 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. */ #ifndef PROJECTMANAGER_H #define PROJECTMANAGER_H #include #include class QListWidget; class QListWidgetItem; class KUrl; class KPushButton; class KMenu; namespace Ui { class ProjectManager; } class ProjectManager : public KDialog { Q_OBJECT public: ProjectManager(QWidget *parent); void addProject(QListWidgetItem *item); void clearProjects(); static bool exportPackage(const KUrl &toExport, const KUrl &targetFile); static bool importPackage(const KUrl &toImport, const KUrl &targetLocation); public Q_SLOTS: void addRecentProject(const QString &path); void setRecentProjects(const QStringList &paths); signals: void projectSelected(const QString &name); void requestRefresh(); private: void deleteProject(const KUrl &projectLocation); private Q_SLOTS: void emitProjectSelected(); void removeSelectedProjects(bool deleteFromDisk); void confirmRemoveFromDisk(); void confirmRemoveFromList(); void checkButtonState(); private: //TODO: Implement: // search/filterbar, // project multi-export, // project multi-import. QListWidget *m_projectList; KPushButton *m_loadButton; KPushButton *m_removeMenuButton; KMenu *m_removeMenu; bool m_destroyFlag; MainWindow* m_mainWindow; }; #endif // PROJECTMANAGER_H plasmate-1.0/plasmate/projectmanager/PaxHeaders.5990/projectmanager.cpp0000644000175000001440000000013212115142004024433 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/projectmanager/projectmanager.cpp0000644000175000001440000001627712115142004025105 0ustar00kokeroulisusers00000000000000/* * Copyright 2009 Lim Yuen Hoe * * 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. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "projectmanager.h" #include "startpage.h" ProjectManager::ProjectManager(QWidget* parent) : KDialog(parent) { setButtons(KDialog::None); m_projectList = new QListWidget(this); m_projectList->setSelectionMode(QAbstractItemView::ExtendedSelection); connect(m_projectList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(emitProjectSelected())); connect(m_projectList,SIGNAL(itemSelectionChanged()), this, SLOT(checkButtonState())); m_loadButton = new KPushButton(i18n("Load Project"), this); connect(m_loadButton, SIGNAL(clicked()), this, SLOT(emitProjectSelected())); m_removeMenuButton = new KPushButton(i18n("Remove Project"), this); m_removeMenu = new KMenu(i18n("Remove Project"), this); m_removeMenuButton->setMenu(m_removeMenu); m_removeMenu->addAction(i18n("From List"), this, SLOT(confirmRemoveFromList())); m_removeMenu->addAction(i18n("From Disk"), this, SLOT(confirmRemoveFromDisk())); QVBoxLayout *l = new QVBoxLayout(); m_loadButton->setDisabled(true); m_removeMenuButton->setDisabled(true); l->addWidget(m_projectList); l->addWidget(m_loadButton); l->addWidget(m_removeMenuButton); QWidget *tmpWidget = new QWidget(); tmpWidget->setLayout(l); setMainWidget(tmpWidget); } void ProjectManager::confirmRemoveFromList() { const int count = m_projectList->selectedItems().count(); QString dialogText = i18np("Are you sure you want to remove the selected project from the project list?", "Are you sure you want to remove the selected projects from the project list?", count); const int code = KMessageBox::warningContinueCancel(this, dialogText); if (code == KMessageBox::Continue) { removeSelectedProjects(false); } } void ProjectManager::confirmRemoveFromDisk() { const int count = m_projectList->selectedItems().count(); QString dialogText = i18np("Are you sure you want to remove the selected project from disk? This cannot be undone", "Are you sure you want to remove the selected projects from disk? This cannot be undone", count); const int code = KMessageBox::warningContinueCancel(this, dialogText); if (code == KMessageBox::Continue) { removeSelectedProjects(true); } } void ProjectManager::removeSelectedProjects(bool deleteFromDisk) { const QList items = m_projectList->selectedItems(); bool checkSuccess = false; QStringList recentList = m_mainWindow->recentProjects(); foreach (const QListWidgetItem *item, items) { QString recentProject = item->data(StartPage::FullPathRole).value(); recentProject.append("/"); if (recentProject.contains(KStandardDirs::locateLocal("appdata","")) && !recentProject.isEmpty() && deleteFromDisk) { deleteProject(recentProject); } else if (recentProject.endsWith("package/")) { deleteProject(recentProject); } if (recentList.removeAll(item->data(StartPage::FullPathRole).value()) > 0) { checkSuccess = true; } } if (checkSuccess) { setRecentProjects(recentList); } } void ProjectManager::checkButtonState() { QList l = m_projectList->selectedItems(); m_loadButton->setEnabled(l.count() == 1); m_removeMenuButton->setEnabled(l.count() > 0); } void ProjectManager::addProject(QListWidgetItem *item) { m_projectList->addItem(item); } void ProjectManager::clearProjects() { m_projectList->clear(); } void ProjectManager::emitProjectSelected() { QList l = m_projectList->selectedItems(); if (l.isEmpty()) { return; } QString url = l[0]->data(StartPage::FullPathRole).value(); emit projectSelected(url); done(KDialog::Accepted); } bool ProjectManager::exportPackage(const KUrl &toExport, const KUrl &targetFile) { // Think ONE minute before committing nonsense: if you want to zip a folder, // and you create the *.zip file INSIDE that folder WHILE copying the files, // guess what happens?? // This also means: always try at least once, before committing changes. if (targetFile.pathOrUrl().contains(toExport.pathOrUrl())) { // Sounds like we are attempting to create the package from inside the package folder, noooooo :) return false; } if (QFile::exists(targetFile.path())) { //TODO: Make sure this succeeds QFile::remove(targetFile.path()); // overwrite! } // Create an empty zip file KZip zip(targetFile.pathOrUrl()); zip.open(QIODevice::ReadWrite); zip.close(); // Reopen for writing if (zip.open(QIODevice::ReadWrite)) { kDebug() << "zip file opened successfully"; zip.addLocalDirectory(toExport.pathOrUrl(), "."); zip.close(); return true; } kDebug() << "Cant open zip file" ; return false; } bool ProjectManager::importPackage(const KUrl &toImport, const KUrl &targetLocation) { bool ret = true; KZip plasmoid(toImport.path()); if (!plasmoid.open(QIODevice::ReadOnly)) { kDebug() << "ProjectManager::importPackage can't open the plasmoid archive"; return false; } plasmoid.directory()->copyTo(targetLocation.path()); plasmoid.close(); return ret; } void ProjectManager::addRecentProject(const QString &path) { QStringList recent = m_mainWindow->recentProjects(); recent.removeAll(path); recent.prepend(path); //kDebug() << "Writing the following recent files to the config:" << recent; KConfigGroup cg(KGlobal::config(), "General"); cg.writeEntry("recentProjects", recent); KGlobal::config()->sync(); emit requestRefresh(); } void ProjectManager::setRecentProjects(const QStringList &paths) { KConfigGroup cg(KGlobal::config(), "General"); cg.writeEntry("recentProjects", paths); KGlobal::config()->sync(); emit requestRefresh(); } void ProjectManager::deleteProject(const KUrl &projectLocation) { KUrl project = projectLocation; KIO::del(project); } plasmate-1.0/plasmate/PaxHeaders.5990/icons0000644000175000001440000000013212115142004016763 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.616641211 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/icons/0000755000175000001440000000000012115142004017475 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/icons/PaxHeaders.5990/hi22-app-plasmagik.png0000644000175000001440000000013212115142004023036 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/icons/hi22-app-plasmagik.png0000644000175000001440000000227112115142004023475 0ustar00kokeroulisusers00000000000000‰PNG  IHDRÄ´l;sBIT|dˆ pHYsaaÁ0UútEXtSoftwarewww.inkscape.org›î<6IDATxÚT}LeþݵW®Œ¯B¡kSZ(_AA™«Î(»%d0AYM¬ñ™‰ h$L…iÆâ?&˜-ºÄÌ2ðc&ë²°.j™âÇ Â2»6ÆÇh -…¶´ôz¯ï‘5²Ù>É“_îÞ÷yÞßýî¹#B'ˆ‡5. 1Ðßß/ ¢Ž$3®‡ãÁOårvú++šj½ÍØ´!»ú£©¿”ª-B®ã ª¤\m¯£. ¹ë––®C̓=uª™Ïç£ÚÚZgWW¹pÔìú62ƒ ƒƒM‚?<¿ó×=M §çC²‘Z©  ±úbJ|@ÊP? I“Œ€ –j¿>õþþ«ªª2»»»[$¨w¿«¡ÈÏê cbò‹K ¥¬b¡1=%Ïd2ê-3ãg{<ä÷ç#I¿¡A©ö­eF#ÓétáÞÞÞþ¦¦&éèè¨]¯×Â6àƒÀñ;ôfåkôÿ¢8Eu†éëu'ÿÝ¥´žÏ_yNwd_ŽÒår%z<`fÐb±ÀÌÌŒ›Ððˆ’¤JºÀ¿ä™Ü˜¯÷Lr{¾x-pœÎÉËËËœýDÛêj{Í}¬5Úíö'ÛÛÛêëëµXëÌÍÍE<€×8]”š€ ýœö+S±k#p8 #]/G᫚¸MƒApíloöâ]Ç¥ÃÍK‹ŠŠö€V&J PuuõPt„câÑÈùt?ºB³kf8 ÉOÊÜ©…À’L0ŒFãú÷—-nKé¡o“hh``€ NœŠ4AªØÌÙ•)DÏ.t"_¦¬ î`WWï:áÝ´½=|¹¹$ËÑGùë+Óº—ºèÿ7Ý6ç^¼â¾õîKO)¥î›:%…*)÷¼"ÈG…%¹‰$“,Œ¤¤±c>ìµ.nÿÐ6Ra=›ÓT¦R½Šˆ%,ó€'`€/C(HHÂë‹ø¼l覗\;ö·'#û™:ûé¾¾Bx 6r¼ûÕ{çp9ÇEÆÞ-®MÝ!1 :ñvðþ˜œ^ ý8â¸ašÉ I’L™UℜÐkؼ¿7fƒG/ü£Ÿ}~…ÉÉÉ/¼)Æ% ÊÏÏÿâq:bobqñØl¶…B±2==íÇÞp8€¯› ç•jwÛžìÙÖ½ÂxBQó0.Þ‰‰ §\._¢iúö[÷ù|RÀó$B§Y‚¹ŸÀgR·Çi¾Æ™OMMÍáè-ây[­Vï¿‹˜wȳk³ n>D:6Þ‹ç|’“«TªÕïêr%î+›÷nÇû2eEð8VE"w³‘[‹a“ј–óx¼!\~‚«±ã7OÀlÇ]#¡PÈ€8¶qüæ2ÌL„ùiìÇŸ”y\Î`Þ­©©±Ã&ü³•÷@­Í,IEND®B`‚plasmate-1.0/plasmate/icons/PaxHeaders.5990/hi48-app-plasmagik.png0000644000175000001440000000013212115142004023046 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/icons/hi48-app-plasmagik.png0000644000175000001440000000656512115142004023517 0ustar00kokeroulisusers00000000000000‰PNG  IHDR00Wù‡sBIT|dˆ pHYs11·í(RtEXtSoftwarewww.inkscape.org›î< òIDATxÚí˜ PSçÇ? ì*ÈÜ¢(MAd¿¢[mEAô©Õ"µnA¤S·–q/U«u«´¢Œ-X,²w*"  ì!˜œw>Æ;ÒZµ}OìÌ»3ÿɽɽ7ç÷}çœïœÀ?Zÿø#YXXÌèß¿>ª”r¥Õóz(žä1m•ßìh+ÛœÔøó&I]y’÷©S§tñ§Þ †¢ rP·ŒŒŒ4Ô”gOãUæC]¶ dß© æX”¯lÕ< jÑ”Ë;˧µ?ò:%¿=láùÄoÿßxxxhÙæ}°ÞÞÞ0a„f#ö¹É0õIR gÑØïQ¨,Têê&ibÒ%D eD•D©‘Ù5·Iíg¥³—¨•ˆ?•…‹A!:Ösú£¢¢ÌÆg‹§ýµ´´¼, ˆÿZ1Yv¶éécïð~p³æ=>|8DDD@qq1”——CXXXB÷w\~Å$ úY"O&áUÉ$ôÆçdî…dᕃä‹;§Iâ*i€ŸI+”#Ä wP>UL+ÊL%/¨Yë4 !¶Ô®qœÒýûöík‚Fh{¥x’ØœÉäÇo|Hv¼3Ù2^`ñÌ‚ ÓÓÓ¡  ~ù娯¯‡¤¤¤ªWŒ'î—‰Ûµd’ÞTH¡gCJš—©:d¦ô÷WŽéÿÝÛduÁLNñµéܼd_˜‰|B}“qrrbŽ=ÊÈd2&++kÒ¡C‡ž^¾|JKK¡±±JJJ 88xÄ_H œŒ¯Hp}!©CW¨Ÿªç¦ÒòÖKœša\¹Š÷Qý ­²ks¸×>Gfã‹…îîîBz„††¾•Íܹs‡©©©éÒúõë\¼xîÞ½ ]‘‘‘É1»‘âïÈ*xDT ‹Z[ž˜%½à32°1–“WÅ­’®æÜÍœC‚ñ]Ö(!‡ÃJ$¡T*îÝ»×#%%er~~>SQQÁ4773›6mÚpîܹ.7ª®®†ŽŽÀßü7R´¶æ§ê×È<•Ê*áiòüüJ´`9­Läid[ú©n‡ndi2°_¿~||ÄbÏt»÷R×M¸ÿ¾]FXUU%ܼyspnn.ƒß1 …‚ijjbvîÜ©ÌË˃‡B[[œ?†:æ¯\;FkWC†d¥N«¢„Äÿ1ÀWľ$Oà˜-´ï·‘†ºêÄÛøTèç|///¾4ÜùFÍZ—‡ÒO£MŒmª«sÀð>qâÄ{8â Î ƒ#ά[·îÒ¾}ûƒšú?àLÑ¡ŒUã/%úÊü¾¥P90+¦Ö¦«éÄáw.¤9ÉqWÍUB*þ–"* Bˆ p8„#‹ñ<( wTÓKU³Þ3S.— q„…»wïž~ï‡ËP…‡‡S—S£ÀÖÖÁÜܼ‚--^FO’¡—ŒåP6àà.éT-4¸Ðz’'М1PA¦h2|Ú ËG› \QM׬Y×~ ‹p’RÃY=Þ¸®¬¬LØÚÚ*ÌÈÈðÙºuë\___fÈ!̶mÛ.‡“oÊ#0ÌD ¶†Âƹ Œ5%“_&p«Nÿ§™†J( ¸nP@@™O²üý ï7ëÀí=6:Êt \´GÊpPg¸¯îþ2œ~î¬0-ò+lQÃDQáT-ö:[XX(|üø±033Sˆq@ñG1ï¿ÿ>3U4t·£ÞâGŽ\µ÷ÿiÆÙF¬Z’Éš¬áj¸: 'ìÑ´ä”§ƒß­Äåg𣠚{1àô|ñÂ… õ0‹ð¯_¿Î¯v?ÖðíV1Ž:ÇŽ7vÔ¨QB\Ä„±±±ãqužvL=z4ó6ž·³n„3xo#^ózþÇ­=¤ó’ªNæ=…l/€Œé4Hgí9úMO`R‘>®ÚJî}šü@õó²–Æiiiü›7oò+++ùJ¥’ÁkËãñÆÓÔjhh(D¿:88ÌÂëap`põþ‘­ðÖ®]KÏg[-!}š·““êýÜNH¶Hœä‚&EGÝrZëâ©hbû<›æmËŠ X4E¡ù‚¦0ø)è–Ó´*u¢óæÍb âb7OGGgbHHˆú½œÇ%ð/'3¸åÒ#PoB·ýÌ`—@"~À T_Y=©ØeNãˆóÒ ÍƒÜÅçå×§c cÀè‚&g((3„…µßŽœ»k—?¯û(È"íŒk$¢Õ´eÓëŒ3ø ¶èB^´'°´´y,rŸä¦w¤`–ÑÅœwu[Ïׂú0.´D˜@ÛzcPF€-ú Ù;HÝ‘4¤LºÕdEwÃ_ ::Z¯$3 ¢å>&Ÿ"o€L= m€sú >c¨VÐûµq›Åͺø)òÈÑå4 Õn¶ü,OÒ7.{µE\Î ëØÒøÑû*âE—o/(mXµt¬6S«ëAÇ\ª`Ô4~>†0hùDÍÛÜ +Ò©C±Óy÷áøætmø[=1%/:ãx¨öjÐS(ELÕ9öߣ[" Ø €îù¿>JM±¡êc¨ŠäÀ¯\hZgÆPJ 3ŒÀÓ-P-6Õ*¨cǃücW8µÀBÜm@²r9LŸ>þñðÿZSÿìйy”'M•w^óïÐÜ ÁYY ªÔw Cû´vù>O¨Û犃Ӡíh04 ‚º=ïu6íšÞTËTç.~ç »nòHk‹£l0¦XÀ‰ÿ;/j釱sº¤»¬fƒ}á3ã5(PìšPÒvÜ%·í€ý¥ªÛÅQæi¹KM¿×Nà$Ïñ666 ÍL˜•}úÀ¢E‹ 00¾À½×÷…h ¡,(n§ð§N:«WÌLÞ8ÞØ#‡àEˆ©©évÖ&Ož «V­„ÚßÛ,„ÊŠB ±|\+ððÅbЯçŒ1"gåCœ%ZZP÷%K–~¯ÀkÝÞ`!ôØõ»ÍcÇŽ€†úêéé½µP64!XzäR `˜9s&›Þ˜…3fÌ b_t#_¬‰QüLdÝÈÍÍÆu£Ôÿ,–âÕ+Äæìõã5nú¯€ýXôf _ ÜlhÂp'/ËŒ 0`À˜={6 ˜ ¯Méór‰x)& ¥,Bü¹,\tµ6\|ùuôLÃæÝg 68îÔ•0¨—¢ÑKpÄ`gÁÏÏ&MšDÏ—Ògk#!tÓ7¯ çÖ£%…À: GÞƒ9ÀØØx5f£ ,ÆJW,`l\¡j2‰ø—÷ëú½n‚Ǻú¾!ìÚ–#ÀJ¬PS‚)S¦t5&ƃGü,; ...€eô<®t…€‡F@<\t7œ ÎG»·Xˆ¾Ï †›™™1¨å8òØÒ³TWàw›‰hðÖ­p5aßÑÛZÝz'œ‰YèRt£Ÿ)f%º 8;ôæ ]ϱ%v/¼¨Ü°Aý1°?¬t‚°+³H$¢çI½°½r¹a‡%F ÖMÑøÙA°E¼®£¥Å›ÀBè?s%,'V`0ç㌅ÀU°^¢ç3ÞTÂe‹š…ûP€E`? €Þò¦ÐÃ5µ g ]‡BÐX Ÿ*ZŽô>À‹ƒÚ5 •@E36Bô†°7€…ÐF BmEu`í˜féo2@ÏÂUÅB`ÕJ ²{“z®Ô§Q@…镯ÕçÿŸ--P´¬ÐLœ81JC=ÁZ©pÙ²e+_ôÌ¿ö“›'‘´æõIEND®B`‚plasmate-1.0/plasmate/icons/PaxHeaders.5990/hi64-app-plasmagik.png0000644000175000001440000000013212115142004023044 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/icons/hi64-app-plasmagik.png0000644000175000001440000001214612115142004023505 0ustar00kokeroulisusers00000000000000‰PNG  IHDR@@ªiqÞsBIT|dˆ pHYsììu85tEXtSoftwarewww.inkscape.org›î<ãIDATxÚí[TTW×½‚ˆbAF1ÆŒ4° ò0‚5[¬Ø06ª`ÃJDc‰Q”ØA‰J4`±W¤ÊÐË€sþ}çç­ÅcbÖ§|ÿ¬µ×ð.3ƒgßsöÙ÷¼‘Ñ5þŸ€ÿÄÅCÝßßßaôèÑn}ûöíý_E@ãÆ7hÐ A[[›êÔ©ód\ºÿÙ{ÒãVõ(IÚ«HÝU–x¾8qÍõþÙ~èsêÔv†<¼çÀEŸ¬§§Ç9¶¿áõ’âøùGH£ œ‹å”® ¬ãe”¹¿ŒR¾)Q&Ï+V¦.Ì«H™û¨ôé˜ð¼»v+oGjväïû ˜3gNÀtàÀ6šššŒ±`€D4iÒ„5jÄ–ZÕßÿl¬¼·¸„’÷–Ñóm¥ô,°„Í)¢ßµåt™åÐ ¸ ÜÕÊ¡ÇäÊÄ&¹Šë9wÔ–Äžc–ÿLLLÔôõõÛc—f+‘HºŽã-šV%€—A·nÝÄëaÕ?'s;ó¤Ã’:c˜KÌò(²©œÎáú<þˆ®q¬n1Ýc¥ôS+¢g,W™ª+/J±>t9¬IûD@–—µ— ¾íÿbª[][@hÑ¢…ÀŸw l½P¿®:U%¡gÏždkkK£FŠ«þ9aÞ¬¹â‹¦Ãòp΀K,çÕx¾ÎätƒÐmVB÷Y=fD‰Àsò¢N¡2w€\þÜtÃðáLó Èö¶òGðåey[½éu3gÎÔ+O$ÀÜÌŒ–/ð¥5ó=¨u}öwƒßÀE°ÇÊ;~"Q,–o2RÞaE×°aâî×  è¨ÖgÊõ•t–ÿŠ)OY%¾†ÙúØ))œœ4u³›S–¯íêdøÚ݃ºË’’’Tq“íÚµk˜‡‡ÇˆO?ýTÀÁH4h°cÇÁ°Öi]Fõ ÆÚ´nb_ŠÚèI#LõÊ uYÓw þÉ̲,ŒåR¬=у‘DÑj„'¡"1ŒÍç™ñZ+\ÖÔ¸"¼™‚N×[sHymŠ’è·zX¶l™Z˜)-}ß<Ó§Ëýê$< òø‚ "z» íOl¥®®>oïíÚµà„qýºû 2fähÈÈ$ŒéïHßo\G\]ù›ñWžÊtäÙîŠÓZå÷9QŒ)ÑEFt ;ÍÊîb3D üZ²Ï˜?¥3 çŠ ˜[BQ}sÞôÇprSC­ÂäHãââ¤Y~]Éòé”™³qìðì½¾ÝbFºŸÛ¾Òý_¶iÓ&v›wY§Nú3ƾœùQyøðá*—•"–Z)Ú¸q#á51o |êT¦‘³“m)e¥Ñ»=„(¼Q#úQÅ&øŽ9ˆ;ÿZnžü¼—üì'D=ˆnÃ-Ýó£Šs6øïþ„MÔµª’7ÏpHŽØÕ=^ZVV&…ÐmٲűwïÞÜ`ò#›8q¢lëÖ­V 6œ€µ¡€`aa!,\¸P066Þ# ««Ëí0¡<åÂ×>}£ÂobkËw³":€†qá3¢ÈÎDÇ„»Æ”'Ù…%£˜ô­‘'g]c ÏêÁ)ÅB)g‚wRœ5¿ö6ö§L™¢{ìØ1)z·½\Šþ/…¥•Båy‹ü”ÏúD‡hii)C°2WWWìì$¬õÅ RÀ`T9cªÎ@­^½šðùüziõÀ³¾e‹[Xr§&ÑSµZ5²ûg~\“Š©ß9»‚Ù‹»þ6$)W¦'åŸÓ&J†UŒ Meô}Û›Å9ì®çyé½{÷¤üçùóçK÷ïß/řߚ1fÈPÿ2Ì d8X·iÓf"ÖFÎ ÂâÅ‹Û"íÛ·'OOO ¤úõë'ò@žû2×¼eìŒb ßROåMè Äz§:Ñn†k*;¨—r+Pg—ú;ÍŸÅÌJÌŠ„ÞE7!ºlD\DÊc\ `Sµÿʇ f›ÂÐH1ê–bw¥¨u)v[ºjÕ*#&^YóæÍe3fÌàD|Ž‘™Ö!å…±cÇ ¦¦¦D@5Š~ZíIÛF¶ ¹+S.eDëaÞ‚áævµ!Ú$!ÚÊ|*ßg˜—²¥¡÷*k*œ3÷Hj̯Y©œ-HcOE®Ý:bð¶éÓ§)ßTô5i¿~ý¤8ðHù”¤ôº5 ëÑ£‡lîܹÖ0;±Î3¡O÷îÝ…I“& ÒP—”;6g´¦;£Äé:T –#Aæc*4-”ŸhÿýãºöêÕ«F!˜Šl/ëåiV¼Å5IÀ.JGŽ)E·ÚÙÙuâCQ¬[`]õ·øÂÅqxÀg­ƒöõivÝUãZÚX´´ÑjÊœñŒr&K(oN}*òi@%ó´)Ï »½ˆ­ ÛLIl*O]¡üµ3kÌMÍ{¹/}ÔybRô´ò»ÁXK€Xy+9¶Õ&åI=*?¦WV¢÷ƒVhúª&÷f™ØgxZmS¹?/ëëp‡õp6he``ЪeË–&v¶>àçÜíÁ².ó£f¶¸>§ýÃÌE³‹[(*ɨl¦•‘bÚÕW*/¡œ± `"'QÁl-*]Ö§W;*øÎþUÑ&‹Ø«_×ÈSý_¹3tò‡Îf#¤Ëo{=™"ÐKõ ÓX¢“ÀQàg ®kAºŠV™àwM)uY#J hL© +3šQî2c*\bL™³êQöTëÎèÕ •ODðã$T6ŠQ9P1AƒrÝ›PÞ¼”¿¦¥¬íGW¾JÁ¾#¨ž–æi.†ÿú­1î–.ïÒ[÷4Ü!;?~²’û£5ÎÈ¢º…Ó«ÊöíøZ²½-)w‰6½˜Ïè…/àÅðZMÊ÷Ó¥|_=Jw× ¼©ª˜¥M¯< ¨Üߌß8Rùú¡T±a(Ý÷wR,íß–dZ@h‘@˜»*cþEjƒÌ2~·î/©¿˜f_ê]®¼1‘èî|ø„”¿¹oà_úYSi-ZR7ÊÛÙ²·õ ì z¹µìL%!ã©8ôkÊýi:•ìüJYôÝ â¤E=_œ`·ÈN/ÄΨ¡Êh¶Ø ’äââBè.4bľæþ¯ð–‘´æ>?fÿ]ÿ§ÁÍŽãÁ«êîíŸVvb@rÙ‘þi¥¡½33vôÊIÞ☚¸ÆöÞÝÅæQ·ü:„„Omµaq_©ŸN:ý  †]Ð'¡÷»ihhLÀL±7žEkL666„ÖIèGóAÜÎð´¶DÀ3½l–dzY} |É x>Óºy%aj•К‹À¼PŠv'utt´CÀNè =¥RiGL—â àátƒ€~‰;È»E U»ïããC;väkm>¸ÛãéÞ `ú2¨nõ! Ú£1 #n’8q» :ÃNêСƒn»¡ÞݪZcx Õ´ïã×K>ºïà¡+€]ç Ád8a‡0³ûä“Oãˆì†g7dÅx¬Ý©zBä·ÑÜÝÝ %~Œð‡~Õy"ÜcsXæ®Hk'œp/¡THà¸am»H~¦p-Ë ÛÇA@M1m"’€€y&˜àHÜ "èRzÁD ƒN¸áì†sÃ,d‹B$ÁÞÞžÜÜÜhذaüúûŽqD]Õ.#ݹ&täY€ 9 ý@‚ôÀ Ùথ¥uU$¯%Xhî xäð®ô± ’  H« W›CüºBМp:gdd¤ÒÜwØ,2w¢UZ€÷ðµ!U?÷¥eŸœyüŸµYvzê·Ätª’‘kÚW•‚þ5?‚·Å©(ƒ‘ UT-_¹á×G«}‰#ÈC[ž²ì¯mŽ}ˆˆ$4 €âKQû– Á àY0Ãw|ÕÆ eñ›Hʃ;CÞù ¤Œ k’jØr/›Ý2 ±H\^ ìxwx^ ® Á-r'+D \ UZ€²ák*ïÁS?¯q6ñ¶òù` Ï€H‚mƒúwâ$À N)¸s4ã´t‘üŽ0Wäw‘øõe^çö@¯AšÜ˺ÕKGõ[nÐ+.†è®ÐO2ÃÓã"H}BûT鲄N|Ù6û'ˆü IЮ"Š-47EÜMá$ í-ÁºR$Þk86€ØuÊò´öä"På€&b„sË´„©}Ȉ$èU±ËmQN0C® Ó“€2x"€u~>à™À¯WÂu°úý£û¶x壑H¶A'àZ0“ðsÕ9AçÎU÷êÕ«Ç׺òÏÈ÷·mŒlˆËô±jûñPSÅ鲿Є•Z°kå" p‹ª €_à×Aâg E¨Ôÿ_:UD±=vÞ Ý`tÀ~á¦H® CW~ýЬ5ÿa­*¢Ø]`Ôßé¾ ÷H$ÎQõ]c˜%~=¸vPs†Ðè‰L˜†¶çƒ,(„HŠÓ"•T~ËäHm"@$¡a% €AÈ.†—  *ø3Qâá¨Я=Ôœ!ØÓAÀ&8º„Š8GÕ! ëüzZí! æ Á„ô÷DÌä$p=€.¨´í’¿øRí" æ Á p a 8¸À:NŽ¢8~R»¨9Cp¾AàJ *ø•/¨Çŵ‹€š3ÀHä‹™€N ¶Ã„ÚL4œ€Ÿ®< ¸ps$–A×ÚE@M»lÌÊExÀéQ$`oí# æ ÁˆH$Y ê@P¯öPs†PÕÉ1Ê?—Cj3" æ•»MUFfÅo¨½%PÓ)®’Ð naPŽÿyÖ÷]>ãé‹+â`~ïöIEND®B`‚plasmate-1.0/plasmate/icons/PaxHeaders.5990/hi128-app-plasmagik.png0000644000175000001440000000013212115142004023125 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/icons/hi128-app-plasmagik.png0000644000175000001440000003337412115142004023574 0ustar00kokeroulisusers00000000000000‰PNG  IHDR€€Ã>aËsBIT|dˆ pHYs × ×B(›xtEXtSoftwarewww.inkscape.org›î<6yIDATxÚì} ˜Õµõ:UuçžçniæY&A‡HÀ€JbÄð ÎÏ ID$ÆÙøû$ˆ‰‘Dѧ!ŠFQÔ•Î"ó óÜMÏãí¾sUïê[xé–0Ê÷ÉæÛ_u×½uou­µ×ÞgŸS…Râ´ýxMÁi;M€Óvš§í4NÛÑ4üˆL‘vË-·Lðù|#Ng{]×µÊÊÊâíÛ·ÿiÙ²e‹ð#´Å(`È!Ýóóó_QQ1–wF£QÄb1°EÉjkk×J)ï#_ü Æ•}Åÿnﮞ“&‹’‚Á@ͦí(¿á¨`›ì’ì4NnÄ+ÙÙÙ˜^SS£™¦‰¸IòééézFFF×]»vù¼"¥¼ß³òÃ9Ý»¶‰ÝíIή&wÉª× ¤uz­”F½.¦ iü†®Ž+6ÔUoÿì£Ï>þpò½¨ K²Ó8Aàx›üg »w'''×üä'?é²téÒTV††Ä-Hž'¥lÄ1ØØ±gy_ŸuÃÛžüÿ. Uœq„Œ<þ³nÿÌ[ ÄÀûhË.aÖK#ZR WìJÖÔTmýbÅêú•×NGyœ§ p¸Àò*òm#FŒèüñÇç"n999ÈËËÃæÍ›Aµâv”rî1|‡#´ùºóþkH3àq°-€m°íߣÁMô2 ”мªRõ¹ ~DBßgF#ÅÛêj÷ük󶦷GNÄQ)åi´A3fLVAAARSS“QZZZùùçŸiÿ¯)Úo¦}]¤”-,55:uBUUöï߸}Hïu´ù~Ï_p{Ñù³f ©³rhÔLjÀÊŸ ºÛ„´raÿ¬šO@K’· ¹êЈX¬~Gmmå{Ûwëï ‡MKÈ~´>|xæÐ¡C‹Âáp2qJYY¨ÈÖ-[BT×ídŒÉwà0æv»Ñ³gO8¬]»‘Hñ⬔²ä( æáßžœžEûÐ<"ºX¾ÆœwÙ$l`0Ž?  6ÌÃ…ÛÎ;3¶nÝŠ„Â.xÖYgaݺu^’ô€äËȇà[LQœyæ™HII©è󷻥”3p{ô ‘õÛ+°ÃRm‡ðµSàÉpç(P4 ¼ÇDdŸI’oB˜G ¼“\“E’óÖþ¶KÕG*Q`ÔÔT¼ò÷7ý3¦Þ‡RJó‡%ÀÍg9ðìªN’¦¸½i(§%œwàœsÎQÖ¯_ï °í«É=®ùh¯âôJœ8ŒuîÜmÚ´±H´|ùr{h¸IJÙG°ü|á-™…턵O´ˆý8¢]…@2ÃßêµD2Ähå}’ók*Õì`Ù¯fßþ@åÓ  ‰ðƒt«’äÂê;ûM=I¹>õÀ}Hæmð›.»ì2Ömßš5k<:t5x`Û‹j–þ¼[FÔ© Îêëë-ð½^/¨†°¿§cŽ`å刔Ö`6Lò0nÿéuÓ ×›& H4‘‡Èur™ð9‚\%w@ÂKžJ­ÐEl©» ÝU¿}í¹Q+7/Ç!„—üûU€ê©rþÄÇ…µBbGæÌµoŸ  àeàIºµ 6¸^C¯^½ÀÆU½a`[}C÷«ïû¤ô†÷v6àÛÌãñ oß¾ÈÊÊ¥k{î¹çbåÊ•kyä‘GÑôñny:çãwІV‚#E{ÔÂ:oÉ…KÒAÇBuN'¤Óx=„®Ë¼=Œ²˜ÍŠ EdÒ4'Ìý2Ð0oÉÍwË^yՒ줠úî>]…¡N3K‰“Éž¹ú¶ã¹¹¹*ôÄ믿F³õïÖ­›‹ò¾ ßbEEEèZ˜å8Ûµ·GRÝ?/ ýS|m»ïókbÒ?÷à[Œ¿S¦LÁ…^h¥‚ÆÆFÔÕÕ¡¤¤Ä¤ÖpÊŒ3G8O†ÀùÔuè8ñ<Ü•ìÅ0EE&T@XýœK)ÅîŠì D‘ΨW(—ª¢€Ôk‡0ˆ›&9’’ “|ªÃ"‡³ÿaÈ%¡ºHzP“fƒ ùÿüù­Sš®ýû›¨”d'o.ÀTH`¢-.Ï6SèÓp vÉ%—hgœqFÁãÀ€¼ôº^ŠWc@‹T‡ôu»k›>ÈKv¿`yºõ£Fâïâh·äßår1˜Ök\Gdff*dÜAüéL’Ñq‘Ûÿ†íä¿äSZ0 =ú´Ç`Uƒ3l 6E}I5Jîy Û7íA4Þý1A–ÇjQ6<7\Žþ©É”žŠ!Yéè—œ Or@0S’¡“û.¸ á!-RŠ€NBÓca‘ü¨âI2ì¯O=6—Èt¢B’´PwWŸ^†T¿àKؽ5kæšî8J7n\. É2IÚ•={ö  íÛ·îÞ½ÛÀO^I>¤ÐϤÎÜ#Ã2= *H¶¤¢<æÉXQŠô¯Þ*ö­ý`ù†HüoóÓçÞÔ§OŸxö´´4kHB¼µ€WU•S+;&ªoºé¦ìcP-‘Pî©`k] àp@$äl•‰Ô­=ò'_‚±Em02/C‰N°˜©)Ô€¢Á"û·¦×à¼wI~< ~õ寧áº9/¡L’Ä  € @®D[€d-êLÍxêKÿ‘.ÜØ±cÏ  žLÒkï `Ú§‚¬O¼¯ C¯:W6®¸ Û÷4á“OËðå‚=ØÇi€‹AMÓ°iÓ&kxÇûÎ?ÿüsè;±Áæ-;G>;«‘dL<Ð(Ô[,†üú׿þ?ŒÙ¤rO¿õÁoò²pQz\iD‚”TH:m7Ëq¨«@Ê3: üe(‰.K*ÀÕ „÷Éš–o˜R|óÄÚ7AVqW_VæŠÐ‘þÀ®]»¶ÿàƒ¼Ô¼±#&H‘éë Öûî¦oï1F§¨*M¸z¥Ëkи?„E”á½Wwc'ŒºzœËy4À £_¿~8p ¾þúë¥Tñ41¤r”Ûnš¦ívo€ a“„£õQ#ñØ­!!ÄFd_3Ý> wv퀋uŠa"LiB@ÂuèèÃ"¨ðŒ—Â1\õŠÅç,_Œ‘CÎÇB±S¥IJ›G? Í}äº RÚíyT‡$ü4Ûçª@8#¡óX6éX4ðòM_á‹]H?œŒ^~ùå¸ñƹºçhf9·&|¨=ü'=ôJ¢ª*Q lÀÙY9˜ ~¿ßRvÔ!L»âŠ+šðÛ&ܺ?;wÈÊ@[R“RƒqU<èZò´ ýý¢ÏEÃ1¬òäâ*ÎØ‰©@ûÿ' ü™CqÆ \urZàý±".˜€aê€êª¬S“Þyy[à­g·›Åv “§‘ $¥ «¢=z4ƒÊ䲤ZÅ ua‰_H`öb [ªo¥”|N|œMž/PI=náSÄ)`qÜÂBˆ7/8Kf¨*Æ’‡Hô4H¨ß(Ad ec&àÒ0ð£✟\ŒEôœ=3‘vÏ@Œê—çOav¤q°iÒh`ùú sÞ¼H§ÏáN1«•j®)ÁŸwdƒlµ&OžÌ-b>L+¢iB<üQqqñ]ô³JdhEÞòqLJAœFxXȿߜH€S„¦¢ôýOpÓÆwñ”É_8;\ð}SrñCž¥—*Dµ<{@ù­>¥cmоo 3§!WHÜ´j"nÝS‡|CŒe¿ŽO?,ÆœûWb ©ÝZE3v©Ö´-Íê!^$:Ø0Kü„ À[ŽV;—ÛÀ2ø &¿Æ`ðÉúVR…ž à·Úò1|,ÃǶk×®ãÂ… ³¨ˆ¬Æ©c6Ƀ½/Âí;–@!Ñú9ó€ %N6Qà®Aë¬xŒ_3ïytVÇuÊ÷4ãÜyoûÑ•w§.¨Ñŵ<ìP‘Ÿå Ù Kþ±K7t~Éà'uœÇ9"¹oÏ’ jaΜ9.jÞ¸yŸ ¦®ë­$ÍV–u*ß´ß×Òy?cƒüDvA#Š)8õÌ>ßÐ칸׈r×áƒ)@É ³A@iO$¸Ä ¤ŠÞ]Ñ“_ø^R€ Ûó`»1}ć1ÃjfG¥@mL12Só_Øá|ùþÏÂû£QC¢…1(õú(OÔØº “¡Š” öÕ·”vžÚå(f@m0YE¨»ø”Vòë¶ °'¦&Œ­G¯Åã‚ –J^±sòÚ]?ú,ß¼yó8ß·,Òì ÂàptWÐN>GtKØ Ûy#š I"ÌBÚÇïKtVÄú!qÁç[@© §¦9.…aVGPëxF¡å@´˜kÚn2^¢C·`ãĤ€YÂ/–A os÷‰.®’ !hzØ¿~ÿW#Ÿ®_„¸1 LîÏ3 î¸Ås’ë•Ë;µU”ü6ÔV×­ŸÐ”›[Æ $J:À†”„Ghò(Ÿº}$éµµ­¥ývD[õ- …Ö^CŸ§Ðë­T ±¨Ü±c(ÿã™gžá®éÅ^:Õ¢ŸÌY”‡ßC ”ë3øÿöMkX/1 @šþ›§a€Ð |^ôF2>‡‰T¨ µRM¬ à 7þûŒ{«&S&ј¼$›nÊ` çèäBÁÕÎn›1B ¦Á4r²6¾óè\ý3ÔôÏ„É"XRŠ…ååhâkþÝð7q3k9” W Ò ˆpD`ïÌ6Ó³ðíÆ pA…Þ½{³Œ[+syEïï~÷;$o|zÌ8³MýŒ¬uo½¨Þý Ãˆ$©‘@¶ åI#ší1ü5÷E¿ÙjÕè3öoÛ¶-›†l¹´ï@" D –þ–Mþî¹´ïí÷ÑÌ/^ š˜â %&'« /áß¹!R‘Bˆ)eé©róËúWñÓü,<"Ü=´ÿ¡•‰òãaþûx…øøgçq+ÿ€À8rÀWÐ >ÿ¨4Q¿mrî´ØÜøâ 7cT¹óD G•ÕʽþúëáÚ¿Ú Sˆc$í_ýZ˜Ü»~°ÕN´€Ã « `ó¨}›L 7’[ÑO[{.ÀîZ„¸òÊ+Wþñ¬'2¦ÑD‘¥L¶qš Ï±× Zd ’)DškÌ<Àßð*Ævë€75W¾†¬ß‘]@ÝK ‡ýì1iBì+Á‚»Á6æñoŠL©¨;!Ä8r ƒ—Ýpzpe u[FâÖèܸ¼Ô“ëøF}ykªvêÔ©È~ÿÑ!)Ïþ«€tàH¦jÅúOoŸO€'æuþ¬ý”"LÚŸI€ ;ÿóÖ¾Ô.‰ |3çö¿¿ñÆ6ø¶ñ b"8eY*—“ —‚kOðÕM¯àÒîí|ŧ‰œ»€XPñX|¶›~¬ªë'Üa5²‚dz€Áï"M×Z¡è^ðd¼íSû"hØØ 7Ë-ºSµ²Z’ÌmÞ´IÉ#«®O^|5 ½+ŽÆd¤Ãà{Œ¢C×9šL®¸º—dåÝÔìáTPn+oíZ€ï%àü¾oß>téÒå“/¿üòZ^ÎùM|¨±Q d#u³“0”®øÚ@Eï§èW•k ‚OÛñ®/ÊÇlUñ©"*`6øÿËgnG¾ç*Ÿx·¯Ø°6ð˜ð†h'Ië…q[ìÊè ¤tm_¯¶^‡É~ëæ„!„¨C‹…¢\üÍš5 çm{þчc0ÛñjýݼÆM`R´Û’n7ˆx_ñ§Ÿ~šKŠà¡ÈuÓþ0¿Gaåv’zN ¼5 4hP­þŠ”á‡8º„7R W jƒ¨ÓP”ª¡¡0þÝ.Ô"·¸é{_ôíÏ’'ñfz2ÆGD!/#@)E>B€8DÛ¦ß^‚;f<‹­Œc¾/@¾'ÒLOÖÝ R»œgªPT fÅ*LlüÇèPEø7¾ð/¼ð‚5wËj;RÊöc"€Ó·—#Ù–uv;ØÜàJ¿Œœwæðëo¿ý6.ºè"ÜvÛm¼ÎåÝ^$Â]Atm›ûq/`{¡¯Ù½áZø"up ”úR¤#ˆöt Š+IÃeœƒ¿OÉÿâO¸ì)ìËðaŒâ*€h{os–rÅjyÿ$ ~µ^w>µo*=6ÌNSdoQ„ž3 øÎrFª ÐÈ60ªÇE›2ÀÚtÞyçqäsÁfX5òWÏa¤·½BÛ…£0GCÙ#ìWl عÝnôð¢Ïô,cÉ’%êUW]•Dëûí›?­5‚”lç;pÞè ¾(ô‰`a|›™JŽh#¢Á&4…£h’¨™máÎ°’åÓpþ÷<»£øeÜv,s;%<€¶Óÿr x& ‡[Ýp !¸n+žy=^¶Á?jðÇR2VªNOžÅ2ErÏ4Osô ®úw>ˆ«e ŽlÜøñSO_rd2`¶GTUÖÿbÆ?Cãçœ'5×§8‚ñ¨ çógG´T.öl0)¨°Ûùâ‹/r“)#a…®½îßvk4ҵǙÑÌd÷š,7@ BrYJƒ»ë£(H)(7“`äwG8§j™è’W>Œ® o`U› ܯ*B™£‰S€²¹@å|@š­ÀohBý{ŸáÖ¡ÿmTvÞ?&ßËø£ÃWp&"û›ß‘ÞpçšÛRÙ¸#€_4þGiÔ©“4†®á¨³AK$BØç3„êØ‰£0Wíž |¼íܬ±Sås|øá‡œbê©uˆƒŸ‘ F(//gðYxkUøŽ¼Nï–…€}MÀÎF`›ØÚ¬ØïÇæ:‰]£†Ã‹ìÜduáÖ¶m[.&}D¾Ë¼|"+üÝOãÖ‚lü?§†$k¿¯;Ðv"Á¹(™ (‡ÞqÀeЬ¾í¸|áç(³ÿ˜À²S³¤ÏÇš¬Q,©7c@r?@õ~ómº±@Å|ŽÝž|òÉåd'uÙ¸B·¥Îr©h â`˜{ç;®}bš»¨/ßÜÁò¡ÊÊ7—­]ۙߛI@ØàSÕ‡zˆ›5öª!«ÃHK¸êè–ï ä%•ÉŠß]Ä}«õL Á$à¬23+k õ& ÁLÓLìpa "/wùû¸£9‘ p€W—?„A½‹ð’×…Ž€P=@ÁÏ€¤ŽÀþçøvs¾å0¡Œ¥xîÌI˜ÎQ¬Ï P`›ÞùI_gòí) 'ÃW6€( #äa Z…‡à9ŸñE­#6ø‚&¦ƒ`nÏψëdRÆ£æ îP zDìÙ?Ö1`’ªüRî)TGd²VÓô.hqç|v˜{ø|_À^@"„HLü~Ž~[ 8²ù‹ÑÚø=\+X E6“M1’<ÿ;äyuÑTt«ý+þ=°–z5t ÎÜÜñ;f=6è]’×úѰd &øwà…ž6øÇG€ŒÌÜY‚;Jy×Yc€äî€3 0#qCFkb/€ã4ºïe·š.¨ä k“ zà5ûÊ'þß…u×üe6¯òIœÊµû÷gŸ}vÜD:¨}ìzçwÛËœ !Á¥—^ZK’$E°×xìYI)$ƒ|ƒh ÉúV´0ŠúD`²°Êð„«ëšã^[u/Îmx+FuÇæ4F*ü’;èx ÒØý,P¾ˆõý॰<…±u?^3=.þ-^c!HÈ÷ÇGzXb¦¢jƒ`Ô)ýGyà̤¾E©7X‘ù]lâĉ&Ep=ûÆ•AIT„–$à.Ë/ ÝÜsÏ=aRTkÙ^fðé5ÞZÇÓSCJ0"Æ›Rž•Lðwrn·U U°€ ÁGVžÖ&›x”À³9¶Ü«ÿ„-ýÚâS*ð(Ì©T›‹‚ Ò÷€]/ÁŠ8èqà¤TeyÜò×…ÞãL^¹åñ1¾üΊÕk“iÔÆW‘Tq½ ㊦1‹¿«ýêW¿ŠPõø v+ðï\á30öbz?wó$MÌ”ÅÏ!%áoàc˜ý¶ p_ †À q±ÇØ©€>ÛN¶ °b|LïÑÑÂH-ë&«7’¸éCÇô>ð®½`jpŠ»æàUŸ~Í[QtpÆå@Ý×Àޏµ~h…¯¥@ªIôÝ¡ÆÏ7êwæÇß<‹vÔ“Ÿ˜GÅ&9üç C…4@N†¾z5©„;žƒ$÷´„U¥ßɦOŸ õ~Ôc…-kVùóç3ü &L„~®¥Of\Ú7žëV vN¼€´”ÀëÈ “ò¤Ä‹¥«G2€j^üÙ@Ǭ$2 i17XðB{•ÏjÂ*0­eEÿî$t¬z÷&{q‰“ *ÐLÛN@Þ`@@ÕWú6»À;x8<ˆkŒ½Uú;ãŸÂŠøêx…/Oô³‚´Ô<ÓP`hY@p- xh%!Fº:~3ÞTÜX´hQ?¾»ñ:€zZ÷§Ñœ¾ƒÀnE.ØhÚ–U×óñð‹Çù Dõ[o½•DDp1T[²y¢Ç&ŽÜó¯Ù¸qcú 7“€< @)}†LHœÛ¹]½xÕªUCZt3 ÀäÏfÒð91Æ !¸ ŽAjétÜêÁÕn …a/T £;ÓWûÿ DªZÏ#.O.d´V–UUlyk%nýå XÅ„µ+üiêƒ>h]èÛo¹t”ÐËh¢îØÆæî"¥€3?ž tJ†Ø&=í.ÿ'Æ8ƒtó…"KŒ"Ú‡ë®»Ž·qöJ Ž@Š1(’ù4’~G\‘t;pÍxó§Â$uH+Uû>;J/ &4ø}¬0eŸ|òÉeôº³Å92A˜P|.ü~þL&Ï.&Ïi¤Ï‡ÇGaåöa ©V~ל9}‚¡@¬(ù¨ßèA@àWœÉhë–¥û·.\¾ièøÝ{k±7žçMÆêD›b3\: wê¦ Sk‡pLM«šÊ& ¸é: E«øÍ¶•o¶Ã 2š'àÜ]E’.—-/î¿ÿþy¦Ë훌,FŸ•'H!¨š ES œNO¡% +*ÜÀ«±oíÎ$ ½Ò— ³©D–—íݰxkdꤹøò{¾5øbm\öçÛÜæö?û<^­ ¾à»ÐôÊC»P h¹¬q ±š`æ_> ÝþWKÏÕ‰ÏßÀOQ¤:[H8.ý{ñ-K««“ÐÚ8’9B(kN•âÜÍË»òx}d j@#¹•*zôèÁ°ÞOïÉ¡žG{’q»$”Q5¯÷ìÜÎuãÁ}½þskk«º#Þ4w€¼Åã…êrCQ¹`5€XLú§›:ú=ÉÝxHÉ'à;@:\ÕìÒ+Ê‹W-ÙªßsÓëø*¡¸“?øÿððÃ'¿À\¬ ƒ“Ü^— otDãÀ”ä-‰)|úˆÆP »–hÌ}æ½²±K©’öÓÐÿ°£zÂhu²Ém½ @&Lóì¬'×oàEkãÞ=Oø0 ìœ Hõ¥—^jOÐ8çÇG!r‹$vtÐêG}ÔWÄB)—µ1ôHEÏ6Fm^4¤§©1¯¦6׿¦h2$ Èm0…Ùÿ{×#Wy¿fvgfggm–Ýõ#ìÁvIHRùÕTU•J“HI¤ª$ˆM"¥é#j#!@ô%¢JI($ ¤ ZU*I‘¢¨Ê£ÑÐT`b{ƒ0Ølï{½³;ï×½ý>ùézrwY;µñ¸÷H‡;wîÝÁÒùþsÎ^ÿÏžøÀSëÆnüP®Ïe{|èMúЍ(×àWbŸ×êÌ*onĪ(á{™k+GIßµZ~z~ÉOƒ#p=”«BÑɤ“2v jãd"%™i¾Ú_ÔèQ-¡Y\@ci‰VC½g49<]PP`AxƒW3qràþ“$'4µÄ;K¸ü ’CcH _D~Îk Q8…£³eüøH÷ÿðf‹V»Oê¾C£l"Õwþ±ï“›6]ÿàІmùüÀ2Bºà"8&^:TOòóÐö"´‚˜*±ÌK¬ö_†Þl½¹2-K…š~Ä'·É- Iæç¤K • s–Hòs…´Ó&×›hÔH;WH‡ø2ã.\Ha©UÞèê{@ 2}¨å†Ð [œÎÂoV0?s /M”q¬u¯dñT"å!è_¨éåk¾ïß×í§†…OÁêÿá7ðÍá‘ën½rÃξÁk!¤S‚­žPj§€ ¹:4«!@#W øÆ5€ÎÿJzÞ³¨¹S‘3á‹ ZÝ­f­APo —ò)½o ÐÊç­åד¸þ! ˜+{níÉAê4./àÐ'ñ£ñcxê0}Œ¾Q\GÄüÅ%è{h;-_ä”|OEïºÑ&¡‡œùîWð‰ÍWo¸oÍ•7¼·íUɾüz‚!)Ó tŸëóÃ.“y_~sªS#8WêIá¥_G­‰HÿCZ ç…@Ђ4xm:‰,…êzr@oÈ À룰ó#@š÷^0w§J­S˜F¹0ëÍ—Nñ'Ç×üç‰FÏ|ý¬x…ŠBä„*¾ `“BÌŠXªAŸoæo=Óň‚…4Þ¿ù‡>‡»×ö÷~²/¿qc~í¨Ë­C¦ÿ]èQü$¿žvé×ÿxñþŸ²SÈæf¡å:Wvhµoá|^eÓyu )èÍ!•YƒD&TZÙ´~ød/™…—HC«<—Þê HpþcîÛ¼þ©—Hl¾|läþñ]Ãomz_øB4˜N•Õ\ºƒ£+YxO %Án$uIÐZ‰>ÃÆjõ%X«æ!å˜2î¡&ÐýT›$¡Úˆ8C+;Å,ã µÄ[Ó«è þ¶@f— ±Ò°i·ÇÇÇ4ôõñ'"Uâ“O¶‡€»fïÙzÜÁ©§­Ü¬{ÇV9%s!b„¡¦P C+Z[µ:·nó¤!®P›ähÇ”…ÝâêæßmÔûf ‚ó…¸úKü{5üFg½ ™™;}Dà‘ 6’x° 5ÀÅ'j„o&’ík=/µmýCûgW©]Úrô1êX8UQhÐ*§˜§pê6U„v]×…4À玚a’¾A›’••YOáÆg£úìͰw;™”ZC>ÁV‚ô†«¤Á¯¾tr䣉±"DM%³ce Ÿ‘»I ÔFÂsUKÐ)š‚<Ùâ÷3Zõf x¯«4J/…«þó•Ì€Þ€ùú}ÒîÞϨÊtD|¯½ù`+]Ã@  Ž„–¦¶è#I xdëJÒj´Ç_C­ñ,:HBï kiS¬€¤ªáD € L6r6bê¸ü3Ê€† •0MÀ•œ£9pº´@x<­9²ŽÎÝQÍé_Á ¨„]ïê·.M(ø½˜BÊÚU½Ò¶ní³¼~sö¤®å¹KK ð;À#‡ÇÓ˜¤E^x»Ý€Lˆõ4šˆpq@à­àÊ0SP¡àl€$ï Íq§ ˜Áœµ¥™0¿€`Ù5³Ó Øa”Ú ná}_ €‹‚–ä¢/ –)ÐÖp–Bmš­§°´w× NRð%iÐø›¬ý0²ÞAëu4g“1™ƒ¼¦ßǸx °ÊàÎ“)ÚöèÔ)ÆoÛ>9nV³„]±e[ýz7(íy»í ™þ¦žvǸ¸T"×"œBë’ý/QHKúÎ9>+HïÔvÖéò^}> \f€¤ÕoÇÓØ9·.ÀÅw ›QN!÷þ6.fšni•‡wFƒßW©’¡s$Xi‰I‚á͈9ÈÒ6ßÀfØyÅI…†c\DòIÖ.¶ŒS(¡µ)ð™¯ß²{Sš3DaºÐ¡RñrE ðÝÎÜ€Þ·¡ÖfV:ƒù§äs÷lý¡q¹#ûçïÝþ—ºÆX}¸xd ¤ø9~ḡ|ž kBÇ=QÀ2?ÀFØ™P†´m¹Ððä?ìèp#ù*À=Fü`êóÛ†aì][¯!8¾ƒvò0ÿ£úB €(Zylm'™)P–Pa› Rú>!M€À†W)ØCQf@ ›ðù…¤]ˆ  _Ü[&aä㣩^¼1{϶oSð?H%Ý«j 1¹ùð 1ÎllmÄ^;©î&íõLhü¬í êÔ:hªGgšCÈÏêóNfx7 {3Òo>ÐqŸsÀ§Ô6÷«]Rî¿bœ_¸¸Ï—&ÐJ]ä ¯XBÈ@@áMÑ)ôù^†@Hè þ‚ïÔ¢bf̬èw”!äû£nZ¥/cuTGµñ£çëF§u$’°')d/œT‰à(|&SÐOñßßá„sáа4ÊòÎ`ÂyX¹Ãü\Špþáâ}\f0d“«}64¦Î:Ó¼ª8QÃ%r|æ‚–õȘ€ù|WfÀ¶˜úcÞg¢ÓwÿÖ(|Üo/­¾†@Ï5ǰ€ÀŠ<ªÀ"YßÉ)Ì Ò¯RKœŽÐ(Qf@­ÃY¡áù{w|Ðw­çä bUäo»wëgc\ Å(è ÀE¥¦Ì«'@z4yÌ'qe „was™3$•ÒûÀ58òÝ·æîÞþg1.L ÌŠOç%<󸂫äE;™œÏÒÑi¬fÐ’CQfàÃß»m󭤯€÷œ—üœÿ-nÿ<À¯.nE¬`±P O,ÕŽ ˆÚ¢ÛDùo®f7 í¡¨ úÞ3ýûšøõè‘…¿Þ±&Àp )@•™OQÈ>`ÇÊVÈKæÙK¨|&쉊1„Sĺ73 þé[Åm×VH÷þЗàã_LâÈ/$\#qÞ½1ÁzÓAŒûPÀƒRßrä(üWö,MLÊ2¿ðåÎ…%{¯l ‚@Šʉ”VйĊ=n Ãè¶Û’sc¯À'"¤ý€k{ÿî\ïd‹yª%¯VØôÐkõóï ˆ)¬ êA@>b_?'ðyoPR¦ ‹¼Þ•PŠ*¯¯p•¿w™Ü€˜êïÀ.ò߆û$ZwmýWõ>ç\ço 23`#¢ÝqMà¥ë6:}ÂÖ 7J Øß˜`ŒAšÀª†Gb\Šáâè‚%>+ÅŸŠ VÈö¾ HNu‚@&Ãü -ÛÉ礧ƒ»-\<­áEFÁŽ ©÷}v4îr1Ëj;hf À¥]CPèÜ’g‚‰#‹Š(ØqUd‡aEí,Ch!bÒvÞ¿'À¥ÝrVŠðÊAÝ€|«'\"!›pí7Ì›+íŽpiS1¢ål*ˆ(Ôj¨ŸP»:ÁprpÄ­U »ÝUCÐ$Ï»µš™`_vÖK`‘Á¨Ý€™Š1òM1º/\¬ûª®p-Ðþ0lq[nÀbÖ¢nf @wÎ!˜Ô#ò´Í YhØ@`GÖEl>ƒm­j8  j:ZÎä9ò‚ž!ß×ùy™?`ΠØBà Çèž–³j¸Ä?¸×¡š®`øˆ>ÓæXLÀFÕšˆÐ5~°+˜'7‚má>ÀXd'£‡·„6W( ð~8@w:…5 ‚ ŒáFÛZÕ°Å,4 (zlí\à6ì i3Zù¶°1táÈáîÝÛræ˜îÇ=RäXPȦ‹´ƒÏ¯н-gú|”Ü v ¯YÆPÜ @a0- »[ΦɧȢ}¡Â0‡`ÕÂg…†ctïØZür †|‚°)°€õ †ý€«É7Æèî±µÅÀXh ý¢üѧbt¸XZ nf 6Z®Ó°Ðp €î[Û$’#ØQmöÄQÈ“ïˆÐýck_ÄýQ…KÅÄ!ú´s®'@w;…µÀü<âqgÁh8^ð;Þ ûÃÅo» t”ý_›d¶ð·Aq{x…‹s³AÏß ä?ŠxGÀaаé›o¾¹ÌëS±¸R €Ë×ø ¯ÐÇÃ+Ü–-[9PâE6~ÿðáÃû9¾¶ Dÿ Ÿiöþ)uœIEND®B`‚plasmate-1.0/plasmate/icons/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004021600 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/icons/CMakeLists.txt0000644000175000001440000000124412115142004022236 0ustar00kokeroulisusers00000000000000install (FILES hi16-app-plasmagik.png DESTINATION ${ICON_INSTALL_DIR}/hicolor/16x16/apps/ RENAME plasmagik.png) install (FILES hi22-app-plasmagik.png DESTINATION ${ICON_INSTALL_DIR}/hicolor/22x22/apps/ RENAME plasmagik.png) install (FILES hi32-app-plasmagik.png DESTINATION ${ICON_INSTALL_DIR}/hicolor/32x32/apps/ RENAME plasmagik.png) install (FILES hi48-app-plasmagik.png DESTINATION ${ICON_INSTALL_DIR}/hicolor/48x48/apps/ RENAME plasmagik.png) install (FILES hi64-app-plasmagik.png DESTINATION ${ICON_INSTALL_DIR}/hicolor/64x64/apps/ RENAME plasmagik.png) install (FILES hi128-app-plasmagik.png DESTINATION ${ICON_INSTALL_DIR}/hicolor/128x128/apps/ RENAME plasmagik.png) plasmate-1.0/plasmate/icons/PaxHeaders.5990/hi16-app-plasmagik.png0000644000175000001440000000013212115142004023041 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/icons/hi16-app-plasmagik.png0000644000175000001440000000143512115142004023501 0ustar00kokeroulisusers00000000000000‰PNG  IHDRóÿasBIT|dˆ pHYs»»:ìãâtEXtSoftwarewww.inkscape.org›î<šIDATxÚ…S}Ha~ïc—óÎót»p)çDœx£´••„ ­ )ý• jAE‚}ˆÿDôG´¢,£LÈ C"*šE¦ÑmHNpsS»æînmw½ ¯qõÀÃï}ïsÏû¾ïUUuét:kxžgÓ㹉‹ë£ï€ÈÐü™,vÚóµ1˲ Ïf9ùNÓôå'ÇÀ:ÅS3£¾ãbŠ7;”  C‹3¶íi-ÖÀˆzAî ï®ØÀ–˜‰[ 7ȇš[NºÝî3åc÷« °LK ˜¯taêE,\°ó·AëÝ4uuŒŒ_ÃûºØ7Væ‡<$Éz£Ñx¤¬S½e³,àF”hv–¼#òí3¦Ð´ñôG{ß.ž?Ü”oÆq¼ßårÉápx/È€ìáÜX--))éQÏÕá™:è.&aƒÁ`H’¤/(ІÍfsËÂR¬g¡Ë!h:Í@ÏD‚e^o Lø|>ÛÝOâ2ì‰'vКèŸ\ƒ™ ˆNXø°®ýý/üß´ÃS(ŠšOŸ\ß@߃¼™ž4ꇨŸG –KQŽãŠ´þOв¢vK-IEND®B`‚plasmate-1.0/plasmate/icons/PaxHeaders.5990/hi32-app-plasmagik.png0000644000175000001440000000013212115142004023037 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/icons/hi32-app-plasmagik.png0000644000175000001440000000357012115142004023501 0ustar00kokeroulisusers00000000000000‰PNG  IHDR szzôsBIT|dˆ pHYsvv}Õ‚ÌtEXtSoftwarewww.inkscape.org›î<õIDATxÚÅ— P”UÇïî²v‰‡Â òdÝ]Gа"òµ52P¬B“EËÜ_Öd–’åd†XˆJ!4 ø¨AäU´Â†ñþNçδf­¯Q©;óŸï|÷»—óãžsî½KàÕCOtrrZàîî¾Ëå>{{?m½õ™Oë/Å/o.ruÄ×ǘ˜hš––æ€3‚ÃbU²X¬~´[Q,ú½ê Âgê4- =4õq}P;WÏÔMÿm¤ÁµL_k»æl!Ý +ÕÛ¡S­ô0Hˆ9JŽNg<çmÏa³h'¸¹¹T*]@CÆæq/ÁIþ (&ÝPŽ:Gzà€«¤Ÿiát h§ç\­¶tº+€N-ÿ¸#YQdx I$‡)b2å)I};dgÍág…øxý¼yófhhh€ìììzÃø4Äî—}$ø·OIÔO‘Y%»IDå'd׳¤~&ƒð« ÃôÌo.)!Â;\Oñì‰"Â?NV‡³rO†¬•näy¥R©*((P­Y³æóÒÒRhjj‚k×®1K–,±ºWø²‰YÙA² šÈtÍeÚírÈÝD§1³nIÄ·¯5=ÅÖˆ¹Ä;((HºjÕ*:U566ª*++£:ÄÔÔÔÀÍ›7aݺu»ï›ñØtUd/\Ÿ ÐéÐ[x˜ØÌ&to3hX/ü0ÚK8 çØk–…ά®®–¶¶¶Ê233¢­ÒëõªM›6µTTT@OO Cóƒ$rÿr´‹ÚÌ»J¿&Öü‚ðá€i t­Ü ^„Ž%"‘HRÕ®Vvh7ÏÍi/ø lïÞ½ÑÅÅÅammm*F“±lÙ2ÀrµZ=Šslïå\w‚ŽÖ @½êÈg·BÀœ2Œä‰tp*à Ev³mllÆ_ܾÂW—¢¼Ž‰ )Êî«—/Ëz{{e;wî\NÑšš:Ƕ¡`ËÆõà($îæ¼'Ÿ¬f.úŽÂ¾Hê÷o%CXˆöˆe+”ÁÈéà*ĸ¸8^aa¡D»5z•nƒß™ÆÔYŸUåïÈÍÍ•FEE…à´ÈÉ“'«-¿´åˆ …ÀÀÀZ£¤ÞC¦ 8TþÂP¹š¿ƒ˜ßÊ‹ã{¦Íê> |ù%:1)ïöÉIIIâŠcœ[jk'`œ'`"ú¢cill¬L,Ç ='<<ü|† ÒÓÓí©t®vqøXTÉœðcà”70_±‡úŽ‘ý11„ûÄ<—¹ó÷ÓÖçC ¿dÆÑÿ[k,;Idd¤dãÆNèÀ×ÔÔTŠe§Bû¹\®Âí¸ŽB¤%'AFïÂð6N³GÂÀA`r„£äšU¼EÆÝ©êHÙá¾måOB¹ Ü“é;%ý°æx‚•apÇz_»í¡Î´$³gϦ’¡­ðññ‘Í÷óxù-…ÉÛûæZԞǂ®µBèK¤ó€y×fdà=Ëó [ˆÇßû,¸7-CqÑœS €9Æe†r½=鵩²þo8·4¾&(«S›¯}ݾº)YÒ­O²~‘ƒK ­àBÏZ{hV»@ÕŽ§áèj·OÞ[(æ£ß? ‹Þçx¶~xxø|d+S1 eó ûu Й"‡þ wÐeNŽw¼¡ïý èÚáÏÜÜê;¨}ÕG%Á³%Anõ ‡E“—žŸ?ôqüWcWgqu¤yÕtn˜Þֵͷª/Gº[—á°§<é‰7÷/ä=ªRb.Ìòððuqq‰Ç²ÝŽó@¡PÀâÅ‹ÿ@›ÿxî„°´Iòq· QOOÏ ~~~O¢€Q¬@ ˆg³Ù}«ðÔ\:fl+`’——W–dB¬äñxßR€èèhÀ÷’±`¡¬)„L&›îè訲³³‹377ßEœ!""âÖÖ|k5Á&` ÁFGÙcÌDç‹$àÃ>šÀápÖýuǸ*E4cS”ŸÏwÃ6G(&š™™§þþþ€÷ÆK])òt<ˆTm“&˜gðˆ|”ó@7§\‰­†­ÏØ7ßåM]Šü  Ïvµbž1À£CˆQ–––Ák1 Í"88˜†a—.yš».Y~Ì0~,h³B¹#ÀR I>puu[[Û6š/Zš”ãPþ†×pF)–)ý¨k„ ʃ'ä 0uêTº);c3”Œ:511Ü!W„0þ³!ú1`eeE;cÇÀbê BÐU gÿk*Ÿ#áØCP ¸´à.ûNcþÁZÌÊ‚ÛøIEND®B`‚plasmate-1.0/plasmate/PaxHeaders.5990/docbrowser0000644000175000001440000000013012115142004020017 xustar000000000000000029 mtime=1362412548.61064126 30 atime=1362412548.611641248 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/docbrowser/0000755000175000001440000000000012115142004020533 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/docbrowser/PaxHeaders.5990/docbrowser.h0000644000175000001440000000012712115142004022424 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/docbrowser/docbrowser.h0000644000175000001440000000270312115142004023057 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Lim Yuen Hoe 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 . */ #ifndef DOCBROWSER_H #define DOCBROWSER_H #include class QDockWidget; class QWebView; class KUrl; class KLineEdit; class QLabel; namespace Ui { class DocBrowser; } class PackageModel; class DocBrowser : public QDockWidget { Q_OBJECT; public: DocBrowser(const PackageModel *package, QWidget* parent); KUrl currentPage() const; void load(KUrl page); void setPackage(const PackageModel *package); const PackageModel *package() const; public slots: void showTutorial(); void showApi(); void showHelp(); void findText(const QString& toFind); void findNext(); void focusSearchField(); private: QWebView *m_view; KLineEdit *m_searchField; QLabel *m_searchLabel; const PackageModel *m_package; }; #endif // DOCBROWSER_H plasmate-1.0/plasmate/docbrowser/PaxHeaders.5990/docbrowser.cpp0000644000175000001440000000012712115142004022757 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/docbrowser/docbrowser.cpp0000644000175000001440000001114412115142004023411 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Lim Yuen Hoe 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 . */ #include "docbrowser.h" #include #include #include #include #include #include #include #include #include "packagemodel.h" DocBrowser::DocBrowser(const PackageModel *package, QWidget *parent) : QDockWidget(i18n("Documentation"), parent), m_package(package) { QWidget *widget = new QWidget(this); m_view = new QWebView(this); connect(m_view, SIGNAL(loadFinished(bool)), this, SLOT(focusSearchField())); QHBoxLayout *topbar = new QHBoxLayout(); QHBoxLayout *btmbar = new QHBoxLayout(); KPushButton *linkButton = new KPushButton(KIcon("favorites"), i18n("Tutorials"), this); connect(linkButton, SIGNAL(clicked()), this, SLOT(showTutorial())); topbar->addWidget(linkButton); linkButton = new KPushButton(KIcon("favorites"), i18n("API Reference"), this); connect(linkButton, SIGNAL(clicked()), this, SLOT(showApi())); topbar->addWidget(linkButton); linkButton = new KPushButton(KIcon("plasmagik"), i18n("Plasmate"), this); connect(linkButton, SIGNAL(clicked()), this, SLOT(showHelp())); topbar->addWidget(linkButton); m_searchLabel = new QLabel(i18n("Find:")); btmbar->addWidget(m_searchLabel); // TODO: should probably respond to the common 'Ctrl-F' by // highlight-focusing the search field m_searchField = new KLineEdit(this); connect(m_searchField, SIGNAL(textChanged(const QString&)), this, SLOT(findText(const QString&))); connect(m_searchField, SIGNAL(returnPressed()), this, SLOT(findNext())); btmbar->addWidget(m_searchField); KPushButton *searchButton = new KPushButton(i18n("Next"), this); connect(searchButton, SIGNAL(clicked()), this, SLOT(findNext())); btmbar->addWidget(searchButton); QVBoxLayout *layout = new QVBoxLayout(); layout->addLayout(topbar); layout->addWidget(m_view); layout->addLayout(btmbar); widget->setLayout(layout); setWidget(widget); showTutorial(); } void DocBrowser::findText(const QString& toFind) { if (!m_view->findText(toFind, QWebPage::FindWrapsAroundDocument)) { m_searchLabel->setText(i18n("(Text not found)")); } else { m_searchLabel->setText(i18n("Find:")); } } void DocBrowser::findNext() { m_view->findText(m_searchField->text(), QWebPage::FindWrapsAroundDocument); } KUrl DocBrowser::currentPage() const { return KUrl(m_view->url()); } void DocBrowser::load(KUrl page) { m_view->load(page); } void DocBrowser::setPackage(const PackageModel *package) { m_package = package; } const PackageModel *DocBrowser::package() const { return m_package; } void DocBrowser::showApi() { m_view->setHtml("

" + i18n("Loading API reference...") + "

"); QUrl url("http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/annotated.html"); if (m_package) { //TODO: API specific to each kind of package! //kDebug() << m_package->implementationApi() << m_package->packageType(); if (m_package->packageType() == "Plasma/Applet") { if (m_package->implementationApi().toLower() == "javascript") { url = QUrl("http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API"); } } } kDebug() << "loading" << url; m_view->load(url); } void DocBrowser::showTutorial() { m_view->setHtml("

" + i18n("Loading tutorials...") + "

"); m_view->load(QUrl("http://techbase.kde.org/Development/Tutorials/Plasma")); } void DocBrowser::showHelp() { m_view->setHtml("

" + i18n("Loading Plasmate Guide...") + "

"); m_view->load(QUrl("http://userbase.kde.org/Plasmate")); } void DocBrowser::focusSearchField() { m_searchField->setFocus(Qt::OtherFocusReason); m_searchField->selectAll(); } plasmate-1.0/plasmate/PaxHeaders.5990/test-kpart0000644000175000001440000000013212115142004017746 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.634641046 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/test-kpart/0000755000175000001440000000000012115142004020460 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/test-kpart/PaxHeaders.5990/mainwindow.cpp0000644000175000001440000000013212115142004022703 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.622641154 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/test-kpart/mainwindow.cpp0000644000175000001440000000346612115142004023351 0ustar00kokeroulisusers00000000000000#include "mainwindow.h" #include #include #include #include #include #include #include #include #include #include #include #include MainWindow::MainWindow() : KParts::MainWindow() { // Setup our actions setupActions(); // this routine will find and load our Part. KLibFactory *factory = KLibLoader::self()->factory("katepart"); if (factory) { // now that the Part is loaded, we cast it to a Part to get // our hands on it m_part = static_cast (factory->create(this, "KatePart")); if (m_part) { // tell the KParts::MainWindow that this is indeed // the main widget setCentralWidget(m_part->widget()); setupGUI(ToolBar | Keys | StatusBar | Save); // and integrate the part's GUI with the shell's createGUI(m_part); } } 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; } } MainWindow::~MainWindow() { } void MainWindow::load(const KUrl& url) { m_part->openUrl(url); } void MainWindow::setupActions() { KStandardAction::open(this, SLOT(fileOpen()), actionCollection()); KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollection()); } void MainWindow::load() { load(KFileDialog::getOpenUrl()); }plasmate-1.0/plasmate/test-kpart/PaxHeaders.5990/mainwindow.h0000644000175000001440000000013212115142004022350 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.622641154 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/test-kpart/mainwindow.h0000644000175000001440000000152112115142004023004 0ustar00kokeroulisusers00000000000000#ifndef KPARTTUTORIAL1_H #define KPARTTUTORIAL1_H #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 Application Shell * @author Developer * @version 0.1 */ class MainWindow : public KParts::MainWindow { Q_OBJECT public: /** * Default Constructor */ MainWindow(); /** * Default Destructor */ virtual ~MainWindow(); /** * Use this method to load whatever file/URL you have */ void load(const KUrl& url); /** * Use this method to display an openUrl dialog and * load the URL that gets entered */ void load(); private: void setupActions(); private: KParts::ReadWritePart *m_part; }; #endif // KPARTTUT1_Hplasmate-1.0/plasmate/test-kpart/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004022563 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.622641154 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/test-kpart/CMakeLists.txt0000644000175000001440000000070612115142004023223 0ustar00kokeroulisusers00000000000000project(kparttut1) FIND_PACKAGE(KDE4 REQUIRED) INCLUDE_DIRECTORIES( ${KDE4_INCLUDES} . ) set(kparttut1_SRCS main.cpp mainwindow.cpp ) kde4_add_executable(kparttut1 ${kparttut1_SRCS}) target_link_libraries(kparttut1 ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS}) ########### install files ############### install(TARGETS kparttut1 ${INSTALL_TARGETS_DEFAULT_ARGS} ) install( FILES kparttut1ui.rc DESTINATION ${DATA_INSTALL_DIR}/kparttut1 ) plasmate-1.0/plasmate/test-kpart/PaxHeaders.5990/main.cpp0000644000175000001440000000013212115142004021453 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.622641154 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/test-kpart/main.cpp0000644000175000001440000000154012115142004022110 0ustar00kokeroulisusers00000000000000#include #include #include #include #include "mainwindow.h" int main(int argc, char *argv[]) { KAboutData aboutData("kparttutorial1", "kparttutorial1", ki18n("KPart Tutorial 1"), "0.1", ki18n("A MainWindow for a KatePart."), KAboutData::License_GPL, ki18n("Copyright (c) 2007 Developer")); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineOptions options; options.add("+[file]", ki18n("Document to open")); KCmdLineArgs::addCmdLineOptions(options); KApplication app; MainWindow* window = new MainWindow(); window->show(); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); if (args->count()) { window->load(args->url(0).url()); } return app.exec(); }plasmate-1.0/plasmate/test-kpart/PaxHeaders.5990/kparttut1ui.rc0000644000175000001440000000013212115142004022646 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.622641154 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/test-kpart/kparttut1ui.rc0000644000175000001440000000064312115142004023306 0ustar00kokeroulisusers00000000000000 &File Main Toolbar plasmate-1.0/plasmate/PaxHeaders.5990/packagemodel.h0000644000175000001440000000013212115142004020512 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412548.616641211 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/packagemodel.h0000644000175000001440000000565612115142004021163 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Aaron Seigo Copyright 2009-2010 Artur Duque de Souza Copyright 2009-2010 Diego '[Po]lentino' Casella Copyright 2009-2010 Shantanu Tushar Jha Copyright 2009-2010 Sandro Andrade Copyright 2009-2010 Lim Yuen Hoe 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 PACKAGEMODEL_H #define PACKAGEMODEL_H #include #include class KDirWatch; namespace Plasma { class Package; } // namespace Plasma class PackageModel : public QAbstractItemModel { Q_OBJECT public: explicit PackageModel(QObject *parent = 0); ~PackageModel(); void setPackageType(const QString &type); QString packageType() const; QString implementationApi() const; int setPackage(const QString &path); QString package() const; QString contentsPrefix() const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QModelIndex parent(const QModelIndex &index) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; int rowCount(const QModelIndex & parent = QModelIndex()) const; enum DataRoles { MimeTypeRole = Qt::UserRole + 1, UrlRole, PackagePathRole, ContentsWithSubdirRole }; Q_SIGNALS: void reloadModel(); private: KUrl urlForIndex(const QModelIndex &index) const; bool fileExists(const QString& key) const; private Q_SLOTS: void fileAddedOnDisk(const QString &path); void fileDeletedOnDisk(const QString &path); void directoryModifiedOnDisk(const QString &path); bool loadPackage(); QString contentsWithSubdirRole(int indexRow) const; private: KDirWatch *m_directory; QVector m_topEntries; QHash m_files; QHash > m_namedFiles; Plasma::PackageStructure::Ptr m_structure; Plasma::Package *m_package; QHash m_dialogOptions; static const int MAX_COLUMN = 0; }; #endif plasmate-1.0/plasmate/PaxHeaders.5990/sidebar.h0000644000175000001440000000013212115142004017507 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/sidebar.h0000644000175000001440000000276112115142004020152 0ustar00kokeroulisusers00000000000000/* Copyright 2007 by Pino Toscano 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 . */ #ifndef _SIDEBAR_H_ #define _SIDEBAR_H_ #include class QIcon; class SidebarTableWidget; class SidebarDelegate; class Sidebar : public QDockWidget { Q_OBJECT public: Sidebar(QWidget *parent = 0, Qt::DockWidgetArea location = Qt::TopDockWidgetArea); ~Sidebar(); Qt::DockWidgetArea location(); void addItem(const QIcon &icon, const QString &text); bool isItemEnabled(int index) const; void setCurrentIndex(int index); int currentIndex() const; void setSidebarVisibility(bool visible); bool isSidebarVisible() const; bool isVertical(); signals: void currentIndexClicked(const QModelIndex &item); protected: void resizeEvent(QResizeEvent * event); private: void saveSplitterSize() const; SidebarTableWidget *m_table; SidebarDelegate *m_delegate; }; #endif plasmate-1.0/plasmate/PaxHeaders.5990/templates0000644000175000001440000000013212115142004017646 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.634641046 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/templates/0000755000175000001440000000000012115142004020360 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/templates/PaxHeaders.5990/mainKWinEffect.js0000644000175000001440000000013212115142004023113 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/templates/mainKWinEffect.js0000644000175000001440000000315712115142004023556 0ustar00kokeroulisusers00000000000000/******************************************************************** This file is part of the KDE project. Copyright (C) 2012 $AUTHOR <$EMAIL> 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 duration; function loadConfig() { duration = animationTime(250); } loadConfig(); effect.configChanged.connect(function() { loadConfig(); }); effects['desktopChanged(int,int)'].connect(function(oldDesktop, newDesktop) { var stackingOrder = effects.stackingOrder; for (var i=0; i # Date: $DATE # # 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 essential modules from PyQt4.QtCore import * from PyQt4.QtGui import * from PyKDE4.plasma import Plasma from PyKDE4 import plasmascript class $PLASMOID_NAME(plasmascript.Applet): # Constructor, forward initialization to its superclass # Note: try to NOT modify this constructor; all the setup code # should be placed in the init method. def __init__(self,parent,args=None): plasmascript.Applet.__init__(self,parent) # init method # Put here all the code needed to initialize our plasmoid def init(self): self.setHasConfigurationInterface(False) self.resize(125, 125) self.setAspectRatioMode(Plasma.Square) # Simple painting function def paintInterface(self, painter, option, rect): painter.save() # Simple paint code example #painter.setPen(Qt.white) #painter.drawText(rect, Qt.AlignVCenter | Qt.AlignHCenter, "Hello Python!") painter.restore() # CreateApplet method # Note: do NOT modify it, needed by Plasma def CreateApplet(parent): return $PLASMOID_NAME(parent) plasmate-1.0/plasmate/templates/PaxHeaders.5990/mainPlasmoid.rb0000644000175000001440000000013212115142004022665 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.622641154 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/templates/mainPlasmoid.rb0000644000175000001440000000335112115142004023324 0ustar00kokeroulisusers00000000000000# -*- coding: iso-8859-1 -*- =begin /* * Author: $AUTHOR <$EMAIL> * Date: $DATE * * 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 # Load QT and KDE Ruby bindings require 'plasma_applet' module $PLASMOID_NAME # Declare our main class as PlasmaScripting::Applet subclass class Main$PLASMOID_NAME < PlasmaScripting::Applet # Constructor, forward initialization to its superclass # Note: try to NOT modify this constructor; all the setup code # should be placed in the init method. def initialize parent super parent end # Init method # Put here all the code needed to initialize our plasmoid def init self.has_configuration_interface = false self.aspect_ratio_mode = Plasma::Square end # Simple painting function def paintInterface(painter, option, rect) painter.save # Simple paint code example #painter.pen = Qt::Color.new Qt::white #painter.draw_text rect, Qt::AlignVCenter | Qt::AlignHCenter, "Hello Ruby!" painter.restore end end end plasmate-1.0/plasmate/templates/PaxHeaders.5990/mainDataEngine.rb0000644000175000001440000000013212115142004023114 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/templates/mainDataEngine.rb0000644000175000001440000000363212115142004023555 0ustar00kokeroulisusers00000000000000# -*- coding: iso-8859-1 -*- =begin /* * Author: $AUTHOR <$EMAIL> * Date: $DATE * * 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 # Load QT and KDE Ruby bindings require 'plasma_applet' module $DATAENGINE_NAME # Declare our main class as PlasmaScripting::DataEngine subclass class Main$DATAENGINE_NAME < PlasmaScripting::DataEngine # Constructor, forward initialization to its superclass # Note: try to NOT modify this constructor; all the setup code # should be placed in the init method. def initialize(parent, args = nil) super(parent) end # Init method # Put here all the code needed to initialize our plasmoid def init setMinimumPollingInterval(333) end # sources method # Used by applets to request what data source the DataEngine has def sources end # sourceRequestEvent method # Called when an applet access the DataEngine and request for # a specific source (name) def sourceRequestEvent(name) return updateSourceEvent(name) end # updateSourceEvent method # The main function for a DataEngine def updateSourceEvent(source) # Add custom code here return true end end end plasmate-1.0/plasmate/templates/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004022463 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/templates/CMakeLists.txt0000644000175000001440000000037612115142004023126 0ustar00kokeroulisusers00000000000000install(FILES mainRunner.py mainDataEngine.py mainDataEngine.rb mainPlasmoid.js mainPlasmoid.py mainPlasmoid.qml mainPlasmoid.rb mainTabbox.qml mainKWinScript.js mainKWinEffect.js DESTINATION ${DATA_INSTALL_DIR}/plasmate/templates) plasmate-1.0/plasmate/templates/PaxHeaders.5990/mainRunner.py0000644000175000001440000000013212115142004022413 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.622641154 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/templates/mainRunner.py0000644000175000001440000000706612115142004023061 0ustar00kokeroulisusers00000000000000# -*- coding: iso-8859-1 -*- # # Author: $AUTHOR <$EMAIL> # Date: $DATE # # 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 essential modules from PyQt4.QtCore import * from PyQt4 import uic from PyKDE4.kdeui import * from PyKDE4.kdecore import * from PyKDE4.plasma import * from PyKDE4 import plasmascript class $RUNNER_NAME(plasmascript.Runner): # Constructor, forward initialization to its superclass # Note: try to NOT modify this constructor; all the setup code # should be placed in the init method. def __init__(self,parent,args=None): plasmascript.Runner.__init__(self,parent) self.actions = [] # init method # Put here all the code needed to initialize your runner def init(self): # Simple runner example #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) # match method # Assign an action for a defined match 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) # run method # Runs the runner def run(self, search, action): #print '### run:', #data = action.data().toString() #print data #KToolInvocation.invokeBrowser(data) # prepare method # Sets up the runner def prepare(self): #print '### prepare', #lock = QMutexLocker(self.bigLock()) #print 'in BIG lock' # teardown method # def teardown(self): print '### teardown' # createRunOption method # Loads an UI to configure the runner options def createRunOptions(self, parent): #print '### createRunOptions', parent #uic.loadUi(self.package().filePath('ui', 'config.ui'), parent) # reloadConfiguration method # def reloadConfiguration(self): #print '### reloadConfiguration: ', #self.url = unicode(self.config().readEntry('url', 'http://www.kde.org').toString()) #print self.url # CreateRunner method # Note: do NOT modify it, needed by Plasma def CreateRunner(parent): return $RUNNER_NAME(parent) plasmate-1.0/plasmate/templates/PaxHeaders.5990/mainKWinScript.js0000644000175000001440000000013212115142004023163 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/templates/mainKWinScript.js0000644000175000001440000000300212115142004023613 0ustar00kokeroulisusers00000000000000/* * Copyright (c) 2012 $AUTHOR <$EMAIL> * * 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 . */ /* * For more information about the KWin Scripting please take a look at the below lines * Tutorial: http://techbase.kde.org/Development/Tutorials/KWin/Scripting * Api: http://techbase.kde.org/Development/Tutorials/KWin/Scripting/API_4.9 */ 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); plasmate-1.0/plasmate/templates/PaxHeaders.5990/mainPlasmoid.js0000644000175000001440000000013212115142004022676 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.622641154 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/templates/mainPlasmoid.js0000644000175000001440000000207712115142004023341 0ustar00kokeroulisusers00000000000000// -*- coding: iso-8859-1 -*- /* * Author: $AUTHOR <$EMAIL> * Date: $DATE * * 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. */ // Define our main layout // Note: plasmoid is the global reference to our widget mainLayout = new LinearLayout(plasmoid); // Create and set a simple label; then add it label = new Label(); label.text = 'Hello JavaScript!'; mainLayout.addItem(label); plasmate-1.0/plasmate/templates/PaxHeaders.5990/mainPlasmoid.qml0000644000175000001440000000013212115142004023053 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.622641154 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/templates/mainPlasmoid.qml0000644000175000001440000000177312115142004023520 0ustar00kokeroulisusers00000000000000// -*- coding: iso-8859-1 -*- /* * Author: $AUTHOR <$EMAIL> * Date: $DATE * * 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 Item { width: 200 height: 300 PlasmaComponents.Label { text: i18n("Hello world") } }plasmate-1.0/plasmate/templates/PaxHeaders.5990/mainDataEngine.py0000644000175000001440000000013212115142004023141 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/templates/mainDataEngine.py0000644000175000001440000000406612115142004023604 0ustar00kokeroulisusers00000000000000# -*- coding: iso-8859-1 -*- # # Author: $AUTHOR <$EMAIL> # Date: $DATE # # 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 essential modules from PyQt4.QtCore import * from PyKDE4.kdecore import * from PyKDE4 import plasmascript class $DATAENGINE_NAME(plasmascript.DataEngine): # Constructor, forward initialization to its superclass # Note: try to NOT modify this constructor; all the setup code # should be placed in the init method. def __init__(self,parent,args=None): plasmascript.DataEngine.__init__(self,parent) # init method # Put here all the code needed to initialize our plasmoid def init(self): self.setMinimumPollingInterval(333) # sources method # Used by applets to request what data source the DataEngine has def sources(self): # Add custom code here return sources # sourceRequestEvent method # Called when an applet access the DataEngine and request for # a specific source ( name ) def sourceRequestEvent(self, name): # Add custom code here return self.updateSourceEvent(name) # updateSourceEvent method # The main function for a DataEngine def updateSourceEvent(self, tz): # Add custom code here return True # CreateDataEngine method # Note: do NOT modify it, needed by Plasma def CreateDataEngine(parent): return $DATAENGINE_NAME(parent) plasmate-1.0/plasmate/templates/PaxHeaders.5990/mainTabbox.qml0000644000175000001440000000013212115142004022522 xustar000000000000000030 mtime=1362412548.622641154 30 atime=1362412548.622641154 30 ctime=1362412548.622641154 plasmate-1.0/plasmate/templates/mainTabbox.qml0000644000175000001440000002000612115142004023155 0ustar00kokeroulisusers00000000000000/******************************************************************** This file is part of the KDE project. Copyright (C) 2012 $AUTHOR <$EMAIL> 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 . *********************************************************************/ import QtQuick 1.0 import org.kde.plasma.core 0.1 as PlasmaCore import org.kde.qtextracomponents 0.1 Item { id: informativeTabBox property int screenWidth : 0 property int screenHeight : 0 property bool allDesktops: true property string longestCaption: "" property int imagePathPrefix: (new Date()).getTime() property int optimalWidth: listView.maxRowWidth property int optimalHeight: listView.rowHeight * listView.count + background.margins.top + background.margins.bottom property bool canStretchX: true property bool canStretchY: false width: Math.min(Math.max(screenWidth * 0.2, optimalWidth), screenWidth * 0.8) height: Math.min(Math.max(screenHeight * 0.2, optimalHeight), screenHeight * 0.8) focus: true property int textMargin: 2 onLongestCaptionChanged: { listView.maxRowWidth = listView.calculateMaxRowWidth(); } function setModel(model) { listView.model = model; listView.maxRowWidth = listView.calculateMaxRowWidth(); listView.imageId++; } function modelChanged() { listView.imageId++; } /** * Returns the caption with adjustments for minimized items. * @param caption the original caption * @param mimized whether the item is minimized * @return Caption adjusted for minimized state **/ function itemCaption(caption, minimized) { var text = caption; if (minimized) { text = "(" + text + ")"; } return text; } PlasmaCore.Theme { id: theme } // just to get the margin sizes PlasmaCore.FrameSvgItem { id: hoverItem imagePath: "widgets/viewitem" prefix: "hover" visible: false } PlasmaCore.FrameSvgItem { id: background anchors.fill: parent imagePath: "dialogs/background" } // delegate Component { id: listDelegate Item { id: delegateItem width: listView.width height: listView.rowHeight Image { id: iconItem source: "image://client/" + index + "/" + informativeTabBox.imagePathPrefix + "-" + listView.imageId + (index == listView.currentIndex ? "/selected" : "/disabled") width: 32 height: 32 sourceSize { width: 32 height: 32 } anchors { verticalCenter: parent.verticalCenter left: parent.left leftMargin: hoverItem.margins.left } } Text { id: captionItem horizontalAlignment: Text.AlignHCenter text: itemCaption(caption, minimized) font.bold: true font.italic: minimized color: theme.textColor elide: Text.ElideMiddle anchors { left: iconItem.right right: parent.right top: parent.top topMargin: informativeTabBox.textMargin + hoverItem.margins.top rightMargin: hoverItem.margins.right } } Text { id: desktopNameItem horizontalAlignment: Text.AlignHCenter text: desktopName font.bold: false font.italic: true color: theme.textColor elide: Text.ElideMiddle visible: informativeTabBox.allDesktops anchors { left: iconItem.right right: parent.right top: captionItem.bottom topMargin: informativeTabBox.textMargin bottom: parent.bottom bottomMargin: informativeTabBox.textMargin + hoverItem.margins.bottom rightMargin: hoverItem.margins.right } } MouseArea { anchors.fill: parent onClicked: { listView.currentIndex = index; listView.currentIndexChanged(listView.currentIndex); } } } } ListView { function calculateMaxRowWidth() { var width = 0; var textElement = Qt.createQmlObject( 'import Qt 4.7;' + 'Text {\n' + ' text: "' + itemCaption(informativeTabBox.longestCaption, true) + '"\n' + ' font.bold: true\n' + ' visible: false\n' + '}', listView, "calculateMaxRowWidth"); width = Math.max(textElement.width, width); textElement.destroy(); return width + 32 + hoverItem.margins.right + hoverItem.margins.left + background.margins.left + background.margins.right; } /** * Calculates the height of one row based on the text height and icon size. * @return Row height **/ function calcRowHeight() { var textElement = Qt.createQmlObject( 'import Qt 4.7;' + 'Text {\n' + ' text: "Some Text"\n' + ' font.bold: true\n' + ' visible: false\n' + '}', listView, "calcRowHeight"); var height = textElement.height; textElement.destroy(); // icon size or two text elements and margins and hoverItem margins return Math.max(32, height*2 + informativeTabBox.textMargin * 3 + hoverItem.margins.top + hoverItem.margins.bottom); } signal currentIndexChanged(int index) id: listView objectName: "listView" // the maximum text width + icon item width (32 + 4 margin) + margins for hover item + margins for background property int maxRowWidth: calculateMaxRowWidth() property int rowHeight: calcRowHeight() // used for image provider URL to trick Qt into reloading icons when the model changes property int imageId: 0 anchors { fill: parent topMargin: background.margins.top leftMargin: background.margins.left rightMargin: background.margins.right bottomMargin: background.margins.bottom } clip: true delegate: listDelegate highlight: PlasmaCore.FrameSvgItem { id: highlightItem imagePath: "widgets/viewitem" prefix: "hover" width: listView.width } highlightMoveDuration: 250 boundsBehavior: Flickable.StopAtBounds } /* * Key navigation on outer item for two reasons: * @li we have to emit the change signal * @li on multiple invocation it does not work on the list view. Focus seems to be lost. **/ Keys.onPressed: { if (event.key == Qt.Key_Up) { listView.decrementCurrentIndex(); listView.currentIndexChanged(listView.currentIndex); } else if (event.key == Qt.Key_Down) { listView.incrementCurrentIndex(); listView.currentIndexChanged(listView.currentIndex); } } } plasmate-1.0/plasmate/PaxHeaders.5990/previewer0000644000175000001440000000013212115142004017660 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.622641154 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/0000755000175000001440000000000012115142004020372 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/previewer/PaxHeaders.5990/runner0000644000175000001440000000013212115142004021171 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.622641154 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/runner/0000755000175000001440000000000012115142004021703 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/previewer/runner/PaxHeaders.5990/runnerpreviewer.cpp0000644000175000001440000000013212115142004025214 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/runner/runnerpreviewer.cpp0000644000175000001440000000432312115142004025653 0ustar00kokeroulisusers00000000000000/* * Copyright 2010 Lim Yuen Hoe * * 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. * */ #include #include #include #include #include #include #include #include "runnerpreviewer.h" RunnerPreviewer::RunnerPreviewer(const QString & title, QWidget * parent, Qt::WindowFlags flags) : Previewer(title, parent, flags), m_runner(0) { m_edit = new KLineEdit(this); connect(m_edit, SIGNAL(textEdited(const QString&)), this, SLOT(doQuery())); m_matches = new QListWidget(this); connect(m_matches, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(executeMatch(QListWidgetItem*))); QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(m_edit); layout->addWidget(m_matches); QWidget *w = new QWidget(); w->setLayout(layout); setWidget(w); } RunnerPreviewer::~RunnerPreviewer() { if (m_runner) { m_runner->matchSessionComplete(); delete m_runner; } } void RunnerPreviewer::showPreview(const QString &packagePath) { delete m_runner; m_runner = new Plasma::RunnerManager(this); connect(m_runner,SIGNAL(matchesChanged(const QList< Plasma::QueryMatch > &)),this,SLOT(showMatches())); QStringList runners; runners << "places"; m_runner->setAllowedRunners(runners); } void RunnerPreviewer::refreshPreview() { //emit refreshView(); } void RunnerPreviewer::showMatches() { m_matches->clear(); foreach (Plasma::QueryMatch match, m_runner->matches()) { m_matches->addItem(match.text()); } } void RunnerPreviewer::executeMatch(QListWidgetItem* item) { m_matches->setCurrentItem(item); m_runner->run(m_runner->matches().at(m_matches->currentRow())); } void RunnerPreviewer::doQuery() { if (m_runner) { m_runner->launchQuery(m_edit->text()); } } QString RunnerPreviewer::takeOutput() const { //TODO add support for a runner previewer return QString(); } plasmate-1.0/plasmate/previewer/runner/PaxHeaders.5990/runnerpreviewer.h0000644000175000001440000000013212115142004024661 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/runner/runnerpreviewer.h0000644000175000001440000000200212115142004025310 0ustar00kokeroulisusers00000000000000/* * Copyright 2010 Lim Yuen Hoe * * 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. * */ #ifndef RUNNERPREVIEWER_H #define RUNNERPREVIEWER_H #include "../previewer.h" class KLineEdit; class QListWidget; class QListWidgetItem; namespace Plasma { class RunnerManager; } class RunnerPreviewer : public Previewer { Q_OBJECT public: RunnerPreviewer(const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 ); ~RunnerPreviewer(); void showPreview(const QString &packagePath); void refreshPreview(); QString takeOutput() const; public slots: void doQuery(); void showMatches(); void executeMatch(QListWidgetItem*); private: KLineEdit* m_edit; QListWidget* m_matches; Plasma::RunnerManager* m_runner; }; #endif // RUNNERPREVIEWER_Hplasmate-1.0/plasmate/previewer/PaxHeaders.5990/plasmoid0000644000175000001440000000013212115142004021470 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.627641107 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/0000755000175000001440000000000012115142004022202 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/previewer/plasmoid/PaxHeaders.5990/previewcontainment.cpp0000644000175000001440000000013212115142004026172 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/previewcontainment.cpp0000644000175000001440000002707212115142004026637 0ustar00kokeroulisusers00000000000000/* * Copyright 2007 Frerich Raabe * Copyright 2007 Aaron Seigo * Copyright 2008 Aleix Pol * Copyright 2009 Artur Duque de Souza * * * 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. */ #include "previewcontainment.h" #include #include #include #include #include #include #include #include #include #include #include #include #include PreviewContainment::PreviewContainment(QObject *parent, const QVariantList &args) : Containment(parent, args), m_applet(0), m_menu(new KMenu()) { setContainmentType(Plasma::Containment::CustomContainment); setBackgroundHints(Plasma::Applet::NoBackground); setHasConfigurationInterface(false); connect(this, SIGNAL(appletAdded(Plasma::Applet *, const QPointF &)), this, SLOT(onAppletAdded(Plasma::Applet *, const QPointF &))); connect(this, SIGNAL(appletRemoved(Plasma::Applet *)), this, SLOT(onAppletRemoved(Plasma::Applet *))); m_layout = new QGraphicsLinearLayout(Qt::Vertical); m_layout->setContentsMargins(5, 0, 5, 10); m_header = new QGraphicsLinearLayout(Qt::Horizontal); m_header->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); m_header->setSpacing(0); m_header->setContentsMargins(0, 4, 0, 0); m_controls = new QGraphicsWidget(this); m_controls->setLayout(m_header); m_controls->setZValue(99); m_controls->resize(100, 32); m_controls->setMaximumHeight(32); m_layout->addItem(m_controls); setupHeader(); m_tmp = new QGraphicsWidget(this); m_layout->addItem(m_tmp); setLayout(m_layout); //setWallpaper("image", "Color"); } PreviewContainment::~PreviewContainment() { delete m_menu; } void PreviewContainment::setupHeader() { // setup toolboxes Plasma::IconWidget *form = new Plasma::IconWidget(this); Plasma::IconWidget *refresh = new Plasma::IconWidget(this); Plasma::IconWidget *location = new Plasma::IconWidget(this); Plasma::IconWidget *wallpaper = new Plasma::IconWidget(this); Plasma::IconWidget *konsole = new Plasma::IconWidget(this); // add actions KAction *action0 = new KAction(KIcon("user-desktop"), "", this); connect(action0, SIGNAL(triggered()), this, SLOT(changeWallpaper())); wallpaper->setAction(action0); KAction *action1 = new KAction(KIcon("distribute-horizontal-x"), "", this); connect(action1, SIGNAL(triggered()), this, SLOT(changeFormFactor())); form->setAction(action1); KAction *action2 = new KAction(KIcon("align-vertical-bottom"), "", this); connect(action2, SIGNAL(triggered()), this, SLOT(changeLocation())); location->setAction(action2); KAction *action3 = new KAction(KIcon("view-refresh"), "", this); connect(action3, SIGNAL(triggered()), this, SLOT(refreshAndEmit())); refresh->setAction(action3); KAction *action4 = new KAction(KIcon("utilities-terminal"), "", this); connect(action4, SIGNAL(triggered()), this, SIGNAL(showKonsole())); konsole->setAction(action4); //add the items to the toolboxes //we will need them in order to modify them later. m_toolbox.insert("refresh", refresh); m_toolbox.insert("form", form); m_toolbox.insert("location", location); m_toolbox.insert("wallpaper", wallpaper); m_toolbox.insert("konsole", konsole); // add the toolboxes m_header->addItem(refresh); m_header->addItem(form); m_header->addItem(location); m_header->addItem(wallpaper); m_header->addItem(konsole); } void PreviewContainment::setKonsolePreviewerVisible(bool visible) { int count = 0; QHashIterator it(m_toolbox); while (it.hasNext()) { it.next(); if (it.key() != "konsole") { count ++; } } if (visible == true) { m_toolbox["konsole"]->setVisible(true); if (!m_header->itemAt(count)) { m_header->addItem(m_toolbox["konsole"]); } } else { m_toolbox["konsole"]->setVisible(false); if (m_header->itemAt(count)) { m_header->removeItem(m_toolbox["konsole"]); } } } QString PreviewContainment::plasmoidApi() { QString plasmaterc = KStandardDirs::locateLocal("config", "plasmaterc"); if (plasmaterc.isEmpty()) { return QString(); } KConfig c(plasmaterc); KConfigGroup projectrcPreferences(&c, "PackageModel::package"); QString projectPath = projectrcPreferences.readEntry("lastLoadedPackage", QString()); if (projectPath.isEmpty()) { return QString(); } KDesktopFile desktopFile(projectPath + "/metadata.desktop"); QString projectApi = desktopFile.desktopGroup().readEntry("X-Plasma-API", QString()); return projectApi; } // Fixme(?): Does not currently respect arguments passed in during // initialization. Will reload applet without arguments void PreviewContainment::refreshApplet() { if (!m_applet) return; clearApplets(); if (m_applet->package()) { QString path = m_applet->package()->path(); delete m_applet; m_applet = Applet::loadPlasmoid(path); addApplet(m_applet, QPointF(-1, -1), false); } else { QString pluginName = m_applet->pluginName(); delete m_applet; m_applet = addApplet(pluginName, QVariantList(), QRectF(0, 0, -1, -1)); } m_applet->setFlag(QGraphicsItem::ItemIsMovable, false); } void PreviewContainment::refreshAndEmit() { // improve me? // basically if we're running inside plasmate, we want // to show the latest state of the code, so we emit a // signal that tells the main window to save its contents // and then do one more refresh refreshApplet(); emit refreshClicked(); } void PreviewContainment::changeFormFactor() { initMenu(i18n("Form Factor")); connect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(formFactorSelected(QAction*))); QHash actions; actions.insert(Plasma::Planar, m_menu->addAction(KIcon("user-desktop"), i18n("Planar"))); actions.insert(Plasma::MediaCenter, m_menu->addAction(KIcon("video-television"), i18n("Media Center"))); actions.insert(Plasma::Horizontal, m_menu->addAction(KIcon("distribute-horizontal-x"), i18n("Horizontal"))); actions.insert(Plasma::Vertical, m_menu->addAction(KIcon("distribute-vertical-y"), i18n("Vertical"))); QHashIterator it(actions); while (it.hasNext()) { it.next(); it.value()->setCheckable(true); it.value()->setData(it.key()); } if (actions.contains(formFactor())) { actions[formFactor()]->setChecked(true); } showMenu(); } void PreviewContainment::formFactorSelected(QAction *action) { setFormFactor(static_cast(action->data().toInt())); } void PreviewContainment::changeWallpaper() { initMenu(i18n("Wallpaper")); connect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(wallpaperSelected(QAction*))); const QString currentPlugin = wallpaper() ? wallpaper()->pluginName() : QString(); // create a menu item for each wallpaper plugin installed foreach (const KPluginInfo &info, Plasma::Wallpaper::listWallpaperInfo()) { QAction *plugin = m_menu->addAction(KIcon("user-desktop"), info.pluginName()); plugin->setCheckable(true); plugin->setData(info.pluginName()); if (currentPlugin == info.pluginName()) { plugin->setChecked(true); } } m_menu->addSeparator(); m_menu->addAction(i18n("Wallpaper Settings")); showMenu(); } void PreviewContainment::wallpaperSelected(QAction *action) { const QString &newPlugin = action->data().toString(); if (newPlugin.isEmpty()) { if (wallpaper()) { QWidget *widget = new QWidget(); wallpaper()->createConfigurationInterface(widget); widget->show(); } } else { setWallpaper(action->data().toString()); } } void PreviewContainment::changeLocation() { initMenu(i18n("Location")); connect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(locationSelected(QAction*))); QHash actions; actions.insert(Plasma::Floating, m_menu->addAction(KIcon("tab-detach"), i18n("Floating"))); actions.insert(Plasma::Desktop, m_menu->addAction(KIcon("user-desktop"), i18n("Desktop"))); actions.insert(Plasma::FullScreen, m_menu->addAction(KIcon("view-fullscreen"), i18n("FullScreen"))); actions.insert(Plasma::TopEdge, m_menu->addAction(KIcon("align-vertical-top"), i18n("Top Edge"))); actions.insert(Plasma::BottomEdge, m_menu->addAction(KIcon("align-vertical-bottom"), i18n("Bottom Edge"))); actions.insert(Plasma::LeftEdge, m_menu->addAction(KIcon("align-horizontal-left"), i18n("Left Edge"))); actions.insert(Plasma::RightEdge, m_menu->addAction(KIcon("align-horizontal-right"), i18n("Right Edge"))); QHashIterator it(actions); while (it.hasNext()) { it.next(); it.value()->setCheckable(true); it.value()->setData(it.key()); } if (actions.contains(location())) { actions[location()]->setChecked(true); } showMenu(); } void PreviewContainment::locationSelected(QAction *action) { setLocation(static_cast(action->data().toInt())); } void PreviewContainment::constraintsEvent(Plasma::Constraints constraints) { Q_UNUSED(constraints); } void PreviewContainment::onAppletAdded(Plasma::Applet *applet, const QPointF &pos) { Q_UNUSED(pos); m_applet = applet; m_layout->removeItem(m_tmp); m_layout->addItem(applet); if (plasmoidApi() != "declarativeappletscript") { //python bindings don't support kDebug, so the konsole previewer //cannot return any debug code. So until this is fixed, //we disable the konsolepreviewer support for the python bindings. setKonsolePreviewerVisible(false); } else { setKonsolePreviewerVisible(true); } } void PreviewContainment::onAppletRemoved(Plasma::Applet *applet) { disconnect(applet, SIGNAL(geometryChanged()), this, SLOT(onAppletGeometryChanged())); m_layout->removeItem(applet); m_layout->addItem(m_tmp); } void PreviewContainment::hoverEnterEvent(QGraphicsSceneHoverEvent* event) { Containment::hoverEnterEvent(event); } void PreviewContainment::hoverLeaveEvent(QGraphicsSceneHoverEvent* event) { Containment::hoverLeaveEvent(event); } void PreviewContainment::initMenu(const QString &title) { disconnect(m_menu, 0, this, 0); m_menu->clear(); m_menu->addTitle(title); } void PreviewContainment::showMenu() { if (m_menu) { m_menu->popup(QCursor::pos()); } } K_EXPORT_PLASMA_APPLET(studiopreviewer, PreviewContainment) plasmate-1.0/plasmate/previewer/plasmoid/PaxHeaders.5990/previewcontainment.h0000644000175000001440000000013212115142004025637 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/previewcontainment.h0000644000175000001440000000544112115142004026300 0ustar00kokeroulisusers00000000000000/* * Copyright 2007 Frerich Raabe * Copyright 2007 Aaron Seigo * Copyright 2008 Aleix Pol * Copyright 2009 Artur Duque de Souza * * 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. */ #ifndef PREVIEWCONTAINMENT_H #define PREVIEWCONTAINMENT_H #include #include #include #include #include #include #include class KMenu; class PreviewContainment : public Plasma::Containment { Q_OBJECT public: PreviewContainment(QObject *parent, const QVariantList &args = QVariantList()); ~PreviewContainment(); void setKonsolePreviewerVisible(bool visible = true); /** * Plasma:Package cannot create a valid package for a binding if its runtime depedencies * are missing. So we use the plasmaterc in order to load the API of our plasmoid */ QString plasmoidApi(); public slots: void changeFormFactor(); void changeLocation(); void changeWallpaper(); void refreshApplet(); signals: void refreshClicked(); void showKonsole(); protected slots: void refreshAndEmit(); void constraintsEvent(Plasma::Constraints constraints); void onAppletAdded(Plasma::Applet *, const QPointF &); void onAppletRemoved(Plasma::Applet *); void formFactorSelected(QAction *); void locationSelected(QAction *); void wallpaperSelected(QAction *); protected: void setupHeader(); void destroyHeader(); void hoverEnterEvent(QGraphicsSceneHoverEvent* event); void hoverLeaveEvent(QGraphicsSceneHoverEvent* event); private: Plasma::Applet *m_applet; KMenu *m_menu; // Little dirty hack to make previewer // look more beautiful when there is no applet. // XXX: Improve this ? QGraphicsWidget *m_tmp; QGraphicsWidget *m_controls; QGraphicsLinearLayout *m_layout; QGraphicsLinearLayout *m_header; QHash m_toolbox; void initMenu(const QString &title); void showMenu(); }; #endif //PREVIEWCONTAINMENT plasmate-1.0/plasmate/previewer/plasmoid/PaxHeaders.5990/test0000644000175000001440000000013212115142004022447 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.628641098 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/test/0000755000175000001440000000000012115142004023161 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/previewer/plasmoid/test/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004025264 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/test/CMakeLists.txt0000644000175000001440000000040512115142004025720 0ustar00kokeroulisusers00000000000000set(previewer_SRCS ../plasmoidview.cpp main.cpp ) kde4_add_executable(plasma-previewer ${previewer_SRCS}) target_link_libraries(plasma-previewer ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS}) #install(TARGETS plasma-previewer ${INSTALL_TARGETS_DEFAULT_ARGS}) plasmate-1.0/plasmate/previewer/plasmoid/test/PaxHeaders.5990/main.cpp0000644000175000001440000000013212115142004024154 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/test/main.cpp0000644000175000001440000001151412115142004024613 0ustar00kokeroulisusers00000000000000/* * Copyright 2007 Frerich Raabe * Copyright 2007-2008 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 "../plasmoidview.h" #include #include #include #include #include #include #include // for --list #include #include using namespace Plasma; static const char description[] = I18N_NOOP("Test plasma-studio previewer"); int main(int argc, char **argv) { KAboutData aboutData("previewer", 0, ki18n("Plasmate Previewer"), "1.0", ki18n(description), KAboutData::License_BSD, ki18n("XXXX")); aboutData.setProgramIconName("plasma"); aboutData.addAuthor(ki18n("XXX"), ki18n("Original author"), "xxx@kde.org"); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineOptions options; options.add("list", ki18n("Displays a list of known applets")); options.add("f"); options.add("formfactor ", ki18nc("Do not translate horizontal, vertical, mediacenter nor planar", "The formfactor to use (horizontal, vertical, mediacenter or planar)"), "planar"); options.add("l"); options.add("location ", ki18nc("Do not translate floating, desktop, fullscreen, top, bottom, left nor right", "The location constraint to start the Containment with (floating, desktop, fullscreen, top, bottom, left, right)"), "floating"); options.add("c"); options.add("containment ", ki18n("Name of the containment plugin"), "null"); options.add("w"); options.add("wallpaper ", ki18n("Name of the wallpaper plugin"), QByteArray()); options.add("p"); options.add("pixmapcache ", ki18n("The size in KB to set the pixmap cache to")); options.add("+applet", ki18n("Name of applet to add (required)")); options.add("+[args]", ki18n("Optional arguments for the applet to add")); KCmdLineArgs::addCmdLineOptions(options); KApplication app; KCmdLineArgs *args = KCmdLineArgs::parsedArgs() ; if (args->isSet("list")) { int maxLen = 0; QMap applets; foreach(const KPluginInfo &info, Plasma::Applet::listAppletInfo()) { if (info.property("NoDisplay").toBool()) continue; int len = info.pluginName().length(); if (len > maxLen) maxLen = len; QString name = info.pluginName(); QString comment = info.comment(); if (comment.isEmpty()) comment = i18n("No description available"); applets.insert(name, comment); } QMap::const_iterator it; for (it = applets.constBegin(); it != applets.constEnd(); it++) { QString applet("%1 - %2"); applet = applet.arg(it.key().leftJustified(maxLen, ' ')).arg(it.value()); std::cout << applet.toLocal8Bit().data() << std::endl; } return 0; } if (args->count() == 0) { KCmdLineArgs::usageError(i18n("No applet name specified")); } //At this point arg(0) is always set QString pluginName = args->arg(0); QVariantList appletArgs; const QString containment = args->getOption("containment"); for (int i = 1; i < args->count(); ++i) { appletArgs << args->arg(i); } PlasmoidView preview; preview.addApplet(pluginName, containment, appletArgs); preview.show(); QAction *action = KStandardAction::quit(&app, SLOT(quit()), &preview); preview.addAction(action); args->clear(); return app.exec(); } plasmate-1.0/plasmate/previewer/plasmoid/PaxHeaders.5990/plasmoidview.cpp0000644000175000001440000000013212115142004024754 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/plasmoidview.cpp0000644000175000001440000001467612115142004025427 0ustar00kokeroulisusers00000000000000/* * Copyright 2007 Frerich Raabe * Copyright 2007 Aaron Seigo * Copyright 2008 Aleix Pol * Copyright 2009 Artur Duque de Souza * * * 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. */ #include "plasmoidview.h" #include "previewcontainment.h" #include #include #include #include PlasmoidView::PlasmoidView(QWidget *parent) : QGraphicsView(parent), m_containment(0), m_applet(0) { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setScene(&m_corona); connect(&m_corona, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(sceneRectChanged(QRectF))); setAlignment(Qt::AlignCenter); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); m_containment = m_corona.addContainment("studiopreviewer"); m_containment->setFormFactor(Plasma::Planar); m_containment->setLocation(Plasma::Floating); m_containment->setAspectRatioMode(Plasma::IgnoreAspectRatio); m_containment->setWallpaper("color"); connect(m_containment, SIGNAL(appletRemoved(Plasma::Applet*)), this, SLOT(appletRemoved(Plasma::Applet*))); // we do a two-way connect here to allow the previewer containment // and main window to tell each other to save/refresh connect(m_containment, SIGNAL(refreshClicked()), parent, SLOT(emitRefreshRequest())); connect(m_containment, SIGNAL(showKonsole()), parent, SLOT(emitShowKonsole())); connect(parent, SIGNAL(refreshView()), m_containment, SLOT(refreshApplet())); setScene(&m_corona); } PlasmoidView::~PlasmoidView() { if (!m_currentPath.isEmpty() && m_applet) { KConfigGroup cg; m_applet->save(cg); cg = m_applet->config(); KConfigGroup storage = storageGroup(); storage.deleteGroup(); cg.copyTo(&storage); } if (m_containment) { KConfigGroup cg; m_containment->save(cg); cg = m_containment->config(); KConfigGroup storage = containmentStorageGroup(); storage.deleteGroup(); cg.copyTo(&storage); storage.deleteGroup("Applets"); m_containment->destroy(false); } KGlobal::config()->sync(); m_corona.saveLayout(); } bool PlasmoidView::hasStorageGroup() const { if (m_currentPath.isEmpty()) { return false; } KConfigGroup stored = KConfigGroup(KGlobal::config(), "StoredApplets"); return stored.groupList().contains(m_currentPath); } KConfigGroup PlasmoidView::storageGroup() const { KConfigGroup stored = KConfigGroup(KGlobal::config(), "StoredApplets"); return KConfigGroup(&stored, m_currentPath); } bool PlasmoidView::hasContainmentStorageGroup() const { if (m_currentPath.isEmpty()) { return false; } KConfigGroup stored = KConfigGroup(KGlobal::config(), "StoredContainments"); return stored.groupList().contains(m_currentPath); } KConfigGroup PlasmoidView::containmentStorageGroup() const { KConfigGroup stored = KConfigGroup(KGlobal::config(), "StoredContainments"); return KConfigGroup(&stored, m_currentPath); } void PlasmoidView::addApplet(const QString &name, const QString &containment, const QVariantList &args) { if (!containment.isEmpty()) { KService::List offers = KServiceTypeTrader::self()->query("Plasma/Containment", "[X-KDE-PluginInfo-Name] == '" + containment + "'"); if (offers.count() > 0) { m_containment = m_corona.addContainment(containment); setScene(m_containment->scene()); } } if (m_applet) { if (m_applet->pluginName() == name) { return; } delete m_applet; m_applet = 0; } QFileInfo info(name); if (!info.isAbsolute()) { info = QFileInfo(QDir::currentPath() + "/" + name); } m_currentPath = info.absoluteFilePath(); // load from package if we have a path if (info.exists()) { m_applet = Applet::loadPlasmoid(m_currentPath); } if (m_applet) { if (hasContainmentStorageGroup()) { KConfigGroup cg = m_containment->config(); KConfigGroup storage = containmentStorageGroup(); cg.deleteGroup(); storage.copyTo(&cg); cg.deleteGroup("Applets"); m_containment->configChanged(); } m_containment->addApplet(m_applet, QPointF(-1, -1), false); if (hasStorageGroup()) { KConfigGroup cg = m_applet->config(); KConfigGroup storage = storageGroup(); cg.deleteGroup(); storage.copyTo(&cg); m_applet->configChanged(); } } else { m_currentPath.clear(); m_applet = m_containment->addApplet(name, args, QRectF(0, 0, -1, -1)); } if (m_applet) { m_applet->setFlag(QGraphicsItem::ItemIsMovable, false); } //resize(m_applet->preferredSize().toSize()); } void PlasmoidView::clearApplets() { m_containment->clearApplets(); } void PlasmoidView::appletRemoved(Plasma::Applet *applet) { if (applet == m_applet) { m_applet = 0; } } void PlasmoidView::sceneRectChanged(const QRectF &rect) { Q_UNUSED(rect); if (m_containment) { setSceneRect(m_containment->geometry()); } } void PlasmoidView::resizeEvent(QResizeEvent *event) { QGraphicsView::resizeEvent(event); // if we do not have any applet being shown // there is no need to do all this stuff //if (!m_applet || m_applet->aspectRatioMode() != Plasma::KeepAspectRatio) { if (m_applet) { m_applet->setMaximumWidth(size().width()); m_containment->resize(size()); return; } m_containment->resize(event->size()); centerOn(m_containment); return; } plasmate-1.0/plasmate/previewer/plasmoid/PaxHeaders.5990/plasmoidview.h0000644000175000001440000000013212115142004024421 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/plasmoidview.h0000644000175000001440000000360012115142004025055 0ustar00kokeroulisusers00000000000000/* * Copyright 2007 Frerich Raabe * Copyright 2007 Aaron Seigo * Copyright 2008 Aleix Pol * Copyright 2009 Artur Duque de Souza * * 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. */ #ifndef PLASMOIDVIEW_H #define PLASMOIDVIEW_H #include "previewcontainment.h" #include #include using namespace Plasma; class PlasmoidView : public QGraphicsView { Q_OBJECT public: PlasmoidView(QWidget *parent = 0); ~PlasmoidView(); void addApplet(const QString &name, const QString &containment = QString(), const QVariantList &args = QVariantList()); void clearApplets(); private slots: void sceneRectChanged(const QRectF &rect); void resizeEvent(QResizeEvent *event); void appletRemoved(Plasma::Applet *applet); private: bool hasStorageGroup() const; KConfigGroup storageGroup() const; bool hasContainmentStorageGroup() const; KConfigGroup containmentStorageGroup() const; Plasma::Corona m_corona; Plasma::FormFactor m_formfactor; Plasma::Containment *m_containment; Plasma::Applet *m_applet; QString m_currentPath; }; #endif //PLASMOIDVIEW_H plasmate-1.0/plasmate/previewer/plasmoid/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004024305 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.616641211 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/CMakeLists.txt0000644000175000001440000000071412115142004024744 0ustar00kokeroulisusers00000000000000set(CMAKE_INCLUDE_CURRENT_DIR ON) set(containment_SRCS previewcontainment.cpp ) add_subdirectory(test) kde4_add_plugin(plasma_containment_studiopreviewer ${containment_SRCS}) target_link_libraries(plasma_containment_studiopreviewer ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS}) install(TARGETS plasma_containment_studiopreviewer DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES plasma-containment-studiopreviewer.desktop DESTINATION ${SERVICES_INSTALL_DIR}) plasmate-1.0/plasmate/previewer/plasmoid/PaxHeaders.5990/plasma-containment-studiopreviewer.desktop0000644000175000001440000000013212115142004032170 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/plasma-containment-studiopreviewer.desktop0000644000175000001440000000565212115142004032635 0ustar00kokeroulisusers00000000000000[Desktop Entry] Name=StudioPreviewer Name[da]=StudioForhÃ¥ndsviser Name[el]=StudioPreviewer Name[es]=StudioPreviewer Name[et]=Stuudio eelvaatlus Name[fi]=Studioesikatselu Name[fr]=StudioPreviewer Name[ga]=StudioPreviewer Name[gl]=Previsualizador do estudio Name[hu]=StudioPreviewer Name[km]=StudioPreviewer Name[nds]=Studio-Vöransicht Name[nl]=StudioBekijken Name[pl]=PodglÄ…d Studia Name[pt]=StudioPreviewer Name[pt_BR]=StudioPreviewer Name[ro]=StudioPreviewer Name[sk]=StudioPreviewer Name[sv]=Förhandsgranskning med Studio Name[tr]=StudioPreviewer Name[uk]=StudioPreviewer Name[x-test]=xxStudioPreviewerxx Name[zh_TW]=StudioPreviewer Comment=Containment used to preview plasmoids on Plasma Studio Comment[da]=Beholder der bruges til at forhÃ¥ndsvise plasmoids pÃ¥ Plasma Studio Comment[el]=ΣυγκεντÏωτική Ï€Ïοεπισκόπηση πλασμοειδών στο Plasma Studio Comment[es]=Contenedor usado para previsualizar plasmoides en Plasma Studio Comment[et]=Konteiner, mis võimaldab plasmoide eelvaadelda Plasma stuudios Comment[fr]=Conteneur utilisé pour afficher un aperçu des composants graphiques dans Plasma Studio Comment[gl]=Contedor para previsualizar plasmoides no estudio de Plasma. Comment[hu]=Elszigetelés a plazmoidok elÅ‘nézetének használatához a Plasma Studioban Comment[km]=ការ​ផ្ទុក​​បាន​ប្រើ​ដើម្បី​មើល​ plasmoids ជា​មុន​នៅ​លើ​ស្ទូឌីយ៉ូ​ប្លាស្មា Comment[nl]=Container gebruikt om plasmoids in Plasma Studio te bekijken Comment[pl]=Kurtyna bezpieczeÅ„stwa używana do podglÄ…du plazmoidów w Studiu Plazmy Comment[pt]=Contentor usado para antever os plasmóides no Plasma Studio Comment[pt_BR]=Contêiner usado para a antevisão de plasmoides no Plasma Studio Comment[ro]=Container folosit pentru previzualizarea plasmoizilor în Plasma Studio Comment[sk]=Zadržiavanie použité na náhľad plazmoidov v Plasma Studio Comment[sv]=Omgivning som används för att förhandsgranska Plasmoider med Plasma Studio Comment[tr]=Plasma Studio'da plasmoidlerin önizlemesinde kullanılan kapsam Comment[uk]=Контейнер, Ñкий викориÑтовуєтьÑÑ Ð´Ð»Ñ Ð¿Ð¾Ð¿ÐµÑ€ÐµÐ´Ð½ÑŒÐ¾Ð³Ð¾ переглÑду плазмоїдів у Plasma Studio Comment[x-test]=xxContainment used to preview plasmoids on Plasma Studioxx Comment[zh_TW]=用於在 Plasma Studio 上é è¦½å°å…ƒä»¶çš„容器 Icon=user-desktop Type=Service X-KDE-ServiceTypes=Plasma/Applet,Plasma/Containment X-Plasma-ContainmentCategories=development NoDisplay=true X-KDE-Library=plasma_containment_studiopreviewer X-KDE-PluginInfo-Author=The Plasma Team X-KDE-PluginInfo-Email=panel-devel@kde.org X-KDE-PluginInfo-Name=studiopreviewer X-KDE-PluginInfo-Version=1.0 X-KDE-PluginInfo-Website=http://plasma.kde.org/ X-KDE-PluginInfo-Category=Containments X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=true plasmate-1.0/plasmate/previewer/plasmoid/PaxHeaders.5990/plasmoidpreviewer.h0000644000175000001440000000013212115142004025457 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/plasmoidpreviewer.h0000644000175000001440000000244312115142004026117 0ustar00kokeroulisusers00000000000000/* * Copyright 2010 Lim Yuen Hoe * * * 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. */ #ifndef PLASMOIDPREVIEWER_H #define PLASMOIDPREVIEWER_H #include "../previewer.h" #include "plasmoidview.h" class PlasmoidPreviewer : public Previewer { Q_OBJECT signals: void refreshView(); // emitted to signal the containment to refresh public: PlasmoidPreviewer(const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 ); void showPreview(const QString &packagePath); void refreshPreview(); private: PlasmoidView* m_view; }; #endif // PLASMOIDPREVIEWER_Hplasmate-1.0/plasmate/previewer/plasmoid/PaxHeaders.5990/plasmoidpreviewer.cpp0000644000175000001440000000013212115142004026012 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/plasmoid/plasmoidpreviewer.cpp0000644000175000001440000000133512115142004026451 0ustar00kokeroulisusers00000000000000/* * Copyright 2010 Lim Yuen Hoe * * 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. * */ #include "plasmoidpreviewer.h" PlasmoidPreviewer::PlasmoidPreviewer(const QString & title, QWidget * parent, Qt::WindowFlags flags) : Previewer(title, parent, flags) { m_view = new PlasmoidView(this); setWidget(m_view); } void PlasmoidPreviewer::showPreview(const QString &packagePath) { m_view->addApplet(packagePath); } void PlasmoidPreviewer::refreshPreview() { emit refreshView(); } plasmate-1.0/plasmate/previewer/PaxHeaders.5990/windowswitcher0000644000175000001440000000013112115142004022737 xustar000000000000000030 mtime=1362412548.618641191 29 atime=1362412548.62964109 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/0000755000175000001440000000000012115142004023452 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/previewer/windowswitcher/PaxHeaders.5990/windowswitcher.cpp0000644000175000001440000000013212115142004026601 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/windowswitcher.cpp0000644000175000001440000001350612115142004027243 0ustar00kokeroulisusers00000000000000/******************************************************************** KWin - the KDE window manager This file is part of the KDE project. Copyright (C) 2009, 2011 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 . *********************************************************************/ // own #include "windowswitcher.h" #include "thumbnailitem.h" #include #include #include #include #include #include #include #include #include #include #include #include #include WindowSwitcher::WindowSwitcher(QWidget* parent) : QDeclarativeView(parent) { setAttribute(Qt::WA_TranslucentBackground); setAutoFillBackground(false); QPalette pal = palette(); pal.setColor(backgroundRole(), Qt::transparent); setPalette(pal); setResizeMode(QDeclarativeView::SizeRootObjectToView); foreach (const QString &importPath, KGlobal::dirs()->findDirs("module", "imports")) { engine()->addImportPath(importPath); } foreach (const QString &importPath, KGlobal::dirs()->findDirs("data", "kwin/tabbox")) { engine()->addImportPath(importPath); } ExampleClientModel *model = new ExampleClientModel(this); engine()->addImageProvider(QLatin1String("client"), new TabBoxImageProvider(model)); KDeclarative kdeclarative; kdeclarative.setDeclarativeEngine(engine()); kdeclarative.initialize(); kdeclarative.setupBindings(); qmlRegisterType("org.kde.kwin", 0, 1, "ThumbnailItem"); rootContext()->setContextProperty("clientModel", model); rootContext()->setContextProperty("sourcePath", QString()); rootContext()->setContextProperty("name", QString()); setSource(KStandardDirs::locate("data", "plasmate/tabboxdelegate.qml")); } WindowSwitcher::~WindowSwitcher() { } void WindowSwitcher::setLayout(const QString &path, const QString &name) { rootContext()->setContextProperty("sourcePath", path); rootContext()->setContextProperty("name", name); } TabBoxImageProvider::TabBoxImageProvider(QAbstractListModel* model) : QDeclarativeImageProvider(QDeclarativeImageProvider::Pixmap) , m_model(model) { } QPixmap TabBoxImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) { bool ok = false; QStringList parts = id.split('/'); const int index = parts.first().toInt(&ok); if (!ok) { return QDeclarativeImageProvider::requestPixmap(id, size, requestedSize); } QSize s(32, 32); if (requestedSize.isValid()) { s = requestedSize; } *size = s; QPixmap icon(KIcon(m_model->data(m_model->index(index), Qt::UserRole+3).toString()).pixmap(s)); if (parts.size() > 2) { KIconEffect *effect = KIconLoader::global()->iconEffect(); KIconLoader::States state = KIconLoader::DefaultState; if (parts.at(2) == QLatin1String("selected")) { state = KIconLoader::ActiveState; } else if (parts.at(2) == QLatin1String("disabled")) { state = KIconLoader::DisabledState; } icon = effect->apply(icon, KIconLoader::Desktop, state); } return icon; } ExampleClientModel::ExampleClientModel (QObject* parent) : QAbstractListModel (parent) { QHash roles; roles[Qt::UserRole] = "caption"; roles[Qt::UserRole+1] = "minimized"; roles[Qt::UserRole+2] = "desktopName"; roles[Qt::UserRole+4] = "windowId"; setRoleNames(roles); init(); } ExampleClientModel::~ExampleClientModel() { } void ExampleClientModel::init() { QList applications; applications << "konqbrowser" << "KMail2" << "systemsettings" << "dolphin"; foreach (const QString& application, applications) { KService::Ptr service = KService::serviceByStorageId("kde4-" + application + ".desktop"); if (service) { m_nameList << service->entryPath(); } } } QVariant ExampleClientModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) { return QVariant(); } switch (role) { case Qt::DisplayRole: case Qt::UserRole: return KDesktopFile(m_nameList.at(index.row())).readName(); case Qt::UserRole+1: return false; case Qt::UserRole+2: return i18nc("An example Desktop Name", "Desktop 1"); case Qt::UserRole+3: return KDesktopFile(m_nameList.at(index.row())).readIcon(); case Qt::UserRole+4: const QString desktopFile = KDesktopFile(m_nameList.at(index.row())).fileName().split('/').last(); if (desktopFile == "konqbrowser.desktop") { return ThumbnailItem::Konqueror; } else if (desktopFile == "KMail2.desktop") { return ThumbnailItem::KMail; } else if (desktopFile == "systemsettings.desktop") { return ThumbnailItem::Systemsettings; } else if (desktopFile == "dolphin.desktop") { return ThumbnailItem::Dolphin; } return 0; } return QVariant(); } int ExampleClientModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent) return m_nameList.size(); }plasmate-1.0/plasmate/previewer/windowswitcher/PaxHeaders.5990/standalone0000644000175000001440000000013112115142004025067 xustar000000000000000030 mtime=1362412548.617641201 29 atime=1362412548.62964109 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/windowswitcher/standalone/0000755000175000001440000000000012115142004025602 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/previewer/windowswitcher/standalone/PaxHeaders.5990/windowswitcherpreviewer.h0000644000175000001440000000013212115142004032327 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/windowswitcher/standalone/windowswitcherpreviewer.h0000644000175000001440000000262012115142004032764 0ustar00kokeroulisusers00000000000000/******************************************************************** * This file is part of the KDE project. * * Copyright (C) 2012 Antonis Tsiapaliokas * * 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 . *********************************************************************/ #ifndef WINDOWSWITCHERPREVIEWER_H #define WINDOWSWITCHERPREVIEWER_H #include "../tabboxpreviewer.h" #include #include #include class WindowSwitcherPreviewer : public KDialog { Q_OBJECT public: WindowSwitcherPreviewer(QWidget *parent = 0); public Q_SLOTS: void loadPreviewer(const QString& filePath); private: QWidget *tmpWidget; QVBoxLayout *tmpLayout; TabBoxPreviewer *m_previewer; KUrlRequester *m_filePath; }; #endif // WINDOWSWITCHERPREVIEWER_Hplasmate-1.0/plasmate/previewer/windowswitcher/standalone/PaxHeaders.5990/main.cpp0000644000175000001440000000013212115142004026575 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/windowswitcher/standalone/main.cpp0000644000175000001440000000323412115142004027234 0ustar00kokeroulisusers00000000000000/* Copyright 2012 Antonis Tsiapaliokas 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 . */ #include #include #include #include #include #include "windowswitcherpreviewer.h" int main(int argc, char *argv[]) { KAboutData aboutData("KWin-WindowSwitcherPreviewer", 0, ki18n("KWin Window Switcher Previewer"), "0.1alpha3", ki18n("Previewer for Window Switcher"), KAboutData::License_GPL, ki18n("Copyright 2012 Plasma Development Team"), KLocalizedString(), "", "plasma-devel@kde.org"); aboutData.addAuthor(ki18n("Antonis Tsiapaliokas"), ki18n("Author"), "kok3rs@gmail.com"); aboutData.setProgramIconName("window-duplicate"); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineOptions options; KCmdLineArgs::addCmdLineOptions(options); KCmdLineArgs::parsedArgs(); KApplication app; QPointer preview = new WindowSwitcherPreviewer(); preview->show(); return app.exec(); } plasmate-1.0/plasmate/previewer/windowswitcher/standalone/PaxHeaders.5990/windowswitcherpreviewer.cp0000644000175000001440000000013212115142004032502 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/windowswitcher/standalone/windowswitcherpreviewer.cpp0000644000175000001440000000331512115142004033321 0ustar00kokeroulisusers00000000000000/* Copyright 2012 Antonis Tsiapaliokas 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 . */ #include "windowswitcherpreviewer.h" #include #include WindowSwitcherPreviewer::WindowSwitcherPreviewer(QWidget* parent) : KDialog(parent) { setMinimumSize(400,370); tmpWidget = new QWidget(); tmpLayout = new QVBoxLayout(); m_previewer = new TabBoxPreviewer(i18nc("Window Title", "Window Switcher Previewer")); m_filePath = new KUrlRequester(tmpWidget); QLabel *welcome = new QLabel(tmpWidget); m_filePath->setFilter("*.qml"); welcome->setText(i18n("Welcome to the Window Switcher Previewer")); m_previewer->hide(); tmpLayout->addWidget(welcome); tmpLayout->addWidget(m_previewer); tmpLayout->addWidget(m_filePath); connect(m_filePath, SIGNAL(textChanged(const QString&)), this, SLOT(loadPreviewer(const QString&))); tmpWidget->setLayout(tmpLayout); setMainWidget(tmpWidget); } void WindowSwitcherPreviewer::loadPreviewer(const QString& filePath) { m_previewer->show(); m_previewer->setLayoutPath(m_filePath->text()); } #include "moc_windowswitcherpreviewer.cpp"plasmate-1.0/plasmate/previewer/windowswitcher/PaxHeaders.5990/thumbnailitem.cpp0000644000175000001440000000013212115142004026363 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/thumbnailitem.cpp0000644000175000001440000000517312115142004027026 0ustar00kokeroulisusers00000000000000/******************************************************************** KWin - the KDE window manager This file is part of the KDE project. Copyright (C) 2011 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 . *********************************************************************/ #include "thumbnailitem.h" // Qt #include #include #include // KDE #include #include ThumbnailItem::ThumbnailItem(QDeclarativeItem* parent) : QDeclarativeItem(parent) , m_wId(0) , m_image() { setFlags(flags() & ~QGraphicsItem::ItemHasNoContents); } ThumbnailItem::~ThumbnailItem() { } void ThumbnailItem::setWId(qulonglong wId) { m_wId = wId; emit wIdChanged(wId); findImage(); } void ThumbnailItem::findImage() { QString imagePath; switch (m_wId) { case Konqueror: imagePath = KStandardDirs::locate("data", "kwin/kcm_kwintabbox/konqueror.png"); break; case Systemsettings: imagePath = KStandardDirs::locate("data", "kwin/kcm_kwintabbox/systemsettings.png"); break; case KMail: imagePath = KStandardDirs::locate("data", "kwin/kcm_kwintabbox/kmail.png"); break; case Dolphin: imagePath = KStandardDirs::locate("data", "kwin/kcm_kwintabbox/dolphin.png"); break; default: // ignore break; } if (imagePath.isNull()) { m_image = QImage(); } else { m_image = QImage(imagePath); } } void ThumbnailItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { if (m_image.isNull()) { // no image: default behavior QDeclarativeItem::paint(painter, option, widget); } QSizeF difference(boundingRect().width() - m_image.width(), boundingRect().height() - m_image.height()); const QRectF drawRect(boundingRect().x() + difference.width()/2.0, boundingRect().y(), m_image.width(), m_image.height()); painter->drawImage(drawRect, m_image); }plasmate-1.0/plasmate/previewer/windowswitcher/PaxHeaders.5990/windowswitcher.h0000644000175000001440000000013212115142004026246 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/windowswitcher.h0000644000175000001440000000365012115142004026707 0ustar00kokeroulisusers00000000000000/******************************************************************** KWin - the KDE window manager This file is part of the KDE project. Copyright (C) 2009, 2011 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 . *********************************************************************/ #ifndef WINDOWSWITCHER #define WINDOWSWITCHER #include #include #include class WindowSwitcher : public QDeclarativeView { Q_OBJECT public: WindowSwitcher(QWidget *parent = NULL); virtual ~WindowSwitcher(); void setLayout(const QString &path, const QString &name = QString()); }; class TabBoxImageProvider : public QDeclarativeImageProvider { public: TabBoxImageProvider(QAbstractListModel *model); virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize); private: QAbstractListModel *m_model; }; class ExampleClientModel : public QAbstractListModel { Q_OBJECT public: ExampleClientModel(QObject *parent = NULL); virtual ~ExampleClientModel(); virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; private: void init(); QStringList m_nameList; }; #endif // WINDOWSWITCHER plasmate-1.0/plasmate/previewer/windowswitcher/PaxHeaders.5990/thumbnails0000644000175000001440000000013212115142004025106 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.630641082 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/thumbnails/0000755000175000001440000000000012115142004025620 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/previewer/windowswitcher/thumbnails/PaxHeaders.5990/systemsettings.png0000644000175000001440000000013212115142004030776 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/thumbnails/systemsettings.png0000644000175000001440000000000012115142004031421 0ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/previewer/windowswitcher/thumbnails/PaxHeaders.5990/konqueror.png0000644000175000001440000000013212115142004027716 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/thumbnails/konqueror.png0000644000175000001440000000000012115142004030341 0ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/previewer/windowswitcher/thumbnails/PaxHeaders.5990/kmail.png0000644000175000001440000000013212115142004026766 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/thumbnails/kmail.png0000644000175000001440000000000012115142004027411 0ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/previewer/windowswitcher/thumbnails/PaxHeaders.5990/dolphin.png0000644000175000001440000000013212115142004027326 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/thumbnails/dolphin.png0000644000175000001440000000000012115142004027751 0ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/previewer/windowswitcher/PaxHeaders.5990/tabboxpreviewer.cpp0000644000175000001440000000013212115142004026731 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/tabboxpreviewer.cpp0000644000175000001440000000476412115142004027401 0ustar00kokeroulisusers00000000000000/******************************************************************** * This file is part of the KDE project. * * Copyright (C) 2012 Antonis Tsiapaliokas * * 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 . *********************************************************************/ #include "tabboxpreviewer.h" #include #include #include #include #include #include TabBoxPreviewer::TabBoxPreviewer(const QString & title, QWidget * parent, Qt::WindowFlags flags) : Previewer(title, parent, flags) { m_view = new WindowSwitcher(this); connect(m_view->rootObject(), SIGNAL(clicked()), this, SLOT(signalForward())); init(); } void TabBoxPreviewer::showPreview(const QString &packagePath) { m_view->setLayout(packageMainFile(packagePath)); } QString TabBoxPreviewer::packageMainFile(const QString& projectPath) { KConfig c(projectPath + '/' + "metadata.desktop"); KConfigGroup projectInformation(&c, "Desktop Entry"); const QString relativeFilenamePath = projectInformation.readEntry("X-Plasma-MainScript"); m_fullFilenamePath = KStandardDirs::locate("data", projectPath + "/contents" + '/' + relativeFilenamePath); return m_fullFilenamePath; } void TabBoxPreviewer::refreshPreview() { if (m_view) { m_view =0; m_view = new WindowSwitcher(this); connect(m_view->rootObject(), SIGNAL(clicked()), this, SLOT(signalForward())); setLayoutPath(m_fullFilenamePath); init(); } } void TabBoxPreviewer::setLayoutPath(const QString& filePath) { if (m_view) { m_view->setLayout(filePath); } } void TabBoxPreviewer::signalForward() { refreshPreview(); } void TabBoxPreviewer::init() { QVBoxLayout *layout = new QVBoxLayout(this); layout->addWidget(m_view); QWidget *w = new QWidget(this); w->setLayout(layout); setWidget(w); }plasmate-1.0/plasmate/previewer/windowswitcher/PaxHeaders.5990/tabboxdelegate.qml0000644000175000001440000000013212115142004026502 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/windowswitcher/tabboxdelegate.qml0000644000175000001440000000443312115142004027143 0ustar00kokeroulisusers00000000000000/******************************************************************** This file is part of the KDE project. Copyright (C) 2011 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 . *********************************************************************/ import QtQuick 1.0 import org.kde.plasma.components 0.1 as PlasmaComponents Item { id : preview signal clicked; PlasmaComponents.ToolButton { id: image iconSource: "view-refresh" smooth: true flat: true anchors.horizontalCenter: parent.horizontalCenter onClicked: { preview.clicked(); } } Loader { id: loader property int screenWidth : preview.width property int screenHeight : preview.height property bool allDesktops: true width: preview.width height: preview.height - textElement.height source: sourcePath anchors.top : image.bottom onLoaded: { if (item.allDesktops != undefined) { item.allDesktops = allDesktops; } if (item.setModel) { item.setModel(clientModel); } if (item.screenWidth != undefined) { item.screenWidth = screenWidth; } if (item.screenHeight != undefined) { item.screenHeight = screenHeight; } item.width = preview.width; item.height = preview.height - textElement.height; } } Text { id: textElement font.bold: true text: name anchors { horizontalCenter: parent.horizontalCenter bottom: parent.bottom } visible: true } }plasmate-1.0/plasmate/previewer/windowswitcher/PaxHeaders.5990/thumbnailitem.h0000644000175000001440000000013212115142004026030 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/thumbnailitem.h0000644000175000001440000000317312115142004026471 0ustar00kokeroulisusers00000000000000/******************************************************************** KWin - the KDE window manager This file is part of the KDE project. Copyright (C) 2011 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 . *********************************************************************/ #ifndef THUMBNAILITEM_H #define THUMBNAILITEM_H #include class ThumbnailItem : public QDeclarativeItem { Q_OBJECT Q_PROPERTY(qulonglong wId READ wId WRITE setWId NOTIFY wIdChanged SCRIPTABLE true) public: ThumbnailItem(QDeclarativeItem *parent = 0); virtual ~ThumbnailItem(); qulonglong wId() const { return m_wId; } void setWId(qulonglong wId); virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); enum Thumbnail { Konqueror = 1, KMail, Systemsettings, Dolphin }; Q_SIGNALS: void wIdChanged(qulonglong wid); private: void findImage(); qulonglong m_wId; QImage m_image; }; #endif // THUMBNAILITEM_H plasmate-1.0/plasmate/previewer/windowswitcher/PaxHeaders.5990/tabboxpreviewer.h0000644000175000001440000000013212115142004026376 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/previewer/windowswitcher/tabboxpreviewer.h0000644000175000001440000000345612115142004027043 0ustar00kokeroulisusers00000000000000/******************************************************************** * This file is part of the KDE project. * * Copyright (C) 2012 Antonis Tsiapaliokas * * 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 . *********************************************************************/ #ifndef TABBOXPREVIEWER_H #define TABBOXPREVIEWER_H #include "../previewer.h" #include "windowswitcher.h" class TabBoxPreviewer : public Previewer { Q_OBJECT public: TabBoxPreviewer(const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0); void showPreview(const QString &packagePath); /** * KWin::TabBox::LayoutPreview requires the fullpath of our main QML file in order to load the previewer * so here we retrieve the fullpath inside from the projectpath. For that task we will use the relative * path from our mail QML file, which is located inside the metadata.desktop file. **/ QString packageMainFile(const QString &projectpath); void setLayoutPath(const QString &filePath); void init(); void refreshPreview(); public Q_SLOTS: void signalForward(); private: WindowSwitcher *m_view; QString m_fullFilenamePath; }; #endif // TABBOXPREVIEWER_Hplasmate-1.0/plasmate/previewer/PaxHeaders.5990/previewer.cpp0000644000175000001440000000013212115142004022451 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/previewer.cpp0000644000175000001440000000216012115142004023105 0ustar00kokeroulisusers00000000000000/* Copyright 2010 Lim Yuen Hoe 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 . */ #include "previewer.h" #include Previewer::Previewer(const QString & title, QWidget * parent, Qt::WindowFlags flags) : QDockWidget(title, parent, flags) { } Previewer::Previewer(QWidget * parent, Qt::WindowFlags flags) : QDockWidget(parent, flags) { } void Previewer::emitRefreshRequest() { emit refreshRequested(); } void Previewer::emitShowKonsole() { emit showKonsole(); } void Previewer::setKonsolePreviewerVisible(bool visible) { } plasmate-1.0/plasmate/previewer/PaxHeaders.5990/previewer.h0000644000175000001440000000013212115142004022116 xustar000000000000000030 mtime=1362412548.617641201 30 atime=1362412548.617641201 30 ctime=1362412548.617641201 plasmate-1.0/plasmate/previewer/previewer.h0000644000175000001440000000405712115142004022561 0ustar00kokeroulisusers00000000000000/* Copyright 2010 Lim Yuen Hoe 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 . * */ #ifndef PREVIEWER_H #define PREVIEWER_H #include // This is the base previewer dockwidget class // All previewer types should inherit from this class class Previewer : public QDockWidget { Q_OBJECT signals: void refreshRequested(); void showKonsole(); public: Previewer(const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 ); Previewer(QWidget * parent = 0, Qt::WindowFlags flags = 0 ); /** * Subclasses should override this method with actual previewing code */ virtual void showPreview(const QString &packagePath) = 0; /** * Subclasses should override this method with code that refreshes the preview */ virtual void refreshPreview() = 0; /** * Subclasses should override this method with code that will show/hide the konsole previewer */ virtual void setKonsolePreviewerVisible(bool visible = true); public slots: /** * Emits refreshRequested(), which should signal the editor to save its contents * and then invoke refresh() on the previewer. All subclasses should call/connect to * this when the user requests a refresh. */ void emitRefreshRequest(); /** * Emits showKonsole(), which will show the konsole. All subclasses should call/connect * to this when the user requests a to see the konsole. **/ void emitShowKonsole(); }; #endif // PREVIEWER_Hplasmate-1.0/plasmate/PaxHeaders.5990/konsole0000644000175000001440000000013212115142004017322 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.616641211 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/konsole/0000755000175000001440000000000012115142004020034 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/konsole/PaxHeaders.5990/konsolepreviewer.cpp0000644000175000001440000000013212115142004023506 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/konsole/konsolepreviewer.cpp0000644000175000001440000001007112115142004024142 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliokas * * 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. * */ #include "konsolepreviewer.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include QWeakPointer KonsolePreviewer::msgHandler; KonsolePreviewer::KonsolePreviewer(const QString & title, QWidget *parent) : QDockWidget(title, parent), m_textEdit(0) { QVBoxLayout *layout = new QVBoxLayout(); KToolBar *toolBar = new KToolBar(this, true, true); toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); KAction *clear = KStandardAction::clear(this, SLOT(clearOutput()), this); KAction *save = KStandardAction::save(this, SLOT(saveOutput()), this); toolBar->addAction(clear); toolBar->addAction(save); m_textEdit = new KTextEdit(this); //don't let the user modify the output m_textEdit->setReadOnly(true); //make the background white QPalette p = m_textEdit->palette(); p.setColor(QPalette::Base, Qt::white); m_textEdit->setPalette(p); layout->addWidget(toolBar); layout->addWidget(m_textEdit); QWidget *tmpWidget = new QWidget(this); tmpWidget->setLayout(layout); setWidget(tmpWidget); KonsolePreviewer::msgHandler = this; } KonsolePreviewer::~KonsolePreviewer() { } void KonsolePreviewer::clearOutput() { m_textEdit->clear(); } void KonsolePreviewer::saveOutput() { KUser user; KUrl destination = KFileDialog::getSaveUrl(KUrl(user.homeDir()), ".*", this); if (destination.isEmpty()) { return; } m_textEdit->toPlainText(); QFile f(destination.pathOrUrl()); f.open(QIODevice::ReadWrite); f.write(m_textEdit->toPlainText().toAscii()); } void KonsolePreviewer::customMessageHandler(QtMsgType type, const char* msg) { static QMutex mutex; QMutexLocker locker(&mutex); if (KonsolePreviewer::msgHandler) { KonsolePreviewer::msgHandler.data()->debugMessage(type, msg); } } void KonsolePreviewer::debugMessage(QtMsgType type, const char *msg) { QString txt; if (QString(msg).startsWith("plasmate") || //don't include the plasmate specific output QString(msg).startsWith("Object::") || // don't include QObject warnings QString(msg).startsWith("QGraphicsScene::") || //don't include QGraphicsScene warnings QString(msg).startsWith(" X Error")) //don't include silly X errors { std::cout << msg << std::endl; } else { switch (type) { case QtDebugMsg: txt = QString("Debug: %1").arg(msg); break; case QtWarningMsg: txt = QString("Warning: %1").arg(msg); break; case QtCriticalMsg: txt = QString("Critical: %1").arg(msg); break; case QtFatalMsg: txt = QString("Fatal: %1").arg(msg); abort(); } } if (KonsolePreviewer::msgHandler) { KonsolePreviewerDebugEvent *e = new KonsolePreviewerDebugEvent(txt); QCoreApplication::postEvent(this, e); } } void KonsolePreviewer::customEvent(QEvent *event) { if (static_cast(event->type()) == KonsolePreviewer::MessageEventType) { if (!m_textEdit) { return; } m_textEdit->append(dynamic_cast(event)->debugOutput); } } KonsolePreviewerDebugEvent::KonsolePreviewerDebugEvent(const QString& debugOutput) :QEvent(static_cast(KonsolePreviewer::MessageEventType)) { this->debugOutput = debugOutput; } KonsolePreviewerDebugEvent::~KonsolePreviewerDebugEvent() { } plasmate-1.0/plasmate/konsole/PaxHeaders.5990/konsolepreviewer.h0000644000175000001440000000013212115142004023153 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/konsole/konsolepreviewer.h0000644000175000001440000000332112115142004023607 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliokas * * 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. */ #ifndef KONSOLEPREVIEWER_H #define KONSOLEPREVIEWER_H #include #include #include class KTextEdit; class KonsolePreviewer : public QDockWidget { Q_OBJECT public: KonsolePreviewer(const QString & title, QWidget *parent = 0); ~KonsolePreviewer(); enum EventType { MessageEventType = QEvent::User + 1 }; static void customMessageHandler(QtMsgType type, const char *msg); static QWeakPointer msgHandler; void debugMessage(QtMsgType type, const char *msg); protected: virtual void customEvent(QEvent *event); public Q_SLOTS: void clearOutput(); void saveOutput(); private: KTextEdit *m_textEdit; }; class KonsolePreviewerDebugEvent: public QEvent { public: KonsolePreviewerDebugEvent(const QString& debugOutput); ~KonsolePreviewerDebugEvent(); QString debugOutput; }; #endif // KONSOLEPREVIEWER_H plasmate-1.0/plasmate/PaxHeaders.5990/Messages.sh0000644000175000001440000000012712115142004020034 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/Messages.sh0000644000175000001440000000035412115142004020467 0ustar00kokeroulisusers00000000000000#! /usr/bin/env bash $EXTRACTRC `find -name \*.ui -o -name \*.rc | grep -v '/test-kpart/'` >> rc.cpp || exit 11 $XGETTEXT `find -name \*.cpp -o -name \*.h | grep -v '/test/' | grep -v '/test-kpart/'` -o $podir/plasmate.pot rm -f rc.cpp plasmate-1.0/plasmate/PaxHeaders.5990/startpage.ui0000644000175000001440000000013212115142004020256 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/startpage.ui0000644000175000001440000006024312115142004020720 0ustar00kokeroulisusers00000000000000 StartPage 0 0 1000 664 24 0 0 0 0 0 <h3>Create a new Addon...</h3> 0 0 255 255 255 255 255 255 255 255 255 QFrame::Plain 32 32 <h3>Continue working on...</h3> 0 10 255 255 255 255 255 255 255 255 255 QFrame::Plain 32 32 <h3>Import an existing project...</h3> Local folder: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 16777215 16777215 KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly Load Local package file: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 16777215 16777215 Import Download: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Download Addon Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::Expanding 20 0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;"> <p style=" margin-top:14px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:large; font-weight:600;">Create a new Addon...</span></p></body></html> QFormLayout::ExpandingFieldsGrow Addon Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter projectName Author: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter authorTextField Email: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter emailTextField Language: radioButtonDe QFrame::NoFrame QFrame::Raised Qt Quick (QML) true JavaScript false Python false true Ruby 0 0 You can change the above information later in the Metadata editor in the project's file list. true Qt::Horizontal 40 20 Back false &Create! true 0 0 Please ensure that your Addon's name will be globally unique; this is easiest to achieve by using a "reverse domain name" such as org.myproject.Addonname. true Qt::Vertical 20 0 0 0 0 0 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;"> <p style=" margin-top:14px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:large; font-weight:600;">Create and Share Plasma Addons</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">With Plasmate, you can easily create your own Plasma Addons, for example Plasma written in Qt Quick, JavaScript, Python or Ruby. Plasmate guides you through the process of importing an existing Addon or creating a new one from scratch, implementing your functionality, and exporting ready-to-install Plasma Packages, either to your computer, or publishing to the world using the Get Hot New Stuff System. <br /></p> <p style=" margin-top:14px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:large; font-weight:600;">Get started with Plasmate...</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Plasmate provides all the tools you need to learn creating new Plasma Widgets. </p> <ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Follow a <span style=" font-weight:600;">Tutorial</span> to gather inspiration and find out how to turn your ideas into reality. </li> <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Browse the online <span style=" font-weight:600;">Documentation</span> for information about the scripting API. </li> <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Work on your project in the <span style=" font-weight:600;">Editor</span> edit scripts and add resources. </li> <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Preview</span> your widget as you work on it. </li> <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Export and Install</span> the result as a Plasma package. </li> <li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Publish</span> your creation via <span style=" font-style:italic;">Get Hot New Stuff</span>. </li></ul> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Have fun creating! </p></body></html> Qt::AlignJustify|Qt::AlignTop true 4 KLineEdit QLineEdit
klineedit.h
KPushButton QPushButton
kpushbutton.h
KListWidget QListWidget
klistwidget.h
KUrlRequester QFrame
kurlrequester.h
KMessageWidget QWidget
kmessagewidget.h
1
projectName authorTextField emailTextField radioButtonJs radioButtonPy radioButtonRb newProjectButton cancelNewProjectButton importPackage projectName returnPressed() newProjectButton animateClick() 705 84 705 84 authorTextField returnPressed() newProjectButton animateClick() 705 84 705 84 emailTextField returnPressed() newProjectButton animateClick() 705 84 705 84 localProject returnPressed() loadLocalProject click() 793 571 913 571 importPackage returnPressed() importPackageButton animateClick() 821 604 936 607
plasmate-1.0/plasmate/PaxHeaders.5990/mainwindow.cpp0000644000175000001440000000013212115142004020605 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/mainwindow.cpp0000644000175000001440000007667512115142004021267 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Riccardo Iaconelli 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 . */ #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 #include #include #include #include #include "editors/editpage.h" #include "editors/metadata/metadataeditor.h" #include "editors/imageviewer/imageviewer.h" #include "editors/text/texteditor.h" #include "editors/kconfigxt/kconfigxteditor.h" #include "savesystem/timeline.h" #include "mainwindow.h" #include "packagemodel.h" #include "sidebar.h" #include "startpage.h" #include "konsole/konsolepreviewer.h" #include "previewer/plasmoid/plasmoidpreviewer.h" #include "previewer/runner/runnerpreviewer.h" #include "previewer/windowswitcher/tabboxpreviewer.h" #include "publisher/publisher.h" #include "docbrowser/docbrowser.h" #include "modeltest/modeltest.h" static const int STATE_VERSION = 0; MainWindow::CentralContainer::CentralContainer(QWidget* parent) : QWidget(parent), m_curMode(Preserve), m_curWidget(0) { m_layout = new QVBoxLayout(); setLayout(m_layout); } void MainWindow::CentralContainer::switchTo(QWidget* newWidget, SwitchMode mode) { if (m_curWidget == newWidget) { return; } if (m_curWidget) { m_curWidget->hide(); m_layout->removeWidget(m_curWidget); if (m_curMode == DeleteAfter) { delete m_curWidget; } } m_curMode = mode; m_curWidget = newWidget; m_layout->addWidget(m_curWidget); m_curWidget->show(); } MainWindow::MainWindow(QWidget *parent) : KParts::MainWindow(parent, Qt::Widget), m_sidebar(0), m_timeLine(0), m_previewerWidget(0), m_metaEditor(0), m_publisher(0), m_browser(0), m_notesWidget(0), m_textEditor(0), m_kconfigXtEditor(0), m_konsoleWidget(0), m_filelist(0), m_editPage(0), m_imageViewer(0), m_model(0), m_oldTab(0), // we start from startPage m_docksCreated(false), m_isPlasmateCreatedPackage(true), m_part(0), m_notesPart(0) { setXMLFile("plasmateui.rc"); setupActions(); createMenus(); toolBar()->hide(); menuBar()->hide(); m_startPage = new StartPage(this); connect(m_startPage, SIGNAL(projectSelected(QString)), this, SLOT(loadProject(QString))); m_central = new CentralContainer(this); setCentralWidget(m_central); m_central->switchTo(m_startPage); setDockOptions(QMainWindow::AllowNestedDocks); // why not? if (autoSaveConfigGroup().entryMap().isEmpty()) { setWindowState(Qt::WindowMaximized); } } MainWindow::~MainWindow() { // Saving layout position KConfigGroup configDock(KGlobal::config(), "DocksPosition"); configDock.writeEntry("MainWindowLayout", saveState(STATE_VERSION)); // if the user closes the application with an editor open, should // save its contents saveEditorData(); factory()->removeClient(m_part); delete m_part; delete m_metaEditor; delete m_publisher; delete m_editPage; delete m_filelist; if (m_previewerWidget) { configDock.writeEntry("PreviewerHeight", m_previewerWidget->height()); configDock.writeEntry("PreviewerWidth", m_previewerWidget->width()); delete m_previewerWidget; } if (m_timeLine) { configDock.writeEntry("TimeLineLocation", QVariant(m_timeLine->location())); delete m_timeLine; } KGlobal::config()->sync(); } void MainWindow::closeEvent(QCloseEvent *event) { saveProjectState(); KParts::MainWindow::closeEvent(event); //This is the last widget which will close before plasmate //exits. Even when we go back to the startpage, we just change //the mainwidget (check the method MainWindow::CentralContaineri::switchTo) //so its safe now to exit the application qApp->exit(); } void MainWindow::toggleDocumentation() { showDocumentation(!m_browser || m_browser->isHidden()); } void MainWindow::showDocumentation(bool show) { if (!m_browser) { if (!show) { return; } m_browser = new DocBrowser(m_model, this); connect(m_browser, SIGNAL(visibilityChanged(bool)), this, SLOT(updateActions())); m_browser->setObjectName("Documentation"); // FIXME: should open the same place it closed at addDockWidget(Qt::LeftDockWidgetArea, m_browser); } m_browser->setVisible(show); if (show) { m_browser->focusSearchField(); } } void MainWindow::createMenus() { menuBar()->addMenu(helpMenu()); setupGUI(ToolBar | Keys | StatusBar | Save); } void MainWindow::quit() { qApp->closeAllWindows(); } KAction *MainWindow::addAction(QString text, const char * icon, const char *slot, const char *name, const KShortcut &shortcut) { KAction *action = new KAction(this); action->setText(text); action->setIcon(KIcon(icon)); action->setShortcut(shortcut); connect(action, SIGNAL(triggered(bool)), this, slot); actionCollection()->addAction(name, action); return action; } void MainWindow::setupActions() { KAction *close = KStandardAction::close(this, SLOT(closeProject()), actionCollection()); close->setText(i18n("Close Project")); KAction *quitAction = KStandardAction::quit(this, SLOT(quit()), actionCollection()); QWidget::addAction(quitAction); KAction *refresh = KStandardAction::redisplay(this, SLOT(saveAndRefresh()), actionCollection()); refresh->setShortcut(Qt::CTRL + Qt::Key_F5); refresh->setText(i18n("Refresh Preview")); addAction(i18n("Console"), "utilities-terminal", SLOT(toggleKonsolePreviewer()), "konsole")->setCheckable(true); addAction(i18n("Install Project"), "plasmagik", SLOT(installPackage()), "installproject", KShortcut(Qt::META + Qt::Key_I)); addAction(i18n("Create Save Point"), "document-save", SLOT(selectSavePoint()), "savepoint", KStandardShortcut::save()); addAction(i18n("Publish"), "krfb", SLOT(selectPublish()), "publish"); addAction(i18n("Preview"), "user-desktop", SLOT(togglePreview()), "preview")->setCheckable(true); addAction(i18n("Notes"), "accessories-text-editor", SLOT(toggleNotes()), "notes")->setCheckable(true); addAction(i18n("Files"), "system-file-manager", SLOT(toggleFileList()), "file_list")->setCheckable(true); addAction(i18n("Timeline"), "process-working", SLOT(toggleTimeLine()), "timeline")->setCheckable(true); addAction(i18n("Documentation"), "help-contents", SLOT(toggleDocumentation()), "documentation")->setCheckable(true); } void MainWindow::updateActions() { actionCollection()->action("preview")->setChecked(m_previewerWidget && m_previewerWidget->isVisible()); actionCollection()->action("notes")->setChecked(m_notesWidget && m_notesWidget->isVisible()); actionCollection()->action("file_list")->setChecked(m_filelist && m_filelist->isVisible()); actionCollection()->action("timeline")->setChecked(m_timeLine && m_timeLine->isVisible()); actionCollection()->action("documentation")->setChecked(m_browser && m_browser->isVisible()); } void MainWindow::toggleActions() { KDesktopFile desktopFile(m_packagePath + "/metadata.desktop"); QString projectApi = desktopFile.desktopGroup().readEntry("X-Plasma-API", QString()); if (projectApi == "python" || projectApi == "ruby-script") { //Python and ruby bindings doesn't support kDebug, //so the konsole previewer cannot retrieve any debug output. //Until this issue is being fixed we are hiding the konsole previewer. actionCollection()->action("konsole")->setVisible(false); //we are hiding the konsole previewer UI. m_konsoleWidget->setVisible(false); } } void MainWindow::installPackage() { if (!m_publisher) { m_publisher = new Publisher(this, m_model->package(), m_model->packageType()); } saveEditorData(); m_publisher->setProjectName(m_currentProject); m_publisher->doPlasmaPkg(); } void MainWindow::closeProject() { saveEditorData(); saveProjectState(); toolBar()->hide(); menuBar()->hide(); if (m_timeLine) { m_timeLine->hide(); } if (m_previewerWidget) { m_previewerWidget->hide(); } if (m_konsoleWidget) { m_konsoleWidget->hide(); } if (m_notesWidget) { m_notesWidget->hide(); } if (m_filelist) { m_filelist->hide(); } if (m_browser) { m_browser->hide(); } setCentralWidget(m_central); m_central->switchTo(m_startPage); setDockOptions(QMainWindow::AllowNestedDocks); m_startPage->cancelNewProject(); } void MainWindow::toggleTimeLine() { if (!m_timeLine) { initTimeLine(); } else { m_timeLine->setVisible(!m_timeLine->isVisible()); } } void MainWindow::initTimeLine() { if (!m_timeLine) { //FIXME: should come from project specific save data if it exists KConfigGroup configDock(KGlobal::config(), "DocksPosition"); Qt::DockWidgetArea location = (Qt::DockWidgetArea)configDock.readEntry("TimeLineLocation", (int)Qt::BottomDockWidgetArea); m_timeLine = new TimeLine(this, m_model->package(), location); m_timeLine->setObjectName("timeline"); connect(m_timeLine, SIGNAL(sourceDirectoryChanged()), this, SLOT(editorDestructiveRefresh())); connect(m_timeLine, SIGNAL(savePointClicked()), this, SLOT(saveEditorData())); connect(m_timeLine, SIGNAL(visibilityChanged(bool)), this, SLOT(updateActions())); connect(this, SIGNAL(newSavePointClicked()), m_timeLine, SLOT(newSavePoint())); addDockWidget(location, m_timeLine); } KUrl directory = m_model->package(); if (QDir(directory.path() + "/contents").exists()) { m_timeLine->loadTimeLine(directory); } } void MainWindow::toggleFileList() { setFileListVisible(!m_filelist || !m_filelist->isVisible()); } void MainWindow::setFileListVisible(const bool visible) { if (visible && !m_filelist) { m_filelist = new QDockWidget(i18n("Files"), this); m_filelist->setObjectName("edit tree"); m_filelist->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); m_filelist->setWidget(m_editPage); if (m_previewerWidget) { splitDockWidget(m_previewerWidget, m_filelist, Qt::Vertical); } else { addDockWidget(Qt::LeftDockWidgetArea, m_filelist); } connect(m_filelist, SIGNAL(visibilityChanged(bool)), this, SLOT(updateActions())); } if (m_filelist) { m_filelist->setVisible(visible); } } void MainWindow::toggleNotes() { setNotesVisible(!m_notesWidget || !m_notesWidget->isVisible()); } void MainWindow::setNotesVisible(const bool visible) { if (visible && !m_notesWidget) { m_notesWidget = new QDockWidget(i18n("Notes"), this); m_notesWidget->setObjectName("projectNotes"); loadNotesEditor(m_notesWidget); addDockWidget(Qt::BottomDockWidgetArea, m_notesWidget); connect(m_notesWidget, SIGNAL(visibilityChanged(bool)), this, SLOT(updateActions())); } if (m_notesWidget) { m_notesWidget->setVisible(visible); } } void MainWindow::selectSavePoint() { if (!m_timeLine) { initTimeLine(); } saveEditorData(); emit newSavePointClicked(); } void MainWindow::selectPublish() { if (!m_publisher) { m_publisher = new Publisher(this, m_model->package(), m_model->packageType()); } saveEditorData(); m_publisher->setProjectName(m_currentProject); m_publisher->exec(); } void MainWindow::togglePreview() { if (m_previewerWidget) { m_previewerWidget->setVisible(!m_previewerWidget->isVisible()); if (m_previewerWidget->isVisible()) { m_previewerWidget->refreshPreview(); } } } void MainWindow::saveEditorData() { if (qobject_cast(m_part)) { static_cast(m_part)->save(); } if (qobject_cast(m_notesPart)) { static_cast(m_notesPart)->save(); } if (m_metaEditor) { m_metaEditor->writeFile(); connect(m_metaEditor, SIGNAL(apiChanged()), SLOT(checkProjectrc())); } } void MainWindow::saveAndRefresh() { //in every new save clear the konsole. m_konsoleWidget->clearOutput(); saveEditorData(); if (m_previewerWidget) { m_previewerWidget->refreshPreview(); } } void MainWindow::editorDestructiveRefresh() { if (qobject_cast(m_part)) { static_cast(m_part)->openUrl( static_cast(m_part)->url()); } if (m_metaEditor) { m_metaEditor->readFile(); } if (qobject_cast(m_notesPart)) { static_cast(m_notesPart)->openUrl( static_cast(m_notesPart)->url()); } } void MainWindow::loadRequiredEditor(const KService::List offers, KUrl target) { // save any previous editor content saveEditorData(); if (offers.isEmpty()) { kDebug() << "No offers for editor, can not load."; return; } KService::Ptr service = offers.at(0); if (!m_partService || m_partService->storageId() != service->storageId() || !m_part) { m_partService = service; QString error; // we should show this via debug if we fail KParts::ReadOnlyPart *part = dynamic_cast( offers.at(0)->createInstance( this, QVariantList(), &error)); //the widget which will be loaded to the plasmate if (!part) { //this means failure. A KMessageBox will appear(see the code above) delete m_textEditor; m_textEditor = 0; delete m_part; m_part = 0; } else if (!m_part || !part->inherits(m_part->metaObject()->className())) { delete m_textEditor; m_textEditor = 0; delete m_part; m_part = part; KTextEditor::Document *editorPart = qobject_cast(m_part); if (editorPart) { m_textEditor = new TextEditor(editorPart, m_model, this); } //Add the part's GUI createGUI(m_part); } else { // reuse m_part if we can delete part; } if (!m_part) { KMessageBox::error(this, i18n("Failed to load editor for %1:\n\n%2", target.prettyUrl(), error), i18n("Loading Failure")); return; } } if (!m_part) { KMessageBox::error(this, i18n("Failed to load editor for %1", target.prettyUrl()), i18n("Loading Failure")); return; } // open the target for editting/viewing if it isn't already viewing that file if (!target.equals(m_part->url())) { m_part->openUrl(target); } QWidget *mainWidget = m_textEditor ? m_textEditor : m_part->widget(); m_central->switchTo(mainWidget); mainWidget->setMinimumWidth(300); // We keep only one editor object alive at a time - // so we know who to activate when the edit tab is reselected delete m_metaEditor; m_metaEditor = 0; m_oldTab = EditTab; } void MainWindow::loadNotesEditor(QDockWidget *container) { delete m_notesPart; m_notesPart = 0; KService::List offers = KMimeTypeTrader::self()->query("text/plain", "KParts/ReadWritePart"); if (offers.isEmpty()) { offers = KMimeTypeTrader::self()->query("text/plain", "KParts/ReadOnlyPart"); } if (!offers.isEmpty()) { QVariantList args; QString error; m_notesPart = dynamic_cast( offers.at(0)->createInstance( this, args, &error)); if (!m_notesPart) { kDebug() << "Failed to load notes editor:" << error; } // use same backup file format as above so that it is gitignored KTextEditor::ConfigInterface *config = dynamic_cast(m_notesPart); if (config) { config->setConfigValue("backup-on-save-prefix", "."); } refreshNotes(); container->setWidget(m_notesPart->widget()); } } void MainWindow::refreshNotes() { if (!m_notesPart) { return; } KParts::ReadWritePart* part = qobject_cast(m_notesPart); if (part && part->isModified()) { part->save(); // save notes if we previously had one open. } const QString notesFile = projectFilePath(".NOTES"); QFile notes(notesFile); if (!notes.exists()) { notes.open(QIODevice::WriteOnly); notes.close(); } m_notesPart->openUrl(KUrl("file://" + notesFile)); } QString MainWindow::projectFilePath(const QString &filename) { if (!m_model) { return QString(); } QDir packageDir(m_model->package()); if (m_isPlasmateCreatedPackage) { packageDir.cdUp(); } return packageDir.absolutePath() + "/" + filename; } void MainWindow::saveProjectState() { kDebug() << m_model << saveState(STATE_VERSION); if (!m_model) { return; } const QString projectrc = projectFilePath(PROJECTRC); KConfig c(projectrc); KConfigGroup configDocks(&c, "DocksPosition"); configDocks.writeEntry("MainWindowLayout", saveState(STATE_VERSION)); configDocks.writeEntry("Timeline", m_timeLine && m_timeLine->isVisible()); configDocks.writeEntry("Documentation", m_browser && m_browser->isVisible()); configDocks.writeEntry("FileList", m_filelist && m_filelist->isVisible()); configDocks.writeEntry("Notes", m_notesWidget && m_notesWidget->isVisible()); configDocks.writeEntry("Previewer", m_previewerWidget && m_previewerWidget->isVisible()); c.sync(); /* TODO: implement browser state loading if (m_browser) { KConfigGroup cg(KGlobal::config(), "General"); cg.writeEntry("lastBrowserPage", m_browser->currentPage().toEncoded()); */ } void MainWindow::updateSideBar() { if (m_sidebar) { m_sidebar->setCurrentIndex(EditTab); } m_oldTab = EditTab; } void MainWindow::loadImageViewer(const KUrl& target) { saveEditorData(); if (!m_imageViewer) { m_imageViewer = new ImageViewer(this); } m_imageViewer->loadImage(target); m_central->switchTo(m_imageViewer); updateSideBar(); } void MainWindow::loadKConfigXtEditor(const KUrl& target) { saveEditorData(); if (!m_kconfigXtEditor) { m_kconfigXtEditor = new KConfigXtEditor(this); } m_kconfigXtEditor->clear(); m_kconfigXtEditor->setFilename(target); m_kconfigXtEditor->readFile(); m_central->switchTo(m_kconfigXtEditor); updateSideBar(); } void MainWindow::toggleKonsolePreviewer() { if (!m_konsoleWidget) { return; } if(m_konsoleWidget->isVisible()) { m_konsoleWidget->setVisible(false); } else { m_konsoleWidget->setVisible(true); } } void MainWindow::loadMetaDataEditor(KUrl target) { // save any previous editor content saveEditorData(); if (!m_metaEditor) { m_metaEditor = new MetaDataEditor(this); } m_metaEditor->setFilename(target.path()); m_metaEditor->readFile(); m_central->switchTo(m_metaEditor); updateSideBar(); } void MainWindow::loadProject(const QString &path) { if (path.isEmpty()) { kDebug() << "path is empty?!"; return; } QString packagePath; QDir pDir(path); if (pDir.isRelative()) { packagePath = KStandardDirs::locateLocal("appdata", path + '/'); } else { packagePath = path; } if (!packagePath.endsWith('/')) { packagePath.append('/'); } QDir dir(packagePath); if (!dir.exists("metadata.desktop")) { kDebug() << "no metadata.desktop?!"; return; } // if the project rc file is IN the package, then this was loaded from an existing local project // otherwise, we assume it was created by plasmate and the project files are up one dir m_isPlasmateCreatedPackage = !QFile::exists(packagePath + PROJECTRC); m_currentProject = path; kDebug() << "Loading project from" << packagePath; KService service(packagePath + "metadata.desktop"); QStringList types = service.serviceTypes(); if (types.isEmpty()) { const QString errorText = i18n("Your metadata.desktop file doesn't contain a X-KDE-ServiceTypes entry," " your package is invalid"); KMessageBox::error(this, errorText); return; } // Workaround for Plasma::PackageStructure not recognizing Plasma/PopupApplet as a valid type QString actualType; if (types.contains("KWin/WindowSwitcher")) { actualType = "Plasma/Applet"; } else if (types.contains("KWin/Script")) { actualType = "Plasma/Applet"; } else if (types.contains("Plasma/Applet")) { actualType = "Plasma/Applet"; } else if (types.contains("KWin/Effect")) { actualType = "Plasma/Applet"; } else { actualType = types.first(); } QString previewerType; if (types.contains("KWin/WindowSwitcher")) { previewerType = "KWin/WindowSwitcher"; } else if (types.contains("KWin/Script")) { //KWin Scripts doesn't have a previewer but we want the previewer to store their type //because we will not use it on MainWindow::createPreviewerFor, so the previewer will be disable previewerType = "KWin/Script"; } else if (types.contains("KWin/Effect")) { previewerType = "KWin/Effect"; } else { previewerType = actualType; } //take the previewerType and packagePath, we will need it //for the actions in the toolbar m_packageType = previewerType; m_packagePath = packagePath; delete m_model; m_model = new PackageModel(this); #ifdef DEBUG_MODEL new ModelTest(m_model, this); #endif kDebug() << "Setting project type to:" << actualType; m_model->setPackageType(actualType); kDebug() << "Setting model package to:" << packagePath; if (!m_model->setPackage(packagePath)) { KMessageBox::error(this, i18n("Invalid Plasma package.")); return; } if (!m_editPage) { m_editPage = new EditPage(); connect(m_editPage, SIGNAL(loadEditor(KService::List, KUrl)), this, SLOT(loadRequiredEditor(const KService::List, KUrl))); connect(m_editPage, SIGNAL(loadMetaDataEditor(KUrl)), this, SLOT(loadMetaDataEditor(KUrl))); connect(m_editPage, SIGNAL(loadImageViewer(KUrl)), this, SLOT(loadImageViewer(KUrl))); connect(m_editPage, SIGNAL(loadKConfigXtEditor(KUrl)), this, SLOT(loadKConfigXtEditor(KUrl))); m_editPage->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); } connect(m_model, SIGNAL(reloadModel()), m_editPage, SLOT(expandAll())); m_editPage->setModel(m_model); m_editPage->expandAll(); // prevent accidental loading of previous active project's file // plus temporary workaround for editor issue with handling different languages delete m_part; m_part = 0; // delete old publisher delete m_publisher; m_publisher = 0; QLabel *l = new QLabel(i18n("Select a file to edit."), this); m_central->switchTo(l); m_oldTab = EditTab; QByteArray state = saveState(STATE_VERSION); const QString projectrc = projectFilePath(PROJECTRC); bool showPreview = true; kDebug() << "******** checking for" << projectrc; if (QFile::exists(projectrc)) { KConfig c(projectrc); KConfigGroup configDocks(&c, "DocksPosition"); state = configDocks.readEntry("MainWindowLayout", state); if (configDocks.readEntry("Timeline", false)) { initTimeLine(); } else { delete m_timeLine; m_timeLine = 0; } if (configDocks.readEntry("Documentation", false)) { showDocumentation(true); } else { delete m_browser; m_browser = 0; } setFileListVisible(configDocks.readEntry("FileList", true)); setNotesVisible(configDocks.readEntry("Notes", false)); showPreview = configDocks.readEntry("Previewer", showPreview); } else { setFileListVisible(true); } if (m_browser) { m_browser->setPackage(m_model); } if (m_notesPart) { refreshNotes(); } //initialize the konsole previewer m_konsoleWidget = createKonsoleFor(previewerType); //after the init, cleat the Output m_konsoleWidget->clearOutput(); // initialize previewer delete m_previewerWidget; m_previewerWidget = createPreviewerFor(previewerType); actionCollection()->action("preview")->setEnabled(m_previewerWidget); if (m_previewerWidget) { addDockWidget(Qt::LeftDockWidgetArea, m_previewerWidget); m_previewerWidget->showPreview(packagePath); m_previewerWidget->setVisible(showPreview); //now do the relative stuff for the konsole connect(m_previewerWidget, SIGNAL(showKonsole()), this, SLOT(toggleKonsolePreviewer())); addDockWidget(Qt::BottomDockWidgetArea, m_konsoleWidget); } restoreState(state, STATE_VERSION); toolBar()->show(); // Now, setup some useful properties such as the project name in the title bar // and setting the current working directory. //connect(m_metaEditor, SIGNAL(apiChanged()), SLOT(checkProjectrc())); kDebug() << "loading metadata:" << packagePath + "metadata.desktop"; checkMetafile(packagePath); KConfig metafile(packagePath + "metadata.desktop"); KConfigGroup meta(&metafile, "Desktop Entry"); m_currentProject = meta.readEntry("Name", path); setCaption(m_currentProject); kDebug() << "Content prefix: " << m_model->contentsPrefix() ; QDir::setCurrent(m_model->package() + m_model->contentsPrefix()); // load mainscript QString mainScript = meta.readEntry("X-Plasma-MainScript", QString()); kDebug() << "read mainScript" << mainScript; if (!mainScript.isEmpty()) { KUrl url = KUrl(packagePath + "contents/" + mainScript); m_editPage->loadFile(url); } // After we loaded the project, init the TimeLine and Previewer component menuBar()->show(); if (m_timeLine) { m_timeLine->loadTimeLine(m_model->package()); } if (m_filelist) { m_filelist->show(); } updateActions(); toggleActions(); } void MainWindow::checkMetafile(const QString &path) { KUrl projectPath(path); QDir dir(projectPath.path()); if (!dir.exists(PROJECTRC)) { kDebug() << dir.filePath(PROJECTRC)+ " file doesn't exist, metadata.desktop cannot be checked"; return; } KConfig preferencesPath(dir.path() +'/'+ PROJECTRC); KConfigGroup preferences(&preferencesPath, "ProjectDefaultPreferences"); QString api; const QString radioButtonChecked = preferences.readEntry("radioButtonChecked", "De"); if (radioButtonChecked == "Js") { api.append("javascript"); } else if (radioButtonChecked == "Py") { api.append("python"); } else if (radioButtonChecked == "Rb") { api.append("ruby-script"); } else if (radioButtonChecked == "De") { api.append("declarativeappletscript"); } KConfig metafile(path + "metadata.desktop"); KConfigGroup meta(&metafile, "Desktop Entry"); meta.writeEntry("X-Plasma-API", api); meta.sync(); } void MainWindow::checkProjectrc() { KUrl path(m_metaEditor->filename()); path.cd("../.."); QDir dir(path.path()); qDebug() << path.path(); if(!dir.exists(PROJECTRC)) { kDebug() << dir.filePath(PROJECTRC)+ " file doesn't exist," << PROJECTRC << "cannot be checked"; return; } KConfig preferencesPath(dir.path() +'/'+ PROJECTRC); KConfigGroup preferences(&preferencesPath, "ProjectDefaultPreferences"); QString api; KConfig metafile(m_metaEditor->filename()); KConfigGroup meta(&metafile, "Desktop Entry"); api = meta.readEntry("X-Plasma-API"); if (api == QString("javascript")) { preferences.writeEntry("radioButtonChecked", "Js"); } else if (api == QString("python")) { preferences.writeEntry("radioButtonChecked", "Py"); } else if (api == QString("ruby-script")) { preferences.writeEntry("radioButtonChecked", "Rb"); } else if (api == QString("declarativeappletscript")) { preferences.writeEntry("radioButtonChecked", "De"); } preferences.sync(); } QStringList MainWindow::recentProjects() { KConfigGroup cg(KGlobal::config(), "General"); // kDebug() << l.toStringList(); return cg.readEntry("recentProjects", QStringList()); } Previewer* MainWindow::createPreviewerFor(const QString& projectType) { Previewer* ret = 0; bool showPreviewAction = true; if (projectType.contains("KWin/WindowSwitcher")) { ret = new TabBoxPreviewer(i18nc("Window Title", "Window Switcher Previewer"), this); } else if (projectType.contains("Plasma/Applet")) { ret = new PlasmoidPreviewer(i18n("Preview"), this); } else if (projectType == "Plasma/Runner") { ret = new RunnerPreviewer(i18n("Previewer"), this); } else { showPreviewAction = false; } if (showPreviewAction) { //we have a previewer( ret is valid) so //show the action in the toolbar actionCollection()->action("preview")->setVisible(true); } else { //we don't have a previewer( ret == 0 ) so //hide the action in the toolbar actionCollection()->action("preview")->setVisible(false); } if (ret) { ret->setObjectName("preview"); connect(ret, SIGNAL(refreshRequested()), this, SLOT(saveAndRefresh())); connect(ret, SIGNAL(visibilityChanged(bool)), this, SLOT(updateActions())); } return ret; } KonsolePreviewer* MainWindow::createKonsoleFor(const QString& projectType) { KonsolePreviewer *konsole = 0; if (projectType.contains("KWin/WindowSwitcher")) { konsole = new KonsolePreviewer(i18nc("Window Title", "Window Switcher Previewer")); } else if (projectType.contains("Plasma/Applet")) { konsole = new KonsolePreviewer(i18n("Previewer Output")); } else if (projectType == "Plasma/Runner") { konsole = new KonsolePreviewer(i18n("Previewer Output")); } if (konsole) { konsole->setParent(this); konsole->setObjectName("Previewer Output"); } return konsole; } plasmate-1.0/plasmate/PaxHeaders.5990/sidebardelegate.h0000644000175000001440000000013212115142004021202 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/sidebardelegate.h0000644000175000001440000000226112115142004021640 0ustar00kokeroulisusers00000000000000/* Copyright 2007 by Pino Toscano 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 . */ #ifndef SIDEBARDELEGATE_H #define SIDEBARDELEGATE_H class SidebarDelegate : public QAbstractItemDelegate { public: SidebarDelegate(QObject *parent = 0); ~SidebarDelegate(); void setShowText(bool show); bool isTextShown() const; // from QAbstractItemDelegate void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; private: bool m_showText; }; #endif // SIDEBARDELEGATE_H plasmate-1.0/plasmate/PaxHeaders.5990/mainwindow.h0000644000175000001440000000013212115142004020252 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/mainwindow.h0000644000175000001440000001171412115142004020713 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Riccardo Iaconelli 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 . */ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #include #include class QSvgWidget; class QKeyEvent; class QModelIndex; namespace Ui { } class QDockWidget; class QStringList; class EditPage; class PackageModel; class StartPage; class Sidebar; class TimeLine; class MetaDataEditor; class ImageViewer; class TextEditor; class KConfigXtEditor; class KonsolePreviewer; // our own previewer class Previewer; class DocBrowser; class Publisher; namespace KTextEditor { class Document; class View; } // namespace KTextEditor class MainWindow : public KParts::MainWindow { Q_OBJECT public: MainWindow(QWidget *parent = 0); ~MainWindow(); QStringList recentProjects(); void checkMetafile(const QString &path); void updateSideBar(); public Q_SLOTS: void quit(); void loadProject(const QString &name); void checkProjectrc(); Q_SIGNALS: void newSavePointClicked(); void refreshRequested(); protected: void closeEvent(QCloseEvent *event); private: void setupActions(); void initTimeLine(); QString projectFilePath(const QString &filename); private Q_SLOTS: void saveProjectState(); void closeProject(); void saveEditorData(); void saveAndRefresh(); void refreshNotes(); void selectSavePoint(); void selectPublish(); void setNotesVisible(const bool visible); void setFileListVisible(const bool visible); void loadRequiredEditor(const KService::List offers, KUrl target); void loadMetaDataEditor(KUrl target); void loadImageViewer(const KUrl& target); void loadKConfigXtEditor(const KUrl& target); void updateActions(); void toggleDocumentation(); void toggleTimeLine(); void togglePreview(); void toggleNotes(); void toggleFileList(); void installPackage(); void toggleKonsolePreviewer(); void toggleActions(); // refreshes editor, killing all local changes void editorDestructiveRefresh(); private: // QMainWindow takes control of and DELETES the previous centralWidget // whenever a new one is set - this is bad because we want to preserve // the state of the previous centralWidget for when it becomes active again. // This class is a workaround - we set an instance as the permanent // centralWidget, and use it to do graceful, non-destructive widget-switching. class CentralContainer : public QWidget { public: enum SwitchMode { Preserve, DeleteAfter }; CentralContainer(QWidget* parent); void switchTo(QWidget* newWidget, SwitchMode mode = Preserve); private: SwitchMode m_curMode; QLayout *m_layout; QWidget *m_curWidget; }; enum WorkflowTabs { StartPageTab = 0, EditTab, SavePoint, PublishTab, DocsTab, PreviewTab }; void showDocumentation(bool show); void createMenus(); void setupTextEditor(KTextEditor::Document *editorPart, KTextEditor::View *view); void loadNotesEditor(QDockWidget *container); Previewer* createPreviewerFor(const QString& projectType); KonsolePreviewer* createKonsoleFor(const QString& projectType); KAction *addAction(QString text, const char * icon,const char *slot, const char *name, const KShortcut &shortcut = KShortcut()); StartPage *m_startPage; Sidebar *m_sidebar; TimeLine *m_timeLine; Previewer *m_previewerWidget; MetaDataEditor *m_metaEditor; Publisher *m_publisher; DocBrowser *m_browser; QDockWidget *m_notesWidget; TextEditor *m_textEditor; KConfigXtEditor *m_kconfigXtEditor; KonsolePreviewer *m_konsoleWidget; QDockWidget *m_filelist; EditPage *m_editPage; ImageViewer *m_imageViewer; PackageModel *m_model; int m_oldTab; bool m_docksCreated; bool m_isPlasmateCreatedPackage; CentralContainer *m_central; QString m_currentProject; QString m_packageType; QString m_packagePath; KService::Ptr m_partService; KParts::ReadOnlyPart *m_part; KParts::ReadOnlyPart *m_notesPart; QSvgWidget *m_svgWidget; bool checkImageSize(const QSize& size); }; #endif // MAINWINDOW_H plasmate-1.0/plasmate/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000012712115142004020471 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/CMakeLists.txt0000644000175000001440000001466012115142004021131 0ustar00kokeroulisusers00000000000000# Find needed packages set(LIBATTICA_MIN_VERSION "0.1.4") find_package(LibAttica REQUIRED) macro_log_feature(LIBATTICA_FOUND "libattica" "A library to access Open Collaboration Service providers" "http://websvn.kde.org/trunk/kdesupport/attica/" TRUE "${LIBATTICA_MIN_VERSION}" "Required uploading and downloading plasmoids using Get Hot New Stuff.") # No need to find(Qt4), since QT4_FOUND it's already set by finding kde4 macro_log_feature(QT_QTWEBKIT_FOUND "QtWebKit" "Opensource web browser engine" "http://trac.webkit.org/wiki/QtWebKit" TRUE "" "Needed to display the online API and documentation.") find_package(QGpgme REQUIRED) # Maybe check for GPGME_PTHREAD_FOUND ? find_package(KdepimLibs REQUIRED) # Find optional executables find_program(GIT_EXECUTABLE_FOUND git) macro_log_feature(GIT_EXECUTABLE_FOUND "Git" "Distributed Revision Control System" "http://git-scm.com/" FALSE "" "Runtime dependency needed to use the TimeLine feature.") string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) if(CMAKE_BUILD_TYPE_TOLOWER MATCHES debugfull) add_definitions(-DDEBUG_MODEL) set (DEBUG_MODEL 1) endif() set (PlasMate_SRC editors/editpage.cpp editors/metadata/metadataeditor.cpp editors/imageviewer/imageloader.cpp editors/imageviewer/imageviewer.cpp editors/text/texteditor.cpp editors/kconfigxt/kconfigxteditor.cpp editors/kconfigxt/kconfigxtreader.cpp editors/kconfigxt/kconfigxtwriter.cpp main.cpp sidebaritem.cpp sidebardelegate.cpp sidebartablewidget.cpp sidebar.cpp savesystem/dvcsjob.cpp savesystem/gitrunner.cpp savesystem/commitdialog.cpp savesystem/timelineitem.cpp savesystem/tabledelegate.cpp savesystem/tablewidget.cpp savesystem/timeline.cpp mainwindow.cpp startpage.cpp packagemodel.cpp previewer/plasmoid/plasmoidpreviewer.cpp previewer/plasmoid/plasmoidview.cpp previewer/runner/runnerpreviewer.cpp previewer/windowswitcher/windowswitcher.cpp previewer/windowswitcher/thumbnailitem.cpp previewer/windowswitcher/tabboxpreviewer.cpp previewer/previewer.cpp publisher/signingwidget.cpp publisher/signingdialog.cpp publisher/publisher.cpp publisher/remoteinstaller/remoteinstaller.cpp publisher/remoteinstaller/remoteinstallerdialog.cpp konsole/konsolepreviewer.cpp docbrowser/docbrowser.cpp projectmanager/projectmanager.cpp ) if (DEBUG_MODEL) set (PlasMate_SRC ${PlasMate_SRC} modeltest/dynamictreemodel.cpp modeltest/modeltest.cpp ) endif (DEBUG_MODEL) kde4_add_ui_files (PlasMate_SRC startpage.ui editors/metadata/metadata.ui publisher/publisher.ui publisher/remoteinstaller/remoteinstaller.ui editors/kconfigxt/kconfigxteditor.ui ) include_directories(${QT_QTWEBKIT_INCLUDE_DIR} ${QGPGME_INCLUDE_DIR} ${GPGME_INCLUDES} ) add_subdirectory( editors ) add_subdirectory( previewer/plasmoid ) add_subdirectory( templates ) add_subdirectory( icons ) kde4_add_executable(plasmate ${PlasMate_SRC}) target_link_libraries(plasmate ${KDE4_KDEUI_LIBS} ${KDE4_KTEXTEDITOR_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KIO_LIBRARY} ${KDE4_PLASMA_LIBS} ${KDE4_KNEWSTUFF3_LIBRARY} ${QT_QTWEBKIT_LIBRARY} ${QT_QTXML_LIBRARY} ${LIBATTICA_LIBRARY_DIRS} ${QGPGME_LIBRARIES} ${QT_QTDECLARATIVE_LIBRARIES} ${KDECLARATIVE_LIBRARIES} ${KDEPIMLIBS_KPIMUTILS_LIBS} ) if (DEBUG_MODEL) target_link_libraries(plasmate ${QT_QTTEST_LIBRARY}) endif (DEBUG_MODEL) install(TARGETS plasmate ${INSTALL_TARGETS_DEFAULT_ARGS}) install(PROGRAMS plasmate.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) install(FILES plasmateui.rc DESTINATION ${DATA_INSTALL_DIR}/plasmate) install(FILES plasmate.knsrc DESTINATION ${CONFIG_INSTALL_DIR}) install( FILES previewer/windowswitcher/thumbnails/konqueror.png previewer/windowswitcher/thumbnails/kmail.png previewer/windowswitcher/thumbnails/systemsettings.png previewer/windowswitcher/thumbnails/dolphin.png DESTINATION ${DATA_INSTALL_DIR}/plasmate) install( FILES previewer/windowswitcher/tabboxdelegate.qml DESTINATION ${DATA_INSTALL_DIR}/plasmate) ##standalone applications #plasmaremoteinstaller set (PlasmaRemoteInstaller_SRC publisher/remoteinstaller/remoteinstallerdialog.cpp publisher/remoteinstaller/remoteinstaller.cpp publisher/remoteinstaller/standalone/main.cpp publisher/remoteinstaller/standalone/plasmaremoteinstaller.cpp ) kde4_add_ui_files (PlasmaRemoteInstaller_SRC publisher/remoteinstaller/remoteinstaller.ui ) kde4_add_executable(plasmaremoteinstaller ${PlasmaRemoteInstaller_SRC}) target_link_libraries(plasmaremoteinstaller ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBRARY} ) install(TARGETS plasmaremoteinstaller ${INSTALL_TARGETS_DEFAULT_ARGS}) #kwin-windowswitcherpreviewer set (KWin-WindowSwitcherPreviewer_SRC previewer/windowswitcher/windowswitcher.cpp previewer/windowswitcher/thumbnailitem.cpp previewer/windowswitcher/tabboxpreviewer.cpp previewer/previewer.cpp previewer/windowswitcher/standalone/main.cpp previewer/windowswitcher/standalone/windowswitcherpreviewer.cpp ) kde4_add_executable(kwin-windowswitcherpreviewer ${KWin-WindowSwitcherPreviewer_SRC}) target_link_libraries(kwin-windowswitcherpreviewer ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBRARY} ${QT_QTDECLARATIVE_LIBRARIES} ${KDECLARATIVE_LIBRARIES} ) install(TARGETS kwin-windowswitcherpreviewer ${INSTALL_TARGETS_DEFAULT_ARGS}) #plasmakconfigxteditor set(plasmakconfigxt_SRCS editors/kconfigxt/kconfigxteditor.cpp editors/kconfigxt/kconfigxtreader.cpp editors/kconfigxt/kconfigxtwriter.cpp editors/kconfigxt/standalone/plasmakconfigxteditor.cpp editors/kconfigxt/standalone/main.cpp ) kde4_add_ui_files (plasmakconfigxt_SRCS editors/kconfigxt/kconfigxteditor.ui ) kde4_add_executable(plasmakconfigxteditor ${plasmakconfigxt_SRCS}) target_link_libraries(plasmakconfigxteditor ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBRARY} ${QT_QTXML_LIBRARY} ) install(TARGETS plasmakconfigxteditor ${INSTALL_TARGETS_DEFAULT_ARGS}) macro_display_feature_log() plasmate-1.0/plasmate/PaxHeaders.5990/plasmate.knsrc0000644000175000001440000000013212115142004020575 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412548.616641211 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/plasmate.knsrc0000644000175000001440000000025512115142004021234 0ustar00kokeroulisusers00000000000000[KNewStuff3] ProvidersUrl=http://download.kde.org/khotnewstuff/plasmoids-providers.xml TargetDir=plasmate/tmp UploadCategories=Plasmoid Script,Plasma Comic,Test category 1 plasmate-1.0/plasmate/PaxHeaders.5990/main.cpp0000644000175000001440000000013212115142004017355 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/main.cpp0000644000175000001440000000452712115142004020022 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Riccardo Iaconelli 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 . */ #include #include #include #include #include #include "mainwindow.h" #include "konsole/konsolepreviewer.h" int main(int argc, char *argv[]) { KAboutData aboutData("plasmate", 0, ki18n("Plasmate"), "0.1alpha3", ki18n("Plasma Add-Ons Creator"), KAboutData::License_GPL, ki18n("Copyright 2009-2012 Plasma Development Team"), KLocalizedString(), "", "plasma-devel@kde.org"); aboutData.addAuthor(ki18n("Sebastian Kügler"), ki18n("Author"), "sebas@kde.org"); aboutData.addAuthor(ki18n("Shantanu Tushar Jha"), ki18n("Author"), "shaan7in@gmail.com"); aboutData.addAuthor(ki18n("Diego Casella"), ki18n("Author"), "polentino911@gmail.com"); aboutData.addAuthor(ki18n("Yuen Hoe Lim"), ki18n("Author"), "yuenhoe@hotmail.com"); aboutData.addAuthor(ki18n("Richard Moore"), ki18n("Author"), "rich@kde.org"); aboutData.addAuthor(ki18n("Artur Duque de Souza"), ki18n("Author"), "asouza@kde.org"); aboutData.addAuthor(ki18n("Frerich Raabe"), ki18n("Author"), "raabe@kde.org"); aboutData.addAuthor(ki18n("Aaron Seigo"), ki18n("Author"), "aseigo@kde.org"); aboutData.addAuthor(ki18n("Riccardo Iaconelli"), ki18n("Author"), "riccardo@kde.org"); aboutData.setProgramIconName("plasmagik"); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineOptions options; KCmdLineArgs::addCmdLineOptions(options); KCmdLineArgs::parsedArgs(); KApplication app; qInstallMsgHandler(KonsolePreviewer::customMessageHandler); MainWindow *mainWindow = new MainWindow(); mainWindow->show(); return app.exec(); } plasmate-1.0/plasmate/PaxHeaders.5990/plasmate.desktop0000644000175000001440000000013212115142004021126 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412548.616641211 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/plasmate.desktop0000755000175000001440000000330212115142004021564 0ustar00kokeroulisusers00000000000000#!/usr/bin/env xdg-open [Desktop Entry] Terminal=false Name=Plasmate Name[cs]=Plasmate Name[da]=Plasmate Name[de]=Plasmate Name[el]=Plasmate Name[es]=Plasmate Name[et]=Plasmate Name[fi]=Plasmate Name[fr]=Plasmate Name[gl]=Plasmate Name[hu]=Plasmate Name[km]=Plasmate Name[mr]=पà¥à¤²à¤¾à¤¸à¥à¤®à¥‡à¤Ÿ Name[nds]=Plasmate Name[nl]=Plasmate Name[pl]=Plasmate Name[pt]=Plasmate Name[pt_BR]=Plasmate Name[ro]=Plasmate Name[sk]=Plasmate Name[sv]=Plasmate Name[tr]=Plasmate Name[uk]=Plasmate Name[x-test]=xxPlasmatexx Name[zh_TW]=Plasmate GenericName=Plasma Addon Creator GenericName[da]=Plasma tilføjelsesskaber GenericName[el]=ΠαÏαγωγός Ï€Ïοσθέτων Plasma GenericName[es]=Creador de complementos para Plasma GenericName[et]=Plasma lisandite looja GenericName[fi]=Plasma-lisäosien luontiohjelma GenericName[fr]=Créateur de modules complémentaires Plasma GenericName[gl]=Creados de complementos para Plasma GenericName[hu]=Plazma kiegészítÅ‘ készítÅ‘ GenericName[km]=កម្មវិធី​បង្កើážâ€‹áž•្នែក​បន្ážáŸ‚ម​​ប្លាស្មា GenericName[nl]=Plasma maker van addons GenericName[pl]=Kreator dodatku Plazmy GenericName[pt]=Criador de Extensões do Plasma GenericName[pt_BR]=Criador de complementos do Plasma GenericName[ro]=Creator de suplimente Plasma GenericName[sk]=Tvorca doplnkov Plasma GenericName[sv]=Skapa Plasma-tillägg GenericName[tr]=Plasma Eklenti OluÅŸturucu GenericName[uk]=Програма Ð´Ð»Ñ ÑÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð´Ð¾Ð´Ð°Ñ‚ÐºÑ–Ð² Плазми GenericName[x-test]=xxPlasma Addon Creatorxx GenericName[zh_TW]=Plasma 附加元件建立器 Exec=plasmate Icon=plasmagik Type=Application InitialPreference=7 Categories=Qt;KDE;Development;IDE; plasmate-1.0/plasmate/PaxHeaders.5990/savesystem0000644000175000001440000000013212115142004020053 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.628641098 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/savesystem/0000755000175000001440000000000012115142004020565 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/timeline.h0000644000175000001440000000012712115142004022113 xustar000000000000000029 mtime=1362412548.62064117 29 atime=1362412548.62064117 29 ctime=1362412548.62064117 plasmate-1.0/plasmate/savesystem/timeline.h0000644000175000001440000001266012115142004022551 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Aaron Seigo Copyright 2009-2010 Diego '[Po]lentino' Casella Copyright 2009-2010 Lim Yuen Hoe 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 TIMELINE_H #define TIMELINE_H #include #include class GitRunner; class QStringList; class QTableWidgetItem; class QWidget; class TableWidget; class TableDelegate; class TimeLineItem; class TimeLine : public QDockWidget { Q_OBJECT /** * Specialized ctor. It initializes the TimeLine object with the given parameters. * @param parent The parent widget. * @param dir The path of the working directory. * @param The DockWidget location */ public: TimeLine(QWidget *parent, const KUrl &dir, Qt::DockWidgetArea location = Qt::BottomDockWidgetArea); virtual ~TimeLine(); /** * Sets the workinf directory with the one passed. * @param dir The path of the new working directory. * @return returns true if the directory is a valid one. */ bool setWorkingDir(const KUrl &dir); /** * Parses the supplied path and initialize the TimeLine object. * @param dir The path of the new working directory. */ void loadTimeLine(const KUrl &dir); /** * Returns the location of the dockwidget. */ Qt::DockWidgetArea location() const; public Q_SLOTS: /** * Creates a custom menu based on the QListWidgetItem that has triggered the event. * @param item Reference to the event sender. */ void showContextMenu(QTableWidgetItem *item); /** * Creates a new SavePoint, if there are uncommitted/new files. */ void newSavePoint(); Q_SIGNALS: /** * Emitted when an element is clicked. */ void currentIndexChanged(int,int); /** * Emitted when the timeline performs a switch to an other branch, or a move to * a different commit than HEAD; so the editor can update its current view. */ void sourceDirectoryChanged(); /** * Emitted when a timeline item is clicked - to notify mainwindow to * make preparations for a possible save point move/restore. */ void savePointClicked(); private Q_SLOTS: /** * For internal use only; its triggered when the user selects to restore a commit. */ void restoreCommit(); /** * For internal use only; its triggered when the user selects to move to particular a commit. */ void moveToCommit(); /** * For internal use only; its triggered when the user selects to switch to a specific branch. */ void switchBranch(); /** * For internal use only; its triggered when the user selects to create a new branch. */ void createBranch(); /** * For internal use only; its triggered when the user selects to rename a branch. */ void renameBranch(); /** * For internal use only; its triggered when the user selects to merge a branch. */ void mergeBranch(); /** * For internal use only; its triggered when the user selects to delete a branch. */ void deleteBranch(); private: /** * Stores a new item with the specified attributes. * @param icon The icon that will be displayed in the TimeLine * @param dataList A QStringList with three elements: * - dataList(0) contains the name that will be displayed under the icon; * - dataList(1) contains the string that will be displayed in the popup; * - dataList(2) contains the sha1 hash identifier. * @param id The object's identifier. * @param flag The object's flag. */ /*void uiAddItem(const QIcon &icon, QStringList &data, const TimeLineItem::ItemIdentifier id, const Qt::ItemFlag flag);*/ /** * Initializes the GUI. * @param parent The parent widget. * @param The location of the dockwidget */ void initUI(QWidget *parent, Qt::DockWidgetArea location = Qt::TopDockWidgetArea); QString currentBranch() const; QStringList listBranches() const; /** * Method called whenever the user resizes the dockwidget or its parent * @param A reference to the QResizeEvent event. */ void resizeEvent(QResizeEvent * event); QString branchDialog(bool *ok); //from here we will take the TimeLineItems for the timeline void identifyCommits(TableWidget *widget); KUrl m_workingDir; GitRunner *m_gitRunner; QString m_currentBranch; QStringList m_branches; TableWidget *m_table; TableDelegate *m_delegate; }; #endif // TIMELINE_H plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/dvcsjob.h0000644000175000001440000000012712115142004021737 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/savesystem/dvcsjob.h0000644000175000001440000001546312115142004022401 0ustar00kokeroulisusers00000000000000/****************************************************************************** * Copyright (C) 2009 by Diego '[Po]lentino' Casella * * * * 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 DVCSJOB_H #define DVCSJOB_H #include #include #include #include #include #include #include #include #include /** * This class is used to execute dvcs jobs. * Result can be obtained by calling output() or rawOutput(), depending if you * want to retrieve a string or binary data. * To use it at its most, some setup is required; here it is an example: * @code * DvcsJob *job = new DvcsJob(); * job->setCommunicationMode(KProcess::SeparateChannels); * job->setDirectory(QDir("a/directory")); * * job << "git" << "init"; * job->start(); * * QString result; * QString error; * if(job->status() == DvcsJob::JobSucceeded) { * // Save job result as a string * result = job->output(); * // Process the output * * } else if(job->status() == DvcsJob::JobFailed) { * error = job->output(); * // Process the error * } * * job->cancel(); * @endcode * * @author Diego [Po]lentino Casella * * @note There is no need to cycle until the process has finished, since the main * thread is blocked until start() has finished. For particular implementations, * consider putting the job in a separate KThread and query isRunning(). */ class DvcsJob : public KJob { Q_OBJECT public: /** * Used to identify the current status of the class. */ enum JobStatus { JobRunning = 0 /**< The job is running */, JobSucceeded = 1 /**< The job succeeded */, JobCancelled = 2 /**< The job was cancelled */, JobFailed = 3 /**< The job failed */, JobNotStarted = 4 /**< The job is not yet started */ }; /** * Simple ctor */ DvcsJob(); ~DvcsJob(); /** * Starts the process with the previously defined arguments. */ void start(); /** * Call this method to clean the job, for example before setting a new one. */ void clear(); /** * @return The status of the last process executed. */ JobStatus status() const; /** * Sets the command arguments. * @param Args contains one string argument per element. */ void setCommandArguments(const QStringList &args); /** * Sets the communication mode. * @param comm Accepts one of the KProcess:OutputChannelMode modes. */ void setCommunicationMode(KProcess::OutputChannelMode comm); /** * Sets the process working directory. * @param directory Should contain only absolute path; relative or "" paths are * deprecated and will make the job fail. */ void setDirectory(const QDir &directory); /** * Sets a file used to write the output in. * @param fileName The name of the file. */ void setStandardInputFile(const QString &fileName); /** *@return The string containing the current commads into a single string. */ QString dvcsCommand() const; /** * @return The handle to the current process reference. */ KProcess *getChildproc(); /** * @return The current working directory. */ QDir const & getDirectory() const; /** * @return The result of the last process executed as binary data * @see DvcsJob::output() */ QByteArray rawOutput() const; /** * @return The result of the last process executed as a string. */ QString output() const; /** * Append a new command to the existing command list. * @param arg The string representing the command argument. */ DvcsJob& operator<<(const QString &arg); /** * Append a new command to the existing command list. * @param arg The char string representing the command argument. */ DvcsJob& operator<<(const char *arg); /** * Append a new list of commands to the existing command list. * @param arg The stringlist representing the command arguments. */ DvcsJob& operator<<(const QStringList &args); /** * Cancels the current process. */ void cancel(); private Q_SLOTS: /** * Helper function, prints to the standard error if something goes wrong and * reset the DvcsJob status to ready. * @param error The QProcess::ProcessError error identifier. */ void slotProcessError(QProcess::ProcessError error); /** * Helper function, writes a debug string accordingly with the exit code/status. * @param exitCode The integer exit code. * @param exitStatus The QProcess::ExitStatus exit code. */ void slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus); /** * Function called whenever the job has available data on standard output. */ void slotReceivedStdout(); /** * Function called whenever the job has available data on standard output. */ void slotReceivedStderr(); private: /** * @return whehter the job is running or not. */ bool isRunning() const; KProcess *m_process; QStringList m_command; QVariant m_results; QDir m_directory; bool m_isRunning; bool m_wasStarted; bool m_failed; QByteArray m_output; KProcess::OutputChannelMode m_comm; void jobIsReady(); }; #endif // DVCSJOB_H plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/tabledelegate.h0000644000175000001440000000012712115142004023067 xustar000000000000000029 mtime=1362412548.62064117 29 atime=1362412548.62064117 29 ctime=1362412548.62064117 plasmate-1.0/plasmate/savesystem/tabledelegate.h0000644000175000001440000000236312115142004023524 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Diego '[Po]lentino' Casella 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 TABLEDELEGATE_H #define TABLEDELEGATE_H #include class TableDelegate : public QAbstractItemDelegate { public: TableDelegate(); void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; }; #endif // TABLEDELEGATE_H plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/tablewidget.h0000644000175000001440000000012712115142004022600 xustar000000000000000029 mtime=1362412548.62064117 29 atime=1362412548.62064117 29 ctime=1362412548.62064117 plasmate-1.0/plasmate/savesystem/tablewidget.h0000644000175000001440000000336012115142004023233 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Diego '[Po]lentino' Casella 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 TABLEWIDGET_H #define TABLEWIDGET_H #include class QMouseEvent; class TimeLineItem; class TableWidget : public QTableWidget { Q_OBJECT public: TableWidget(Qt::DockWidgetArea location, QWidget *parent = 0); void addItem(TimeLineItem *item); void clear(); QSize scrollbarSize(bool vertical); Qt::DockWidgetArea location(); int totalLenght(); public Q_SLOTS: void updateLayout(Qt::DockWidgetArea location); private: void updateSize(TimeLineItem *item); void mouseReleaseEvent(QMouseEvent *event); QScrollBar *m_horizontalSB; QScrollBar *m_verticalSB; Qt::DockWidgetArea m_location; // Max Cell Dimension: according with its position, could be a width or height int m_maxCellDimension; // Total Length: stores the width/height of the entire row/column int m_totalLenght; }; #endif // TABLEWIDGET_H plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/timelineitem.h0000644000175000001440000000013212115142004022766 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/savesystem/timelineitem.h0000644000175000001440000000351212115142004023424 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Aaron Seigo Copyright 2009-2010 Diego '[Po]lentino' Casella 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 TIMELINEITEM_H #define TIMELINEITEM_H #include #include class TimeLineItem : public QTableWidgetItem { public: enum ItemIdentifier { OutsideWorkingDir = 0, /**< The TimeLineItem represents an object that it isn't inside the working directory. */ NotACommit = 1, /**< The TimeLineItem represents an object that is not yet a commit. */ Commit = 2, /**< The TimeLineItem representd Commit type. */ Branch = 3, /**< The TimeLineItem representd Branch type. */ Merge = 4 /**< The TimeLineItem representd Merge type. */ }; TimeLineItem(const Qt::ItemFlag flag = Qt::ItemIsEnabled); void setHash(const QString &hash); void setIdentifier(const TimeLineItem::ItemIdentifier id); QString getHash(); TimeLineItem::ItemIdentifier getIdentifier(); private: QString m_sha1hash; ItemIdentifier m_type; }; #endif // TIMELINEITEM_H plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/test0000644000175000001440000000013012115142004021030 xustar000000000000000029 mtime=1362412548.62064117 30 atime=1362412548.637641019 29 ctime=1362412548.62064117 plasmate-1.0/plasmate/savesystem/test/0000755000175000001440000000000012115142004021544 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/savesystem/test/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000012712115142004023653 xustar000000000000000029 mtime=1362412548.62064117 29 atime=1362412548.62064117 29 ctime=1362412548.62064117 plasmate-1.0/plasmate/savesystem/test/CMakeLists.txt0000644000175000001440000000101612115142004024302 0ustar00kokeroulisusers00000000000000project(timeline_test) find_package(KDE4) include(KDE4Defaults) set (gitrunner_test_SRC ../dvcsjob.cpp ../gitrunner.cpp ../commitdialog.cpp ../branchdialog.cpp ../timelineitem.cpp ../tabledelegate.cpp ../tablewidget.cpp ../timeline.cpp main.cpp ) include_directories (${KDE4_INCLUDES}) kde4_add_executable (timeline_test ${gitrunner_test_SRC}) # Check for unused/redundant link libraries =P target_link_libraries (timeline_test ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ) plasmate-1.0/plasmate/savesystem/test/PaxHeaders.5990/main.cpp0000644000175000001440000000012712115142004022543 xustar000000000000000029 mtime=1362412548.62064117 29 atime=1362412548.62064117 29 ctime=1362412548.62064117 plasmate-1.0/plasmate/savesystem/test/main.cpp0000644000175000001440000001460212115142004023177 0ustar00kokeroulisusers00000000000000/* Simple test app for the GitRunner class. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../gitrunner.h" #include "../dvcsjob.h" #include "../timeline.h" QString appDir; QString rootDir; void testGitRunner() { QDir dirHandler = QDir(appDir); // Let's build a simple directory structure, with some files if (dirHandler.mkdir("root")) { // Start with creating our root dir. // If success, add create a file named main.cpp . QFile *main = new QFile(rootDir + "main.cpp"); // Defining ../root/main.cpp main->open(QIODevice::WriteOnly); main->close(); } // Init our GitRunner instance GitRunner *git = new GitRunner(); // Set the repo directory git->setDirectory(KUrl(rootDir)); // Perform a check on the folder to confirm we have a valid git repo if (!git->isValidDirectory()) git->init(KUrl(rootDir)); // Init an empty repo // Note: in the following GitRunner call, I'll skip testing the JobStatus value returned, // in order to focus the reader on how the runner works; in a real application, always // perform that check !!! // Ok, now let's add and commit one file QStringList *list = new QStringList("main.cpp"); git->add(KUrl::List(*list)) ; // Add the element in the git index git->commit(QString("This is a comment: committed main.")); // Commit it // Now create some other files QFile *src1 = new QFile(rootDir + "src1.cpp"); // Defining ../root/src2.cpp QFile *src2 = new QFile(rootDir + "src2.cpp"); // Defining ../root/src2.cpp QFile *src3 = new QFile(rootDir + "src3.cpp"); // Defining ../root/src2.cpp src1->open(QIODevice::WriteOnly); src2->open(QIODevice::WriteOnly); src3->open(QIODevice::WriteOnly); src1->close(); src2->close(); src3->close(); // Now add them and then commit list->clear(); *list << "src1.cpp"; *list << "src2.cpp"; *list << "src3.cpp"; git->add(KUrl::List(*list)); git->commit("Multiline comment.\n\nThe first line briefly explains the commits purpose,\nwhile the remaining lines add more details."); // Now lets create a new branch QString brName("devel"); git->newBranch(brName); // Switch to the new branch git->switchBranch(brName); // Add an other file QFile *h1 = new QFile(rootDir + "h1.h"); // Defining ../root/h1.h h1->open(QIODevice::WriteOnly); h1->close(); // Lets perform an other add/commit action list->clear(); list->append("h1.h"); git->add(KUrl::List(*list)); git->commit("Added h1.h in branch \"devel\"."); // Note: you can also try git->createWorkingCopy(), to clone a local repo from an other. // Show the logs regarding the devel branch // Note: it derives from "master", so there will be also // the commits made in "master" since "devel" creation. git->log(); QString log = git->getResult(); QMessageBox *mb = new QMessageBox(QMessageBox::NoIcon, QString("Log result in \"devel\":") , log, 0, 0, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint); mb->exec(); // Switch branch git->switchBranch(QString("master")); // Show the logs regarding the "master" branch // Note: the commit made inside "devel" branch won't be listed! git->log(); QString log1 = git->getResult(); QMessageBox *mb1 = new QMessageBox(QMessageBox::NoIcon, QString("Log result in \"master\":") , log1, 0, 0, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint); mb1->exec(); // Show branches git->branches(); QString br = git->getResult(); QMessageBox *mb2 = new QMessageBox(QMessageBox::NoIcon, QString("Log result in \"master\":") , br, 0, 0, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint); mb2->exec(); // Now lets create an other file, but we don't commit it, so in the testTimeLine() // you'll be able to perform a new SavePoint by clicking the button. QFile *src4 = new QFile(rootDir + "src4.cpp"); // Defining ../root/src2.cpp src4->open(QIODevice::WriteOnly); src4->close(); } void testTimeLine() { // Setup the main window, a dock widget and the TimeLine QMainWindow *w = new QMainWindow(0, Qt::Window); //QDockWidget *dockTimeLine = new QDockWidget(i18n("TimeLine"), w); TimeLine *timeline = new TimeLine(w, KUrl(rootDir), Qt::RightDockWidgetArea); // Setting some relationships between widgets //dockTimeLine->setWidget(timeline); w->addDockWidget(Qt::LeftDockWidgetArea, timeline); timeline->loadTimeLine(KUrl(rootDir)); // Some policy //dockTimeLine->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); //timeline->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Expanding); // Now lets create a New SavePoint button, that will be connected to the // TimeLine::newSavePoint() slot //QWidget *centralDialog = new QWidget(w); QPushButton *newCommit = new QPushButton(KIcon("document-save"), i18n("New save point"), w);//centralDialog); //w->setCentralWidget(centralDialog); //centralDialog->show(); QObject::connect(newCommit, SIGNAL(clicked()), timeline, SLOT(newSavePoint())); w->resize(400, 400); w->show(); } int main(int argc, char *argv[]) { KAboutData aboutData("timeline_test", 0, ki18n("TimeLine and GitRunner Test app"), "0.1", ki18n("Shows how to use TimeLine and GitRunner"), KAboutData::License_GPL, ki18n("Diego [Po]lentino Casella"), KLocalizedString(), "", "polentino911@gmail.com"); aboutData.addAuthor(ki18n("Diego [Po]lentino Casella"), ki18n("Author"), "polentino911@gmail.com"); KCmdLineArgs::init(argc, argv, &aboutData); KApplication app; appDir = app.applicationDirPath(); rootDir = appDir + "/root/"; testGitRunner(); testTimeLine(); return app.exec(); } plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/tablewidget.cpp0000644000175000001440000000012712115142004023133 xustar000000000000000029 mtime=1362412548.62064117 29 atime=1362412548.62064117 29 ctime=1362412548.62064117 plasmate-1.0/plasmate/savesystem/tablewidget.cpp0000644000175000001440000001607112115142004023571 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Diego '[Po]lentino' Casella 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 #include //#include #include "tablewidget.h" #include "timelineitem.h" static const int ITEM_MARGIN_LEFT = 5; static const int ITEM_MARGIN_TOP = 5; static const int ITEM_MARGIN_RIGHT = 5; static const int ITEM_MARGIN_BOTTOM = 5; static const int ITEM_PADDING = 5; TableWidget::TableWidget(Qt::DockWidgetArea location, QWidget *parent) :QTableWidget(0,0,parent), m_horizontalSB(0), m_verticalSB(0), m_location(location), m_maxCellDimension(0), m_totalLenght(0) { horizontalHeader()->setVisible(false); verticalHeader()->setVisible(false); setIconSize(QSize(32,32)); setShowGrid(false); setMouseTracking(true); viewport()->setAutoFillBackground(false); m_horizontalSB = horizontalScrollBar(); m_verticalSB = verticalScrollBar(); setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); //updateLayout(); } Qt::DockWidgetArea TableWidget::location() { return m_location; } void TableWidget::updateLayout(Qt::DockWidgetArea location) { bool wasVertical = true; // Ensure we REALLY need to update the layout switch(location) { case Qt::LeftDockWidgetArea: if((m_location == Qt::LeftDockWidgetArea)|| (m_location == Qt::RightDockWidgetArea)) { return; } wasVertical = false; break; case Qt::RightDockWidgetArea: if((m_location == Qt::LeftDockWidgetArea)|| (m_location == Qt::RightDockWidgetArea)) { return; } wasVertical = false; break; case Qt::TopDockWidgetArea: if((m_location == Qt::TopDockWidgetArea)|| (m_location == Qt::BottomDockWidgetArea)) { return; } break; case Qt::BottomDockWidgetArea: if((m_location == Qt::TopDockWidgetArea)|| (m_location == Qt::BottomDockWidgetArea)) { return; } break; default: return; } // Before starting swapping, hide the table for a while to avoid flickering and reset // minimum and maximum widget size; hide(); // Store the current position m_location = location; // Compute the number of required iterations int iterations = (wasVertical ? rowCount() : columnCount()); if(wasVertical) { setColumnCount(iterations); } else { setRowCount(iterations); } m_maxCellDimension = 0; m_totalLenght = 0; for(int i=0; isize() : m_horizontalSB->size()); } void TableWidget::addItem(TimeLineItem *item) { // According with the orientation, expand the widget through the first column or row, // then add the item. setRowCount(((m_location == Qt::RightDockWidgetArea)||(m_location == Qt::LeftDockWidgetArea)) ? rowCount()+1 : 1); setColumnCount(((m_location == Qt::RightDockWidgetArea)||(m_location == Qt::LeftDockWidgetArea)) ? 1 : columnCount()+1); setItem(((m_location == Qt::RightDockWidgetArea)||(m_location == Qt::LeftDockWidgetArea)) ? rowCount()-1 : 0, ((m_location == Qt::RightDockWidgetArea)||(m_location == Qt::LeftDockWidgetArea)) ? 0 : columnCount()-1, item); updateSize(item); } int TableWidget::totalLenght() { return m_totalLenght; } void TableWidget::clear() { bool vertical = ((m_location == Qt::RightDockWidgetArea)||(m_location == Qt::LeftDockWidgetArea)); for(int i = 0; i < (vertical ? rowCount(): columnCount()); ++i ) { takeItem(vertical ? i: 0, vertical ? 0: i); } setRowCount(0); setColumnCount(0); m_maxCellDimension = 0; m_totalLenght = 0; } void TableWidget::mouseReleaseEvent(QMouseEvent *event) { QModelIndex index = indexAt(event->pos()); if (!index.isValid()){ return; } emit itemClicked(itemFromIndex(index)); } void TableWidget::updateSize(TimeLineItem *item) { // Now compute the correct row and column size for the current item QFontMetrics font(item->font()); QSize rect(ITEM_MARGIN_LEFT + qMax(iconSize().width(), font.width(item->text())) + ITEM_MARGIN_RIGHT, ITEM_MARGIN_TOP + iconSize().height() + ITEM_PADDING + font.boundingRect(item->text()).height() + 2*ITEM_MARGIN_BOTTOM ); //qDebug() << "TableWidget::updateSize = " << rect; if((m_location == Qt::RightDockWidgetArea) || (m_location == Qt::LeftDockWidgetArea)) { setRowHeight(item->row(),rect.height()); m_totalLenght += rect.height(); if(m_maxCellDimension < rect.width()) { m_maxCellDimension = rect.width(); setColumnWidth(1,m_maxCellDimension); } setMinimumHeight(0); setMaximumHeight(16777215); setColumnWidth(1,m_maxCellDimension); setColumnWidth(0,m_maxCellDimension); setMinimumWidth(m_maxCellDimension+5); setMaximumWidth(m_maxCellDimension+5); } else { setColumnWidth(item->column(),rect.width()); m_totalLenght += rect.width(); if(m_maxCellDimension < rect.height()) { m_maxCellDimension = rect.height(); setRowHeight(1,m_maxCellDimension); } setMinimumWidth(0); setMaximumWidth(16777215); setRowHeight(1,m_maxCellDimension); setRowHeight(0,m_maxCellDimension); setMinimumHeight(m_maxCellDimension+5); setMaximumHeight(m_maxCellDimension+5); } } plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/timelineitem.cpp0000644000175000001440000000013212115142004023321 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/savesystem/timelineitem.cpp0000644000175000001440000000453112115142004023761 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Aaron Seigo Copyright 2009-2010 Diego '[Po]lentino' Casella 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 "timelineitem.h" static const int TimeLineItemType = QTableWidgetItem::UserType + 1; TimeLineItem::TimeLineItem(const Qt::ItemFlag flag) : QTableWidgetItem(0,TimeLineItemType) { setFlags(flag); /*setData(Qt::DecorationRole,QVariant(icon)); setData(Qt::DisplayRole,QVariant(dataList.takeFirst())); setData(Qt::ToolTipRole,QVariant(dataList.takeFirst()));*/ } void TimeLineItem::setHash(const QString &hash) { m_sha1hash = hash; } void TimeLineItem::setIdentifier(const TimeLineItem::ItemIdentifier id) { m_type = id; switch (m_type) { case Merge: setIcon(KIcon("svn_merge")); break; case Commit: setIcon(KIcon("dialog-ok")); break; case Branch: setIcon(KIcon("system-switch-user")); break; case NotACommit: setIcon(KIcon("document-save")); break; } } QString TimeLineItem::getHash() { return m_sha1hash; } TimeLineItem::ItemIdentifier TimeLineItem::getIdentifier() { return m_type; } /*QVariant TimeLineItem::data(int role) { switch(role) { case Qt::DisplayRole: return QVariant(text()); break; case Qt::DecorationRole: return QVariant(icon()); break; case Qt::ToolTipRole: return QVariant(toolTip()); break; default: return QVariant(); } }*/ plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/commitdialog.h0000644000175000001440000000012712115142004022755 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/savesystem/commitdialog.h0000644000175000001440000000423212115142004023407 0ustar00kokeroulisusers00000000000000/****************************************************************************** * Copyright (C) 2009 by Diego '[Po]lentino' Casella * * * * 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 COMMITDIALOG_H #define COMMITDIALOG_H #include #include #include #include /** * Simple class used to display a dialog window where the user will write comments * about the commit he wants to perform. * The widget is composed of a QLineEdit, used to insert a bried ( and required ) * comment, and a QPlainTexEdit field, used to give more detailed information. * * @author Diego [Po]lentino Casella */ class CommitDialog : public KDialog { public: CommitDialog(QWidget *parent = 0); QString briefText() const; QString fullText() const; private: QLineEdit *m_commitBriefText; QPlainTextEdit *m_commitFullText; }; #endif // COMMITDIALOG_H plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/tabledelegate.cpp0000644000175000001440000000012712115142004023422 xustar000000000000000029 mtime=1362412548.62064117 29 atime=1362412548.62064117 29 ctime=1362412548.62064117 plasmate-1.0/plasmate/savesystem/tabledelegate.cpp0000644000175000001440000001122612115142004024055 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Diego '[Po]lentino' Casella 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 #include "tabledelegate.h" static const int ITEM_MARGIN_LEFT = 5; static const int ITEM_MARGIN_TOP = 5; static const int ITEM_MARGIN_RIGHT = 5; static const int ITEM_MARGIN_BOTTOM = 5; static const int ITEM_PADDING = 5; TableDelegate::TableDelegate() { } void TableDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { QBrush backBrush; QColor foreColor; bool disabled = false; bool hover = false; if (!(option.state & QStyle::State_Enabled)) { backBrush = option.palette.brush(QPalette::Disabled, QPalette::Base); foreColor = option.palette.color(QPalette::Disabled, QPalette::Text); disabled = true; // Since the TimeLine doesn't allow selectable items, because you don't actually "are" on a given savepoint, // we don't actually need this check. /*} else if (option.state & (QStyle::State_HasFocus | QStyle::State_Selected)) { backBrush = option.palette.brush(QPalette::Highlight); foreColor = option.palette.color(QPalette::HighlightedText);*/ } else if (option.state & QStyle::State_MouseOver) { backBrush = option.palette.color(QPalette::Highlight).darker(); foreColor = option.palette.color(QPalette::Text); hover = true; } else { /*if ( option.state & QStyle::State_Enabled )*/ backBrush = option.palette.brush(QPalette::Base); foreColor = option.palette.color(QPalette::Text); } QStyle *style = QApplication::style(); QStyleOptionViewItemV4 opt(option); // KStyle provides an "hover highlight" effect for free; // but we want that for non-KStyle-based styles too if (!style->inherits("KStyle") && hover) { Qt::BrushStyle bs = opt.backgroundBrush.style(); if (bs > Qt::NoBrush && bs < Qt::TexturePattern) opt.backgroundBrush = opt.backgroundBrush.color().light(115); else opt.backgroundBrush = backBrush; } painter->save(); style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, 0); painter->restore(); QIcon icon = index.data(Qt::DecorationRole).value< QIcon >(); if (!icon.isNull()) { QPoint iconpos( (option.rect.width() - option.decorationSize.width()) / 2, ITEM_MARGIN_TOP ); iconpos += option.rect.topLeft(); QIcon::Mode iconmode = disabled ? QIcon::Disabled : QIcon::Normal; painter->drawPixmap(iconpos, icon.pixmap(option.decorationSize, iconmode)); } QString text = index.data(Qt::DisplayRole).toString(); QRect fontBoundaries = QFontMetrics(option.font).boundingRect(text); fontBoundaries.setWidth(fontBoundaries.width() + ITEM_PADDING); QPoint textPos( ITEM_MARGIN_LEFT + (option.rect.width() - ITEM_MARGIN_LEFT - ITEM_MARGIN_RIGHT - fontBoundaries.width()) / 2, ITEM_MARGIN_TOP + option.decorationSize.height() + ITEM_PADDING ); fontBoundaries.translate(-fontBoundaries.topLeft()); fontBoundaries.translate(textPos); fontBoundaries.translate(option.rect.topLeft()); painter->setPen(foreColor); painter->drawText(fontBoundaries, Qt::AlignCenter, text); } QSize TableDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { QSize baseSize(option.decorationSize.width(), option.decorationSize.height()); QRect fontBoundaries = QFontMetrics(option.font).boundingRect(index.data(Qt::DisplayRole).toString()); baseSize.setWidth(qMax(fontBoundaries.width(), baseSize.width())); baseSize.setHeight(baseSize.height() + fontBoundaries.height() + 2*ITEM_PADDING); return baseSize += QSize(ITEM_MARGIN_LEFT + ITEM_MARGIN_RIGHT, ITEM_MARGIN_TOP + ITEM_MARGIN_BOTTOM); } plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/timeline.cpp0000644000175000001440000000012712115142004022446 xustar000000000000000029 mtime=1362412548.62064117 29 atime=1362412548.62064117 29 ctime=1362412548.62064117 plasmate-1.0/plasmate/savesystem/timeline.cpp0000644000175000001440000004510112115142004023100 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Aaron Seigo Copyright 2009-2010 Diego '[Po]lentino' Casella Copyright 2009-2010 Lim Yuen Hoe 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 #include #include #include #include #include #include #include #include #include #include #include #include #include "timeline.h" #include "tablewidget.h" #include "tabledelegate.h" #include "timelineitem.h" #include "dvcsjob.h" #include "gitrunner.h" #include "commitdialog.h" TimeLine::TimeLine(QWidget *parent, const KUrl &dir, Qt::DockWidgetArea location) :QDockWidget(i18n("TimeLine")) { m_gitRunner = new GitRunner(); initUI(parent, location); setWorkingDir(dir); } TimeLine::~TimeLine() { delete m_gitRunner; delete m_table; } void TimeLine::loadTimeLine(const KUrl &dir) { m_table->clear(); setWorkingDir(dir); if (!m_gitRunner->isValidDirectory()) { newSavePoint(); return; } m_branches = listBranches(); m_currentBranch = currentBranch(); TimeLineItem *branchItem = new TimeLineItem(); branchItem->setText(i18n("On branch: %1", m_currentBranch)); QString branchToolTip = i18n("You are currently working on branch:\n" "%1\n" "\n" "Available branches are:\n" "%2\n" "Click here to switch to those branches.", m_currentBranch, m_branches.join("\n") ); branchItem->setToolTip(branchToolTip); branchItem->setIdentifier(TimeLineItem::Branch); m_table->addItem(branchItem); TimeLineItem *saveItem = new TimeLineItem(); saveItem->setText(i18n("New save point")); saveItem->setIdentifier(TimeLineItem::NotACommit); m_table->addItem(saveItem); identifyCommits(m_table); parentWidget()->show(); } void TimeLine::identifyCommits(TableWidget *widget) { // Log gets the full git commit list if (m_gitRunner->log() != DvcsJob::JobSucceeded) { // handle error return; } const QString rawCommits = m_gitRunner->getResult(); const QStringList commitLog = rawCommits.split('\n',QString::SkipEmptyParts); // Regexp to match the sha1hash from the git commits. const QString regExp("(commit\\s[0-9a-f]{40})"); const QRegExp rx(regExp); TimeLineItem *commitItem = NULL; int logIndex = 0; // Iterate every commit log line. the newest commits are on the top of the log while ( logIndex < commitLog.size()) { QString toolTipText; // here we got a sha1hash, hence a new commit beginns if (commitLog.at(logIndex).contains(rx)) { commitItem = new TimeLineItem(); // set the git hash commitItem->setHash(commitLog.at(logIndex).right(40)); // FIXME: As long as the hash has 40 chars it works. ++logIndex; if (commitLog.at(logIndex).contains("Merge: ", Qt::CaseSensitive)) { commitItem->setIdentifier(TimeLineItem::Merge); ++logIndex; } else { commitItem->setIdentifier(TimeLineItem::Commit); } // The next line is the author toolTipText = commitLog.at(logIndex) + "\n\n"; ++logIndex; toolTipText.replace("Author", i18n("Author"), Qt::CaseSensitive); // Then comes the date QString date = commitLog.at(logIndex); ++logIndex; date.remove("Date: ",Qt::CaseSensitive); toolTipText.prepend(i18n("Created on: %1", date) + "\n"); //Our format date is Tue Nov 6 23:17:56 2012 +0200" QStringList dateList = date.split(" ", QString::SkipEmptyParts); QDateTime tmpDateTime = QDateTime::fromString(dateList.at(2) + " " + dateList.at(1) + " " + dateList.at(4) + " " + dateList.at(3), "d MMM yyyy hh:mm:ss"); QString localeTime = KGlobal::locale()->formatDateTime(tmpDateTime, KLocale::LongDate); commitItem->setText(localeTime); } // The rest is Commit log info while (logIndex < commitLog.size()) { if (commitLog.at(logIndex).contains(rx)) { break; } toolTipText.append(commitLog.at(logIndex) + "\n"); ++logIndex; } commitItem->setToolTip(toolTipText); //check if this is the last item if (logIndex + 1 < commitLog.size()) { // The last Item is maked as such. commitItem->setText(i18n("First save point")); } widget->addItem(commitItem); } } QStringList TimeLine::listBranches() const { QStringList branchList; if (m_gitRunner->branches() != DvcsJob::JobSucceeded) { // handle error return branchList; } // Scan available branches,and save them const QString branches = m_gitRunner->getResult(); foreach (QString branch, branches.split('\n', QString::SkipEmptyParts)) { branch.remove(0, 2); // Clean the string form * branchList.append(branch); } return branchList; } QString TimeLine::currentBranch() const { if (m_gitRunner->currentBranch() != DvcsJob::JobSucceeded) { return QString(); } return m_gitRunner->getResult(); } Qt::DockWidgetArea TimeLine::location() const { return m_table->location(); } void TimeLine::showContextMenu(QTableWidgetItem *item) { emit savePointClicked(); TimeLineItem *tlItem = dynamic_cast(item); if (!tlItem) { return; } KMenu menu(this); menu.addTitle(tlItem->toolTip()); menu.addSeparator(); switch (tlItem->getIdentifier()) { case TimeLineItem::Commit: case TimeLineItem::Merge: { QAction *restoreCommit = menu.addAction(i18n("Restore save point")); restoreCommit->setData(QVariant(tlItem->getHash())); QAction *moveToCommit = menu.addAction(i18n("Move to this save point")); moveToCommit->setData(QVariant(tlItem->getHash())); connect(restoreCommit, SIGNAL(triggered(bool)), this, SLOT(restoreCommit())); connect(moveToCommit, SIGNAL(triggered(bool)), this, SLOT(moveToCommit())); break; } case TimeLineItem::Branch: { QAction *createBranch = menu.addAction(i18n("Create new branch")); QMenu *switchBranchMenu = menu.addMenu(i18n("Switch to branch")); QMenu *mergeBranchMenu = menu.addMenu(i18n("Combine into branch")); QAction *renameBranch = menu.addAction(i18n("Rename current branch")); menu.addSeparator(); QMenu *deleteBranchMenu = menu.addMenu(i18n("Delete branch")); const int index = m_branches.size(); // Scan all the branches and, create a menu item for each item, and connect them for (int i = 0; i < index; ++i) { const QString tmp = m_branches.value(i); if (tmp.compare(m_currentBranch) == 0) { continue; } connect(switchBranchMenu->addAction(tmp), SIGNAL(triggered(bool)), this, SLOT(switchBranch())); connect(mergeBranchMenu->addAction(tmp), SIGNAL(triggered(bool)), this, SLOT(mergeBranch())); connect(deleteBranchMenu->addAction(tmp), SIGNAL(triggered(bool)), this, SLOT(deleteBranch())); } connect(createBranch, SIGNAL(triggered(bool)), this, SLOT(createBranch())); connect(renameBranch, SIGNAL(triggered(bool)), this, SLOT(renameBranch())); switchBranchMenu->setEnabled(!switchBranchMenu->actions().isEmpty()); mergeBranchMenu->setEnabled(!mergeBranchMenu->actions().isEmpty()); deleteBranchMenu->setEnabled(!deleteBranchMenu->actions().isEmpty()); renameBranch->setEnabled(m_currentBranch != "master"); break; } case TimeLineItem::NotACommit: { newSavePoint(); return; } case TimeLineItem::OutsideWorkingDir: break; } QRect rc = m_table->visualItemRect(tlItem); menu.exec(mapToGlobal(rc.bottomLeft())); } void TimeLine::newSavePoint() { QString commitMessage; CommitDialog *commitDialog = new CommitDialog(); commitDialog->setModal(true); connect(commitDialog, SIGNAL(finished()), commitDialog, SLOT(deleteLater())); bool dialogAlreadyOpen = false; if (!m_gitRunner->isValidDirectory()) { dialogAlreadyOpen = true; commitMessage = i18n("Initial Commit"); m_gitRunner->init(m_workingDir); // Retrieve Name and Email, and set git global parameters Plasma::PackageMetadata metadata(m_workingDir.pathOrUrl() + "metadata.desktop"); m_gitRunner->setAuthor(metadata.author()); m_gitRunner->setEmail(metadata.email()); // Set up a basic .gitignore file m_gitRunner->addIgnoredFileExtension("*.*~"); m_gitRunner->addIgnoredFileExtension("*.*bak"); m_gitRunner->addIgnoredFileExtension("NOTES"); } if (!m_gitRunner->hasNewChangesToCommit()) { const QString dialog = i18n("No changes have been made in order to create a savepoint."); KMessageBox::information(this, dialog); return; } if (!dialogAlreadyOpen) { if (commitDialog->exec() == KDialog::Rejected) { return; } commitMessage = commitDialog->briefText(); } // Ensure the required comment is not empty if (commitMessage.isEmpty()) { return; } QString optionalComment = commitDialog->fullText(); if (!optionalComment.isEmpty() != 0) { commitMessage.append("\n\n"); commitMessage.append(optionalComment); } m_gitRunner->add(KUrl::List(QString('.'))); m_gitRunner->commit(commitMessage); loadTimeLine(m_workingDir); if (isHidden()) { show(); } } void TimeLine::restoreCommit() { const QString dialog = (i18n("You are restoring the selected save point.\nWith this operation, all the save points and branches created starting from it, will be deleted.\nContinue anyway?")); const int code = KMessageBox::warningContinueCancel(this, dialog); if (code!=KMessageBox::Continue) { return; } QAction *sender = qobject_cast(this->sender()); QVariant data = sender->data(); m_gitRunner->deleteCommit(data.toString()); loadTimeLine(m_workingDir); emit sourceDirectoryChanged(); } void TimeLine::moveToCommit() { QString dialog = i18n("You are going to move to the selected save point.\nTo perform this, a new branch will be created and your current work may be lost if you do not have saved it as a Savepoint.\nContinue?"); const int code = KMessageBox::warningContinueCancel(this,dialog); if (code!=KMessageBox::Continue) { return; } bool ok; const QString newBranchName = branchDialog(&ok); if (!ok) { return; } if (m_branches.contains(newBranchName)) { dialog = i18n("Cannot rename the section: a section with this name already exists."); KMessageBox::information(this, dialog); return; } // Retrieve data from the sender QAction *sender = qobject_cast(this->sender()); QVariant data = sender->data(); m_gitRunner->moveToCommit(data.toString(), newBranchName); loadTimeLine(m_workingDir); emit sourceDirectoryChanged(); } void TimeLine::switchBranch() { QAction *sender = qobject_cast(this->sender()); QString branch = sender->text(); branch.remove('&'); m_gitRunner->switchBranch(branch); loadTimeLine(m_workingDir); emit sourceDirectoryChanged(); } void TimeLine::mergeBranch() { // Prompt the user that a new save point will be created; if so, // popup a Savepoint dialog. const QString dialog = i18n("You are going to combine two branches.\nWith this operation, a new save point will be created; then you should have to manually resolve some conflicts on source code. Continue?"); const int code = KMessageBox::warningContinueCancel(this,dialog); if (code!=KMessageBox::Continue) { return; } CommitDialog *commitDialog = new CommitDialog(); connect(commitDialog, SIGNAL(finished()), commitDialog, SLOT(deleteLater())); commitDialog->setModal(true); if (commitDialog->exec() == KDialog::Rejected) { return; } QString commit = commitDialog->briefText(); QString optionalComment = commitDialog->fullText(); if (!optionalComment.isEmpty()) { commit.append("\n\n"); commit.append(optionalComment); } QString branchToMerge = m_currentBranch; QAction *sender = qobject_cast(this->sender()); QString branch = sender->text(); branch.remove('&'); // To merge current branch into the selected one, first whe have to // move to the selected branch and then call merge function ! m_gitRunner->switchBranch(branch); m_gitRunner->mergeBranch(branchToMerge, commit); loadTimeLine(m_workingDir); emit sourceDirectoryChanged(); } void TimeLine::deleteBranch() { const QString dialog = i18n("You are going to remove the selected branch.\nWith this operation, you will also delete all save points and branches performed inside it.\nContinue anyway?"); const int code = KMessageBox::warningContinueCancel(this,dialog); if (code!=KMessageBox::Continue) { return; } QAction *sender = qobject_cast(this->sender()); QString branch = sender->text(); branch.remove('&'); m_gitRunner->deleteBranch(branch); loadTimeLine(m_workingDir); } void TimeLine::renameBranch() { QAction *sender = qobject_cast(this->sender()); QString branch = sender->text(); branch.remove('&'); bool ok; const QString newBranchName = branchDialog(&ok); if (!ok) { return; } QString dialog = i18n("Cannot rename the section: a section with this name already exists."); KMessageBox::information(this, dialog); return; m_gitRunner->renameBranch(newBranchName); loadTimeLine(m_workingDir); } void TimeLine::createBranch() { QAction *sender = qobject_cast(this->sender()); QString branch = sender->text(); branch.remove('&'); bool ok; const QString newBranchName = branchDialog(&ok); if (!ok) { return; } const QString dialog = i18n("Cannot create section: a section with this name already exists."); KMessageBox::information(this, dialog); return; m_gitRunner->newBranch(newBranchName); loadTimeLine(m_workingDir); } bool TimeLine::setWorkingDir(const KUrl &dir) { if (dir.isValid()) { m_gitRunner->setDirectory(dir); m_workingDir = dir; return true; } // If the dir hasn't a git tree, don't show nothig! hide(); return false; } void TimeLine::initUI(QWidget *parent,Qt::DockWidgetArea location) { Q_UNUSED(parent) setFeatures(QDockWidget::AllDockWidgetFeatures); m_table = new TableWidget(location); m_table->setParent(this); setWidget(m_table); m_delegate = new TableDelegate(); m_table->setItemDelegate(m_delegate); connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)), m_table,SLOT(updateLayout(Qt::DockWidgetArea))); connect(m_table, SIGNAL(itemClicked(QTableWidgetItem *)), this, SLOT(showContextMenu(QTableWidgetItem *))); } void TimeLine::resizeEvent (QResizeEvent * event) { /* I've reimplemented this event handler because, when resizing the main widget to a size smaller than the dockwidget, a bothersome effects appears. According with the orientation, it appears a scrollbar INSIDE the m_table widget, which hovers partially the icons when the dock is vertical, and hovers completely the text when it is horizontal. So I've implemented this simple workaround, in order to expand the dockwidget when a scrollbar is shown. I know that resizing a child widget inside a parent resizeEvent() is dangerous at 98%, by the way this trick is very simple and well structured, so it wont cause issues I hope =) */ QSize newSize = event->size(); //qDebug() << "New size: " << newSize; //qDebug() << "m_table size:" << m_table->size(); //qDebug() << "m_table total length" << m_table->totalLenght(); bool vertical = ((m_table->location() == Qt::RightDockWidgetArea) || (m_table->location() == Qt::LeftDockWidgetArea)); if (vertical) { if (m_table->totalLenght() > newSize.height()) { m_table->setFixedWidth(m_table->columnWidth(0) + m_table->scrollbarSize(vertical).width()); return; } else { if (m_table->columnWidth(0) < newSize.width()) { m_table->setFixedWidth(m_table->columnWidth(0)); return; } } } else { if (m_table->totalLenght() > newSize.width()) { m_table->setFixedHeight(m_table->rowHeight(0) + m_table->scrollbarSize(vertical).height()); return; } else { if (m_table->rowHeight(0) < newSize.height()) { m_table->setFixedHeight(m_table->rowHeight(0)); return; } } } } QString TimeLine::branchDialog(bool *ok) { QValidator *validator = new QRegExpValidator(QRegExp("[a-zA-Z0-9_.]*")); return KInputDialog::getText(i18n("New Branch"), i18n("New branch name:"), "type here", ok, this, validator); } #include "moc_timeline.cpp" plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/commitdialog.cpp0000644000175000001440000000012712115142004023310 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/savesystem/commitdialog.cpp0000644000175000001440000000531712115142004023747 0ustar00kokeroulisusers00000000000000/****************************************************************************** * Copyright (C) 2009 by Diego '[Po]lentino' Casella * * * * 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 * * * ******************************************************************************/ /** * Simple class that pops-up a dialog to add a comment to the commit */ #include "commitdialog.h" #include #include #include CommitDialog::CommitDialog(QWidget *parent) : KDialog(parent) { setWindowTitle(i18n("New Save Point")); QWidget *mainWidget = new QWidget(this); QFormLayout *layout = new QFormLayout(mainWidget); QLabel *commitBriefLabel = new QLabel(i18n("Brief comment (required):"), mainWidget); m_commitBriefText = new QLineEdit(i18n("Type here a brief description"), mainWidget); layout->addRow(commitBriefLabel, m_commitBriefText); QLabel *commitFullLabel = new QLabel(i18n("Detailed comment:"), mainWidget); m_commitFullText = new QPlainTextEdit(mainWidget); layout->addRow(commitFullLabel, m_commitFullText); setMainWidget(mainWidget); setButtons(KDialog::Ok | KDialog::Cancel); setButtonText(KDialog::Ok, i18n("Create Save Point")); m_commitBriefText->setFocus(); m_commitBriefText->selectAll(); connect(m_commitBriefText, SIGNAL(returnPressed()), this, SLOT(accept())); } QString CommitDialog::briefText() const { return m_commitBriefText->text(); } QString CommitDialog::fullText() const { return m_commitFullText->toPlainText(); } #include "commitdialog.moc" plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/dvcsjob.cpp0000644000175000001440000000012712115142004022272 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/savesystem/dvcsjob.cpp0000644000175000001440000001541512115142004022731 0ustar00kokeroulisusers00000000000000/****************************************************************************** * Copyright (C) 2009 by Diego '[Po]lentino' Casella * * * * 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 "dvcsjob.h" DvcsJob::DvcsJob() { m_process = new KProcess(); this->clear(); } DvcsJob::~DvcsJob() { if (m_process) delete m_process; m_process = 0; } void DvcsJob::clear() { //Do not use KProcess::clearEnvironment() // (it sets the environment to kde_dummy) m_command.clear(); m_output.clear(); m_comm = KProcess::SeparateChannels; m_directory = QDir::temp(); m_isRunning = m_failed = m_wasStarted = false; } void DvcsJob::setDirectory(const QDir &directory) { m_directory = directory; } void DvcsJob::setStandardInputFile(const QString &fileName) { m_process->setStandardInputFile(fileName); } const QDir & DvcsJob::getDirectory() const { return m_directory; } bool DvcsJob::isRunning() const { return m_isRunning; } DvcsJob& DvcsJob::operator<<(const QString &arg) { m_command.append(arg); return *this; } DvcsJob& DvcsJob::operator<<(const char *arg) { m_command.append(arg); return *this; } DvcsJob& DvcsJob::operator<<(const QStringList &args) { m_command << args; return *this; } QString DvcsJob::dvcsCommand() const { return m_command.join(" "); } QString DvcsJob::output() const { QByteArray stdoutbuf = rawOutput(); int endpos = stdoutbuf.size(); if (isRunning()) { // We may have received only part of a code-point endpos = stdoutbuf.lastIndexOf('\n') + 1; // Include the final newline or become 0, when there isRun no newline } return QString::fromLocal8Bit(stdoutbuf, endpos); } QByteArray DvcsJob::rawOutput() const { return m_output; } void DvcsJob::start() { m_wasStarted = true; QString workingDirectory = m_directory.absolutePath(); m_process->setWorkingDirectory(workingDirectory); // Processing the signal result connect(m_process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotProcessExited(int, QProcess::ExitStatus))); connect(m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(slotProcessError(QProcess::ProcessError))); connect(m_process, SIGNAL(readyReadStandardError()), this, SLOT(slotReceivedStderr())); connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(slotReceivedStdout())); m_output.clear(); m_isRunning = true; m_process->setOutputChannelMode(m_comm); m_process->setProgram(m_command); m_process->setEnvironment(QProcess::systemEnvironment()); //the started() and error() signals may be delayed! It causes crash with deferred deletion!!! m_process->start(); m_process->waitForFinished(-1); } void DvcsJob::setCommunicationMode(KProcess::OutputChannelMode m_comm) { m_comm = m_comm; } void DvcsJob::cancel() { m_process->kill(); } void DvcsJob::slotProcessError(QProcess::ProcessError error) { // disconnect all connections to childproc's signals; they are no longer needed m_process->disconnect(); m_isRunning = false; //NOTE: some DVCS commands can use stderr... m_failed = true; //Do not use d->childproc->exitCode() to set an error! If we have FailedToStart exitCode will return 0, //and if exec is used, exec will return true and that is wrong! setError(UserDefinedError); setErrorText(i18n("Process exited with status %1", m_process->exitCode())); QString errorValue; //if trolls add Q_ENUMS for QProcess, then we can use better solution than switch: //QMetaObject::indexOfEnumerator(char*), QLatin1String(QMetaEnum::valueToKey())... switch (error) { case QProcess::FailedToStart: errorValue = "FailedToStart"; break; case QProcess::Crashed: errorValue = "Crashed"; break; case QProcess::Timedout: errorValue = "Timedout"; break; case QProcess::WriteError: errorValue = "WriteErro"; break; case QProcess::ReadError: errorValue = "ReadError"; break; case QProcess::UnknownError: errorValue = "UnknownError"; break; } kDebug() << "oops, found an error while running" << dvcsCommand() << ":" << errorValue << "Exit code is:" << m_process->exitCode(); jobIsReady(); } void DvcsJob::slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus) { // disconnect all connections to childproc's signals; they are no longer needed m_process->disconnect(); m_isRunning = false; if (exitStatus != QProcess::NormalExit || exitCode != 0) slotProcessError(QProcess::UnknownError); kDebug() << "process has finished with no errors"; jobIsReady(); } void DvcsJob::slotReceivedStdout() { // accumulate output m_output.append(m_process->readAllStandardOutput()); } void DvcsJob::slotReceivedStderr() { // accumulate output m_output.append(m_process->readAllStandardError()); } void DvcsJob::setCommandArguments(const QStringList &args) { m_command.append(args); } DvcsJob::JobStatus DvcsJob::status() const { if (!m_wasStarted) return JobNotStarted; if (m_failed) return JobFailed; if (m_isRunning) return JobRunning; return JobSucceeded; } void DvcsJob::jobIsReady() { //emit readyForParsing(this); //let parsers to set status emitResult(); //KJob //emit resultsReady(this); //VcsJob //reset stases; m_isRunning = m_failed = false; } KProcess* DvcsJob::getChildproc() { return m_process; } #include "moc_dvcsjob.cpp" plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/gitrunner.h0000644000175000001440000000012712115142004022322 xustar000000000000000029 mtime=1362412548.62064117 29 atime=1362412548.62064117 29 ctime=1362412548.62064117 plasmate-1.0/plasmate/savesystem/gitrunner.h0000644000175000001440000002761612115142004022767 0ustar00kokeroulisusers00000000000000/****************************************************************************** * Copyright (C) 2009 by Diego '[Po]lentino' Casella * * * * 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 GITRUNNER_H #define GITRUNNER_H #include "dvcsjob.h" #include #include #include #include #include /** * This class executes the majority of Git commands. * Its usage is very simple: after setting the communication mode and the working directory, * you simply have to call the desired method, check the return value to ensure the process * has correctly done its duty, and check/process the saved result. * * @note Always remember to check the result of a git command, before performing an other one, * because every command call ovverrides the previous stored result. * * Example of usage: * @code * GitRunner *git = new GitRunner(); * git->setDirectory(KUrl("/home/user/foo/")); * git->setCommunicationMode(KProcess::SeparateChannels); * if(git->isValidDirectory()) { * // We are now sure to be in a valid git root tree * * // Now suppose to create some files named foo.h foo.cpp under "foo/": * // we add it to the git index by doing this * QStringList *list = new QStringList(); * *list << "foo.h" << "foo.cpp"; * * // Note: sometimes is more easy to pass a list with only an argument: '.', * // so git will automatically add all new/changed files under the working * // directory and its subdirectories =) * * if(git->add(KUrl::List(*list)) == DvcsJob::JobSucceeded) { * // Here we are sure the files are added correctly to git index; * // so now we can commit. * * if(git->commit("My first commit") != DvcsJob::JobSucceeded) { * // Deal with errors * } * } else { * // Deal with a unsuccessful git-add command * } * * // Now retrieve the available branches * if(git->branches() != DvcsJob::JobSucceeded) { * // Deal with errors * } * QString branches = git->getResult(); * * // Now let suppose you find an oldBranch branch, and you want to delete it * if(git->deleteBranch(oldBranch) != DvcsJob::JobSucceeded) { * //Do something * } * @endcode * * @author Diego [Po]lentino Casella */ class GitRunner { public: /** * Simple constructor; it initializes the class with some default parameters. * @see setDirectory() * @see setCommunicationMode() */ GitRunner(); ~GitRunner(); /** * Checks if the current working directory is inside a valid git repository, * and that directory is also the root of that repo. * @return True if the directory is the git root tree, false otherwise. Note that * if we set as working directory a subdirectory managedby git, it will returns false. */ bool isValidDirectory(); /** * Checks if the current git index has new changes/files that could be committed. * @return True if there are changes to be committed, false otherwise. */ bool hasNewChangesToCommit(); /** * @return True if a git command is still running, false otherwise. * @note Since the main thread is blocked until the command is executed, this * method is useful when there are more threads running in the same app. */ bool isRunning(); /** * Sets the working directory for our class. * @param dir A KUrl with the absolute path of the working directory. */ void setDirectory(const KUrl &dir); /** * Sets the communication mode. * @param comm Accepts one of the KProcess:OutputChannelMode modes. */ void setCommunicationMode(KProcess::OutputChannelMode comm); /** * Adds a list of files in the git index, so they are ready to be committed later. * @param localLocations A list of KUrl containing the absolute of the files * that will be added. * @return The status of the performed operation. * @note Sometimes is more easy using a KUrl::List with a single element, '.' ; by * doing this, git will automatically include recursively all the modified/new * files in the working directory. */ DvcsJob::JobStatus add(const KUrl::List &localLocations); /** * Clones an existing git repository to an other one. * @note Now is supported only a local cloning operation; soon there will be * a more general cloning support over the internet. * @param repoOrigin The absolute path of the directory containing the git repo. * @param repoDestination The destination where cloning the source to. * @return The status of the performed operation. */ DvcsJob::JobStatus createWorkingCopy(const KUrl &repoOrigin, const KUrl &repoDestination); /** * Removes the listed files from the directory and the git repo. * @param files A List of KUrl files to be removed. * @return The status of the performed operation. */ DvcsJob::JobStatus remove(const KUrl::List &files); /** * Checks the status of the git index tree, useful to look for uncommitted cnahges. * @return The status of the performed operation. */ DvcsJob::JobStatus status(); /** * Commits the files previously added, and stores also a message containing some infos about it. * @param message The string containing the message to be included in the commit. * @return The status of the performed operation. */ DvcsJob::JobStatus commit(const QString &message); /** * Move HEAD from the current stage, to the commit pointed by its sha1hash, and then * create a new branch so new changes won't affect the original branch history. * @param sha1hash The sha1 hash string representing the commit we want to point to. * @param newBranch The string representing the new branch. * @return The status of the performed operation. */ DvcsJob::JobStatus moveToCommit(const QString &sha1hash, const QString &newBranch); /** * Delete the commit pointed by its sha1hash. * @param sha1hash The sha1 has string representing the commit we want to delete. * @return The status of the performed operation. * @note This command will also delete all the commits directly derived from * this one, so pay attention when using it. * @see moveToCommit() */ DvcsJob::JobStatus deleteCommit(const QString &sha1hash); /** * Logs all git-related event, such as commits, merges and so on. * @return The status of the performed operation. */ DvcsJob::JobStatus log(); /** * Init a new git repository tree in the given directory. * @param directory The directory we want being revision-controlled. * @return The status of the performed operation. */ DvcsJob::JobStatus init(const KUrl &directory); /** * It adds a new line inside the .gitignore file (if any, will be created too) * @param file extension to be ignored from git */ void addIgnoredFileExtension(const QString ignoredFileExtension); /** * Create a new branch with the given name. * @param newBranch The string containing the new branch name. * @return The status of the performed operation. */ DvcsJob::JobStatus newBranch(const QString &newBranch); /** * Renames the current branch with the new name supplied. * @param newBranch The string containing the new name for the current branch. * @return The status of the performed operation. */ DvcsJob::JobStatus renameBranch(const QString &newBranch); /** * Switch to the supplied branch. * @param newBranch The string containing the name of the branch we want to move into. * @return The status of the performed operation. */ DvcsJob::JobStatus switchBranch(const QString &newBranch); /** * Merges the current branch with the branch supplied, creating a new commit and * setting a message. * @param branchName The string containing the branch name we want to merge with. * @param message The string used to store the merge commit. * @return The status of the performed operation. * @note Always commit before performing a merge, otherwise you'll lose all your * uncommitted work. */ DvcsJob::JobStatus mergeBranch(const QString &branchName, const QString &message); /** * Deletes the branch passed. * @param The string containing the branch you no longer need and want to remove. * @return The status of the performed operation. * @note It deletes also the commit directly derived from it, so ensure they're no * longer needed. */ DvcsJob::JobStatus deleteBranch(const QString &branch); /** * Retrieve the current branch in use. * @return The status of the performed operation. */ DvcsJob::JobStatus currentBranch(); /** * Retrieves all the branches available in the current git repo. * @return The status of the performed operation. * @note The current branch is marked with a '*'. */ DvcsJob::JobStatus branches(); /** * Utility function: sets the author name, so it will be displayed when * calling git-log or querying a particular commit. * @param The string representing the author name. * @return The status of the performed operation. */ DvcsJob::JobStatus setAuthor(const QString &username); /** * Utility function: sets the author email, so it will be displayed when * calling git-log or querying a particular commit. * @param The string representing the author email. * @return The status of the performed operation. */ DvcsJob::JobStatus setEmail(const QString &email); /** * @return The string containing the result of the last action performed. */ QString& getResult(); private: /** * Private function that initialize the job. * @param The job that must be initialized. */ void initJob(DvcsJob &job); /** * Private function that start the job. * @param The job that must be started. */ void startJob(DvcsJob &job); QString m_result; KUrl *m_lastRepoRoot; DvcsJob::JobStatus m_jobStatus; KProcess::OutputChannelMode m_commMode; volatile bool m_isRunning; }; #endif plasmate-1.0/plasmate/savesystem/PaxHeaders.5990/gitrunner.cpp0000644000175000001440000000012712115142004022655 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/savesystem/gitrunner.cpp0000644000175000001440000002305012115142004023306 0ustar00kokeroulisusers00000000000000/****************************************************************************** * Copyright (C) 2009 by Diego '[Po]lentino' Casella * * * * 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 "gitrunner.h" #include "dvcsjob.h" #include #include #include #include #include GitRunner::GitRunner() { //m_job = new DvcsJob(); m_commMode = KProcess::SeparateChannels; m_lastRepoRoot = new KUrl(); m_result = QString(); m_isRunning = false; m_jobStatus = DvcsJob::JobNotStarted; } GitRunner::~GitRunner() { /*if( m_job ) delete m_job;*/ delete m_lastRepoRoot; } void GitRunner::initJob(DvcsJob &job) { job.setCommunicationMode(m_commMode); job.setDirectory(QDir(m_lastRepoRoot->pathOrUrl())); job << "git"; } void GitRunner::startJob(DvcsJob &job) { m_result.clear(); m_isRunning = true; job.start(); m_result.append(job.output()); // Save the result m_isRunning = false; m_jobStatus = job.status(); // Save job status job.cancel(); // Kill the job delete &job; } void GitRunner::setCommunicationMode(KProcess::OutputChannelMode comm) { m_commMode = comm; } void GitRunner::setDirectory(const KUrl &dir) { m_lastRepoRoot->setDirectory(dir.pathOrUrl()); } bool GitRunner::isRunning() { return m_isRunning; } bool GitRunner::isValidDirectory() { const QString initialPath(m_lastRepoRoot->toLocalFile(KUrl::RemoveTrailingSlash)); setDirectory(*m_lastRepoRoot); // A possible git repo has a .git subdicerctory const QString gitDir(".git"); // Also, git rev-parse --is-inside-work-tree returns "true" if we are // inside any subdirectory of the git tree. DvcsJob *job = new DvcsJob(); initJob(*job); *job << "rev-parse"; *job << "--is-inside-work-tree"; startJob(*job); QFileInfo finfo(initialPath); QDir dir; if (finfo.isFile()) { dir = finfo.absoluteDir(); } else { dir = QDir(initialPath); dir.makeAbsolute(); } return (dir.exists(gitDir) && m_result.compare("true")) ? true : false; } bool GitRunner::hasNewChangesToCommit() { if(status() != DvcsJob::JobSucceeded) return false; if(m_result.contains("nothing to commit (working directory clean)", Qt::CaseSensitive)) return false; return true; } QString& GitRunner::getResult() { return m_result; } DvcsJob::JobStatus GitRunner::init(const KUrl &directory) { // We need to tell the runner to change dir! m_lastRepoRoot->setDirectory(directory.pathOrUrl()); DvcsJob *job = new DvcsJob(); initJob(*job); *job << "init"; startJob(*job); return m_jobStatus; } void GitRunner::addIgnoredFileExtension(const QString ignoredFileExtension) { QFile gitIgnoreFile(this->m_lastRepoRoot->path() + "/.gitignore"); if(!gitIgnoreFile.exists()) { gitIgnoreFile.open(QIODevice::ReadWrite); gitIgnoreFile.write(ignoredFileExtension.toUtf8() + '\n'); } else { gitIgnoreFile.open(QIODevice::Append); gitIgnoreFile.write(ignoredFileExtension.toUtf8() + '\n'); } gitIgnoreFile.close(); } DvcsJob::JobStatus GitRunner::createWorkingCopy(const KUrl &repoOrigin, const KUrl &repoDestination) { // TODO: now supports only cloning a local repo(not very useful, I know =P), // so extend the method to be used over the Internet. m_lastRepoRoot->setDirectory(repoDestination.pathOrUrl()); DvcsJob *job = new DvcsJob(); initJob(*job); *job << "clone"; *job << repoOrigin.pathOrUrl(); startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::add(const KUrl::List &localLocations) { if (localLocations.empty()) return m_jobStatus = DvcsJob::JobCancelled; DvcsJob *job = new DvcsJob(); initJob(*job); *job << "add"; // Adding files to the runner. QStringList stringFiles = localLocations.toStringList(); while (!stringFiles.isEmpty()) { *job << m_lastRepoRoot->pathOrUrl() + '/' + stringFiles.takeAt(0); } startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::status() { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "status"; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::commit(const QString &message) { // NOTE: git doesn't allow empty commit ! if (message.isEmpty()) return m_jobStatus = DvcsJob::JobCancelled; DvcsJob *job = new DvcsJob(); initJob(*job); *job << "commit"; *job << "-m"; //Note: the message is quoted somewhere else *job << message; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::moveToCommit(const QString &sha1hash, const QString &newBranch) { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "checkout"; *job << sha1hash; startJob(*job); if (m_jobStatus != DvcsJob::JobSucceeded) return m_jobStatus; job = new DvcsJob(); initJob(*job); *job << "checkout"; *job << "-b"; *job << newBranch; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::deleteCommit(const QString &sha1hash) { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "reset"; *job << "--hard"; *job << sha1hash; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::remove(const KUrl::List &files) { if (files.empty()) return m_jobStatus = DvcsJob::JobCancelled; DvcsJob *job = new DvcsJob(); initJob(*job); *job << "rm"; QStringList stringFiles = files.toStringList(); while (!stringFiles.isEmpty()) { *job << m_lastRepoRoot->pathOrUrl() + '/' + stringFiles.takeAt(0); } startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::log() { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "log"; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::switchBranch(const QString &newBranch) { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "checkout"; *job << newBranch; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::mergeBranch(const QString &branchName, const QString &message) { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "merge"; *job << "--no-ff"; *job << "-m"; *job << message; *job << branchName; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::deleteBranch(const QString &branch) { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "branch"; *job << "-D"; *job << branch; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::currentBranch() { DvcsJob::JobStatus status = branches(); if (status != DvcsJob::JobSucceeded) return status; // Every branch is listed in one line. so first split by lines, // then look for the branch marked with a "*". QStringList list = m_result.split('\n'); QString tmp = list.takeFirst(); while (!tmp.contains('*', Qt::CaseInsensitive)) tmp = list.takeFirst(); tmp.remove(0, 2); m_result = tmp; return status; } DvcsJob::JobStatus GitRunner::branches() { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "branch"; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::newBranch(const QString &newBranch) { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "branch"; *job << newBranch; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::renameBranch(const QString &newBranch) { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "branch"; *job << "-m"; *job << newBranch; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::setAuthor(const QString &username) { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "config"; *job << "user.name"; *job << username; startJob(*job); return m_jobStatus; } DvcsJob::JobStatus GitRunner::setEmail(const QString &email) { DvcsJob *job = new DvcsJob(); initJob(*job); *job << "config"; *job << "user.email"; *job << email; startJob(*job); return m_jobStatus; } plasmate-1.0/plasmate/PaxHeaders.5990/sidebartablewidget.h0000644000175000001440000000013212115142004021723 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/sidebartablewidget.h0000644000175000001440000000424212115142004022362 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Diego '[Po]lentino' Casella Copyright 2009-2010 Laurent Montel 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 SIDEBARTABLEWIDGET_H #define SIDEBARTABLEWIDGET_H #include class SidebarItem; class SidebarTableWidget : public QTableWidget { Q_OBJECT public: SidebarTableWidget(Qt::DockWidgetArea location, QWidget *parent = 0); ~SidebarTableWidget(); void addItem(SidebarItem *item); void clear(); QSize scrollbarSize(bool vertical); Qt::DockWidgetArea location(); int totalLenght(); public Q_SLOTS: void updateLayout(Qt::DockWidgetArea location); protected: private: void updateSize(SidebarItem *item); void mouseReleaseEvent(QMouseEvent *event); QScrollBar *m_horizontalSB; QScrollBar *m_verticalSB; Qt::DockWidgetArea m_location; // Max Cell Dimension: according with its position, could be a width or height int m_maxCellDimension; // Total Length: stores the width/height of the entire row/column int m_totalLenght; // from QTableWidget void mouseDoubleClickEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event); //void mouseReleaseEvent(QMouseEvent *event); QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers); }; #endif // SIDEBARTABLEWIDGET_H plasmate-1.0/plasmate/PaxHeaders.5990/README0000644000175000001440000000012712115142004016611 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/README0000644000175000001440000001600412115142004017243 0ustar00kokeroulisusers00000000000000PlasMate === Development and Feedback === Please report bugs to http://bugs.kde.org under the plasmate component. Development discussion occurs on the plasma-deve@kde.org mailing list and #plasma on irc.freenode.net. Patch review is done on http://reviewboard.kde.org and patches should be assigned to the plasma group. Coding style is the KDE Libs Coding Style: http://techbase.kde.org/Policies/Kdelibs_Coding_Style === First Impressions === On launch the window will contain only a "start page". Logo at the top, tagline describing what it does right under that (bonus points for an animation when it appears). Beneath that three sets of options: Continue Working On.., Create a New..., Open An Existing... Each of those options will then have a list of clickable links to get started. Continue Working On will list the last few projects opened, or be hidden if there are no recent projects. Create A New will include options for Widgets, DataEngine or Theme. Open An Existing will provide those as well, but launch a file dialog. The intended user experience is "launch, click, work!" No menu bars, no project workspace by default (like a normal IDE tends to) on first launch. Once started, the work flow is: edit, preview, repeat, save point, repeat, publish ... repeat. ;) === The Work Interface === The main work interface will be divided into two area: the editor/viewer as the main widget, and toolboxes to provide workflow. The most important toolbox will be the Package Listing. This will be a tree that shows the contents of a Plasma::PackageStructure. Given that we know from the PackageStructure the mimetypes, etc, of each entry we can use this to make it easy to add items. Each directory in the listing will have an "Add.." entry, and the metadata.desktop file will also be listed. Behind the scenes, it will use a KDirWatch to update based on the filesystem. Other toolboxes will include: * the Widget previewer: with buttons to set the form factor and location as well as reload the widget. This way the author can simply preview their widget as they go, including interction. * timeline: save point browser and selector * notes/todos: a place for the author to collect their thoughts as they work (<-- very very nice idea) * documentation * widgets explorer (listing of Plasma::Widgets, links to the doc) === Editor / Viewer === When an entry is selected in the Package Listing, the selected file will be shown in the Editor/Viewer. Using KParts for all but a few types of entries will allow the user to edit code, view SVGs (we probably don't want the user to view/edit svgs with a kpart. dunno if you remember the application i made some time ago to help testing themes, but I think that i can integrate that with some information taken from plasma, like elements that can be themed... this requires some thinking...), etc. without having to write any appreciable amount of code ourselves. There are some editors that will need to be written from scratch, however. These include: * Metadata: a simple form that lets one fill in the metadata. Plasmagik should have some code about this. * KConfigXt: a form to create KConfigXt files; this will be used for both the configuration entries in a widget as well as Service .operation files. * SVG theme visualizer (look at ruphy's app) Integrating Qt Designer would also be a goal at some point. Tricky though, especially for the code it will generate. Requires further thinking, and not for the first releases. === Integrated Revision Control, or the Save-less Interface === Integrating a simple git-based revision control system will be critical to providing both a smooth user experience as well as making publishing and social interaction possible. When creating a new widget, it will be automatically saved into the plasmate appdata dir and a local git repository started for it. The user will be able to create Save Points as they go. This will simply do a git commit of all the work done to this point, adding files that are new, etc. The user will be prompted for a summary of changes. This will allow the user to then "roll back" to any given save point via the timeline toolbox. We will then provide an online git hosting system on plasma.kde.org. (based on gitorious?) When the user hits "Publish" they will be prompted whether they would like to create a local package or publish it publicly. If the latter is chosen, a git push will be done and their work will appear on our shared git repo. The hosting system will create Plasma::Packages out of the git repos for download; this is simply a matter of getting rid of any git metadata in the directry structure and creating a zip archive out of that, which is an easily automated task. Consumers will get Packages, creators can push and pull repos. Neither consumer nor user should have to understand what's actually happening. If the user does not already have an account on the shared git repo, they will be prompted to create one at this point. Some basic oversight will be needed: basically, just watching what new stuff goes up. Eventually, we will want to have a widget browser integrated into Plasmate so that the user can see what is already available on plasma.kde.org and, with a click of a button, fork that widget and start working on it locally. The required git functionality is therefore pretty basic on the Plasmate side: * init a repo (milestone 1) * add files (milestone 1) * simple commits (milestone 1) * change to a different commit, aka "roll back" (milestone 2) * push (milestone 2) * diffs (milestone 2) * pull (milestone 3) (what about enabling powerful users to get access to more advanced solutions? hmmm... obviously we should only do that if it doesn't clutter things for the target audience) === User Actions === Actions will be provided to the user in the work interface through a simple "see and click" interface that will be more like a toolbar or ribbon than a menu bar. These actions will include: * Save Point * Roll back (with history graph provided by the Timeline toolbox) * Publish * Exit / Leave === Code Design === Classes: * StartPage * Takes a pointer ot the main window * Creates the ProjectBox and other default toolboxes for a given action when selected * ProjectBox * ProjectView tree (maybe just a generic QTreeView?) * ProjectModel * based on Plasma::Package * uses a KDirModel internally to keep sync'd with disk * Takes a pointer to the main window to load viewers/editors with * Hosts the revision control object * WidgetPreview * Provides a Corona and View * Controls for: form factor, location, refresh. Translucent buttons at the top of the Previewer with those labels? Click on FF or L and a list of relevant choices will appear as an overlay? * Actions * Timeline * SaveSystem * Use the git classes from vng? * Application * Creates the main window * Creates the start page === Art / Design === Artwork and design work required: * PlasMate logo: the Plasma logo with some elegant text * The PlasMate tagline * The layout of the main page. Qt Creator's take on this is very nice; should feel "webby" plasmate-1.0/plasmate/PaxHeaders.5990/publisher0000644000175000001440000000013012115142004017643 xustar000000000000000029 mtime=1362412548.61964118 30 atime=1362412548.627641107 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/publisher/0000755000175000001440000000000012115142004020357 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/publisher/PaxHeaders.5990/signingdialog.cpp0000644000175000001440000000012712115142004023250 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/publisher/signingdialog.cpp0000644000175000001440000001635112115142004023707 0ustar00kokeroulisusers00000000000000/* * Copyright 2010 by Diego '[Po]lentino' Casella * * 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 #include #include #include #include #include #include #include #include #include #include "signingdialog.h" SigningDialog::SigningDialog(QWidget *parent) : QDialog(parent) { setModal(true); QVBoxLayout *mainLay = new QVBoxLayout(this); QFrame *separator = new QFrame(this); QFrame *separator2 = new QFrame(this); QHBoxLayout *buttonLay = new QHBoxLayout(this); //QHBoxLayout *expirationLay = new QHBoxLayout(this); KConfigGroup preferences(KGlobal::config(), "NewProjectDefaultPreferences"); m_nameLabel = new QLabel("Name:", this); m_emailLabel = new QLabel("Email:", this); m_commentLabel = new QLabel("Comment (optional):", this); //m_expirationLabel = new QLabel("Set Expiration Date:", this); m_pwdLabel = new QLabel("Password:", this); m_repeatPwdLabel = new QLabel("Confirm Password:", this); m_showPassword = new QCheckBox("Show password", this); m_createButton = new QPushButton("Create!", this); m_cancelButton = new QPushButton("Cancel", this); m_nameLine = new KLineEdit(preferences.readEntry("Username", QString("foo")), this); m_emailLine = new KLineEdit(preferences.readEntry("Email", QString("foo@foo.org")), this); m_commentLine = new KLineEdit(this); //m_expirationLineInput = new KIntNumInput(0, this); //m_expirationLineInput->setEnabled(false); //m_expirationComboBox = new KComboBox(this); m_pwdLine = new KLineEdit(this); m_repeatPwdLine = new KLineEdit(this); //m_expirationComboBox->addItem("Never"); //m_expirationComboBox->addItem("Days"); //m_expirationComboBox->addItem("Weeks"); //m_expirationComboBox->addItem("Months"); //m_expirationComboBox->addItem("Years"); //expirationLay->addWidget(m_expirationLineInput); //expirationLay->addWidget(m_expirationComboBox); separator->setFrameStyle(QFrame::HLine | QFrame::Sunken); separator2->setFrameStyle(QFrame::HLine | QFrame::Sunken); m_pwdLine->setEchoMode(QLineEdit::Password); m_repeatPwdLine->setEchoMode(QLineEdit::Password); m_createButton->setIcon(KIcon("dialog-ok")); m_createButton->setEnabled(false); m_cancelButton->setIcon(KIcon("dialog-cancel")); m_cancelButton->setEnabled(true); buttonLay->addWidget(m_createButton); buttonLay->addWidget(m_cancelButton); mainLay->addWidget(m_nameLabel); mainLay->addWidget(m_nameLine); mainLay->addWidget(m_emailLabel); mainLay->addWidget(m_emailLine); mainLay->addWidget(m_commentLabel); mainLay->addWidget(m_commentLine); //mainLay->addWidget(m_expirationLabel); //mainLay->addLayout(expirationLay); mainLay->addWidget(separator); mainLay->addWidget(m_pwdLabel); mainLay->addWidget(m_pwdLine); mainLay->addWidget(m_repeatPwdLabel); mainLay->addWidget(m_repeatPwdLine); mainLay->addWidget(m_showPassword); mainLay->addWidget(separator2); mainLay->addLayout(buttonLay); connect(m_emailLine, SIGNAL(textChanged(const QString&)), this, SLOT(validateParams())); connect(m_nameLine, SIGNAL(textChanged(const QString&)), this, SLOT(validateParams())); //connect(m_expirationLineInput, SIGNAL(valueChanged(int)), // this, SLOT(validateParams())); //connect(m_expirationComboBox, SIGNAL(currentIndexChanged(int)), // this, SLOT(toggleExpirationLine())); connect(m_pwdLine, SIGNAL(textChanged(const QString&)), this, SLOT(validateParams())); connect(m_repeatPwdLine, SIGNAL(textChanged(const QString&)), this, SLOT(validateParams())); connect(m_showPassword, SIGNAL(toggled(bool)), this, SLOT(toggleShowPassword(bool))); connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(close())); connect(m_createButton, SIGNAL(clicked()), this, SLOT(fetchParameters())); } void SigningDialog::validateParams() { // Check for a valid email address. if (!KPIMUtils::isValidSimpleAddress(m_emailLine->text())) { m_createButton->setEnabled(false); return; } // Check for valid name, and expiration date, if any if (m_nameLine->text().isEmpty()) { m_createButton->setEnabled(false); return; } //if (m_expirationLineInput->isEnabled() && m_expirationLineInput->value() == 0) { // m_createButton->setEnabled(false); // return; //} // Check for a valid password if (m_pwdLine->text().isEmpty() && m_repeatPwdLine->text().isEmpty()) { m_createButton->setEnabled(false); return; } if (m_pwdLine->text() != m_repeatPwdLine->text()) { m_createButton->setEnabled(false); return; } // We are ready now :) m_createButton->setEnabled(true); } void SigningDialog::toggleShowPassword(const bool hide) { m_pwdLine->setEchoMode(hide ? QLineEdit::Normal : QLineEdit::Password); m_repeatPwdLine->setEchoMode(hide ? QLineEdit::Normal : QLineEdit::Password); } //void SigningDialog::toggleExpirationLine() //{ // if (m_expirationComboBox->currentIndex() != 0) { // m_expirationLineInput->setEnabled(true); // } else { // m_expirationLineInput->setEnabled(false); // } // validateParams(); //} void SigningDialog::fetchParameters() { /* Structure of the param to send back to gpgme: Key-Type: DSA Key-Length: 1024 Subkey-Type: ELG-E Subkey-Length: 1024 Name-Real: Joe Tester Name-Comment: with stupid passphrase Name-Email: joe@foo.bar Expire-Date: 0 Passphrase: abc */ QString param; param.append("\n"); param.append("Key-Type: DSA\n"); param.append("Key-Length: 1024\n"); param.append("Subkey-Type: ELG-E\n"); param.append("Subkey-Length: 1024\n"); param.append("Name-Real: " + m_nameLine->text() + "\n"); param.append("Name-Comment: " + m_commentLine->text() + "\n"); param.append("Name-Email: " + m_emailLine->text() + "\n"); param.append("Expire-Date: 0\n"); param.append("Passphrase: " + m_pwdLine->text() + "\n"); param.append(""); close(); emit(emitCreateKey(param)); } #include "moc_signingdialog.cpp" plasmate-1.0/plasmate/publisher/PaxHeaders.5990/publisher.cpp0000644000175000001440000000013212115142004022423 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/publisher/publisher.cpp0000644000175000001440000002243112115142004023062 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Lim Yuen Hoe Copyright 2012 Giorgos Tsiapaliwkas 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. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "publisher.h" #include "signingwidget.h" #include "../packagemodel.h" #include "../projectmanager/projectmanager.h" #include "remoteinstaller/remoteinstallerdialog.h" Publisher::Publisher(QWidget *parent, const KUrl &path, const QString& type) : KDialog(parent), m_signingWidget(0), m_projectPath(path), m_projectType(type), m_comboBoxIndex(0) { QWidget *uiWidget = new QWidget(); m_ui.setupUi(uiWidget); m_signingWidget = new SigningWidget(); //merge the ui file with the SigningWidget QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(uiWidget); layout->addWidget(m_signingWidget); QWidget *tmpWidget = new QWidget(); QHBoxLayout *tmpLayout = new QHBoxLayout(); tmpLayout->addLayout(layout); setButtons(KDialog::None); tmpWidget->setLayout(tmpLayout); setMainWidget(tmpWidget); m_extension = (type == "Plasma/Applet" || type == "Plasma/PopupApplet") ? "plasmoid" : "zip"; m_ui.exporterUrl->setFilter(QString("*.") + m_extension); m_ui.exporterUrl->setMode(KFile::File | KFile::LocalOnly); //we want the installButton to be enabled only when the comboBox's current index is valid. m_ui.installButton->setEnabled(false); //populate the comboBox m_ui.installerButton->addItem(""); m_ui.installerButton->addItem("Use PlasmaPkg"); m_ui.installerButton->addItem("Remote Install"); connect(m_ui.exporterUrl, SIGNAL(urlSelected(const KUrl&)), this, SLOT(addSuffix())); connect(m_ui.exporterButton, SIGNAL(clicked()), this, SLOT(doExport())); connect(m_ui.installerButton, SIGNAL(currentIndexChanged(int)), this, SLOT(checkInstallButtonState(int))); connect(m_ui.installButton, SIGNAL(clicked()), this, SLOT(doInstall())); connect(m_ui.publisherButton, SIGNAL(clicked()), this, SLOT(doPublish())); // Publish only works right for Plasmoid now afaik. Disabling for other project types. m_ui.publisherButton->setEnabled(type == "Plasma/Applet" || type == "Plasma/PopupApplet"); setLayout(layout); } void Publisher::addSuffix() { QString selected = m_ui.exporterUrl->url().path(); QString suffix = QFileInfo(selected).suffix(); if (suffix != m_extension && suffix != "zip") { m_ui.exporterUrl->setUrl(selected + "." + m_extension); } } void Publisher::setProjectName(const QString &name) { m_projectName = name; } void Publisher::doExport() { if (QFile(m_ui.exporterUrl->url().path()).exists()) { QString dialogText = i18n("A file already exists at %1. Do you want to overwrite it?", m_ui.exporterUrl->url().path()); int code = KMessageBox::warningYesNo(0,dialogText); if (code != KMessageBox::Yes) return; } bool ok = exportToFile(m_ui.exporterUrl->url()); // If signing is enabled, lets do that! if (m_signingWidget->signingEnabled()) { ok = ok && m_signingWidget->sign(m_ui.exporterUrl->url()); } if (QFile::exists(m_ui.exporterUrl->url().path()) && ok) { KMessageBox::information(this, i18n("Project has been exported to %1.", m_ui.exporterUrl->url().path())); } else { KMessageBox::error(this, i18n("An error has occurred during the export. Please check the write permissions " "in the target directory.")); } } //we want the installButton to be enabled only when comboBox's index is valid. void Publisher::checkInstallButtonState(int comboBoxCurrentIndex) { if (comboBoxCurrentIndex == 1) { m_ui.installButton->setEnabled(true); m_comboBoxIndex = 1; } else if (comboBoxCurrentIndex == 2) { m_ui.installButton->setEnabled(true); m_comboBoxIndex = 2; } else if (comboBoxCurrentIndex == 3) { m_ui.installButton->setEnabled(true); m_comboBoxIndex = 3; } else { m_ui.installButton->setEnabled(false); m_comboBoxIndex = 0; } } //choose the method which which we will install the project //according to comboBox's index void Publisher::doInstall() { if (m_comboBoxIndex == 1) { doPlasmaPkg(); } else if (m_comboBoxIndex == 2) { doRemoteInstall(); } } void Publisher::doPlasmaPkg() { const KUrl tempPackage(tempPackagePath()); qDebug() << "tempPackagePath" << tempPackage.pathOrUrl(); qDebug() << "m_projectPath" << m_projectPath.pathOrUrl(); ProjectManager::exportPackage(m_projectPath, tempPackage); // create temporary package QStringList argv("plasmapkg"); argv.append("-t"); if (m_projectType == "Plasma/Runner") { argv.append("runner"); } else if (m_projectType == "Plasma/DataEngine") { argv.append("dataengine"); } else if (m_projectType == "Plasma/Theme") { argv.append("theme"); } else if (m_projectType == "Plasma/Applet") { argv.append("plasmoid"); } else if (m_projectType == "KWin/WindowSwitcher") { argv.append("windowswitcher"); } else if (m_projectType == "KWin/Script") { argv.append("kwinscript"); } else if (m_projectType == "KWin/Effect") { argv.append("kwineffect"); } // we do a plasmapkg -u in case the package was installed before // in which case it should be updated. -u also installs the // package if it hasn't been installed before, so it's all good. argv.append("-u"); argv.append(tempPackage.path()); bool ok = (KProcess::execute(argv) >= 0 ? true: false); if(ok) { QDBusInterface dbi("org.kde.kded", "/kbuildsycoca", "org.kde.kbuildsycoca"); dbi.call(QDBus::NoBlock, "recreate"); } else { KMessageBox::error(this, i18n("Project has not been installed")); return; } if (m_signingWidget->signingEnabled()) { ok = ok && m_signingWidget->sign(tempPackage); QString signatureDestPath = KStandardDirs::locateLocal("data", "plasma/plasmoids/"); signatureDestPath.append(m_projectName).append(".plasmoid.asc"); QString signatureOrigPath(tempPackage.pathOrUrl().append(".asc")); QFile signatureDest(signatureDestPath); if(signatureDest.open(QIODevice::ReadWrite)) { signatureDest.remove(signatureDestPath); signatureDest.close(); } QFile signatureOrig(signatureOrigPath); if(signatureOrig.open(QIODevice::ReadWrite)) { ok = signatureOrig.copy(signatureOrigPath,signatureDestPath); } else { ok = false; } } QFile::remove(tempPackage.path()); // delete temporary package // TODO: probably check for errors and stuff instead of announcing // succcess in a 'leap of faith' if(ok) { KMessageBox::information(this, i18n("Project has been installed")); } else { KMessageBox::error(this, i18n("Project has not been installed")); } } void Publisher::doRemoteInstall() { QScopedPointer dialog(new RemoteInstallerDialog()); //get the source directory from plasmaterc QString path = currentPackagePath(); dialog->setPackagePath(path); dialog->exec(); } const QString Publisher::tempPackagePath() { QDir d(m_projectPath.pathOrUrl()); if (d.cdUp()) { return d.path() + "/" + m_projectName + "." + m_extension; } return m_projectPath.path(KUrl::AddTrailingSlash) + m_projectName + "." + m_extension; } void Publisher::doPublish() { // TODO: make sure this works with non-plasmoids too? kDebug() << "projectPath:" << m_projectPath.path(); kDebug() << "Exportando no tmp: file://" + tempPackagePath(); KUrl url(tempPackagePath()); bool ok = exportToFile(url); if (m_signingWidget->signingEnabled()) { ok = ok && m_signingWidget->sign(url); } if (ok) { KNS3::UploadDialog *mNewStuffDialog = new KNS3::UploadDialog("plasmate.knsrc", this); mNewStuffDialog->setUploadFile(url); mNewStuffDialog->exec(); QFile::remove(url.path()); // delete temporary package } else { // should probably eventually use a better error message KMessageBox::error(this, i18n("An error has occurred during the export. Please check the write permissions in the target directory.")); } } bool Publisher::exportToFile(const KUrl& url) { if (!url.isLocalFile() || QDir(url.path()).exists()) { KMessageBox::error(this, i18n("The file you entered is invalid.")); return false; } return ProjectManager::exportPackage(m_projectPath, url); // will overwrite if exists! } QString Publisher::currentPackagePath() const { KConfigGroup cg(KGlobal::config(), "PackageModel::package"); return cg.readEntry("lastLoadedPackage", QString()); } plasmate-1.0/plasmate/publisher/PaxHeaders.5990/remoteinstaller0000644000175000001440000000013212115142004023056 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.635641037 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/publisher/remoteinstaller/0000755000175000001440000000000012115142004023570 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/publisher/remoteinstaller/PaxHeaders.5990/remoteinstaller.h0000644000175000001440000000013212115142004026515 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/publisher/remoteinstaller/remoteinstaller.h0000644000175000001440000000154512115142004027157 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliwkas * * 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. */ #ifndef REMOTEINSTALLERCORE_H #define REMOTEINSTALLERCORE_H #include #include class KJob; class RemoteInstaller : public QObject { Q_OBJECT public: RemoteInstaller(const QString& username, const QString& hostname, const QString& source, QWidget* parent = 0); private Q_SLOTS: void doPlasmaPkg(KJob* job); private: void doInstall(); KUrl m_execUrl; QString m_plasmaPkgUrl; QString m_sourcePath; KUrl m_destinationPath; QWidget *m_widget; }; #endif // PUBLISHER_H plasmate-1.0/plasmate/publisher/remoteinstaller/PaxHeaders.5990/remoteinstallerdialog.h0000644000175000001440000000013212115142004027675 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/publisher/remoteinstaller/remoteinstallerdialog.h0000644000175000001440000000163212115142004030334 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliwkas * * 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. */ #ifndef REMOTEINSTALLERDIALOG_H #define REMOTEINSTALLERDIALOG_H #include #include "ui_remoteinstaller.h" class RemoteInstaller; class RemoteInstallerDialog : public KDialog { Q_OBJECT; public: RemoteInstallerDialog(QWidget* parent = 0); QString packagePath() const; void setPackagePath(const QString& path); private Q_SLOTS: void install(); void checkInformations(); protected: Ui::RemoteInstaller m_ui; private: RemoteInstaller *m_installer; QString m_packagePath; QString m_username; QString m_hostname; }; #endif // PUBLISHER_H plasmate-1.0/plasmate/publisher/remoteinstaller/PaxHeaders.5990/standalone0000644000175000001440000000013012115142004025204 xustar000000000000000029 mtime=1362412548.61964118 30 atime=1362412548.635641037 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/publisher/remoteinstaller/standalone/0000755000175000001440000000000012115142004025720 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/publisher/remoteinstaller/standalone/PaxHeaders.5990/plasmaremoteinstaller.h0000644000175000001440000000012712115142004032047 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/publisher/remoteinstaller/standalone/plasmaremoteinstaller.h0000644000175000001440000000122712115142004032502 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliwkas * * 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. */ #ifndef PLASMAREMOTEINSTALLER_H #define PLASMAREMOTEINSTALLER_H #include "../remoteinstallerdialog.h" class PlasmaRemoteInstaller : public RemoteInstallerDialog { Q_OBJECT; public: PlasmaRemoteInstaller(QWidget* parent = 0); public Q_SLOTS: void checkProjectPath(const QString& path); private: }; #endif // PUBLISHER_H plasmate-1.0/plasmate/publisher/remoteinstaller/standalone/PaxHeaders.5990/main.cpp0000644000175000001440000000012712115142004026717 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/publisher/remoteinstaller/standalone/main.cpp0000644000175000001440000000331412115142004027351 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliwkas * * 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 . */ #include #include #include #include #include #include "plasmaremoteinstaller.h" int main(int argc, char *argv[]) { KAboutData aboutData("plasmaremoteinstaller", 0, ki18n("Plasma Remote installer"), "0.1alpha3", ki18n("Plasma Remote Installer"), KAboutData::License_GPL, ki18n("Copyright 2012 Plasma Development Team"), KLocalizedString(), "", "plasma-devel@kde.org"); aboutData.addAuthor(ki18n("Giorgos Tsiapaliwkas"), ki18n("Author"), "terietor@gmail.com"); aboutData.setProgramIconName("plasmagik"); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineOptions options; KCmdLineArgs::addCmdLineOptions(options); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); KApplication app; QPointer dialog = new PlasmaRemoteInstaller(); dialog->exec(); delete dialog; return app.exec(); } plasmate-1.0/plasmate/publisher/remoteinstaller/standalone/PaxHeaders.5990/plasmaremoteinstaller.cpp0000644000175000001440000000012712115142004032402 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/publisher/remoteinstaller/standalone/plasmaremoteinstaller.cpp0000644000175000001440000000266212115142004033041 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliwkas > * * 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. */ #include "plasmaremoteinstaller.h" PlasmaRemoteInstaller::PlasmaRemoteInstaller(QWidget* parent) : RemoteInstallerDialog(parent) { connect(m_ui.sourceDirectory, SIGNAL(textChanged(QString)), this, SLOT(checkProjectPath(QString))); //disable the buttons. The user hasn't give a path yet. m_ui.usernameLineEdit->setEnabled(false); m_ui.hostnameLineEdit->setEnabled(false); //we want the source relative ui to be visible. m_ui.installPackageLabel->setVisible(true); m_ui.sourceLabel->setVisible(true); m_ui.sourceDirectory->setVisible(true); m_ui.srcSeparator->setVisible(true); } void PlasmaRemoteInstaller::checkProjectPath(const QString& path) { if (path.isEmpty()) { return; } //check if projectName/metadata.desktop exists if(path.endsWith("metadata.desktop")) { setPackagePath(path); m_ui.usernameLineEdit->setEnabled(true); m_ui.hostnameLineEdit->setEnabled(true); } else { m_ui.usernameLineEdit->setEnabled(false); m_ui.hostnameLineEdit->setEnabled(false); } } #include "moc_plasmaremoteinstaller.cpp"plasmate-1.0/plasmate/publisher/remoteinstaller/PaxHeaders.5990/remoteinstaller.ui0000644000175000001440000000013212115142004026703 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/publisher/remoteinstaller/remoteinstaller.ui0000644000175000001440000001035512115142004027344 0ustar00kokeroulisusers00000000000000 RemoteInstaller 0 0 510 422 <html><head/><body><p><span style=" font-size:12pt; font-weight:600;">Before you use the remote installer please check that:</span></p></body></html> <html><head/><body><p><span style=" font-size:10pt; font-weight:600;">the sshd daemon has started in the target pc</span></p><p><span style=" font-size:10pt; font-weight:600;">the ssh port is opened</span></p></body></html> <html><head/><body><p><span style=" font-size:12pt; font-weight:600;">Source</span></p></body></html> Choose the source directory of your package. <html><head/><body><p><span style=" font-size:12pt; font-weight:600;">Username</span></p></body></html> Enter the username of the target pc. <html><head/><body><p><span style=" font-size:12pt; font-weight:600;">Hostname</span></p></body></html> Enter the hostname of the target pc <html><head/><body><p><span style=" font-size:12pt;">Install Package</span></p></body></html> Install the package KLineEdit QLineEdit
klineedit.h
KSeparator QFrame
kseparator.h
KPushButton QPushButton
kpushbutton.h
KUrlRequester QFrame
kurlrequester.h
plasmate-1.0/plasmate/publisher/remoteinstaller/PaxHeaders.5990/remoteinstallerdialog.cpp0000644000175000001440000000013212115142004030230 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/publisher/remoteinstaller/remoteinstallerdialog.cpp0000644000175000001440000000447212115142004030674 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliwkas * * 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. */ #include "remoteinstallerdialog.h" #include "remoteinstaller.h" #include #include #include #include #include RemoteInstallerDialog::RemoteInstallerDialog(QWidget* parent) : KDialog(parent), m_installer(0) { QWidget *widget = new QWidget(); setButtons(KDialog::None); m_ui.setupUi(widget); setMainWidget(widget); //we don't want the ok button to be enabled //before we get all the necessary information m_ui.installButton->setEnabled(false); connect(m_ui.usernameLineEdit, SIGNAL(textChanged(QString)), this, SLOT(checkInformations())); connect(m_ui.hostnameLineEdit, SIGNAL(textChanged(QString)), this, SLOT(checkInformations())); connect(m_ui.installButton, SIGNAL(clicked()), this, SLOT(install())); //we don't want the source relative ui to be visible. //We will get this information from plasmate. m_ui.installPackageLabel->setVisible(false); m_ui.sourceLabel->setVisible(false); m_ui.sourceDirectory->setVisible(false); m_ui.srcSeparator->setVisible(false); } void RemoteInstallerDialog::checkInformations() { QString username = m_ui.usernameLineEdit->text(); //we don't want spaces username = username.replace(' ', ""); QString hostname = m_ui.hostnameLineEdit->text(); //we don't want spaces hostname = hostname.replace(' ', ""); QFile metadateDesktopFile(m_packagePath); if (!metadateDesktopFile.exists()) { return; } if (!username.isEmpty() && !hostname.isEmpty()) { m_username = username; m_hostname = hostname; //now enable the install button m_ui.installButton->setEnabled(true); } } void RemoteInstallerDialog::install() { m_installer = new RemoteInstaller(m_username, m_hostname, m_packagePath, this); } QString RemoteInstallerDialog::packagePath() const { return m_packagePath; } void RemoteInstallerDialog::setPackagePath(const QString& path) { m_packagePath = path; } plasmate-1.0/plasmate/publisher/remoteinstaller/PaxHeaders.5990/remoteinstaller.cpp0000644000175000001440000000013212115142004027050 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/publisher/remoteinstaller/remoteinstaller.cpp0000644000175000001440000000610312115142004027505 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliwkas * * 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. */ #include "remoteinstaller.h" #include #include #include #include #include #include #include RemoteInstaller::RemoteInstaller(const QString& username, const QString& hostname, const QString& source, QWidget* parent) : QObject(parent), m_widget(parent) { //like fish://username@192.123.23.1 m_execUrl.setUrl("fish://" + hostname); m_execUrl.setUserName(username); //this will be out temp directory. First we need to create a temporary file, and then find its //absolute path. //Q: Why don't we use the something like //const QString temporaryDirectory(KStandardDirs::locate("tmp", "") + "plasmaremoteinstaller/"); //A: The following code is running in our system. That means that the temporary directory will be something //like /tmp/kde-$username. If my user is named foo and the other user is named bar //then there is no user foo on the other system. So the /tmp/kde-foo doesn't exist. QString temporaryDirectory = QDir::tempPath(); temporaryDirectory.append("/plasmaremoteinstaller"); KUrl tmpUrl = m_execUrl; tmpUrl.addPath(temporaryDirectory); if (!KIO::NetAccess::exists(tmpUrl, KIO::NetAccess::DestinationSide, m_widget)) { const bool ok = KIO::NetAccess::mkdir(tmpUrl, m_widget); if (!ok) { QString text = i18n("Plasma Remote Installer was not able to create a temporary directory in " "%1, please check the permissions of %1", temporaryDirectory); KMessageBox::error(m_widget, text); return; } } //our destination path m_destinationPath = m_execUrl; m_destinationPath.setPath(temporaryDirectory); //we need our source path m_sourcePath = source; //we will need the dirname of the source QDir packageDir(source); m_plasmaPkgUrl.append("plasmapkg -u " + temporaryDirectory + packageDir.dirName() + '/'); //now do the installation doInstall(); } void RemoteInstaller::doInstall() { //copy the project in the target's plasmate data directory KIO::CopyJob *copy = KIO::copy(m_sourcePath, m_destinationPath); connect(copy, SIGNAL(result(KJob*)), this, SLOT(doPlasmaPkg(KJob*))); } void RemoteInstaller::doPlasmaPkg(KJob* job) { if (job->error() != 0) { //an error has occurred from the previous job. //show the error to the user. KMessageBox::error(m_widget, job->errorText()); } KIO::NetAccess::fish_execute(m_execUrl, m_plasmaPkgUrl, m_widget); //an error has occurred. if (KIO::NetAccess::lastError()) { //show the error KMessageBox::error(m_widget, KIO::NetAccess::lastErrorString()); } } plasmate-1.0/plasmate/publisher/PaxHeaders.5990/signingdialog.h0000644000175000001440000000012712115142004022715 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/publisher/signingdialog.h0000644000175000001440000000346312115142004023354 0ustar00kokeroulisusers00000000000000/* * Copyright 2010 by Diego '[Po]lentino' Casella * * 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 SIGNINGDIALOG_H #define SIGNINGDIALOG_H #include class QCheckBox; class QLabel; class QPushButton; class KComboBox; class KIntNumInput; class KLineEdit; class SigningDialog : public QDialog { Q_OBJECT public: explicit SigningDialog(QWidget *parent = 0); Q_SIGNALS: void emitCreateKey(const QString ¶m); public Q_SLOTS: void validateParams(); void toggleShowPassword(const bool hide); //void toggleExpirationLine(); void fetchParameters(); private: QLabel *m_nameLabel; QLabel *m_emailLabel; QLabel *m_commentLabel; //QLabel *m_expirationLabel; QLabel *m_pwdLabel; QLabel *m_repeatPwdLabel; QCheckBox *m_showPassword; KLineEdit *m_nameLine; KLineEdit *m_emailLine; KLineEdit *m_commentLine; //KIntNumInput *m_expirationLineInput; //KComboBox *m_expirationComboBox; KLineEdit *m_pwdLine; KLineEdit *m_repeatPwdLine; QPushButton *m_createButton; QPushButton *m_cancelButton; }; #endif // SIGNINGDIALOG_H plasmate-1.0/plasmate/publisher/PaxHeaders.5990/signingwidget.h0000644000175000001440000000012712115142004022741 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/publisher/signingwidget.h0000644000175000001440000000377412115142004023405 0ustar00kokeroulisusers00000000000000/* * Copyright 2010 by Diego '[Po]lentino' Casella * * 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 SIGNINGWIDGET_H #define SIGNINGWIDGET_H #include #include class QTreeWidget; class QPushButton; class QRadioButton; class QStringList; class QCheckBox; class QStringList; class Kurl; namespace GpgME { class Context; } class SigningWidget : public QWidget { Q_OBJECT public: SigningWidget(QWidget *parent = 0); ~SigningWidget(); bool signingEnabled() const; bool sign(const KUrl &path); public Q_SLOTS: void setEnabled(); void createKey(const QString ¶m); private: void loadConfig(); void initUI(); void initGpgContext(); void initKeys(); QList< QMap > gpgEntryList(const bool privateKeysOnly = false) const; QString mapKeyToString(const QMap &map, const bool appendKeyId = true) const; QTreeWidget *m_treeWidget; QPushButton *m_createKeyButton; QPushButton *m_deleteKeyButton; QRadioButton *m_noSigningButton; QString m_currentKey; GpgME::Context *m_gpgContext; bool m_signingEnabled; bool m_contextInitialized; private Q_SLOTS: void showCreateKeyDialog(); void deleteKey(); void loadKeys(); void updateCurrentKey(); }; #endif // SIGNINGWIDGET_H plasmate-1.0/plasmate/publisher/PaxHeaders.5990/publisher.h0000644000175000001440000000013212115142004022070 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/publisher/publisher.h0000644000175000001440000000234512115142004022531 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Lim Yuen Hoe 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. */ #ifndef PUBLISHER_H #define PUBLISHER_H #include #include #include #include #include "ui_publisher.h" class SigningWidget; class Publisher : public KDialog { Q_OBJECT; public: Publisher(QWidget* parent, const KUrl &path, const QString& type); void setProjectName(const QString &name); public slots: void doPlasmaPkg(); private slots: void doExport(); void addSuffix(); void doPublish(); void doInstall(); void doRemoteInstall(); void checkInstallButtonState(int comboBoxCurrentIndex); private: bool exportToFile(const KUrl& url); const QString tempPackagePath(); //avoid duplication QString currentPackagePath() const; SigningWidget* m_signingWidget; KUrl m_projectPath; QString m_projectType; QString m_extension; QString m_projectName; int m_comboBoxIndex; Ui::Publisher m_ui; }; #endif // PUBLISHER_H plasmate-1.0/plasmate/publisher/PaxHeaders.5990/publisher.ui0000644000175000001440000000013212115142004022256 xustar000000000000000030 mtime=1362412548.618641191 30 atime=1362412548.618641191 30 ctime=1362412548.618641191 plasmate-1.0/plasmate/publisher/publisher.ui0000644000175000001440000001070012115142004022711 0ustar00kokeroulisusers00000000000000 Publisher 0 0 671 320 <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">Export Project</span></p></body></html> Choose a target file to export the current project to an installable package file on your system. Export current project <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">Install Project</span></p></body></html> Select the method with which you want to install the current project directly onto your computer. 0 0 0 0 0 0 20 0 Install Current Project <html><head/><body><p><span style=" font-size:16pt; font-weight:600;">Publish Project</span></p></body></html> Qt::AutoText <html><head/><body><p>Click to publish the current project online, so that other people can find and install it using the Internet.</p></body></html> Publish current project KComboBox QComboBox
kcombobox.h
KSeparator QFrame
kseparator.h
KPushButton QPushButton
kpushbutton.h
KUrlRequester QFrame
kurlrequester.h
plasmate-1.0/plasmate/publisher/PaxHeaders.5990/signingwidget.cpp0000644000175000001440000000012712115142004023274 xustar000000000000000029 mtime=1362412548.61964118 29 atime=1362412548.61964118 29 ctime=1362412548.61964118 plasmate-1.0/plasmate/publisher/signingwidget.cpp0000644000175000001440000003012112115142004023722 0ustar00kokeroulisusers00000000000000/* * Copyright 2010 by Diego '[Po]lentino' Casella * * 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #define _FILE_OFFSET_BITS 64 #include #include #include #include #include #include #include #include #include #include #include // FILE #include "signingwidget.h" #include "signingdialog.h" SigningWidget::SigningWidget(QWidget* parent) : QWidget(parent), m_treeWidget(0), m_noSigningButton(0) { loadConfig(); initUI(); initGpgContext(); loadKeys(); } SigningWidget::~SigningWidget() { delete m_gpgContext; } void SigningWidget::loadConfig() { KConfigGroup cg(KGlobal::config(), "Signing Options"); m_signingEnabled = cg.readEntry("signingEnabled", false); m_currentKey = cg.readEntry("currentSignerKey", QString()); } void SigningWidget::initUI() { QVBoxLayout *mainlLayout = new QVBoxLayout(); QHBoxLayout *buttonLayout = new QHBoxLayout(); m_treeWidget = new QTreeWidget(this); m_treeWidget->setHeaderLabel(i18n("Select one key from the list below:")); m_noSigningButton = new QRadioButton(i18n("No signing key."), this); m_createKeyButton = new QPushButton(this); m_createKeyButton->setText(i18n("Create new Key...")); m_createKeyButton->setIcon(KIcon("dialog-password")); m_createKeyButton->setEnabled(false); m_deleteKeyButton = new QPushButton(this); m_deleteKeyButton->setText(i18n("Delete selected key")); m_deleteKeyButton->setIcon(KIcon("edit-delete")); buttonLayout->addWidget(m_createKeyButton); buttonLayout->addWidget(m_deleteKeyButton); mainlLayout->addWidget(m_treeWidget); mainlLayout->addLayout(buttonLayout); setLayout(mainlLayout); connect(m_createKeyButton, SIGNAL(clicked()), this, SLOT(showCreateKeyDialog())); connect(m_deleteKeyButton, SIGNAL(clicked()), this, SLOT(deleteKey())); connect(m_noSigningButton, SIGNAL(clicked(bool)), this, SLOT(setEnabled())); //disable the delete button when the m_noSigningButton is clicked //we don't want the m_noSigningButton to be deleted ever! connect(m_noSigningButton, SIGNAL(clicked(bool)), m_deleteKeyButton, SLOT(setDisabled(bool))); connect(m_noSigningButton, SIGNAL(clicked(bool)), m_createKeyButton, SLOT(setEnabled(bool))); m_deleteKeyButton->setDisabled(m_noSigningButton->isChecked()); } void SigningWidget::initGpgContext() { GpgME::initializeLibrary(); GpgME::Error error = GpgME::checkEngine(GpgME::OpenPGP); if (error) { kDebug() << "OpenPGP not supported!"; m_contextInitialized = false; return; } m_gpgContext = GpgME::Context::createForProtocol(GpgME::OpenPGP); if (!m_gpgContext) { m_contextInitialized = true; } } QList< QMap > SigningWidget::gpgEntryList(const bool privateKeysOnly) const { GpgME::Error error = m_gpgContext->startKeyListing("", privateKeysOnly ? 1 : 0); QList< QMap > result; while (!error) { GpgME::Key k = m_gpgContext->nextKey(error); if (error) break; QMap tmp; tmp.insert("name", k.userID(0).name()); tmp.insert("comment", k.userID(0).comment()); tmp.insert("email", k.userID(0).email()); tmp.insert("id", k.keyID()); result << tmp; } GpgME::KeyListResult lRes = m_gpgContext->endKeyListing(); if (lRes.error()) { kDebug() << "Error while ending the keyListing operation: " << lRes.error().asString(); } return result; } QString SigningWidget::mapKeyToString(const QMap &map, const bool appendKeyId) const { QString result; result.append(map["name"].toString() + " "); if (!map["comment"].toString().isEmpty()) result.append("(" + map["comment"].toString() + ") "); result.append(map["email"].toString()); if (appendKeyId) result.append(" , " + map["id"].toString()); return result; } void SigningWidget::setEnabled() { //Q: Why there is no parameter. //A: Because we enable disable the feature according to //m_noSigningButton's state. //this method will be called every time //that the user clicks the m_noSigningButton //so if the button is checked we don't want the signing feature, //otherwise we do. //Also when the button(this is every key that the user //has in his computer) is clicked this slot will be called, //this means that we need the signing feature. m_signingEnabled = !m_noSigningButton->isChecked(); KConfigGroup cg(KGlobal::config(), "Signing Options"); cg.writeEntry("signingEnabled", m_signingEnabled); } bool SigningWidget::signingEnabled() const { return m_signingEnabled; } bool SigningWidget::sign(const KUrl &path) { // Ensure we have a key set if (m_currentKey.isEmpty() || m_currentKey.isNull()) return false; m_gpgContext->clearSigningKeys(); QString hash = m_currentKey.split(" ",QString::SkipEmptyParts).last(); // Lets start looking for the key GpgME::Error error = m_gpgContext->startKeyListing("", true); while (!error) { GpgME::Key k = m_gpgContext->nextKey(error); if (error) break; QString fingerprint(k.subkey(0).fingerprint()); if (fingerprint.contains(hash)) { m_gpgContext->addSigningKey(k); kDebug() << "Added signer: " << k.subkey(0).fingerprint(); break; } } GpgME::KeyListResult lRes = m_gpgContext->endKeyListing(); if (lRes.error()) { kDebug() << "Error while ending the keyListing operation: " << lRes.error().asString(); } FILE *fp; fp = fopen(QFile::encodeName(path.pathOrUrl()).data(), "r"); FILE *fp1; fp1 = fopen(QFile::encodeName(path.pathOrUrl().append(".asc")).data(), "w"); GpgME::Data plasmoidata(fp); GpgME::Data signature(fp1); kDebug() << "Ready to sign: " << path.pathOrUrl(); GpgME::SigningResult sRes = m_gpgContext->sign(plasmoidata, signature, GpgME::Detached); error = m_gpgContext->startSigning(plasmoidata, signature, GpgME::Detached); kDebug() <<"Signing result: " << m_gpgContext->signingResult().createdSignature(0).fingerprint(); fclose(fp1); fclose(fp); if (!error) { return true; } return false; } void SigningWidget::showCreateKeyDialog() { SigningDialog *dialog = new SigningDialog(this); connect(dialog, SIGNAL(emitCreateKey(const QString&)), this, SLOT(createKey(const QString&))); dialog->exec(); } void SigningWidget::createKey(const QString ¶m) { kDebug() << "READY TO CREATE:" << param; GpgME::Data *data = new GpgME::Data(); // GpgME::KeyGenerationResult result = m_gpgContext->generateKey(param.toAscii().data(), data); // if(result.primaryKeyGenerated() && result.subkeyGenerated()) { // kDebug() << "Generated new key with fingerprint: " << result.fingerprint(); // } // kDebug() << "Generated new key with fingerprint: " << result.fingerprint(); GpgME::KeyGenerationResult e = m_gpgContext->generateKey(param.toUtf8().data(), *data); GpgME::Error er = m_gpgContext->startKeyGeneration(param.toUtf8().data(), *data); kDebug() << "Error:" << e.error().source() << "::" << e.error().asString(); kDebug() << "Error:" << er.source() << "::" << er.asString(); QString error(er.asString()); //There is been an error with the generation of the key if (!error.isEmpty()) { KMessageBox::error(0, i18n("Your key has not been created because of the following error: %1", error)); } } void SigningWidget::deleteKey() { if (m_currentKey.isEmpty() || m_currentKey.isNull()) return; GpgME::Error error = m_gpgContext->startKeyListing("",true); QList< QMap > result; while (!error) { GpgME::Key k = m_gpgContext->nextKey(error); if (error) break; if (m_currentKey.contains(k.keyID())) { error = m_gpgContext->deleteKey(k, true); if (!error) { m_currentKey.clear(); KConfigGroup cg(KGlobal::config(), "Signing Options"); cg.writeEntry("currentSignerKey", m_currentKey); cg.sync(); loadKeys(); } GpgME::KeyListResult lRes = m_gpgContext->endKeyListing(); if (lRes.error()) { kDebug() << "Error while ending the keyListing operation: " << lRes.error().asString(); } return; } } GpgME::KeyListResult lRes = m_gpgContext->endKeyListing(); if (lRes.error()) { kDebug() << "Error while ending the keyListing operation: " << lRes.error().asString(); } return; } void SigningWidget::loadKeys() { m_treeWidget->clear(); QTreeWidgetItem *item = new QTreeWidgetItem(m_treeWidget); //add the no singing button QVBoxLayout *l = new QVBoxLayout(); l->addWidget(m_noSigningButton); QList< QMap > entries = gpgEntryList(true); for (int i = 0; i < entries.count(); ++i) { QMap entry = entries.at(i); QRadioButton *button = new QRadioButton(mapKeyToString(entry, false), this); button->setObjectName(mapKeyToString(entry)); if (!m_currentKey.isNull() || m_currentKey.isEmpty()) { //First check if this is the key that we want //and then check if the signing option is enabled. if (m_currentKey == mapKeyToString(entry) && signingEnabled()) { //yes this is the right key and the signing option is enabled //so checkk the right button button->setChecked(true); } else { //either the signing option isn't enabled //or there is no right key, in both cases //we want the m_noSigningButton to be checked m_noSigningButton->setChecked(true); } } l->addWidget(button); connect(button, SIGNAL(clicked(bool)), this, SLOT(updateCurrentKey())); //enable the signing feature connect(button, SIGNAL(clicked(bool)), this, SLOT(setEnabled())); //enable the m_deleteKeyButton //we want the user to be able to delete a key, so enable the m_deleteKeyButton connect(button, SIGNAL(clicked(bool)), m_deleteKeyButton, SLOT(setEnabled(bool))); } //add the widgets into the treewidget QWidget *tmpWidget = new QWidget(); tmpWidget->setLayout(l); m_treeWidget->setItemWidget(item, 0, tmpWidget); } void SigningWidget::updateCurrentKey() { QRadioButton *sender = static_cast(QObject::sender()); m_currentKey = sender->objectName(); kDebug() << m_currentKey; KConfigGroup cg(KGlobal::config(), "Signing Options"); cg.writeEntry("currentSignerKey", m_currentKey); cg.sync(); } #include "moc_signingwidget.cpp" plasmate-1.0/plasmate/PaxHeaders.5990/sidebar.cpp0000644000175000001440000000013212115142004020042 xustar000000000000000030 mtime=1362412548.621641162 30 atime=1362412548.621641162 30 ctime=1362412548.621641162 plasmate-1.0/plasmate/sidebar.cpp0000644000175000001440000001226412115142004020504 0ustar00kokeroulisusers00000000000000/* Copyright 2007 by Diego [Po]lentino Casella * * 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 . */ #include #include #include #include #include #include #include //#include #include "sidebar.h" #include "sidebartablewidget.h" #include "sidebardelegate.h" #include "sidebaritem.cpp" Sidebar::Sidebar(QWidget *parent, Qt::DockWidgetArea location) :QDockWidget(i18n("Workflow")) { Q_UNUSED(parent) setFeatures(QDockWidget::AllDockWidgetFeatures); m_table = new SidebarTableWidget(location); m_table->setParent(this); setWidget(m_table); m_delegate = new SidebarDelegate(this); m_table->setItemDelegate(m_delegate); connect(m_table, SIGNAL(clicked(const QModelIndex &)), this, SIGNAL(currentIndexClicked(const QModelIndex &))); connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)), m_table,SLOT(updateLayout(Qt::DockWidgetArea))); } Sidebar::~Sidebar() { //delete d; } Qt::DockWidgetArea Sidebar::location() { return m_table->location(); } void Sidebar::resizeEvent(QResizeEvent * event) { /* I've reimplemented this event handler because, when resizing the main widget to a size smaller than the dockwidget, a bothersome effects appears. According with the orientation, it appears a scrollbar INSIDE the m_table widget, which hovers partially the icons when the dock is vertical, and hovers completely the text when it is horizontal. So I've implemented this simple workaround, in order to expand the dockwidget when a scrollbar is shown. I know that resizing a child widget inside a parent resizeEvent() is dangerous at 98%, by the way this trick is very simple and well structured, so it won't cause issues I hope =) */ QSize newSize = event->size(); //qDebug() << "New size: " << newSize; //qDebug() << "m_table size:" << m_table->size(); //qDebug() << "m_table total length" << m_table->totalLenght(); bool vertical = ((m_table->location() == Qt::RightDockWidgetArea) || (m_table->location() == Qt::LeftDockWidgetArea)); if(vertical) { if(m_table->totalLenght() > newSize.height()) { m_table->setFixedWidth(m_table->columnWidth(0) + m_table->scrollbarSize(vertical).width()); return; } else { if(m_table->columnWidth(0) < newSize.width()) { m_table->setFixedWidth(m_table->columnWidth(0)); return; } } } else { if(m_table->totalLenght() > newSize.width()) { m_table->setFixedHeight(m_table->rowHeight(0) + m_table->scrollbarSize(vertical).height()); return; } else { if(m_table->rowHeight(0) < newSize.height()) { m_table->setFixedHeight(m_table->rowHeight(0)); return; } } } } void Sidebar::addItem(const QIcon &icon, const QString &text) { SidebarItem *newItem = new SidebarItem(icon, text); m_table->addItem(newItem); } bool Sidebar::isVertical() { return ((m_table->location() == Qt::LeftDockWidgetArea)||(m_table->location() == Qt::RightDockWidgetArea)); } bool Sidebar::isItemEnabled(int index) const { /*if (index < 0 || index >= d->pages.count()) return false; Qt::ItemFlags f = d->pages.at(index)->flags(); return (f & Qt::ItemIsEnabled) == Qt::ItemIsEnabled;*/ return true; } void Sidebar::setCurrentIndex(int index) { /*if (index < 0 || index >= d->pages.count() || !isItemEnabled(index)) return;*/ bool vertical = ((m_table->location() == Qt::LeftDockWidgetArea)|| (m_table->location() == Qt::RightDockWidgetArea)); QModelIndex modelindex = m_table->model()->index(vertical? 0: index, vertical? index: 0); m_table->setCurrentIndex(modelindex); m_table->selectionModel()->select(modelindex, QItemSelectionModel::ClearAndSelect); } int Sidebar::currentIndex() const { return m_table->currentRow(); } void Sidebar::setSidebarVisibility(bool visible) { if (visible != m_table->isHidden()) return; static bool sideWasVisible = !isHidden(); m_table->setHidden(!visible); if (visible) { setHidden(!sideWasVisible); sideWasVisible = true; } else { sideWasVisible = !isHidden(); setHidden(true); } } bool Sidebar::isSidebarVisible() const { return !isHidden(); } #include "sidebar.moc" plasmate-1.0/plasmate/PaxHeaders.5990/editors0000644000175000001440000000013112115142004017320 xustar000000000000000030 mtime=1362412548.614641227 29 atime=1362412548.61564122 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/editors/0000755000175000001440000000000012115142004020033 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/editors/PaxHeaders.5990/text0000644000175000001440000000013112115142004020304 xustar000000000000000030 mtime=1362412548.614641227 29 atime=1362412548.61564122 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/editors/text/0000755000175000001440000000000012115142004021017 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/editors/text/PaxHeaders.5990/texteditor.cpp0000644000175000001440000000013212115142004023261 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/editors/text/texteditor.cpp0000644000175000001440000001107212115142004023717 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Riccardo Iaconelli 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 .*/ #include "texteditor.h" #include "../../packagemodel.h" #include #include #include #include #include #include #include #include #include TextEditor::TextEditor(KTextEditor::Document *editorPart, PackageModel *model, QWidget *parent) : QWidget(parent) { QHBoxLayout *l = new QHBoxLayout(this); QWidget *centralWidget = editorPart->widget(); KTextEditor::View *view = qobject_cast(centralWidget); if (view) { view->setContextMenu(view->defaultContextMenu()); //modify the toolbar modifyToolBar(view); KTextEditor::ConfigInterface *config = qobject_cast(view); if (config) { config->setConfigValue("line-numbers", true); config->setConfigValue("dynamic-word-wrap", true); } config = dynamic_cast(editorPart); if (config) { config->setConfigValue("backup-on-save-prefix", "."); } // set nice defaults for katepart KTextEditor::CommandInterface *command = dynamic_cast(editorPart->editor()); QString ret; if (command) { //generic command->queryCommand("set-indent-mode")->exec(view, "set-indent-mode normal", ret); // more friendly command->queryCommand("set-replace-tabs")->exec(view, "set-replace-tabs 1", ret);// replaces tabs with spaces???? command->queryCommand("set-indent-width")->exec(view, "set-indent-width 4", ret);//4 spaces, Plasma's general coding style } //we should be setting the specific editing indentation, highlighting based on the type of document if (model->implementationApi() == "declarativeappletscript" || model->implementationApi() == "javascript") { editorPart->setHighlightingMode("JavaScript"); } else if (model->implementationApi() == "ruby-script") { editorPart->setHighlightingMode("ruby"); if (command) { command->queryCommand("set-indent-width")->exec(view, "set-indent-width 2", ret);// 2 spaces recommended for ruby } } //there is no need for one more control. But we keep the code because it is easier to understand. //so keep the generic format. /*} else if (editorPart->setHighlightingMode() == "python") { continue; // Q: why we don't change the spaces? // A: 4 spaces are recommended for python }*/ } l->addWidget(centralWidget); } void TextEditor::modifyToolBar(KTextEditor::View *view) { //we don't want all the actions to be visible. //Q:why? //A:because Plasmate doesn't use actions like save and save as, automatically it saves //the projects //see this page, http://techbase.kde.org/Development/Architecture/KDE4/XMLGUI_Technology QStringList names; names << "file_save" << "file_save_as"; QDomDocument doc = view->xmlguiBuildDocument(); if (doc.documentElement().isNull()) { doc = view->domDocument(); } QDomElement e = doc.documentElement(); removeNamedElementsRecursive(names, e); view->setXMLGUIBuildDocument(doc); } void TextEditor::removeNamedElementsRecursive(const QStringList &names, QDomNode &parent) { QDomNode nchild; for (QDomNode child = parent.firstChild(); !child.isNull(); child = nchild) { removeNamedElementsRecursive(names, child); nchild = child.nextSibling(); // need to fetch next sibling here, as we might remove the child below if (child.isElement()) { QDomElement e = child.toElement(); if (names.contains(e.attribute("name"))) { parent.removeChild(child); } } } } plasmate-1.0/plasmate/editors/text/PaxHeaders.5990/texteditor.h0000644000175000001440000000013212115142004022726 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/editors/text/texteditor.h0000644000175000001440000000223012115142004023360 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Riccardo Iaconelli 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 . */ #ifndef TEXTEDITOR_H #define TEXTEDITOR_H #include #include namespace KTextEditor { class Document; class View; } // namespace KTextEditor class PackageModel; class TextEditor : public QWidget { public: TextEditor(KTextEditor::Document *editorPart, PackageModel *model, QWidget *parent = 0); void modifyToolBar(KTextEditor::View *view); private: void removeNamedElementsRecursive(const QStringList &names, QDomNode &parent); }; #endif // TEXTEDITOR_Hplasmate-1.0/plasmate/editors/PaxHeaders.5990/editpage.h0000644000175000001440000000012712115142004021335 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/editors/editpage.h0000644000175000001440000000414112115142004021766 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Laurent Montel Copyright 2009-2010 Shantanu Tushar Jha Copyright 2009-2010 Sandro Andrade Copyright 2009-2010 Lim Yuen Hoe 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 EDITPAGE_H #define EDITPAGE_H #include #include #include #include #include #include #include "editors/metadata/metadataeditor.h" class QWidget; class EditPage : public QTreeView { Q_OBJECT public: explicit EditPage(QWidget *parent = 0); void loadFile(const KUrl &path); Q_SIGNALS: void loadEditor(const KService::List offers, KUrl target); void loadMetaDataEditor(KUrl target); void loadImageViewer(const KUrl &target); void loadKConfigXtEditor(const KUrl &target); private Q_SLOTS: void findEditor(const QModelIndex &index); void showTreeContextMenu(const QPoint&); void doDelete(bool); void mimetypeJobFinished(KJob *job); private: KMenu *m_contextMenu; MetaDataEditor *m_metaEditor; KUrl m_path; QString m_mimetype; bool hasExtension(const QString &filename); void imageDialog(const QString &filter, const QString& destinationPath); QString createContentWithSubdir(const QString& packagePath, const QString& contentWithSubdir) const; }; #endif plasmate-1.0/plasmate/editors/PaxHeaders.5990/editpage.cpp0000644000175000001440000000012712115142004021670 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/editors/editpage.cpp0000644000175000001440000002564412115142004022334 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Aaron Seigo Copyright 2009-2010 Artur Duque de Souza Copyright 2009-2010 Laurent Montel Copyright 2009-2010 Shantanu Tushar Jha Copyright 2009-2010 Sandro Andrade Copyright 2009-2010 Lim Yuen Hoe 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 "editpage.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "packagemodel.h" #include EditPage::EditPage(QWidget *parent) : QTreeView(parent), m_metaEditor(0) { setHeaderHidden(true); m_contextMenu = new KMenu(this); QAction *del = m_contextMenu->addAction(KIcon("window-close"), i18n("Delete")); connect(del, SIGNAL(triggered(bool)), this, SLOT(doDelete(bool))); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(activated(const QModelIndex &)), this, SLOT(findEditor(const QModelIndex &))); connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showTreeContextMenu(const QPoint&))); } void EditPage::doDelete(bool) { QModelIndexList items = selectedIndexes(); if (items.empty()) { return; // this shouldn't happen } QModelIndex selected = items.at(0); // only one can be selected const QString path = selected.data(PackageModel::UrlRole).toString(); const QString name = selected.data(Qt::DisplayRole).toString(); const QString dialogText = i18n("Are you sure you want to delete the file \"%1\"?", name); int code = KMessageBox::warningContinueCancel(this, dialogText); if (code == KMessageBox::Continue) { QFile::remove(path); QDir dirPath(path); //our path points to a file, so go up one dir dirPath.cdUp(); foreach(const QFileInfo& fileInfo, dirPath.entryInfoList(QDir::AllEntries)) { if (fileInfo.isFile()) { //if there is no file the foreach //will end and the directory will be deleted return; } } KIO::del(dirPath.path()); } } void EditPage::showTreeContextMenu(const QPoint&) { QModelIndexList items = selectedIndexes(); if (items.empty()) { return; } const QStringList mimeTypeList = items.at(0).data(PackageModel::MimeTypeRole).toStringList(); const QStringList pathList = items.at(0).data(PackageModel::UrlRole).toStringList(); if (mimeTypeList.isEmpty() || pathList.isEmpty() || mimeTypeList.at(0).startsWith("[plasmate]/") || !QFile::exists(pathList.at(0))) { return; } m_contextMenu->popup(QCursor::pos()); } void EditPage::findEditor(const QModelIndex &index) { const QStringList mimetypes = index.data(PackageModel::MimeTypeRole).toStringList(); const QString packagePath = index.data(PackageModel::PackagePathRole).toString(); const QString contentWithSubdir = index.data(PackageModel::ContentsWithSubdirRole).toString(); foreach (const QString &mimetype, mimetypes) { QString target = index.data(PackageModel::UrlRole).toUrl().toString(); if (mimetype == "[plasmate]/metadata") { emit loadMetaDataEditor(target); return; } if (mimetype == "[plasmate]/imageDialog") { imageDialog("*.png *.gif *.svg *.jpeg *.svgz", "contents/images/"); return; } QString commonFilter = "*.svg *.svgz"; const QString themeType = "[plasmate]/themeImageDialog/"; if (mimetype.startsWith(themeType)) { const QString opts = "contents/" + mimetype.right(mimetype.size() - themeType.length()); imageDialog(commonFilter, opts); return; } if (mimetype == "[plasmate]/imageViewer") { emit loadImageViewer(target); return; } if (mimetype == "[plasmate]/kconfigxteditor") { emit loadKConfigXtEditor(target); return; } bool createNewFile = false; QString nameOfNewFile; if (mimetype == "[plasmate]/mainconfigxml/new") { createNewFile = true; nameOfNewFile = "main.xml"; } if (mimetype == "[plasmate]/mainconfigui") { createNewFile = true; nameOfNewFile = "config.ui"; } if (createNewFile) { QString path = createContentWithSubdir(packagePath, contentWithSubdir); if (!path.isEmpty()) { if (!path.endsWith('/')) { path.append('/'); } target.clear(); target.append(path + nameOfNewFile); } QFile f(target); f.open(QIODevice::ReadWrite); // create the file return; } if (mimetype == "[plasmate]/kcolorscheme") { QFile f(target); f.open(QIODevice::ReadWrite); // create the file return; } if (mimetype == "[plasmate]/new") { target = createContentWithSubdir(packagePath, contentWithSubdir); const QString dialogText = i18n("Enter a name for the new file:"); QString file = KInputDialog::getText(QString(), dialogText); if (!file.isEmpty()) { kDebug() << target; if (!m_metaEditor) { m_metaEditor = new MetaDataEditor(this); m_metaEditor->setFilename(packagePath + "/metadata.desktop"); } if (m_metaEditor->isValidMetaData()) { const QString api = m_metaEditor->api(); //we don't need the m_metaEditor anymore delete m_metaEditor; m_metaEditor = 0; if (!api.isEmpty()) { if (!hasExtension(file)) { if (api =="Ruby" && !file.endsWith(".rb")) { file.append(".rb"); } else if (api =="Python" && !file.endsWith(".py")) { file.append(".py"); } else if (api =="Javascript" && !file.endsWith(".js")) { file.append(".js"); } else if (api =="declarativeappletscript" && !file.endsWith(".qml")) { file.append(".qml"); } } } file = target + file; QFile fl(file); fl.open(QIODevice::ReadWrite); // create the file fl.close(); } } return; } KService::List offers = KMimeTypeTrader::self()->query(mimetype, "KParts/ReadWritePart"); //kDebug() << mimetype; if (offers.isEmpty()) { offers = KMimeTypeTrader::self()->query(mimetype, "KParts/ReadOnlyPart"); } if (!offers.isEmpty()) { //create the part using offers.at(0) //kDebug() << offers.at(0); //offers.at(0)->createInstance(parentWidget); emit loadEditor(offers, KUrl(target)); return; } } } void EditPage::imageDialog(const QString& filter, const QString& destinationPath) { KUser user; KUrl homeDir = user.homeDir(); const QList srcDir = KFileDialog::getOpenUrls(homeDir, filter, this); KConfigGroup cg(KGlobal::config(), "PackageModel::package"); const KUrl destinationDir(cg.readEntry("lastLoadedPackage", QString()) + destinationPath); QDir destPath(destinationDir.pathOrUrl()); if (!destPath.exists()) { destPath.mkpath(destinationDir.pathOrUrl()); } if (!srcDir.isEmpty()) { foreach(const KUrl source, srcDir) { KIO::copy(source, destinationDir, KIO::HideProgressInfo); } } } QString EditPage::createContentWithSubdir(const QString& packagePath, const QString& contentWithSubdir) const { //now create the content and the subdir directory. //Q: why now and not in the Packagemodel? //A: Because now the user want to create the subdir, //in the PackageModel he just clicked on the entry. QString target; QDir dir(packagePath); if (!dir.exists(contentWithSubdir)) { dir.mkpath(contentWithSubdir); target = packagePath + contentWithSubdir; if (!target.endsWith('/')) { target.append('/'); } } return target; } bool EditPage::hasExtension(const QString& filename) { QStringList list; list << ".rb" << ".js" << ".qml" << ".py" << ".xml"; foreach (const QString &str, list) { if (filename.endsWith(str)) { return true; } } return false; } void EditPage::loadFile(const KUrl &path) { m_path = path; kDebug() << "Loading file: " << path; KIO::JobFlags flags = KIO::HideProgressInfo; KIO::MimetypeJob *mjob = KIO::mimetype(path, flags); connect(mjob, SIGNAL(finished(KJob*)), this, SLOT(mimetypeJobFinished(KJob*))); } void EditPage::mimetypeJobFinished(KJob *job) { KIO::MimetypeJob *mjob = qobject_cast(job); if (!job) { return; } if (mjob->error()) { return; } m_mimetype = mjob->mimetype(); if (m_mimetype.isEmpty()) { kDebug() << "Could not detect the file's mimetype"; return; } kDebug() << "loaded mimetype: " << m_mimetype; KService::List offers = KMimeTypeTrader::self()->query(m_mimetype, "KParts/ReadWritePart"); if (offers.isEmpty()) { offers = KMimeTypeTrader::self()->query(m_mimetype, "KParts/ReadOnlyPart"); } if (!offers.isEmpty()) { //create the part using offers.at(0) //kDebug() << offers.at(0); //offers.at(0)->createInstance(parentWidget); emit loadEditor(offers, m_path); return; } kDebug() << "loading" << m_path; } plasmate-1.0/plasmate/editors/PaxHeaders.5990/metadata0000644000175000001440000000013112115142004021100 xustar000000000000000030 mtime=1362412548.612641239 29 atime=1362412560.66053227 30 ctime=1362412548.612641239 plasmate-1.0/plasmate/editors/metadata/0000755000175000001440000000000012115142004021613 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/editors/metadata/PaxHeaders.5990/metadata.ui0000644000175000001440000000013212115142004023275 xustar000000000000000030 mtime=1362412548.612641239 30 atime=1362412548.612641239 30 ctime=1362412548.612641239 plasmate-1.0/plasmate/editors/metadata/metadata.ui0000644000175000001440000002437612115142004023746 0ustar00kokeroulisusers00000000000000 MetaDataEditor 0 0 770 564 10 0 75 true Project Info Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 10 0 Comment: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 104 20 10 0 Icon: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 138 20 Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter License: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 10 0 Version: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 10 0 75 true Plugin Details Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 10 0 Plugin Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter API: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Author: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 10 0 Email: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 10 0 Website: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 10 0 10 0 75 true Qt::LeftToRight Contact Details label_16 label_13 label name_edit label_2 comment_edit label_3 label_10 category_combo label_6 version_edit label_14 label_4 type_combo label_5 pluginname_edit label_12 api_combo label_8 author_edit label_9 email_edit label_7 website_edit label_11 license_edit label_15 KIconButton QPushButton
kicondialog.h
KComboBox QComboBox
kcombobox.h
KLineEdit QLineEdit
klineedit.h
KMessageWidget QWidget
kmessagewidget.h
1
plasmate-1.0/plasmate/editors/metadata/PaxHeaders.5990/metadataeditor.h0000644000175000001440000000013212115142004024316 xustar000000000000000030 mtime=1362412548.612641239 30 atime=1362412548.612641239 30 ctime=1362412548.612641239 plasmate-1.0/plasmate/editors/metadata/metadataeditor.h0000644000175000001440000000311112115142004024747 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Richard Moore, 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 . */ #ifndef METADATAEDITOR_H #define METADATAEDITOR_H #include #include namespace Ui { class MetaDataEditor; } namespace Plasma { class PackageMetadata; } class MetaDataEditor : public QWidget { Q_OBJECT public: MetaDataEditor(QWidget *parent = 0); ~MetaDataEditor(); enum apiModes { coreApi, uiApi }; void setFilename(const QString &filename); QString formatApi(const QString &api, apiModes apiMode); const QString filename(); const QString api(); bool isValidMetaData(); public slots: void readFile(); void writeFile(); Q_SIGNALS: void apiChanged(); private slots: void serviceTypeChanged(); private: Ui::MetaDataEditor *m_view; QString m_filename; Plasma::PackageMetadata *m_metadata; QStringList m_apis; QStringList m_categories; void initCatergories(const QString& serviceType); }; #endif // METADATAEDITOR__H plasmate-1.0/plasmate/editors/metadata/PaxHeaders.5990/metadataeditor.cpp0000644000175000001440000000013212115142004024651 xustar000000000000000030 mtime=1362412548.612641239 30 atime=1362412548.612641239 30 ctime=1362412548.612641239 plasmate-1.0/plasmate/editors/metadata/metadataeditor.cpp0000644000175000001440000002542212115142004025313 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Richard Moore, 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 . */ #include #include #include #include #include #include #include #include #include #include "ui_metadata.h" #include "metadataeditor.h" #include "../../packagemodel.h" // // TODO: Now we know what this does it needs rewriting to use the metadata object // as its main store. And to handle updates in a clean per-change way rather than // the hacks that are there right now. // MetaDataEditor::MetaDataEditor(QWidget *parent) : QWidget(parent), m_metadata(0) { m_view = new Ui::MetaDataEditor; m_view->setupUi(this); m_view->label_16->setText(i18n("Plasmate cannot detect the correct API. Please choose one from the above list")); m_view->label_16->setMessageType(KMessageWidget::Error); m_view->label_16->setCloseButtonVisible(false); connect(m_view->type_combo, SIGNAL(currentIndexChanged(int)), SLOT(serviceTypeChanged())); } MetaDataEditor::~MetaDataEditor() { delete m_metadata; } void MetaDataEditor::setFilename(const QString &filename) { m_filename = filename; } const QString MetaDataEditor::filename() { return m_filename; } bool MetaDataEditor::isValidMetaData() { kDebug() << "readFile file" << m_filename; delete m_metadata; m_metadata = new Plasma::PackageMetadata(m_filename); return m_metadata->isValid(); } void MetaDataEditor::readFile() { if (!this->isValidMetaData()) { kWarning() << "MetaData cannot read the file because the filename:" + m_filename + "is not valid."; return; } m_view->name_edit->setText(m_metadata->name()); m_view->comment_edit->setText(m_metadata->description()); m_view->icon_button->setIcon(m_metadata->icon()); m_view->pluginname_edit->setText(m_metadata->pluginName()); QString serviceType = m_metadata->serviceType(); initCatergories(serviceType); m_view->type_combo->clear(); m_view->type_combo->setEnabled(false); if (serviceType == "Plasma/DataEngine") { m_view->type_combo->insertItem(0, i18n("Data Engine")); m_metadata->setServiceType("Plasma/DataEngine"); } else if (serviceType == "Plasma/Theme") { m_view->type_combo->insertItem(0, i18n("Theme")); m_metadata->setServiceType("Plasma/Theme"); } else if (serviceType == "Plasma/Runner") { m_view->type_combo->insertItem(0, i18n("Runner")); m_metadata->setServiceType("Plasma/Runner"); } else if (serviceType == "KWin/WindowSwitcher") { m_view->type_combo->insertItem(0,i18n("Window Switcher")); m_metadata->setServiceType("KWin/WindowSwitcher"); } else if (serviceType == "KWin/Script") { m_view->type_combo->insertItem(0, i18n("KWin Script")); m_metadata->setServiceType("KWin/Script"); } else if (serviceType == "KWin/Effect") { m_view->type_combo->insertItem(0, i18n("KWin Effect")); m_metadata->setServiceType("KWin/Effect"); } else { m_view->type_combo->insertItem(0, i18n("Applet")); m_view->type_combo->insertItem(1, i18n("Popup Applet")); m_view->type_combo->setEnabled(true); if (serviceType == "Plasma/Applet") { m_view->type_combo->setCurrentIndex(0); } else { m_view->type_combo->setCurrentIndex(1); } serviceTypeChanged(); } // Enforce the security restriction from package.cpp in the input field QRegExpValidator *pluginname_validator = new QRegExpValidator(m_view->pluginname_edit); QRegExp validatePluginName("^[\\w-\\.]+$"); // Only allow letters, numbers, underscore and period. pluginname_validator->setRegExp(validatePluginName); m_view->pluginname_edit->setValidator(pluginname_validator); int idx = m_view->category_combo->findText(m_metadata->category()); if (idx != -1) { m_view->category_combo->setCurrentIndex(idx); } else { kWarning() << "Unknown category detected " << m_metadata->category() << "using miscellaneous instead"; m_view->category_combo->setCurrentIndex(m_view->category_combo->count() - 1); // misc is last } m_view->version_edit->setText(m_metadata->version()); m_view->website_edit->setText(m_metadata->website()); m_view->author_edit->setText(m_metadata->author()); m_view->email_edit->setText(m_metadata->email()); m_view->license_edit->setText(m_metadata->license()); m_view->api_combo->setCurrentIndex(0); } const QString MetaDataEditor::api() { readFile(); return m_view->api_combo->currentText(); } void MetaDataEditor::serviceTypeChanged() { Plasma::ComponentTypes currentType; switch (m_view->type_combo->currentIndex()) { case 0: m_metadata->setServiceType("Plasma/Applet"); currentType = Plasma::AppletComponent; break; case 1: m_metadata->setServiceType("Plasma/Applet,Plasma/PopupApplet"); currentType = Plasma::AppletComponent; break; /*case 2: // only applet/popupapplet can be dynamically selected now m_metadata->setServiceType("Plasma/DataEngine"); currentType = Plasma::DataEngineComponent; break; case 3: m_metadata->setServiceType("Plasma/Theme"); m_view->api_combo->setEnabled(false); return; break; case 4: m_metadata->setServiceType("Plasma/Runner"); currentType = Plasma::RunnerComponent; break;*/ default: kWarning() << "Unknown service type" << currentType; return; } m_view->api_combo->setEnabled(false); // disallow dynamic changing of api //FIXME: shouldn't need to do most of the stuff below anymore m_apis = Plasma::knownLanguages(currentType); m_apis.append(QString()); // Add empty string for native kDebug() << "Got m_apis " << m_apis; // Map to friendly names (TODO: fix in library) //add api from the metadata.desktop inside the api KConfig filenamePath(m_filename); KConfigGroup metaFilePreferences(&filenamePath, "Desktop Entry"); QString api = metaFilePreferences.readEntry("X-Plasma-API"); QStringList apiName; apiName << formatApi(api, MetaDataEditor::uiApi); m_view->label_16->setVisible(false); m_view->api_combo->clear(); m_view->api_combo->insertItems(0, apiName); if (m_view->api_combo->currentIndex() == -1 || apiName.first().isEmpty()) { m_view->label_16->setVisible(true); m_view->api_combo->clear(); m_view->api_combo->insertItems(0, m_apis); m_view->api_combo->setEnabled(true); } } QString MetaDataEditor::formatApi(const QString &api, apiModes apiMode) { if (apiMode == MetaDataEditor::uiApi) { if (api == QString("dashboard")) { return QString("Dashboard"); } else if (api == QString("javascript")) { return QString("Javascript"); } else if (api == QString("ruby-script")) { return QString("Ruby"); } else if (api == QString("webkit")) { return QString("Webkit"); } else if (api == QString("python")) { return QString("Python"); } else if (api == QString("declarativeappletscript")) { return QString("declarativeappletscript"); } } else if (apiMode == MetaDataEditor::coreApi) { if (api == QString("Dashboard")) { return QString("dashboard"); } else if (api == QString("Javascript")) { return QString("javascript"); } else if (api == QString("Ruby")) { return QString("ruby-script"); } else if (api == QString("Webkit")) { return QString("webkit"); } else if (api == QString("Python")) { return QString("python"); } else if (api == QString("declarativeappletscript")) { return QString("declarativeappletscript"); } } kWarning() << "Unknown API " << api << apiMode; return QString(api); } void MetaDataEditor::writeFile() { QString api = m_view->api_combo->currentText(); m_metadata->setName(m_view->name_edit->text()); m_metadata->setDescription(m_view->comment_edit->text()); m_metadata->setIcon(m_view->icon_button->icon()); m_metadata->setCategory(m_categories[m_view->category_combo->currentIndex()]); m_metadata->setImplementationApi(formatApi(api, MetaDataEditor::coreApi)); m_metadata->setPluginName(m_view->pluginname_edit->text()); m_metadata->setVersion(m_view->version_edit->text()); m_metadata->setWebsite(m_view->website_edit->text()); m_metadata->setAuthor(m_view->author_edit->text()); m_metadata->setEmail(m_view->email_edit->text()); m_metadata->setLicense(m_view->license_edit->text()); emit apiChanged(); m_metadata->write(m_filename); //TODO: alert the necessary components (eg. packagemodel) if plugin type/api is changed } void MetaDataEditor::initCatergories(const QString& serviceType) { m_categories.clear(); m_view->category_combo->clear(); if (serviceType == "KWin/Effect") { m_categories << QString("Accessibility") << QString("Appearance") << QString("Candy") << QString("Focus") << QString("Tools") << QString("Window Management"); } else { // This list contains the untranslated version of the m_categories so that we // write the correct version into the package metadata. The list of allowed m_categories can be // found at http://techbase.kde.org/Projects/Plasma/PIG#Category_Names m_categories << QString("Application Launchers") << QString("Astronomy") << QString("Date and Time") << QString("Development Tools") << QString("Education") << QString("Environment and Weather") << QString("Examples") << QString("File System") << QString("Fun and Games") << QString("Graphics") << QString("Language") << QString("Mapping") << QString("Online Services") << QString("System Information") << QString("Utilities") << QString("Windows and Tasks") << QString("Miscellaneous"); } //now add them in the combobox m_view->category_combo->addItems(m_categories); } plasmate-1.0/plasmate/editors/metadata/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004023716 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/metadata/CMakeLists.txt0000644000175000001440000000133012115142004024350 0ustar00kokeroulisusers00000000000000project( plasmate-metadata-editor ) find_package(KDE4 REQUIRED) include(KDE4Defaults) set(metadata_editor_SRCS metadataeditor.cpp) kde4_add_ui_files (metadata_editor_SRCS metadata.ui ) add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) include_directories(${KDE4_INCLUDES} ../..) kde4_add_plugin(plasmate_metadata_editor ${metadata_editor_SRCS}) target_link_libraries(plasmate_metadata_editor ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS}) set( testmetadata_SRCS tests/test_metadata.cpp metadataeditor.cpp ) kde4_add_ui_files (testmetadata_SRCS metadata.ui ) kde4_add_executable( testmetadata TEST ${testmetadata_SRCS}) target_link_libraries( testmetadata ${KDE4_KIO_LIBS} ${KDE4_PLASMA_LIBS} ) plasmate-1.0/plasmate/editors/metadata/PaxHeaders.5990/tests0000644000175000001440000000013112115142004022242 xustar000000000000000030 mtime=1362412548.612641239 29 atime=1362412560.66153226 30 ctime=1362412548.612641239 plasmate-1.0/plasmate/editors/metadata/tests/0000755000175000001440000000000012115142004022755 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/editors/metadata/tests/PaxHeaders.5990/test_metadata.cpp0000644000175000001440000000013212115142004025643 xustar000000000000000030 mtime=1362412548.612641239 30 atime=1362412548.612641239 30 ctime=1362412548.612641239 plasmate-1.0/plasmate/editors/metadata/tests/test_metadata.cpp0000644000175000001440000000234212115142004026301 0ustar00kokeroulisusers00000000000000/* Copyright (c) 2009 Richard Moore, 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. */ #include #include #include #include #include #include #include #include "../metadataeditor.h" int main(int argc, char **argv) { // KCmdLineArgs::init(argc, argv); // KApplication app; QApplication app(argc, argv); QWidget *top = new QWidget(); QVBoxLayout *vbox = new QVBoxLayout(top); MetaDataEditor *ed = new MetaDataEditor(top); vbox->addWidget(ed); QPushButton *save = new QPushButton(top); save->setText("&Save"); vbox->addWidget(save); QString filename; if (argc != 2) { filename = QDir::currentPath() + "/tests/plasma-applet-systemtray.desktop"; } else { filename = QDir::currentPath() + "/" + argv[1]; } ed->setFilename(filename); ed->readFile(); QObject::connect(save, SIGNAL(clicked()), ed, SLOT(writeFile())); top->show(); return app.exec(); } plasmate-1.0/plasmate/editors/metadata/tests/PaxHeaders.5990/victory-calendar.desktop0000644000175000001440000000013212115142004027161 xustar000000000000000030 mtime=1362412548.612641239 30 atime=1362412548.612641239 30 ctime=1362412548.612641239 plasmate-1.0/plasmate/editors/metadata/tests/victory-calendar.desktop0000644000175000001440000000575512115142004027632 0ustar00kokeroulisusers00000000000000[Desktop Entry] Name=Victory Calendar Name[da]=Victory-kalender Name[el]=ΗμεÏολόγιο Victory Name[es]=Calendario victoriano Name[et]=Võidukalender Name[fi]=Voittokalenteri Name[fr]=Calendrier de victoires Name[gl]=Calendario da vitoria Name[hu]=GyÅ‘zelemnaptár Name[km]=ប្រážáž·áž‘ិន​ជáŸáž™â€‹áž‡áŸ†áž“ះ Name[mr]=वà¥à¤¹à¤¿à¤•à¥à¤Ÿà¤°à¥€ दिनदरà¥à¤¶à¤¿à¤•ा Name[nds]=Spood-Kalenner Name[nl]=Victory agenda Name[pl]=Victory Calendar Name[pt]=Calendário de Vitórias Name[pt_BR]=Calendário de Vitórias Name[ro]=Calendarul victoriilor Name[sk]=Kalendár víťazstiev Name[sv]=Vinstkalender Name[tr]=Zafer Takvimi Name[uk]=Календар перемог Name[x-test]=xxVictory Calendarxx Name[zh_TW]=å‹åˆ©è¡Œäº‹æ›† Comment=1) Log your daily accomplishments. 2) ??? 3) Profit! Comment[da]=1) Log dine daglige bedrifter. 2) ??? 3) FÃ¥ profit! Comment[el]=1) ΚαταγÏάψτε τα καθημεÏινά σας επιτεÏγματα. 2) ;;; 3) ΚέÏδος! Comment[es]=1) Registre sus logros diarios. 2) ??? 3) Obtenga beneficios Comment[et]=1) Pane kirja oma igapäevased saavutused. 2) ??? 3) Kasu! Comment[fi]=1) Merkitse päivittäiset saavutuksesi muistiin. 2) ??? 3) Voittoa! Comment[fr]=1) Journalisez vos réalisations quotidiennes. 2) ??? 3) Profitez ! Comment[gl]=(1) Rexistre os seus logros diarios, (2) ? e (3) obteña beneficios! Comment[hu]=1) Naplózza a napi teljesítményeket. 2) ??? 3) Profit! Comment[km]=១) ចុះ​កំណážáŸ‹â€‹áž áŸážáž»â€‹ážŸáŸ’នាដៃ​ប្រចាំ​ážáŸ’ងៃ​របស់​អ្ន ។ ២) ??? ៣) ប្រាក់​កម្រៃ ! Comment[nds]=1) Elk Dag Dien Spood opschrieven 2) Dor wat ut maken 3) De Frücht austen! Comment[nl]=1) Log uw dagelijkse verrichtingen. 2) ??? 3) Winst! Comment[pl]=1) Wpisuj do dziennika swoje dzienne dokonania. 2) ??? 3) Korzyść! Comment[pt]=1) Registar os seus sucessos diários. 2) ??? 3) Lucro! Comment[pt_BR]=1) Registrar os seus sucessos diários. 2) ??? 3) Lucro! Comment[ro]=1) ÃŽnsemnaÈ›i-vă realizările zilnice. 2) ??? 3) Profit! Comment[sk]=1) Záznam vaÅ¡ich denných úspechov. 2) ??? 3) Zisk! Comment[sv]=1) Logga dagliga framsteg. 2) ??? 3) Dra nytta. Comment[tr]=1) Günlük baÅŸarılarınızı kayıt altına alın. 2) ??? 3) Kar edin! Comment[uk]=1) Запишіть ваші щоденні звершеннÑ. 2) ??? 3) Profit! Comment[x-test]=xx1) Log your daily accomplishments. 2) ??? 3) Profit!xx Comment[zh_TW]=1) 紀錄您æ¯å¤©çš„好事。 2) ??? 3) å‹åˆ©ï¼ Icon=view-calendar-tasks Type=Service X-Plasma-API=javascript X-Plasma-MainScript=code/main.js X-Plasma-DefaultSize=200,100 X-KDE-ServiceTypes=Plasma/Applet X-KDE-PluginInfo-Author=Chani Armitage X-KDE-PluginInfo-Email=chani@kde.org X-KDE-PluginInfo-Name=victorycalendar X-KDE-PluginInfo-Version=0.0 X-KDE-PluginInfo-Website=http://plasma.kde.org/ X-KDE-PluginInfo-Category=Personal Information Management X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=true plasmate-1.0/plasmate/editors/metadata/tests/PaxHeaders.5990/plasma-applet-systemtray.desktop0000644000175000001440000000013212115142004030675 xustar000000000000000030 mtime=1362412548.612641239 30 atime=1362412548.612641239 30 ctime=1362412548.612641239 plasmate-1.0/plasmate/editors/metadata/tests/plasma-applet-systemtray.desktop0000644000175000001440000000747712115142004031351 0ustar00kokeroulisusers00000000000000[Desktop Entry] Comment=Access hidden applications minimized in the system tray Comment[bs]=Pristup skrivenim programima minimizovanim u sistemsku kasetu Comment[cs]=Přístup ke skrytým aplikacím, které jsou minimalizované v systémové oblasti Comment[da]=TilgÃ¥ skjulte programmer der er minimeret i statusomrÃ¥det Comment[de]=Ermöglicht den Zugriff auf Programme, die im Systemabschnitt der Kontrollleiste laufen. Comment[el]=ΠÏόσβαση σε κÏυμμένες εφαÏμογές ελαχιστοποιημένες στο πλαίσιο συστήματος Comment[es]=Acceder a aplicaciones ocultas minimizadas en la bandeja del sistema Comment[et]=Süsteemisalve minimeeritud peidetud rakenduste kasutamine Comment[fi]=Hae piilotettuja sovelluksia, jotka on pienennetty ilmoitusalueelle Comment[fr]=Accède aux applications cachées minimisées dans la boîte à miniatures Comment[ga]=Rochtain feidhmchláir atá íoslaghdaithe i dtráidire an chórais Comment[gl]=Accede a programas ocultos minimizados na bandexa do sistema Comment[hu]=Minimalizált alkalmazások elérését teszi lehetÅ‘vé a paneltálcáról Comment[km]=ចូល​ដំណើរការ​​កម្មវិធី​ដែលលាក់​ ដែល​បាន​បង្រួម​អប្បបរមា​នៅ​ក្នុង​ážáž¶ážŸâ€‹áž”្រពáŸáž“្ធ Comment[mr]=system tray अंतरà¥à¤—त पà¥à¤°à¤µà¥‡à¤¶ करिता लपविलेले अनà¥à¤ªà¥à¤°à¤¯à¥‹à¤— लहान करा Comment[nds]=Togriep op versteken Programmen binnen den Systeemafsnitt Comment[nl]=Biedt toegang tot programma's die in het systeemvak draaien Comment[pl]=DostÄ™p do programów zminimalizowanych na tacce systemowej Comment[pt]=Aceder às aplicações escondidas e minimizadas na bandeja do sistema Comment[pt_BR]=Acessa aplicativos ocultos minimizados na área de notificação Comment[ro]=AccesaÈ›i aplicaÈ›iile ascunse minimizate în tava de sistem Comment[sk]=Prístup k skrytým aplikáciam minimalizovaným do systémovej liÅ¡ty Comment[sv]=Kom Ã¥t dolda program minimerade i systembrickan Comment[tr]=Sistem çekmecesine küçültülen uygulamalara eriÅŸin Comment[ug]=سىستÛما قونداققا كىچىكلىتىپ يوشۇرۇلغان پروگراممىلارنى زىيارەت Comment[uk]=ДоÑтуп до прихованих програм, мінімізованих до ÑиÑтемного лотка Comment[x-test]=xxAccess hidden applications minimized in the system trayxx Comment[zh_TW]=å­˜å–æœ€å°åŒ–åœ¨ç³»çµ±åŒ£å…§çš„éš±è—æ‡‰ç”¨ç¨‹å¼ Encoding=UTF-8 Name=System Tray Name[bs]=sistemska kaseta Name[cs]=Systémová Äást panelu Name[da]=StatusomrÃ¥de Name[de]=Systemabschnitt der Kontrollleiste Name[el]=Πλαίσιο συστήματος Name[es]=Bandeja del sistema Name[et]=Süsteemisalv Name[fi]=Ilmoitusalue Name[fr]=Boîte à miniatures Name[ga]=Tráidire an Chórais Name[gl]=Ãrea de notificación Name[hu]=Paneltálca Name[km]=ážáž¶ážŸâ€‹áž”្រពáŸáž“្ធ Name[mr]=पà¥à¤°à¤£à¤¾à¤²à¥€ टà¥à¤°à¥‡ Name[nds]=Systeemafsnitt Name[nl]=Systeemvak Name[pl]=Tacka systemowa Name[pt]=Bandeja do Sistema Name[pt_BR]=Ãrea de notificação Name[ro]=Tavă de sistem Name[sk]=Systémová liÅ¡ta Name[sv]=Systembricka Name[tr]=Sistem Çekmecesi Name[ug]=سىستÛما قوندىقى Name[uk]=СиÑтемний лоток Name[x-test]=xxSystem Trayxx Name[zh_TW]=系統匣 Type=Service X-KDE-Library=plasma_applet_systemtray X-KDE-ParentApp= X-KDE-PluginInfo-Author=Alexander Rodin X-KDE-PluginInfo-Category=Windows and Tasks X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-Email=rodin.alexander@gmail.com X-KDE-PluginInfo-EnabledByDefault=true X-KDE-PluginInfo-License=GPL v2+ X-KDE-PluginInfo-Name=systemtray X-KDE-PluginInfo-Version=1.0 X-KDE-PluginInfo-Website=http://plasma.kde.org/ X-KDE-ServiceTypes=Plasma/Applet X-Plasma-API= plasmate-1.0/plasmate/editors/PaxHeaders.5990/kconfigxt0000644000175000001440000000013212115142004021315 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.612641239 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/0000755000175000001440000000000012115142004022027 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/editors/kconfigxt/PaxHeaders.5990/standalone0000644000175000001440000000013212115142004023445 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.613641233 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/standalone/0000755000175000001440000000000012115142004024157 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/editors/kconfigxt/standalone/PaxHeaders.5990/plasmakconfigxteditor.h0000644000175000001440000000013212115142004030274 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/standalone/plasmakconfigxteditor.h0000644000175000001440000000126212115142004030732 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliwkas * * 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. */ #ifndef PLASMAREMOTEINSTALLER_H #define PLASMAREMOTEINSTALLER_H #include "../kconfigxteditor.h" class PlasmaKConfigXtEditor : public KConfigXtEditor { Q_OBJECT; public: PlasmaKConfigXtEditor(QWidget* parent = 0); public Q_SLOTS: void checkProjectPath(const QString& path); private: void enableWidgets(bool enable); }; #endif // PUBLISHER_H plasmate-1.0/plasmate/editors/kconfigxt/standalone/PaxHeaders.5990/plasmakconfigxteditor.cpp0000644000175000001440000000013212115142004030627 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/standalone/plasmakconfigxteditor.cpp0000644000175000001440000000305112115142004031263 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliwkas > * * 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. */ #include "plasmakconfigxteditor.h" PlasmaKConfigXtEditor::PlasmaKConfigXtEditor(QWidget* parent) : KConfigXtEditor(parent) { connect(m_ui.srcRequester, SIGNAL(textChanged(const QString&)), this, SLOT(checkProjectPath(const QString&))); //we want only the xml files m_ui.srcRequester->setFilter("*.xml"); //disable the widgets. The user hasn't give a path yet. enableWidgets(false); //we want the source relative ui to be visible. m_ui.srcLabel1->setVisible(true); m_ui.srcLabel2->setVisible(true); m_ui.srcRequester->setVisible(true); m_ui.srcSeparator->setVisible(true); } void PlasmaKConfigXtEditor::checkProjectPath(const QString& path) { if (path.isEmpty()) { return; } //check if the files is an xml if(path.endsWith(".xml")) { enableWidgets(true); setFilename(path); readFile(); } else { enableWidgets(false); } } void PlasmaKConfigXtEditor::enableWidgets(bool enable) { m_ui.twEntries->setEnabled(enable); m_ui.twGroups->setEnabled(enable); m_ui.pbAddGroup->setEnabled(enable); m_ui.pbDeleteGroup->setEnabled(enable); m_ui.pbAddEntry->setEnabled(enable); m_ui.pbDeleteEntry->setEnabled(enable); } plasmate-1.0/plasmate/editors/kconfigxt/standalone/PaxHeaders.5990/main.cpp0000644000175000001440000000013212115142004025152 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/standalone/main.cpp0000644000175000001440000000347112115142004025614 0ustar00kokeroulisusers00000000000000/* * Copyright 2012 Giorgos Tsiapaliwkas * * 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 . */ #include #include #include #include #include #include #include #include "plasmakconfigxteditor.h" int main(int argc, char *argv[]) { KAboutData aboutData("plasmakconfigxteditor", 0, ki18n("Plasma KConfigXt Editor"), "0.1alpha3", ki18n("Plasma KConfigXt Editor"), KAboutData::License_GPL, ki18n("Copyright 2012 Plasma Development Team"), KLocalizedString(), "", "plasma-devel@kde.org"); aboutData.addAuthor(ki18n("Giorgos Tsiapaliwkas"), ki18n("Author"), "terietor@gmail.com"); aboutData.setProgramIconName("plasmagik"); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineOptions options; KCmdLineArgs::addCmdLineOptions(options); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); KApplication app; PlasmaKConfigXtEditor *editor = new PlasmaKConfigXtEditor(); QScopedPointer dialog(new KDialog()); dialog->setMainWidget(editor); dialog->exec(); return app.exec(); } plasmate-1.0/plasmate/editors/kconfigxt/PaxHeaders.5990/kconfigxtreader.cpp0000644000175000001440000000013212115142004025255 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/kconfigxtreader.cpp0000644000175000001440000001477512115142004025730 0ustar00kokeroulisusers00000000000000/* This file is part of the KDE project Copyright 2009 by Dmitry Suzdalev Copyright 2012 by Giorgos Tsiapaliokas 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kconfigxtreader.h" #include #include #include #include KConfigXtReaderItem::KConfigXtReaderItem() { } void KConfigXtReaderItem::appendGroupNode(const KConfigXtReaderItem::GroupNode& groupNode) { m_groupNodeList.append(groupNode); } void KConfigXtReaderItem::clear() { m_groupNodeList.clear(); } QList KConfigXtReaderItem::groupNodes() const { return m_groupNodeList; } bool KConfigXtReaderItem::isEmpty() { return m_groupNodeList.isEmpty(); } KConfigXtReader::KConfigXtReader(QObject *parent) : QObject(parent) { } void KConfigXtReader::setConfigXmlFile(const QString& filename) { m_filename = filename; } bool KConfigXtReader::parse() { m_data.clear(); bool parseResult = true; QString parseError; QFile f(m_filename); if (!f.open(QIODevice::ReadOnly)) { parseResult = false; parseError = i18n("The xml file isn't writable"); } if (parseResult) { QDomDocument document; document.setContent(&f); //iterate inside it //this is the root element QDomElement docElem = document.documentElement(); //this is the first child QDomNode it = docElem.firstChild(); while(!it.isNull() && parseResult) { if (it.nodeName() == "group") { //continue, its a group const QString groupName = attributeValue(it, "name"); if (groupName.isEmpty()) { parseError = i18n("The group element doesn't have a name"); break; } KConfigXtReaderItem::GroupNode groupNode; groupNode.groupName = groupName; QDomNodeList childList = it.childNodes(); //check if the node has children if (!childList.isEmpty()) { for(uint i = 0; i < childList.length(); i++) { const QDomNode child = childList.at(i); if (child.nodeName() == "entry") { KConfigXtReaderItem::EntryNode entryNode; entryNode.groupName = groupName; //we have an entry element const QString entryName = attributeValue(child, "name"); const QString entryType = attributeValue(child, "type"); if (entryName.isEmpty()) { parseError = i18n("The entry element doesn't have a name"); break; } entryNode.entryName = entryName; if (entryType.isEmpty()) { parseError = i18n("The entry element doesn't have a type"); break; } entryNode.entryType = entryType; //until now we have a valid group and a valid entry //so lets take those data, if we have more we will //take them later //now check if the child has more children QDomNodeList childList2 = child.childNodes(); if (!childList2.isEmpty()) { for(uint j = 0; j < childList2.length(); j++) { const QDomNode child2 = childList2.at(j); bool descriptionExists = true; if (child2.nodeName() == "label") { entryNode.entryDescriptionType = KConfigXtReaderItem::Label; } else if (child2.nodeName() == "tooltip") { entryNode.entryDescriptionType = KConfigXtReaderItem::ToolTip; } else if (child2.nodeName() == "whatsthis") { entryNode.entryDescriptionType = KConfigXtReaderItem::WhatsThis; } else if (child2.nodeName() == "default") { entryNode.entryValue = child2.toElement().text(); descriptionExists = false; } else { descriptionExists = false; } if (descriptionExists) { entryNode.entryDescriptionValue = child2.toElement().text(); } } } groupNode.entryNodeList.append(entryNode); } } } m_data.appendGroupNode(groupNode); //we have parsed all the element so go to the next one it = it.nextSibling(); } else { //its not a group element, so go to the next one it = it.nextSibling(); } } } if (!parseResult) { KMessageBox::error(0, parseError); } return parseResult; } QString KConfigXtReader::attributeValue(const QDomNode element, const QString& attributeName) const { QDomElement e = element.toElement(); if (e.hasAttribute(attributeName)) { return e.attribute(attributeName); } return QString(); } KConfigXtReaderItem KConfigXtReader::data() const { return m_data; } plasmate-1.0/plasmate/editors/kconfigxt/PaxHeaders.5990/kconfigxtwriter.h0000644000175000001440000000013212115142004024774 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/kconfigxtwriter.h0000644000175000001440000000434512115142004025437 0ustar00kokeroulisusers00000000000000/* This file is part of the KDE project Copyright 2012 by Giorgos Tsiapaliokas 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KCONFIGXTWRITER_H #define KCONFIGXTWRITER_H #include "kconfigxtreader.h" #include class KConfigXtWriter : public QObject { Q_OBJECT public: KConfigXtWriter(QObject *parent = 0); KConfigXtWriter( const QString& xmlFilePath, QObject *parent = 0); ~KConfigXtWriter(); /** * This is the xml in which the data will be * writen **/ void setConfigXmlFile(const QString& filename); void setData(const QList& data); QList data() const; void addNewEntry(const KConfigXtReaderItem::EntryNode newEntry); void addNewGroup(const QString& groupName); void editGroupName(const QString& groupName, const QString& newValue); void editEntry(const QString& groupName, const QString& entryName, const QString elementName, const QString& newValue); bool removeEntry(const QString& groupName, const QString& entryName); bool removeGroup(const QString& groupName); private: /** * writes the data in the xml **/ void writeXML(const QList &data); void writeXML(); QList m_data; QString m_xmlFile; KConfigXtReaderItem::EntryNode entryNode(const QString& groupName, const QString& entryName) const; KConfigXtReaderItem::GroupNode groupNode(const QString& groupName) const; }; #endif plasmate-1.0/plasmate/editors/kconfigxt/PaxHeaders.5990/kconfigxteditor.h0000644000175000001440000000013212115142004024746 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/kconfigxteditor.h0000644000175000001440000001074012115142004025405 0ustar00kokeroulisusers00000000000000/* This file is part of the KDE project Copyright 2009 by Dmitry Suzdalev Copyright 2012 by Giorgos Tsiapaliwkas 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KCONFIGXT_EDITOR_H #define KCONFIGXT_EDITOR_H #include "ui_kconfigxteditor.h" #include "kconfigxtreader.h" #include "kconfigxtwriter.h" #include #include class QTreeWidgetItem; class KConfigXtEditor : public QWidget { Q_OBJECT public: KConfigXtEditor(QWidget *parent = 0); enum ElementType { Group = 0, Entry }; /** * Sets filename to edit */ void setFilename(const KUrl& filename); KUrl filename(); void clear(); public slots: /** * Sets up editor widgets according to contents of config file * specified with setFilename */ void readFile(); private slots: /** * Creates new kconfig group */ void createNewGroup(); /** * Creates new entry */ void createNewEntry(); /** * Sets up editor widgets for * the groups. This method should be called every time that the * a group is modified/deleted/etc. **/ void setupWidgetsForGroups(); /** * Sets up editor widgets for * the entries. This method should be called every time that the * an entry is modified/deleted/etc. **/ void setupWidgetsForEntries(QTreeWidgetItem *item); /** * Removes a group from the xml file **/ void removeGroup(); /** * Removes an entry from the xml file **/ void removeEntry(); /** * Modifies a group from the xml file **/ void modifyGroup(QTreeWidgetItem *item, int column); /** * Modifies an entry from the xml file **/ void modifyEntry(QTreeWidgetItem *item, int column); /** * Modifies the label description of an entry from the xml file **/ void modifyTypeDescription(); /** * sets the last item of the group treewidget **/ void setLastGroupItem(QTreeWidgetItem* item, int column); /** * sets the last item of the entry treewidget **/ void setLastEntryItem(QTreeWidgetItem* item); /** * It will enable and disable the itemWidget of the entry **/ void entryItemWidgetState(QTreeWidgetItem* currentItem, QTreeWidgetItem* previousItem); protected: Ui::KConfigXtEditor m_ui; private: /** * Sets up editor widgets for an existing file * (e.g. creates a default group etc) */ void setupWidgetsForOldFile(); /** * Sets up editor widgets for a new file * (e.g. creates a default group etc) */ void setupWidgetsForNewFile(); /** * This method takes the groups from the parser * If group is specified it will also take the * keys,values and types from the parser for the specified group * * NOTE: after the call of this method you can use m_groups * and m_keysValuesTypes */ void takeDataFromParser(); //with this method we avoid duplication void addGroupToUi(const QString& group); //with this method we can avoid duplication void addEntryToUi(const QString& entryName, const QString& entryType, const QString& entryValue ,const QString& descriptionValue, KConfigXtReaderItem::DescriptionType descriptionType); //with this method we can avoid duplication, //this method will delete everything that is between the startsWith //and endsWith bool removeElement(const QString& elementName, ElementType elementType); //reduces duplication void removeError(); KUrl m_filename; QStringList m_groups; KConfigXtReader m_parser; KConfigXtWriter m_writer; QString m_lastGroupItem; QHash m_lastEntryItem; }; #endif plasmate-1.0/plasmate/editors/kconfigxt/PaxHeaders.5990/kconfigxteditor.ui0000644000175000001440000000013212115142004025134 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/kconfigxteditor.ui0000644000175000001440000001400112115142004025565 0ustar00kokeroulisusers00000000000000 KConfigXtEditor 0 0 1214 756 <html><head/><body><p><span style=" font-size:12pt; font-weight:600;">Source</span></p></body></html> Choose your file, your file should be an XML file: Configuration file layout: Add Entry Delete Entry 2 0 false Key Type Value Description Type Description Value Add Group 1 0 false Group Delete Group Qt::Horizontal 40 20 Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::Fixed 20 15 16 16 16 16 true To edit a configuration item double-click its cell KSeparator QFrame
kseparator.h
KPushButton QPushButton
kpushbutton.h
KUrlRequester QFrame
kurlrequester.h
plasmate-1.0/plasmate/editors/kconfigxt/PaxHeaders.5990/kconfigxteditor.cpp0000644000175000001440000000013212115142004025301 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/kconfigxteditor.cpp0000644000175000001440000003617012115142004025745 0ustar00kokeroulisusers00000000000000/* This file is part of the KDE project Copyright 2009 by Dmitry Suzdalev Copyright 2012 by Giorgos Tsiapaliokas 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kconfigxteditor.h" #include #include #include #include #include #include #include #include KConfigXtEditor::KConfigXtEditor(QWidget *parent) : QWidget(parent) { m_ui.setupUi(this); //don't move the columns!!! m_ui.twEntries->header()->setMovable(false); m_ui.twEntries->header()->setResizeMode(QHeaderView::ResizeToContents); m_ui.twGroups->header()->setResizeMode(QHeaderView::ResizeToContents); m_ui.lblHintIcon->setPixmap(KIcon("dialog-information").pixmap(16, 16)); connect(m_ui.pbAddGroup, SIGNAL(clicked()), this, SLOT(createNewGroup())); connect(m_ui.pbAddEntry, SIGNAL(clicked()), this, SLOT(createNewEntry())); connect(m_ui.twGroups, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(setupWidgetsForEntries(QTreeWidgetItem*))); connect(m_ui.twEntries, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(entryItemWidgetState(QTreeWidgetItem*, QTreeWidgetItem*))); connect(m_ui.twGroups, SIGNAL(itemPressed(QTreeWidgetItem*, int)), this, SLOT(setLastGroupItem(QTreeWidgetItem*, int))); connect(m_ui.twEntries, SIGNAL(itemPressed(QTreeWidgetItem*, int)), this, SLOT(setLastEntryItem(QTreeWidgetItem*))); connect(m_ui.twGroups, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(modifyGroup(QTreeWidgetItem*, int))); connect(m_ui.twEntries, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(modifyEntry(QTreeWidgetItem*, int))); connect(m_ui.pbDeleteGroup, SIGNAL(clicked()), this, SLOT(removeGroup())); connect(m_ui.pbDeleteEntry, SIGNAL(clicked()), this, SLOT(removeEntry())); //hide the source related ui stuff m_ui.srcLabel1->setVisible(false); m_ui.srcLabel2->setVisible(false); m_ui.srcRequester->setVisible(false); m_ui.srcSeparator->setVisible(false); } void KConfigXtEditor::setFilename(const KUrl& filename) { m_filename = filename; //load the xml file } KUrl KConfigXtEditor::filename() { return m_filename; } void KConfigXtEditor::readFile() { m_writer.setConfigXmlFile(filename().pathOrUrl()); if (m_filename.isEmpty()) { kDebug() << "Empty filename given!"; return; } //check if the xml exists if (!QFile::exists(m_filename.pathOrUrl())) { setupWidgetsForNewFile(); return; } else { m_parser.setConfigXmlFile(m_filename.pathOrUrl()); takeDataFromParser(); setupWidgetsForOldFile(); } } void KConfigXtEditor::clear() { m_ui.twEntries->clear(); m_ui.twGroups->clear(); } void KConfigXtEditor::setupWidgetsForNewFile() { // Add default group createNewGroup(); } void KConfigXtEditor::setupWidgetsForOldFile() { setupWidgetsForGroups(); } void KConfigXtEditor::createNewGroup() { m_ui.twEntries->clear(); takeDataFromParser(); QString newGroupName; if (m_groups.isEmpty()) { newGroupName = "General"; } else { int counter = 1; newGroupName = QString("Group %1").arg(counter); while (m_groups.contains(newGroupName)) { counter++; newGroupName = QString("Group %1").arg(counter); } } m_groups.append(newGroupName); addGroupToUi(newGroupName); KConfigXtReaderItem::GroupNode groupNode; groupNode.groupName = newGroupName; KConfigXtReaderItem::EntryNode newEntryItem; newEntryItem.groupName = newGroupName; newEntryItem.entryName = "TODO"; newEntryItem.entryType = "string"; newEntryItem.entryDescriptionType = KConfigXtReaderItem::Label; newEntryItem.entryDescriptionValue = "TODO"; newEntryItem.entryValue = "TODO"; m_writer.addNewGroup(newGroupName); m_writer.addNewEntry(newEntryItem); //add our new entry into the tree addEntryToUi(newEntryItem.entryName, newEntryItem.entryType, newEntryItem.entryValue, newEntryItem.entryDescriptionValue, newEntryItem.entryDescriptionType); } void KConfigXtEditor::createNewEntry() { QTreeWidgetItem *currentGroupItem = m_ui.twGroups->currentItem(); //check if the ptr is evil!! if (!currentGroupItem) { return; } takeDataFromParser(); QString groupName = currentGroupItem->text(0); QStringList entryNameList; for(int i = 0; i < m_parser.data().groupNodes().length(); i++) { KConfigXtReaderItem::GroupNode it = m_parser.data().groupNodes().at(i); if (groupName == it.groupName) { for (int j = 0; j < it.entryNodeList.length(); j++) { KConfigXtReaderItem::EntryNode it2 = it.entryNodeList.at(j); entryNameList << it2.entryName; } } } if (entryNameList.contains("TODO")) { QString text = i18n("There is already a TODO entry," " fix it before you continue"); KMessageBox::information(this, text); return; } KConfigXtReaderItem::EntryNode newEntryItem; newEntryItem.groupName = groupName; newEntryItem.entryName = "TODO"; newEntryItem.entryValue = "TODO"; newEntryItem.entryType = "string"; newEntryItem.entryDescriptionType = KConfigXtReaderItem::Label; newEntryItem.entryDescriptionValue = "TODO"; //add our new entry into the tree addEntryToUi(newEntryItem.entryName, newEntryItem.entryType, newEntryItem.entryValue, newEntryItem.entryDescriptionValue, newEntryItem.entryDescriptionType); m_writer.addNewEntry(newEntryItem); } void KConfigXtEditor::setupWidgetsForGroups() { takeDataFromParser(); foreach(const QString& group, m_groups) { addGroupToUi(group); } } void KConfigXtEditor::addGroupToUi(const QString& group) { QTreeWidgetItem *item = new QTreeWidgetItem(m_ui.twGroups); item->setText(0, group); item->setFlags(item->flags() | Qt::ItemIsEditable); m_ui.twGroups->setCurrentItem(item); m_lastGroupItem = group; } void KConfigXtEditor::setupWidgetsForEntries(QTreeWidgetItem *item) { if (!item) { return; } //the currectIndex of m_ui.twGroups has changed. //this means that we need to load the data for the new //group so remove the old items m_ui.twEntries->clear(); takeDataFromParser(); for (int i = 0; i < m_parser.data().groupNodes().length(); i++) { KConfigXtReaderItem::GroupNode it = m_parser.data().groupNodes().at(i); //check if this group has an entry if (item->text(0) == it.groupName) { for(int j = 0; j < it.entryNodeList.length(); j++) { KConfigXtReaderItem::EntryNode entryNode = it.entryNodeList.at(j); addEntryToUi(entryNode.entryName, entryNode.entryType, entryNode.entryValue, entryNode.entryDescriptionValue, entryNode.entryDescriptionType); } } } } void KConfigXtEditor::addEntryToUi(const QString& key, const QString& type, const QString& value, const QString& descriptionValue, KConfigXtReaderItem::DescriptionType descriptionType) { KComboBox *descriptionButton = new KComboBox(); descriptionButton->addItem("Label"); descriptionButton->addItem("ToolTip"); descriptionButton->addItem("WhatsThis"); //we need a valid QTreeWidgetItem in order to enable the button, //so disable it for now, and leave the signal to do the work! descriptionButton->setEnabled(false); connect(descriptionButton, SIGNAL(currentIndexChanged(int)), this, SLOT(modifyTypeDescription())); //find the correct index if (descriptionType == KConfigXtReaderItem::Label) { descriptionButton->setCurrentIndex(0); m_lastEntryItem["descriptionType"] = "label"; } else if (descriptionType == KConfigXtReaderItem::ToolTip) { descriptionButton->setCurrentIndex(1); m_lastEntryItem["descriptionType"] = "ToolTip"; } else if (descriptionType == KConfigXtReaderItem::WhatsThis) { descriptionButton->setCurrentIndex(2); m_lastEntryItem["descriptionType"] = "WhatsThis"; } QTreeWidgetItem *item = new QTreeWidgetItem(m_ui.twEntries); item->setText(0, key); item->setText(1, type); item->setText(2, value); item->setText(4, descriptionValue); item->setFlags(item->flags() | Qt::ItemIsEditable); m_ui.twEntries->setItemWidget(item, 3, descriptionButton); } void KConfigXtEditor::modifyGroup(QTreeWidgetItem* item, int column) { //check if ptr is evil //and if the name of the group has been changed if (!item || !item->isSelected()) { return; } //take the groups const QString oldGroupName = m_lastGroupItem; const QString newGroupName = item->text(column); m_writer.editGroupName(oldGroupName, newGroupName); } void KConfigXtEditor::setLastGroupItem(QTreeWidgetItem* item, int column) { //check if ptr is evil if (!item) { return; } m_lastGroupItem = item->text(column); } void KConfigXtEditor::modifyTypeDescription() { modifyEntry(m_ui.twEntries->currentItem(), m_ui.twEntries->currentColumn()); } void KConfigXtEditor::modifyEntry(QTreeWidgetItem* item, int column) { //* check if ptr is evil //* make sure that this method will be called //only when we modify an item. When do we modify an item? //When we click on it. The itemChanged signal is also called //on the creation of a new entry. if (!item || !item->isSelected()) { return; } takeDataFromParser(); //create the entry const QString oldEntryName = m_lastEntryItem["name"]; if (column == 0) { const QString newEntryName = item->text(0); m_writer.editEntry(m_lastGroupItem, oldEntryName, "name", newEntryName); } else if (column == 1) { const QString oldEntryType = m_lastEntryItem["type"]; const QString newEntryType = item->text(1); m_writer.editEntry(m_lastGroupItem, oldEntryName, "type", newEntryType); } else if (column == 2) { const QString oldEntryValue = m_lastEntryItem["value"]; const QString newEntryValue = item->text(2); m_writer.editEntry(m_lastGroupItem, oldEntryName, "default", newEntryValue); } else if (column == 3) { KComboBox *bt = qobject_cast(m_ui.twEntries->itemWidget(item, column)); //check if the ptr is evil if (!bt) { return; } const QString oldDescriptionType = m_lastEntryItem["descriptionType"]; if (bt->currentIndex() == 0) { //it's a label m_writer.editEntry(m_lastGroupItem, oldEntryName, "label", "label"); //our descriptionType is about to change, so update its value m_lastEntryItem["descriptionType"] = "label"; } else if (bt->currentIndex() == 1) { //it's a tooltip m_writer.editEntry(m_lastGroupItem, oldEntryName, "tooltip", "tooltip"); //our descriptionType is about to change, so update its value m_lastEntryItem["descriptionType"] = "tooltip"; } else if (bt->currentIndex() == 2) { //it's a whatsthis m_writer.editEntry(m_lastGroupItem, oldEntryName, "whatsthis", "whatsthis"); //our descriptionType is about to change, so update its value m_lastEntryItem["descriptionType"] = "whatsthis"; } } else if (column == 4) { const QString newDescriptionValue = item->text(4); //m_writer.editEntry(m_lastGroupItem, oldEntryName, m_lastEntryItem["descriptionType"], newDescriptionValue); m_writer.editEntry(m_lastGroupItem, oldEntryName, QString(), newDescriptionValue); } } void KConfigXtEditor::entryItemWidgetState(QTreeWidgetItem *currentItem, QTreeWidgetItem *previousItem) { //we need to check every button/item individually because, //the first time that the signal will be emitted the previousItem //will be 0, because there is no previousItem at that time, only //the currentItem is valid KComboBox *previousBt = 0; KComboBox *currentBt = 0; if (previousItem) { previousBt = qobject_cast(m_ui.twEntries->itemWidget(previousItem, 3)); if (previousBt) { if (previousBt->isEnabled()) { previousBt->setEnabled(false); } } } if (currentItem) { currentBt = qobject_cast(m_ui.twEntries->itemWidget(currentItem, 3)); if (currentBt) { if (!currentBt->isEnabled()) { currentBt->setEnabled(true); } } } } void KConfigXtEditor::setLastEntryItem(QTreeWidgetItem* item) { //check if ptr is evil if (!item) { return; } //our tree has 4 columns and those columns doesn't move m_lastEntryItem["name"] = item->text(0); m_lastEntryItem["type"] = item->text(1); m_lastEntryItem["value"] = item->text(2); m_lastEntryItem["descriptionValue"] = item->text(4); } void KConfigXtEditor::removeGroup() { //take the current item of the tree QTreeWidgetItem *item = m_ui.twGroups->currentItem(); if (!item) { return; } if (m_writer.removeGroup(item->text(0))) { //remote the group from the ui, //we have already deleted it from the xml file delete m_ui.twGroups->currentItem(); //clear the tree of the entries m_ui.twEntries->clear(); } else { removeError(); } } void KConfigXtEditor::removeEntry() { //take the current item of the tree QTreeWidgetItem *item = m_ui.twEntries->currentItem(); if (!item) { return; } if (m_writer.removeEntry(m_lastGroupItem, item->text(0))) { //remote the entry from the ui, //we have already deleted it from the xml file delete m_ui.twEntries->currentItem(); } else { removeError(); } } void KConfigXtEditor::removeError() { QString error = i18n("An error has occurred during the removal of the item"); KMessageBox::error(this, error); } void KConfigXtEditor::takeDataFromParser() { m_parser.parse(); m_writer.setData(m_parser.data().groupNodes()); QList dataList = m_parser.data().groupNodes(); m_groups.clear(); for (int i = 0; i < dataList.length(); i++) { m_groups << dataList.at(i).groupName; } } plasmate-1.0/plasmate/editors/kconfigxt/PaxHeaders.5990/kconfigxtwriter.cpp0000644000175000001440000000013212115142004025327 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/kconfigxtwriter.cpp0000644000175000001440000001742212115142004025772 0ustar00kokeroulisusers00000000000000/* This file is part of the KDE project Copyright 2012 by Giorgos Tsiapaliwkas 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kconfigxtwriter.h" #include #include #include #include #include KConfigXtWriter::KConfigXtWriter(QObject *parent) : QObject(parent) { } KConfigXtWriter::KConfigXtWriter(const QString& xmlFilePath, QObject *parent) : QObject(parent) { setConfigXmlFile(xmlFilePath); } KConfigXtWriter::~KConfigXtWriter() { } void KConfigXtWriter::setConfigXmlFile(const QString& filename) { m_xmlFile = filename; } void KConfigXtWriter::editEntry(const QString& groupName, const QString& entryName, const QString elementName, const QString& newValue) { KConfigXtReaderItem::EntryNode n = entryNode(groupName, entryName); if (elementName == "name") { n.entryName = newValue; } else if (elementName == "type") { n.entryType = newValue; } else if (elementName == "default") { n.entryValue = newValue; } else if (elementName == "label") { n.entryDescriptionType = KConfigXtReaderItem::Label; } else if (elementName == "whatthis") { n.entryDescriptionType = KConfigXtReaderItem::WhatsThis; } else if (elementName == "tooltip") { n.entryDescriptionType = KConfigXtReaderItem::ToolTip; } else { n.entryDescriptionValue = newValue; } KConfigXtReaderItem::GroupNode n2 = groupNode(groupName); int index = n2.entryNodeList.indexOf(entryNode(groupName, entryName)); n2.entryNodeList.replace(index, n); int index2 = m_data.indexOf(groupNode(groupName)); m_data.replace(index2, n2); writeXML(m_data); } void KConfigXtWriter::editGroupName(const QString& groupName, const QString& newValue) { KConfigXtReaderItem::GroupNode n = groupNode(groupName); n.groupName = newValue; int index = m_data.indexOf(groupNode(groupName)); //TODO show kmessagebox if (index == -1) { return; } m_data.replace(index, n); writeXML(m_data); } bool KConfigXtWriter::removeGroup(const QString& groupName) { int count = m_data.removeAll(groupNode(groupName)); bool ok = false; if (count > 0) { ok = true; writeXML(); } return ok; } bool KConfigXtWriter::removeEntry(const QString& groupName, const QString& entryName) { KConfigXtReaderItem::GroupNode n = groupNode(groupName); int count = n.entryNodeList.removeAll(entryNode(groupName, entryName)); int index = m_data.indexOf(groupNode(groupName)); m_data.replace(index, n); bool ok = false; if (count > 0) { ok = true; writeXML(); } return ok; } void KConfigXtWriter::addNewEntry(const KConfigXtReaderItem::EntryNode newEntry) { KConfigXtReaderItem::GroupNode n = groupNode(newEntry.groupName); n.entryNodeList.append(newEntry); int index = m_data.indexOf(n); m_data.replace(index, n); writeXML(m_data); } void KConfigXtWriter::addNewGroup(const QString& groupName) { KConfigXtReaderItem::GroupNode n; n.groupName = groupName; m_data.append(n); writeXML(); } KConfigXtReaderItem::EntryNode KConfigXtWriter::entryNode(const QString& groupName, const QString& entryName) const { KConfigXtReaderItem::GroupNode n = groupNode(groupName); for (int i = 0; i < n.entryNodeList.length(); i++) { KConfigXtReaderItem::EntryNode n2 = n.entryNodeList.at(i); if (n2.groupName == groupName && n2.entryName == entryName) { return n2; } } KConfigXtReaderItem::EntryNode e; return e; } KConfigXtReaderItem::GroupNode KConfigXtWriter::groupNode(const QString& groupName) const { for (int i = 0; i < m_data.length(); i++) { KConfigXtReaderItem::GroupNode n = m_data.at(i); if (n.groupName == groupName) { return n; } } KConfigXtReaderItem::GroupNode g; return g; } void KConfigXtWriter::setData(const QList& data) { m_data = data; } QList KConfigXtWriter::data() const { return m_data; } void KConfigXtWriter::writeXML() { writeXML(m_data); } void KConfigXtWriter::writeXML(const QList& data) { QFile f (m_xmlFile); if (!f.open(QFile::WriteOnly)) { KMessageBox::error(0, i18n("This xml file isn't writable")); } QXmlStreamWriter writer(&f); if (data.isEmpty()) { return; } writer.setAutoFormatting(true); writer.setAutoFormattingIndent(4); //start the document writer.writeStartDocument(); //start kcfg element writer.writeStartElement("kcfg"); QString ns; ns.append("http://www.kde.org/standards/kcfg/1.0\""); ns.append("\n"); ns.append(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "); ns.append("\n"); ns.append(" xsi:schemaLocation=\"http://www.kde.org/standards/kcfg/1.0"); ns.append("\n"); ns.append(" http://www.kde.org/standards/kcfg/1.0/kcfg.xsd"); writer.writeDefaultNamespace(ns); //start kcfgfile element writer.writeStartElement("kcfgfile"); writer.writeAttribute("name", ""); writer.writeEndElement(); for (int i = 0; i < data.length(); i++) { KConfigXtReaderItem::GroupNode groupIt = data.at(i); //start group writer.writeStartElement("group"); writer.writeAttribute("name", groupIt.groupName); for (int j = 0; j < groupIt.entryNodeList.length(); j++) { KConfigXtReaderItem::EntryNode entryIt = groupIt.entryNodeList.at(j); //start entry writer.writeStartElement("entry"); writer.writeAttribute("name", entryIt.entryName); writer.writeAttribute("type", entryIt.entryType); //start label/tooltip/whatthis //check what if we have label or tooltip or whatthis if (entryIt.entryDescriptionType == KConfigXtReaderItem::Label) { writer.writeStartElement("label"); } else if (entryIt.entryDescriptionType == KConfigXtReaderItem::ToolTip) { writer.writeStartElement("tooltip"); } else if (entryIt.entryDescriptionType == KConfigXtReaderItem::WhatsThis) { writer.writeStartElement("whatsthis"); } else { kDebug() << "There is no descriptionType, probably something is wrong"; } writer.writeCharacters(entryIt.entryDescriptionValue); //end label/tooltip/whatthis writer.writeEndElement(); //start default writer.writeStartElement("default"); writer.writeCharacters(entryIt.entryValue); //end default writer.writeEndElement(); //end entry writer.writeEndElement(); } //end group writer.writeEndElement(); } //end kcfg element writer.writeEndElement(); //end the document writer.writeEndDocument(); //finally close the device and write our data writer.device()->close(); } plasmate-1.0/plasmate/editors/kconfigxt/PaxHeaders.5990/kconfigxtreader.h0000644000175000001440000000013212115142004024722 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/kconfigxt/kconfigxtreader.h0000644000175000001440000000555412115142004025370 0ustar00kokeroulisusers00000000000000/* This file is part of the KDE project Copyright 2009 by Dmitry Suzdalev Copyright 2012 by Giorgos Tsiapaliokas 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KCONFIGXTREADER_H #define KCONFIGXTREADER_H #include #include #include class KConfigXtReaderItem { public: KConfigXtReaderItem(); enum DescriptionType { Label = 0, ToolTip, WhatsThis }; struct EntryNode { QString groupName; QString entryName; QString entryType; QString entryValue; QString entryDescriptionValue; KConfigXtReaderItem::DescriptionType entryDescriptionType; inline bool operator==(const KConfigXtReaderItem::EntryNode& e) { return (e.groupName == this->groupName && e.entryName == this->entryName && e.entryType == this->entryType && e.entryValue == this->entryValue && e.entryDescriptionValue == this->entryDescriptionValue && e.entryDescriptionType == this->entryDescriptionType); }; }; struct GroupNode { QString groupName; QList entryNodeList; inline bool operator==(const KConfigXtReaderItem::GroupNode& g) { return g.groupName == this->groupName; }; }; QList groupNodes() const; void appendGroupNode(const KConfigXtReaderItem::GroupNode& groupNode); void clear(); bool isEmpty(); private: QList m_groupNodeList; }; class KConfigXtReader : public QObject { Q_OBJECT public: KConfigXtReader(QObject *parent = 0); void setConfigXmlFile(const QString& filename); /** * Parses a kcfg file. * Should be called after setConfigXmlFile() */ bool parse(); /** * Returns the data from the xml file. * Valid only after a successful call to parse() **/ KConfigXtReaderItem data() const; private: QString attributeValue(const QDomNode element, const QString& attributeName) const; QString m_filename; KConfigXtReaderItem m_data; }; #endif plasmate-1.0/plasmate/editors/PaxHeaders.5990/svg0000644000175000001440000000013212115142004020120 xustar000000000000000030 mtime=1362412548.613641233 30 atime=1362412548.614641227 30 ctime=1362412548.613641233 plasmate-1.0/plasmate/editors/svg/0000755000175000001440000000000012115142004020632 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/editors/svg/PaxHeaders.5990/svgviewer.cpp0000644000175000001440000000013212115142004022722 xustar000000000000000030 mtime=1362412548.612641239 30 atime=1362412548.612641239 30 ctime=1362412548.612641239 plasmate-1.0/plasmate/editors/svg/svgviewer.cpp0000644000175000001440000000520012115142004023354 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Richard Moore, 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 . */ #include #include #include #include "svgviewer.h" /** * Q: Why not just use QSvgWidget? * A: We want to support plasma specific features such as panel svg, svgs * containing a stack of images etc. */ SvgViewer::SvgViewer(QWidget *parent) : QWidget(parent), m_mode(SvgViewer::ModeSvg), m_renderer(0) { } SvgViewer::~SvgViewer() { } void SvgViewer::setFilename(const QString &filename) { m_filename = filename; } void SvgViewer::readFile() { m_renderer->deleteLater(); m_renderer = new Plasma::FrameSvg(this); m_renderer->setImagePath(m_filename); if (!m_renderer->isValid()) { kWarning() << "The svg file " << m_filename << "was invalid"; } m_mode = detectMode(); m_renderer->resize(size()); } SvgViewer::Mode SvgViewer::detectMode() { if (!m_renderer) { kWarning() << "We can't detect the mode when there's no renderer"; return SvgViewer::ModeSvg; } if (m_renderer->hasElement(QString("topleft")) && m_renderer->hasElement(QString("top")) && m_renderer->hasElement(QString("bottom")) && m_renderer->hasElement(QString("bottomright"))) return SvgViewer::ModeFrameSvg; return SvgViewer::ModeSvg; } void SvgViewer::setMode(SvgViewer::Mode mode) { m_mode = mode; update(); } SvgViewer::Mode SvgViewer::mode() const { return m_mode; } void SvgViewer::paintEvent(QPaintEvent *) { QPainter p(this); if (m_mode == SvgViewer::ModeSvg) m_renderer->paint(&p, 0, 0, width(), height()); else if (m_mode == SvgViewer::ModeFrameSvg) m_renderer->paintFrame(&p); } #if 0 void SvgViewer::mouseReleaseEvent(QMouseEvent *e) { } #endif void SvgViewer::resizeEvent(QResizeEvent *) { if (!m_renderer) return; if (m_mode == SvgViewer::ModeSvg) m_renderer->resize(size()); else if (m_mode == SvgViewer::ModeFrameSvg) m_renderer->resizeFrame(size()); update(); } plasmate-1.0/plasmate/editors/svg/PaxHeaders.5990/svgviewer.h0000644000175000001440000000013212115142004022367 xustar000000000000000030 mtime=1362412548.613641233 30 atime=1362412548.613641233 30 ctime=1362412548.613641233 plasmate-1.0/plasmate/editors/svg/svgviewer.h0000644000175000001440000000252012115142004023023 0ustar00kokeroulisusers00000000000000/* Copyright 2009 Richard Moore, 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 .*/ #ifndef SVGVIEWER_H #define SVGVIEWER_H #include namespace Plasma { class FrameSvg; } class SvgViewer : public QWidget { Q_OBJECT public: enum Mode { ModeSvg, ModeFrameSvg }; SvgViewer(QWidget *parent); ~SvgViewer(); void setFilename(const QString &filename); void readFile(); void setMode(SvgViewer::Mode mode); SvgViewer::Mode mode() const; protected: void paintEvent(QPaintEvent *p); // void mouseReleaseEvent( QMouseEvent *e ); void resizeEvent(QResizeEvent *e); SvgViewer::Mode detectMode(); private: Mode m_mode; QString m_filename; Plasma::FrameSvg *m_renderer; }; #endif // SVGVIEWER_H plasmate-1.0/plasmate/editors/svg/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004022735 xustar000000000000000030 mtime=1362412548.612641239 30 atime=1362412548.612641239 30 ctime=1362412548.612641239 plasmate-1.0/plasmate/editors/svg/CMakeLists.txt0000644000175000001440000000122012115142004023365 0ustar00kokeroulisusers00000000000000project( plasmate-svg-editor ) find_package(KDE4 REQUIRED) include(KDE4Defaults) set(svg_viewer_SRCS svgviewer.cpp) #kde4_add_ui_files (svg_viewer_SRCS # svg.ui #) add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) include_directories(${KDE4_INCLUDES} ../..) kde4_add_plugin(plasmate_svg_viewer ${svg_viewer_SRCS}) target_link_libraries(plasmate_svg_viewer ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS}) set( testsvg_SRCS tests/test_svg.cpp svgviewer.cpp ) #kde4_add_ui_files (testsvg_SRCS # svg.ui #) kde4_add_executable( testsvg TEST ${testsvg_SRCS}) target_link_libraries( testsvg ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ) plasmate-1.0/plasmate/editors/svg/PaxHeaders.5990/tests0000644000175000001440000000013212115142004021262 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.618641191 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/editors/svg/tests/0000755000175000001440000000000012115142004021774 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/editors/svg/tests/PaxHeaders.5990/battery-oxygen-inkscape.svgz0000644000175000001440000000013212115142004027026 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/editors/svg/tests/battery-oxygen-inkscape.svgz0000644000175000001440000001522612115142004027471 0ustar00kokeroulisusers00000000000000‹í}[sɕ滗~éŽRç~Q·<ái‡'ѱ¶cöÍA‘Ä1EjIª%õ¯ß¬ÈB Ð„DJ&Њf¼œÌï\òä¥?þÛÇ·g¿Ì.¯N/Î_bÃÙùñÅÉéùë‡ÿÛŸ§qxpu}t~rtvq>{qx~qøoøÝÿk:=øérvt=;9øpzýæà/çÿ¼:>z7;øîÍõõ»çÏž}øð¡œ.ˆåâòõ³ï¦ÓZòê—׿;88¨lϯžŸ¿8\ä÷þò¬Íwrülv6{;;¿¾z†ŸvÙ»ìÇ óÓ_fÇoß^œ_µ%ϯ~¿”ùòäUÍÝ5æ·™03Ÿ=#šÖÓ«Oç×G§ý¢µCE žÕ´.ç¸\Ï?žU$Ö6¦M]æ^ÑWÿݸ!”«‹÷—dzWµä¬œÏ®ŸýéoºMœB9¹>YªæüŽïªDÎÞήÞÏ®žÝЛò}u¨„*á“ë7õ‘¼djDK|3;}ýæz•zzòâ°vÓ¬}¾ºþtV›przõîìèSmTíìœËMß߲ƒÂÔ&Ý´f9I¬_êä⸶¿VýòèúzvùizññÓëÙy©ÌíWrñþúÝûëÌ>^ÏÎçµÕÎwHÌ“Ûrå†?Ô~|;»>:9º>ª/zvC!Ö6KÍT•èùÿùÓŸ›§öùøøù_\þ³>.>M†£—•ˋöÌ"ßÉñó*È·G×8}{ôzÖhÌÿ®‚ûñY—ÐË|ýéݬzÕ^Îæ1dDõ¿·§M¡g½>=;ûKÃäðàÙm;Ÿ-Z íc×úpÓÏöéòï“_Ng*uà§ç'¦7 áà‡Ã9nôÒVs¼«Í»zsTs½8¤¡Ä‹ª¨µ?*À"ýõûÓ“ÙõÅÙìòè¼—’.+«Á”‹—ÿ3;¾N{yqy2»¼å„+ Çg—/oíg‘Ô´í&áUû9ìôååÑÕlñxõæâCmU%¾::«Ô•.þzqñ¶é[š„KàjúñLJSä(Aá|'µi-c‰à5à× `MÒ§¤ã÷——ÕO«ÕÎ.;›n5¨*äìÕU×Íæ ÓâÆ&?ºüË£“ÓZE¥Ýæì§0E.Ê4zv}ñ®ù»ËÝP˜;rëOæ)Óöç ÔhI Ù=_.rñêÕÕ¬ê%ÔÆog&ûa†•Ùiõ;½ 6OGg«5bVŽâηÕ6â5Å‚ÀJ·Ô*$+@,‡Ëÿßÿüù/úê?n©¯\þ~~z]Ǭ÷W³Ë¿6~ÿ¿Îÿ~5»“ëoÕ0®ª ªúxÝüyVGùï¦2™šË÷Û†ì›!<>žïE^ȹ™¿<:Á«('`*[2qŠ»éH_v¶£ÄvÄ›› íg_v¤»3ƒñv´;FÛ0¢0Ø¢OP¿ûÁˆÂxw_E“P-rP‹AÝ’G±Íìåeó]e!Œì<ÈQ9Äh{Û†@±lQ\~×éâ”4È>C eT§ý7‰\2À‡Ù+&1ø(ö´™½ž4ß ê½«tÙn•n[4›ïž¬Òc ³/é¹m+F‰ñÅ¢$J‚1̾ F ²}á/æÝD·ØZûYavO¯Ê ¼- j¾c¸’iÅ8®[ÜšIóÅ5TYGqÝ‚°¿l¾c¸ ; À(®²¥¯Ñ~Æp?n1Hné«Ôï(„ÇW Šl¼`Únç!_.Ò…°Gé2 lÅ…¾Ü¬EÙxA‘º=îHÿrcjd>¶15h»­É—Ó£ {tñŒøKbÄ #‰í>[b›Ï>~%‰¼Œ$ÂÆ0û¢9lÇÈ·úì“€=aä²³ýcôkQ¤’&K-ùÔP¹H†JGýH• Tˆ4£Ë[©Ñ òpÃXàØÔnÆ=s9{U×óôøÞKªucçòôãwXÂ&P¿·S+“){IBï+|[—ŒÓJ°doÁØ£„’„-/“2Â.ç«Ò¯VJwÀõ[@Ž28‡Ï  ^Æ A ¨5°mׯ"DžÉ}ý*@d™=õÒ¢iàL]Vê²nÒ.BƒàÞ@’†`s´p°³N %AV¢€#ŽÉŠ(±$õ@šR @ÃäU˜4)Va’PHÝŒÃ)èQâ„X„<ï(S¤öt1åLTÈ“L6«ä(˜‚ö“ H½)Ôµº((ª*ÕmQ“ÃyPZL-Tú eBI{@uyûú$ƺ(ûºõ) ¸ôQÒâ¬}«s*’‘}çÔåÝŒA‰Bc.ЭE J 5àxq1”¦@éÄ- x¢¯šR÷Íθ¨+ôpâ,n™â›q‚q8¹ì'`a¿Å ÛΊÏa"Ž—”p޾ÇJ7Iëá$\#Q{8©”t Í£¦<Nh‘´À)8Uc®OŒè‹è‚F5ØùJõ¢B#€B-Œ À›Â*0ü([˜›WQ™ʼn<*è´¦óDÐ;µ8$vÔË.k?î4+@”BµWÁúÈ“)}”s§Äý¡·€ ÓeK*Ah6 -¤ÂàÑC‹ XDô‚ô’ÁÖG ¹¤ˆ§wÔ^Ð Žq1ӞѢ’Fi<›ÒüIÁ@?`B_`S*H$ˆÚ7H)„)Œ=Ä °aªtØ ×ðªWÃzÈÔ× Ýq¤}!5•‚ d1ábêÆÒ 5‚ÈžÑ>d“E]ÛQÒXÒ'æE‘¾ 0é!Àt@å!4Ñ(}ÎÌdÿ*ð”'åܘöæþÀŒ¯ÌqÁ3G Wˆ•Y«¥@êÏ E ]{³Ö.ï†àÙˆbTðœh{ƒŠ"*ÈbÅ6À$'„+`V ÕâQÅü@uÓVóâÎ :‘L ¦cWÕT˜Ý{8qv]Yÿ/ÌÙÃHK`nÆhœ2Eê>WÔÌ•²¿¢FR('S*`jLü¨´I\›Ü‘uI›¬%ÊØ)k¨±ž«Ÿ"za1 ž¯÷’õ£Ö9õÁ^õjØàëmÜ4 ö_&°éÂk™ jLÐ )fèĵ(J0?þ±Ÿ"=¢ÉOhîM}4]ÍɆ§lŠÄ*}<)Eó«4âÉØ÷‰æ×nì¿öÜa©oñùá÷È"ýñn’=~#E•§eªý¡ùH.šF 9q,®èD@ØÈ­µÈÏ|"@‹’Q«îâ#Ntï¯_œÍŽëùã³GŸ®6õ˜må|êî‡u´HûNn~±úX7×]ï-T ºI6Þ]æÀ¯rkh[YuþaÅ«Rï|gç#Ú45YÄÞgU-¹(ÓùV.˜&‹°®ï]Ó:ïºÎ¿¶Ð:×úéMg8Q"Ln^§ƒŸ8 8-S:à,†À‘ËdJ4a®D+©Š=¢u ÄZíÙ 4ÌÐ *£è:jWÅOy™z%&&/5l¸k¿®@Û@ÂxÚµn”PØn°®Ç/x¤"dÒ“qGþÒ¢çDOß‚è³$±µÒôBJª êìÅE}™\e% ’i™ÌY\SÉZQPYôˆZ)²ÖÛ#·-×zI “`%C!!<`-`¬¦m^S‰ˆFÄ ËüÜ‘—ÙýÔ‘—›†Q\¢×‰!Öi‰î¢%_¿–ôL FBЪ g í[ì0u¸ŠŽ¼wß wûªpïBŠ “ŽmÓŽá‰ÇðÔ£ A hp uÞ¯›$ˆ „ Œ‘;‰ƒ¿¾éÆx!I1W {JO¾#$L‘¸+$cæ°¾°ˆ+øN2J\&BQ„æƒ?l|ËbÓ"J> 6ÍâèfwÅiàwÅF’Æ#M+­˜(tËåýiK]!;›}׌†ßËU7É5¼•+­—+¦|ãrõ$2Gâ€ÂxW®n„<`Ž(©è_H°»Œq˜ø-Hq8.ÕB‰:™_˜’©uqæö¢• ˆà[,Ïda’t[`ů=±{kvÊTœ‘s2%)É–ßÅ/e{÷Êœ'Ù~IÙrAÄX‘-BQR’*e)¡¶F¸¹‹p…¾áÖå×½,Õÿ¹öü F®Ñ]ð›BAaðÉ4Š¥ºÏ¦Ô²î1G€‘Ë~-ËML‰ °OŽj·ì:†¯‰HÆëŠú@6غþxØŠgçV¶| +sR/µŽrQPƒ,zô:ÊI´ƒh·ÝÅ ã3²‹÷4M…úá5Š{KAKFºêX)”Ø …ÜQ ò$…Ý¥%R=ŒÖ‰qG1Ø“vƒS Ió–ºî(…øÆ¥Ðß±¢a)ÔTT^•”¸pFÀ9L¡€ŠS†wz¿~Œ¾ ¦]d0(@ã^u;ïyuK÷GË*$ÐŒÜÁë¸íA%oÞuiëú+m÷>ì-ÒŠ¡8k÷èªé!…OªÄÙTSýnd0´c:ìFù€¾è‡$a ªÓj„-‹•÷¼|ÖÿeïÂaäwCžŸ‰|z¬ƒž×@ÿû“˜ÙËì E)D•ô_ q+B”â#!ÀSm7U×oIÕ‡÷–ÁͼÙSÍàíÞò2™¨wä.÷ºX"_ôâ]ÌUÅvµpÛßÇ©Ñ]‚”8¤ÑmZ ®ž4’’à@+:Ý A!;ŸÓ WÆŸ4úÌ‹D¶9tÙÿÂÁ½ƒ‚> Ö&‡âÉAÝC@cµÀ…& t@Jêw–µBõðKÏûúqßÀ ºÓZB>Í¿÷½…Ú¥ŒGRMŸà¿ïòBîjßR ÞÅ'Ÿ5Béb”qîR¾ý0¥ðÃÆ?ØéHþ4ŠªqL C¦}?(ÑÞ}S»Ïï¬ê~1ÿãvjýsPÛOB Ÿ…Úxjø<ÔÖQ+¤ð6á§¢"ýÛØœözÿQº|é(]¾Ž(]`¯qúð›ÅXÙ ½i»´Ž%8îí¨.hG%x ,XD%Ú)XD•=m»^‘öä­¨£‘èÄ û€G¤½gA)Á¢Ö¾XžÉÂ9äE‚ìóy‘Ö­:0ßÑc+Á)Lkô8(vÓãHü¶ôø^#8k¬Œ|¤…ÌluèËBäš48ôÑãYC„/À[¬½|¸½h€ûoFwøþñø'Gï®G¼­ÛÍ»™"A!•ù+\Θõ.+ Ú¾L”d~0E+f‘òâ –ÝI±bœèQg쵌£‘Uj”äpÁZå±pŠ›MLJ’Z[)h²ú$µ¢éÁ”¨„:Ä$³(ˆ¶¥£¸N2 ¢fûRšhJòD¹ °Ô1 Ž˜0ÒÚ-ˆÈ†"I¢R+D(D\ëkZ`œ(£*W%yýð0<íŒwgkèä…ë¯ `òX\ÖpüJùîŠÅ’œý2;¿89YïñÝÇUÇøòýõõ¿ØºÂ!Ïö¤:Gudœê ¿¹à84Ð>¼"¡TgåI#ha3Ð ³W'¬øQ!U#¬2§’@ 1!+,ÀÐÝK2:çD´…'7ª¤% e"Mý,š2dÍœäLæ¶V• £ID!ÍV·ÁZÝJI™+R0Ê$²¸e¶r×@®Õ©Qñ¤†Â ž>a)ÉÒhvM¦”𱑱$p­0Š95Ú…^SABÝÊk° JsÐÄçÞšÄõyT€FŽòj3|êúI‹—Ñ ý~ÆG'¨4»{8íyñ÷åhzQF #£;w1‘1í3Ìû¯_f—µKBèûô±ÑbNÄÙl¥¿ âLè>×^Ô&îÞåÍÒá‚A±8P Eï]þ½KŸ`¹SáÅ s¹ChÅœ$¹×›¦º~ %R ^;Ðñ×þÞõîò`,a†÷2æȽ"_»@†Ç<ƒ* ­ïO!:Â4Tf¶\¦L0Šx:βs{;H}"*H†„µ´C‰PEŸW7S,”(2qÀ¨¸•çh´ïÛ†®?Cýd ü N8µ‰kN(¸¤á÷kØó.>xÿMøûùÑ/G§•çÙÆêK`"édŠŽEÂ$¿ß¸Hà%]kç6¼ÚÅ&LLÁ±›ô¨·FlÑ }Ôë5IûM÷WÃzHŸÁÅÁPÐ0n“Ú±Õ­š=Cô~ðõZüpÍû=W'§ïê¿çןÞUhŽ.7]HÅ‘,B´6P“Ô{^áH’™±:¸\ý¿÷G—³µ«uû]úÇ€ápµÞ/f eèýxÆP†ËÝc ¦ê§÷Ö§…J¢²OnYÔ³¶7¹'7,NÚJs‹Ô1¹‡êÞrñWbŽ…OvÎäÅݲdظ ¡Bæ­ ¯÷8©+©òèêŽ×B5^§…·'¬‡2ôtdX »Ö©áíÑíšá¡Î†oÕAUÉ…¹O0Š¢›à„ #Ý[×­4Hª}‹þqXóú?.2ìÿ¸®Ñ¼î7GÖ:@.Iw4¨BNnyT…º­nr[îF¡¬ 3Ë?PývHìz£NÚhoAÆlôO¤ˆ¨Øþ¯Õ"u¥VEÂï<ãE8^ új4Zû ̱e$AqµM#I|+–=ìå4rh#öå+`ào‰nÛC‹a»Ï,‘~j¨b ÙP©QxCFÁøÀ¤¸1ļ4‚ª7'}*•ªW*«X¥Še%š—Ov­Œ*‘DpÁÈÄ$»sÔZº64q£X6ªU²–T5jAÊZg¥š¡Ëœêhsš†74,D8/m‘sš¢7Í´‚*Ñp,ŽìÙpªTtµJÍJU„˜s Fæ†JØ[šÄœ¦ˆâmiAZÐ*Lm?óÖÉEÔRæˆ@˜/¨®êÒB§,xCKö†œÆ‹ÒΨsèÃ-©áT©¬Q¡oEç>ÏkÌs!³iœš$A -˜Toh‘q`VLø¦´b­Ò¹˜x«!ÉQ„k••ši‹Ž¨ÍiB8§±˜b[Zù†ªM3¹ˆ*- u•9' E‹)ÈMæœÜ‘c!gAíÖ剨¤r‹ïÏ®~©°þéÍøkÊplasmate-1.0/plasmate/editors/svg/tests/PaxHeaders.5990/background.svg0000644000175000001440000000013212115142004024177 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/editors/svg/tests/background.svg0000644000175000001440000011553212115142004024643 0ustar00kokeroulisusers00000000000000 image/svg+xml image/svg+xml plasmate-1.0/plasmate/editors/svg/tests/PaxHeaders.5990/background.svgz0000644000175000001440000000013212115142004024371 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/editors/svg/tests/background.svgz0000644000175000001440000001174612115142004025037 0ustar00kokeroulisusers00000000000000‹¤¸>Ibackground.svgí]iwâ¸Òþ~oæËÌ íKf2÷²/Ξô—÷Û€ÀĘ@øõW²fKâ^BÚ=ݶJ«Ÿ*U•T2óÏ»õZæÙ ZžßØ\ƒX˸ Ûw¼Fesíêr7'Ö2­°ÔpJ5¿án®5üµÿþûŸþ/—Ë·ºN¦ã…ÕÌAã±e—šnæÏj67òùN§cy}¢å•ü_™\NÕl=Wþ“ÉdT·Ö†co®õË7ÛA-*çØy·æÖÝFØÊC æ×LqÛ·uçÞ³kûõºßhE5­?F NY•6ƒéਔRæÊ#”S%r­—FXêæÆ«ª1N«Šy•gJ.Wj£[SHÌL”;Ú»B¿©þ+ VËo¶[V5]«á†ùíËíafXNèŒ43ßô;É‘F©î¶š%Ûmåô¨~ÇsÂêæQªêz•j8LzÎæšz;ÌŠÒƒþ7†B,g Í"l¼–ãÛ÷¥–d¾ê×ݼã•ÚùrÉ«)¹Ú Jͪg·2¥0tëM%ÍZ©U/eîKöc%ðÛ 'O`^¶â†­D³êíT³¦¬¥FÝ—ß›íðÿÝnè6â*X FqvTÏh|¾ü«(ÿ ;Ö½:ÏžÛQÔ>ZúýÖâd³TQ[óƒÍµ?ÊÑÕϸ÷Ç Y,ºÆ²|Å'/|‰ºŒ3ÌkèV‡ù`z~«ZrüÎæšÌìù~]µ - 1r2Ûîª:ØâI!™/Q&²df;Ô$ÎÕJ/®z©èû…ZU¿S 48aÐv'kêœÜý½ßš­yÛ®ë–Û /TS°Ù,Ññêes}9†Œƒ%²-9šQBaVå—a–™1ñÄ-Hæ¥Ûžã¶f¼¶ÎK¾·ÿàÚaè×Ü Ô°•Hx¤a!C‰¢Æ1 #’–Y¯åÝ×\Ótt¹’":†:”Z]QJ‡ÄðEë’î‹ÎXËä#±Ï'å>¢;n¹e&€NaFÈ`|AIMóÚž¾)6*Ú„àøµšk+ìJµNé¥5@¤'7ª[VSD=»¥`ÐFŽ~¼ Αɮô‰W±ô´[np¡•àiãªå&J]*t[Jãª9R/…×ýfþc(9\=K,-&… «GÓR“Ö3—a BÐZŽJ‹Š.G9µˆ„pH ӡŀĜ*è"Œ85•½‚L@FIV¨äœº9¤HI¨Ô U†r9ÎR&5v”g!aÜB’‰I´1²Ðâ˜Y& ¾SJ–§–4˜Kñs1‡©‹.†Br!³9ÈC”…”@ @'PXL3×1I6e§"‹ kPI Y Cv"›Cù~dCýXS~ðŸˆKH„…Â’‹# –]¸¹FâE…´ç@SM+ªˆQI!%ÿ©âyz*`R•2È-§ŸH¥âß–)[¦ùoËô,úm™Þà(­žeú™BȈLS¥ªî <•[”ë?LkRnÎÏ" pÊï-›I, I„â:z‹'ô›ú9¾ür¹å†f@_­ðE/°uÁ\´•³ñŠ®¿#R‹fþÕ1½ê\ÕV#\Ô›…0Œ2¿[`ë?Ëu+w ô]½MïlD¢óã`/Í£ ÞÉ›rt-’ê‹/ÃúúþC¤B2½cßÂÅÝÎxM9Ÿ=Iµž´› œ—òb‡(é:-¡aˆ% ˜ 7‡#· ""ý’ƒÂA±ß(Ï2f …=¢Ù£ô×+^Ò aŠÙÒÆl¡Ïä—„Ï7*Æø,0RÆ”-VéH!!'Ú7Ž´z.2—TH–Ø¢B ³ k 0ŠÒÁV~lÐdµt–àJl¹PÐ2IÓ€– 4¡ýÕµEn¶º˜®-² ‡à”µ¡¿ìÈP—[_%×bo“m … Œf!±“‘,¦L‘SÁX|ŒÇ+Ow8oº¼ MÑ·)¥dá,烄H’¥ÈâˆQHÞæH”Âe׫fÞÆ­£ˆ¥­ƒ)ùL:X ] 9ë;fï f!…u"l1LRÑ  ß!¹uòæ _ÊQ*P²Oå+ÌTı౜2)SW~6 ÀLôæ/Ž‘¥©(þ©<Ü1ŒÜŒ F1Þbä ”¤:]Mßˈ-ÌRÕÑZ6j2 7‹‹eݬÕVlH¡ªéæð„°B J Ã*1*¯ ªI9OC^YuyåU­H 15¢ËtPC`”ÊAðÕÞÅþ˜“,ÁtÄ%§²JŸdƒqèÇ")ŽS¬4,%j<(É.å'^o1ÍADFüX.HrÊúlŽ,L"+qd£é@K?ÙÌø² R€Ø´ã8 H(y–@6td¡*ƒ0©`¾º»ˆ}GVë(0ÎJ‰ZI1‡iø´ ÂOåŒ;µ˜A9µIŸ‰¾@C6âÒRÌÒ[ÈWVl“þ¬‘Ü4ýY†À¯°ç udŠÐE%Š$8{³Ç…-( F‚+@c¯ )T¤iloq Ó’Çô±ÄKbI–™þSÀÄ¥‹%N ËŸxÐ ŽÓ=íH-B žv$x…N;ÐÒ<7nö_å4:} -˜Â`Qþ£Oßþ\hy ÐÎr)„EI‹2Ì$‰f%ΓRK ’`ƈrjÙr¢ì¯pŠ'K§",¤ÌR!,.°„1Â*Éø¹üòúÛÇè©î†%§–Ìg‘ f„?tÊçۻö½qãæ°ž.Pº÷ÛŠ!q¸œcohXJá¿^½Tqõ÷çëÝzMõ?È/¬?æŒ ¦ÙÀ¿/ŸöI¾ú¯îéJù‹Ð«Õt'£'óý~èë¤a€J 8¥*‰¯”ýv³î;nÿÛæµ‰üZéÞ­m®ë¼ ä:ýÒ0Á4gÝûaè×͹ÖóºJìX3i-šhâ$gTã|Œ ‡…Í7˱T'ç´~ï˜'ÍFåoý;#Yïzëô¼Žö*~A]_.®ª;Wýx¥ÿ9)îÔ­øt·o‡š°µÿ¥xq}vP,TÊ…ê£WÐW­s±[ëet°S(l;öÖ™çÝ»Q8¿®‚+$ëξSµëW;ø¸^k—𗇻ۭÚq]¾|£Ïí¯[Ñ Ö/®Î·2×ï›c·yñ¬PÙ)\žŸ:ûW{íÞîCžîôÖ[6{±¶¿ÜlWŠU¶¾w°Úź] ž‹4Ü+¸Ï.ܾ¨µ¸ßȉÃ̱!NïÜ{™þÀ ï4«8%L‰ÈbšsàüoÃ̤¯·Ì$8^c‡c@ u€;¢PÄ„>1•1£¡\¢K©¦%ÚHvU4UTNL㦠ÀÔqê΋WržpÀ1äô/8Oø/- `p½E$à 8U$XR$ ‰éã4Ô9"AÁ|‘0¿¢á;®vV”'lÇ×Ú\ÑAóDE®°¨ TDeI‰L ‘„À( ”ÁŒië"aL#‚㈸%O{o–œ 1×´¢Íä¯XsËá°pføTaM@úÜz6G„%£ÊžÌó19÷1˜æcbÆÐ“&]LSò1[úŸÝ¾yÙ¬~»ùQ>¦ú˜5;Ø*Ú…Ê®ò1eïfÿöËQáëµ×øváÞ–»[[g_·O‚âÖ^G”NïQõîé¬öååïÝäWë'Í|Ù9iíg¶î¶·Nvì|}'ðÅÕõéù-ÞÿÒh‹„´àÁ‰V3Ox\sœ‹Ìq”`êΡ¹›LSÒãB·3>–'’Àq±Î]›Š5]ˆ5&è0QŒÄÂXˆèY ª§óB[ÙÚ^bHrŠÒ7ážÏŸ$ö|)9gÔÜUX@¨0H"‚ Á}6 æq€p,9¢|68…ÎW_소|Z™½o±¼Eqc‘f‚Í·H|9‹„ÙÂ]ôM’ÙöOW®ûƒLR‘Ä&©èß;{ü²rÖÝ>¸­öz§üÆß#N¡òt¸×$—5vQðü§£Ö¹ü^º=ÏSÆçìê´|ÿŒvh¥ ¿ØäŒãÓ““›L>ÚÇÛ;ûµ<9Ú^—ë×ë»Ýõ ~Y¸=Ù}~>=ªvŽj^±·…¾Þ¡š£àürT­½Û‡íË3P.ß\‡ã‡Ó+öÔÙg—õóÇs»çTžòìðö¼½ª{^¿8ò8ï{Ýõë‡ö³}î~«6ÎAg÷ø¬ÙÚ«ÙíJp±•ñòä1ß9 o &[náåëöíaý´—pÝ©í^>^´ÏêÅâ2†r4M¡°QeÀ-‚)æ2SÔI-À#4ØÖ‚fE´åÎp 7F)ÚÖN$'šgo0½®œj‡œ,à B…1'¸°8…K•°´²Y.-ÉÄX«t¡Õ‹ G†`êï´±@¬žåpF0Æ3SBrIa4%`“SÃ…sB Í,©¦BLÒ}p BȤšÇ˜I…&Uí-|æóLWÁøWd0gp”¿Hb„#þ ÈÐÛÙköÔæq­ >?TŸ¦â1S)Wpº±wN7ú}ô)NèSÖ×§â}úÍc0ûX ^´Ú ýfb©“8†¯näÜe •Ë-kˆœ¶¬ß{YsÜ_Ö4ƒ}»þ£–5ñ²fË».;Åîe夻spYí!÷²B •«³³ðxvåíºŸVý“þ,žjèü&8âpSuóßнS«ßt¿>!Xõš~†t¥æå{Û/´Ò[×¥­ÓÞC÷ælß öɵÓ;nì9­ÎÖW·X¸Æ½JõÄmÜ©µÌí!ÕÓ¼{ÐØùêÁ¡wTΈ;Ø;<ètJ¸Ñå—ç½ÃêáNþñ¶ÐþR?ý¬{÷äøb¯DfÛâúÌo{¯Ášw•ÛB±\?sŸž»åó3õ²™7Ä•„Å_Ä@ Åô2 N‰!¿CWsùÇDâ¾n„Tè ‚2öob‚\?`MリdŽi?ÆÚ2&5!öP5X ¦z±«ih¼ó~ câªÇñ1ÎŒ+A„•¼¼ý”çP®;Ù87!HLp“S:Lñ¨Æ7 úb #Øb>еåÂy¯dWò§ÀϾ_höñ·DuMX÷›œ#¼’¢À¸¤rrê2Dç‹‚0B ,(@C!À!òûL]–·Æˆþ‚_A0|EÜ>Pî{zûßõ×Ö篙Ì)†é 1>±`Ë EHHò¶e—jÚcÏ¿ÛK‡¨øÞ·™íb4æ*úñZ.Ì}$sjLÜÌ9„iÈ÷ìêSAV[Aô½݉… @¾òàý9Ï-‚9ÕZ‚ÆÇÌÝd¸Ðôcdr‡wÓÀ,}A`º—ÓŽº “è)Ž¡×q5`&ZtTM¨f!Š©2ÐïcJ®Â&ø àóG«‡‘Ã#§û´w~‡ZÅð°q|²ßm7’öÂ˃â%qž»öåùÝí·ýŒ8kãâsa«õ$ö÷®îÀÁúUòØEºaôƒÇê9²€º É2¬Ÿˆ ¾ŒIô$"*ŸCŠí¨p5Ñì¬XŽàô]qüÅ!5 W€CI€ UFTA 3Ô¹-êLñ”y”üÿb®8pD5f:59—g‘\†Eé†M ý͵wÎ,—a[º&‹ OÇ6c³Rb~#Û’-ÑÄë-/iï•`ýzï“%üÁ|üÔØÆç°Í°b3Ñ\j²…¤T¾Osc¶Âl3KãÀµÃÿ˜E˜i¦kf™E,¬Ñä:Ë0¿ê5œœÚÕܽ8nÐRf0Bpóàt`tiÈÁ+qL®bcþÉ·žÕíðÑÊ8Z›plasmate-1.0/plasmate/editors/svg/tests/PaxHeaders.5990/test_svg.cpp0000644000175000001440000000013212115142004023701 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/editors/svg/tests/test_svg.cpp0000644000175000001440000000210412115142004024333 0ustar00kokeroulisusers00000000000000/* Copyright (c) 2009 Richard Moore, 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. */ #include #include #include #include #include #include #include #include "../svgviewer.h" int main(int argc, char **argv) { // KCmdLineArgs::init(argc, argv); // KApplication app; QApplication app(argc, argv); QWidget *top = new QWidget(); QVBoxLayout *vbox = new QVBoxLayout(top); SvgViewer *viewer = new SvgViewer(top); vbox->addWidget(viewer); QString filename; if (argc != 2) { filename = QDir::currentPath() + "/tests/battery-oxygen.svgz"; } else { filename = QDir::currentPath() + "/" + argv[1]; } viewer->setFilename(filename); viewer->readFile(); top->resize(400, 300); top->show(); return app.exec(); } plasmate-1.0/plasmate/editors/svg/tests/PaxHeaders.5990/battery-oxygen.svgz0000644000175000001440000000013212115142004025233 xustar000000000000000030 mtime=1362412548.614641227 30 atime=1362412548.614641227 30 ctime=1362412548.614641227 plasmate-1.0/plasmate/editors/svg/tests/battery-oxygen.svgz0000644000175000001440000001522612115142004025676 0ustar00kokeroulisusers00000000000000‹í}[sɕ滗~éŽRç~Q·<ái‡'ѱ¶cöÍA‘Ä1EjIª%õ¯ß¬ÈB Ð„DJ&Њf¼œÌï\òä¥?þÛÇ·g¿Ì.¯N/Î_bÃÙùñÅÉéùë‡ÿÛŸ§qxpu}t~rtvq>{qx~qøoøÝÿk:=øérvt=;9øpzýæà/çÿ¼:>z7;øîÍõõ»çÏž}øð¡œ.ˆåâòõ³ï¦ÓZòê—׿;88¨lϯžŸ¿8\ä÷þò¬Íwrülv6{;;¿¾z†ŸvÙ»ìÇ óÓ_fÇoß^œ_µ%ϯ~¿”ùòäUÍÝ5æ·™03Ÿ=#šÖÓ«Oç×G§ý¢µCE žÕ´.ç¸\Ï?žU$Ö6¦M]æ^ÑWÿݸ!”«‹÷—dzWµä¬œÏ®ŸýéoºMœB9¹>YªæüŽïªDÎÞήÞÏ®žÝЛò}u¨„*á“ë7õ‘¼djDK|3;}ýæz•zzòâ°vÓ¬}¾ºþtV›przõîìèSmTíìœËMß߲ƒÂÔ&Ý´f9I¬_êä⸶¿VýòèúzvùizññÓëÙy©ÌíWrñþúÝûëÌ>^ÏÎçµÕÎwHÌ“Ûrå†?Ô~|;»>:9º>ª/zvC!Ö6KÍT•èùÿùÓŸ›§öùøøù_\þ³>.>M†£—•ˋöÌ"ßÉñó*È·G×8}{ôzÖhÌÿ®‚ûñY—ÐË|ýéݬzÕ^Îæ1dDõ¿·§M¡g½>=;ûKÃäðàÙm;Ÿ-Z íc×úpÓÏöéòï“_Ng*uà§ç'¦7 áà‡Ã9nôÒVs¼«Í»zsTs½8¤¡Ä‹ª¨µ?*À"ýõûÓ“ÙõÅÙìòè¼—’.+«Á”‹—ÿ3;¾N{yqy2»¼å„+ Çg—/oíg‘Ô´í&áUû9ìôååÑÕlñxõæâCmU%¾::«Ô•.þzqñ¶é[š„KàjúñLJSä(Aá|'µi-c‰à5à× `MÒ§¤ã÷——ÕO«ÕÎ.;›n5¨*äìÕU×Íæ ÓâÆ&?ºüË£“ÓZE¥Ýæì§0E.Ê4zv}ñ®ù»ËÝP˜;rëOæ)Óöç ÔhI Ù=_.rñêÕÕ¬ê%ÔÆog&ûa†•Ùiõ;½ 6OGg«5bVŽâηÕ6â5Å‚ÀJ·Ô*$+@,‡Ëÿßÿüù/úê?n©¯\þ~~z]Ǭ÷W³Ë¿6~ÿ¿Îÿ~5»“ëoÕ0®ª ªúxÝüyVGùï¦2™šË÷Û†ì›!<>žïE^ȹ™¿<:Á«('`*[2qŠ»éH_v¶£ÄvÄ›› íg_v¤»3ƒñv´;FÛ0¢0Ø¢OP¿ûÁˆÂxw_E“P-rP‹AÝ’G±Íìåeó]e!Œì<ÈQ9Äh{Û†@±lQ\~×éâ”4È>C eT§ý7‰\2À‡Ù+&1ø(ö´™½ž4ß ê½«tÙn•n[4›ïž¬Òc ³/é¹m+F‰ñÅ¢$J‚1̾ F ²}á/æÝD·ØZûYavO¯Ê ¼- j¾c¸’iÅ8®[ÜšIóÅ5TYGqÝ‚°¿l¾c¸ ; À(®²¥¯Ñ~Æp?n1Hné«Ôï(„ÇW Šl¼`Únç!_.Ò…°Gé2 lÅ…¾Ü¬EÙxA‘º=îHÿrcjd>¶15h»­É—Ó£ {tñŒøKbÄ #‰í>[b›Ï>~%‰¼Œ$ÂÆ0û¢9lÇÈ·úì“€=aä²³ýcôkQ¤’&K-ùÔP¹H†JGýH• Tˆ4£Ë[©Ñ òpÃXàØÔnÆ=s9{U×óôøÞKªucçòôãwXÂ&P¿·S+“){IBï+|[—ŒÓJ°doÁØ£„’„-/“2Â.ç«Ò¯VJwÀõ[@Ž28‡Ï  ^Æ A ¨5°mׯ"DžÉ}ý*@d™=õÒ¢iàL]Vê²nÒ.BƒàÞ@’†`s´p°³N %AV¢€#ŽÉŠ(±$õ@šR @ÃäU˜4)Va’PHÝŒÃ)èQâ„X„<ï(S¤öt1åLTÈ“L6«ä(˜‚ö“ H½)Ôµº((ª*ÕmQ“ÃyPZL-Tú eBI{@uyûú$ƺ(ûºõ) ¸ôQÒâ¬}«s*’‘}çÔåÝŒA‰Bc.ЭE J 5àxq1”¦@éÄ- x¢¯šR÷Íθ¨+ôpâ,n™â›q‚q8¹ì'`a¿Å ÛΊÏa"Ž—”p޾ÇJ7Iëá$\#Q{8©”t Í£¦<Nh‘´À)8Uc®OŒè‹è‚F5ØùJõ¢B#€B-Œ À›Â*0ü([˜›WQ™ʼn<*è´¦óDÐ;µ8$vÔË.k?î4+@”BµWÁúÈ“)}”s§Äý¡·€ ÓeK*Ah6 -¤ÂàÑC‹ XDô‚ô’ÁÖG ¹¤ˆ§wÔ^Ð Žq1ӞѢ’Fi<›ÒüIÁ@?`B_`S*H$ˆÚ7H)„)Œ=Ä °aªtØ ×ðªWÃzÈÔ× Ýq¤}!5•‚ d1ábêÆÒ 5‚ÈžÑ>d“E]ÛQÒXÒ'æE‘¾ 0é!Àt@å!4Ñ(}ÎÌdÿ*ð”'åܘöæþÀŒ¯ÌqÁ3G Wˆ•Y«¥@êÏ E ]{³Ö.ï†àÙˆbTðœh{ƒŠ"*ÈbÅ6À$'„+`V ÕâQÅü@uÓVóâÎ :‘L ¦cWÕT˜Ý{8qv]Yÿ/ÌÙÃHK`nÆhœ2Eê>WÔÌ•²¿¢FR('S*`jLü¨´I\›Ü‘uI›¬%ÊØ)k¨±ž«Ÿ"za1 ž¯÷’õ£Ö9õÁ^õjØàëmÜ4 ö_&°éÂk™ jLÐ )fèĵ(J0?þ±Ÿ"=¢ÉOhîM}4]ÍɆ§lŠÄ*}<)Eó«4âÉØ÷‰æ×nì¿öÜa©oñùá÷È"ýñn’=~#E•§eªý¡ùH.šF 9q,®èD@ØÈ­µÈÏ|"@‹’Q«îâ#Ntï¯_œÍŽëùã³GŸ®6õ˜må|êî‡u´HûNn~±úX7×]ï-T ºI6Þ]æÀ¯rkh[YuþaÅ«Rï|gç#Ú45YÄÞgU-¹(ÓùV.˜&‹°®ï]Ó:ïºÎ¿¶Ð:×úéMg8Q"Ln^§ƒŸ8 8-S:à,†À‘ËdJ4a®D+©Š=¢u ÄZíÙ 4ÌÐ *£è:jWÅOy™z%&&/5l¸k¿®@Û@ÂxÚµn”PØn°®Ç/x¤"dÒ“qGþÒ¢çDOß‚è³$±µÒôBJª êìÅE}™\e% ’i™ÌY\SÉZQPYôˆZ)²ÖÛ#·-×zI “`%C!!<`-`¬¦m^S‰ˆFÄ ËüÜ‘—ÙýÔ‘—›†Q\¢×‰!Öi‰î¢%_¿–ôL FBЪ g í[ì0u¸ŠŽ¼wß wûªpïBŠ “ŽmÓŽá‰ÇðÔ£ A hp uÞ¯›$ˆ „ Œ‘;‰ƒ¿¾éÆx!I1W {JO¾#$L‘¸+$cæ°¾°ˆ+øN2J\&BQ„æƒ?l|ËbÓ"J> 6ÍâèfwÅiàwÅF’Æ#M+­˜(tËåýiK]!;›}׌†ßËU7É5¼•+­—+¦|ãrõ$2Gâ€ÂxW®n„<`Ž(©è_H°»Œq˜ø-Hq8.ÕB‰:™_˜’©uqæö¢• ˆà[,Ïda’t[`ů=±{kvÊTœ‘s2%)É–ßÅ/e{÷Êœ'Ù~IÙrAÄX‘-BQR’*e)¡¶F¸¹‹p…¾áÖå×½,Õÿ¹öü F®Ñ]ð›BAaðÉ4Š¥ºÏ¦Ô²î1G€‘Ë~-ËML‰ °OŽj·ì:†¯‰HÆëŠú@6غþxØŠgçV¶| +sR/µŽrQPƒ,zô:ÊI´ƒh·ÝÅ ã3²‹÷4M…úá5Š{KAKFºêX)”Ø …ÜQ ò$…Ý¥%R=ŒÖ‰qG1Ø“vƒS Ió–ºî(…øÆ¥Ðß±¢a)ÔTT^•”¸pFÀ9L¡€ŠS†wz¿~Œ¾ ¦]d0(@ã^u;ïyuK÷GË*$ÐŒÜÁë¸íA%oÞuiëú+m÷>ì-ÒŠ¡8k÷èªé!…OªÄÙTSýnd0´c:ìFù€¾è‡$a ªÓj„-‹•÷¼|ÖÿeïÂaäwCžŸ‰|z¬ƒž×@ÿû“˜ÙËì E)D•ô_ q+B”â#!ÀSm7U×oIÕ‡÷–ÁͼÙSÍàíÞò2™¨wä.÷ºX"_ôâ]ÌUÅvµpÛßÇ©Ñ]‚”8¤ÑmZ ®ž4’’à@+:Ý A!;ŸÓ WÆŸ4úÌ‹D¶9tÙÿÂÁ½ƒ‚> Ö&‡âÉAÝC@cµÀ…& t@Jêw–µBõðKÏûúqßÀ ºÓZB>Í¿÷½…Ú¥ŒGRMŸà¿ïòBîjßR ÞÅ'Ÿ5Béb”qîR¾ý0¥ðÃÆ?ØéHþ4ŠªqL C¦}?(ÑÞ}S»Ïï¬ê~1ÿãvjýsPÛOB Ÿ…Úxjø<ÔÖQ+¤ð6á§¢"ýÛØœözÿQº|é(]¾Ž(]`¯qúð›ÅXÙ ½i»´Ž%8îí¨.hG%x ,XD%Ú)XD•=m»^‘öä­¨£‘èÄ û€G¤½gA)Á¢Ö¾XžÉÂ9äE‚ìóy‘Ö­:0ßÑc+Á)Lkô8(vÓãHü¶ôø^#8k¬Œ|¤…ÌluèËBäš48ôÑãYC„/À[¬½|¸½h€ûoFwøþñø'Gï®G¼­ÛÍ»™"A!•ù+\Θõ.+ Ú¾L”d~0E+f‘òâ –ÝI±bœèQg쵌£‘Uj”äpÁZå±pŠ›MLJ’Z[)h²ú$µ¢éÁ”¨„:Ä$³(ˆ¶¥£¸N2 ¢fûRšhJòD¹ °Ô1 Ž˜0ÒÚ-ˆÈ†"I¢R+D(D\ëkZ`œ(£*W%yýð0<íŒwgkèä…ë¯ `òX\ÖpüJùîŠÅ’œý2;¿89YïñÝÇUÇøòýõõ¿ØºÂ!Ïö¤:Gudœê ¿¹à84Ð>¼"¡TgåI#ha3Ð ³W'¬øQ!U#¬2§’@ 1!+,ÀÐÝK2:çD´…'7ª¤% e"Mý,š2dÍœäLæ¶V• £ID!ÍV·ÁZÝJI™+R0Ê$²¸e¶r×@®Õ©Qñ¤†Â ž>a)ÉÒhvM¦”𱑱$p­0Š95Ú…^SABÝÊk° JsÐÄçÞšÄõyT€FŽòj3|êúI‹—Ñ ý~ÆG'¨4»{8íyñ÷åhzQF #£;w1‘1í3Ìû¯_f—µKBèûô±ÑbNÄÙl¥¿ âLè>×^Ô&îÞåÍÒá‚A±8P Eï]þ½KŸ`¹SáÅ s¹ChÅœ$¹×›¦º~ %R ^;Ðñ×þÞõîò`,a†÷2æȽ"_»@†Ç<ƒ* ­ïO!:Â4Tf¶\¦L0Šx:βs{;H}"*H†„µ´C‰PEŸW7S,”(2qÀ¨¸•çh´ïÛ†®?Cýd ü N8µ‰kN(¸¤á÷kØó.>xÿMøûùÑ/G§•çÙÆêK`"édŠŽEÂ$¿ß¸Hà%]kç6¼ÚÅ&LLÁ±›ô¨·FlÑ }Ôë5IûM÷WÃzHŸÁÅÁPÐ0n“Ú±Õ­š=Cô~ðõZüpÍû=W'§ïê¿çןÞUhŽ.7]HÅ‘,B´6P“Ô{^áH’™±:¸\ý¿÷G—³µ«uû]úÇ€ápµÞ/f eèýxÆP†ËÝc ¦ê§÷Ö§…J¢²OnYÔ³¶7¹'7,NÚJs‹Ô1¹‡êÞrñWbŽ…OvÎäÅݲdظ ¡Bæ­ ¯÷8©+©òèêŽ×B5^§…·'¬‡2ôtdX »Ö©áíÑíšá¡Î†oÕAUÉ…¹O0Š¢›à„ #Ý[×­4Hª}‹þqXóú?.2ìÿ¸®Ñ¼î7GÖ:@.Iw4¨BNnyT…º­nr[îF¡¬ 3Ë?PývHìz£NÚhoAÆlôO¤ˆ¨Øþ¯Õ"u¥VEÂï<ãE8^ új4Zû ̱e$AqµM#I|+–=ìå4rh#öå+`ào‰nÛC‹a»Ï,‘~j¨b ÙP©QxCFÁøÀ¤¸1ļ4‚ª7'}*•ªW*«X¥Še%š—Ov­Œ*‘DpÁÈÄ$»sÔZº64q£X6ªU²–T5jAÊZg¥š¡Ëœêhsš†74,D8/m‘sš¢7Í´‚*Ñp,ŽìÙpªTtµJÍJU„˜s Fæ†JØ[šÄœ¦ˆâmiAZÐ*Lm?óÖÉEÔRæˆ@˜/¨®êÒB§,xCKö†œÆ‹ÒΨsèÃ-©áT©¬Q¡oEç>ÏkÌs!³iœš$A -˜Toh‘q`VLø¦´b­Ò¹˜x«!ÉQ„k••ši‹Ž¨ÍiB8§±˜b[Zù†ªM3¹ˆ*- u•9' E‹)ÈMæœÜ‘c!gAíÖ剨¤r‹ïÏ®~©°þéÍøkÊplasmate-1.0/plasmate/editors/PaxHeaders.5990/imageviewer0000644000175000001440000000013112115142004021624 xustar000000000000000030 mtime=1362412548.611641248 29 atime=1362412548.61564122 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/imageviewer/0000755000175000001440000000000012115142004022337 5ustar00kokeroulisusers00000000000000plasmate-1.0/plasmate/editors/imageviewer/PaxHeaders.5990/imageviewer.cpp0000644000175000001440000000013212115142004024712 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/imageviewer/imageviewer.cpp0000644000175000001440000000461712115142004025357 0ustar00kokeroulisusers00000000000000/* Copyright 2011 Giorgos Tsiapaliwkas 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 "imageviewer.h" #include "imageloader.h" #include #include #include #include #include #include ImageViewer::ImageViewer(QWidget* parent) : QWidget(parent) { QHBoxLayout *layout = new QHBoxLayout(this); layout->setAlignment(Qt::AlignHCenter); m_svgWidget = new QSvgWidget(this); layout->addWidget(m_svgWidget); m_label = new QLabel(this); layout->addWidget(m_label); m_reloadRequestTimer = new QTimer(this); connect(m_reloadRequestTimer, SIGNAL(timeout()), this, SLOT(reloadImage())); } void ImageViewer::loadImage(const KUrl& image) { m_reloadRequestTimer->stop(); m_image = image; if (image.path().endsWith(".svg") || image.path().endsWith(".svgz")) { loadSvg(image); } else { ImageLoader *loader = new ImageLoader(image, size(), this); connect(loader, SIGNAL(loadImage(KUrl,QSize,QImage)), this, SLOT(loadPixmap(KUrl,QSize,QImage))); QThreadPool::globalInstance()->start(loader); } } void ImageViewer::resizeEvent(QResizeEvent *) { m_reloadRequestTimer->start(); } void ImageViewer::reloadImage() { loadImage(m_image); } void ImageViewer::loadPixmap(const KUrl &url, const QSize &s, const QImage& image) { if (url == m_image && s == size()) { m_label->setPixmap(QPixmap::fromImage(image)); } } void ImageViewer::loadSvg(const KUrl& image) { m_svgWidget->load(image.path()); } const KUrl ImageViewer::imagePath() { return m_image; } #include "imageviewer.moc" plasmate-1.0/plasmate/editors/imageviewer/PaxHeaders.5990/imageloader.cpp0000644000175000001440000000012712115142004024663 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/editors/imageviewer/imageloader.cpp0000644000175000001440000000306012115142004025313 0ustar00kokeroulisusers00000000000000/* Copyright 2011 Giorgos Tsiapaliwkas 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 "imageloader.h" ImageLoader::ImageLoader(const KUrl& image, const QSize &size, QObject *parent) : QObject(parent), m_image(image), m_size(size) { setAutoDelete(true); } void ImageLoader::run() { QImage image(m_image.path(), "PNG JPG GIF JPEG SVG SVGZ"); QSize newSize = image.size(); if (newSize.width() > m_size.width()) { newSize.setWidth(m_size.width()); } if (newSize.height() > m_size.height()) { newSize.setHeight(m_size.height()); } if (newSize != image.size()) { image = image.scaled(newSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); } emit loadImage(m_image, m_size, image); } #include "imageloader.moc" plasmate-1.0/plasmate/editors/imageviewer/PaxHeaders.5990/imageviewer.h0000644000175000001440000000013212115142004024357 xustar000000000000000030 mtime=1362412548.611641248 30 atime=1362412548.611641248 30 ctime=1362412548.611641248 plasmate-1.0/plasmate/editors/imageviewer/imageviewer.h0000644000175000001440000000313012115142004025011 0ustar00kokeroulisusers00000000000000/* Copyright 2011 Giorgos Tsiapaliwkas 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 . */ #ifndef IMAGEVIEWER_H #define IMAGEVIEWER_H #include #include #include #include class ImageLoader; class QLabel; class QSvgWidget; class QTimer; class ImageViewer : public QWidget { Q_OBJECT public: /** * A simple ctor.Nothing special. **/ ImageViewer(QWidget *parent = 0); /** * Returns the directory for the image which will be displayed. * @see setImage() **/ const KUrl imagePath(); /** * Sets the directory for the image which will be displayed. **/ void loadImage(const KUrl& image); protected: void resizeEvent(QResizeEvent *event); private Q_SLOTS: void loadPixmap(const KUrl &url, const QSize &size, const QImage& image); void reloadImage(); private: KUrl m_image; QSvgWidget *m_svgWidget; QLabel *m_label; QTimer *m_reloadRequestTimer; void loadSvg(const KUrl& image); }; #endif // IMAGEVIEWER_H plasmate-1.0/plasmate/editors/imageviewer/PaxHeaders.5990/imageloader.h0000644000175000001440000000012712115142004024330 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/editors/imageviewer/imageloader.h0000644000175000001440000000232412115142004024762 0ustar00kokeroulisusers00000000000000/* Copyright 2011 Giorgos Tsiapaliwkas 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 . */ #ifndef IMAGELOADER_H #define IMAGELOADER_H #include #include #include #include class ImageLoader : public QObject, public QRunnable { Q_OBJECT public: /** * You just have to create an instance of the object. * Don't do anything else. **/ ImageLoader(const KUrl& image, const QSize &size, QObject *parent = 0); void run(); Q_SIGNALS: void loadImage(const KUrl &url, const QSize &size, const QImage& image); private: KUrl m_image; QSize m_size; }; #endif // IMAGELOADER_H plasmate-1.0/plasmate/editors/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000012712115142004022142 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/editors/CMakeLists.txt0000644000175000001440000000006512115142004022574 0ustar00kokeroulisusers00000000000000add_subdirectory( metadata ) add_subdirectory( svg ) plasmate-1.0/plasmate/PaxHeaders.5990/packagemodel.cpp0000644000175000001440000000013212115142004021045 xustar000000000000000030 mtime=1362412548.616641211 30 atime=1362412548.616641211 30 ctime=1362412548.616641211 plasmate-1.0/plasmate/packagemodel.cpp0000644000175000001440000005325612115142004021515 0ustar00kokeroulisusers00000000000000/* Copyright 2009-2010 Aaron Seigo Copyright 2009-2010 Artur Duque de Souza Copyright 2009-2010 Diego '[Po]lentino' Casella Copyright 2009-2010 Shantanu Tushar Jha Copyright 2009-2010 Sandro Andrade Copyright 2009-2010 Lim Yuen Hoe 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 #include #include #include #include #include #include #include #include #include #include #include PackageModel::PackageModel(QObject *parent) : QAbstractItemModel(parent), m_directory(0), m_structure(0), m_package(0) { m_dialogOptions["widgets"] = QStringList("[plasmate]/themeImageDialog/widgets"); m_dialogOptions["animations"] = QStringList("[plasmate]/themeImageDialog/animations"); m_dialogOptions["dialogs"] = QStringList("[plasmate]/themeImageDialog/dialogs"); m_dialogOptions["locolor/dialogs"] = QStringList("[plasmate]/themeImageDialog/locolor/dialogs"); m_dialogOptions["locolor/widgets"] = QStringList("[plasmate]/themeImageDialog/locolor/widgets"); m_dialogOptions["opaque/dialogs"] = QStringList("[plasmate]/themeImageDialog/opaque/dialogs"); m_dialogOptions["opaque/widgets"] = QStringList("[plasmate]/themeImageDialog/opaque/widgets"); m_dialogOptions["wallpapers"] = QStringList("[plasmate]/themeImageDialog/wallpapers"); m_dialogOptions["config"] = QStringList("[plasmate]/mainconfigxml/new"); m_dialogOptions["images"] = QStringList("[plasmate]/imageDialog"); } PackageModel::~PackageModel() { delete m_directory; delete m_package; m_structure = 0; } void PackageModel::setPackageType(const QString &type) { m_structure = 0; m_structure = Plasma::PackageStructure::load(type); } QString PackageModel::packageType() const { if (m_structure) { //Plasma:PackageStructure is not able to understand the KWin staff that are //written with QML. So we need to retrieve that information inside from the //metadata.desktop file const QString metadataFile = package() + "metadata.desktop"; KConfig c(metadataFile); KConfigGroup projectInformation(&c, "Desktop Entry"); const QString projectType = projectInformation.readEntry("X-KDE-ServiceTypes"); return projectType; } return QString(); } QString PackageModel::contentsPrefix() const { return m_structure->contentsPrefix(); } QString PackageModel::implementationApi() const { if (m_structure) { return const_cast(m_structure)->metadata().implementationApi(); } return QString(); } int PackageModel::setPackage(const QString &path) { if (!m_structure) { kDebug() << "Must set the package type FIRST!"; return 0; } m_structure->setPath(path); delete m_package; m_package = new Plasma::Package(path, m_structure); delete m_directory; m_directory = new KDirWatch(this); m_directory->addDir(path, KDirWatch::WatchSubDirs | KDirWatch::WatchFiles); if (!loadPackage()) { delete m_directory; m_directory = 0; delete m_package; m_package = 0; return 0; } connect(m_directory, SIGNAL(created(QString)), this, SLOT(fileAddedOnDisk(QString))); connect(m_directory, SIGNAL(created(QString)), this, SLOT(loadPackage())); connect(m_directory, SIGNAL(deleted(QString)), this, SLOT(fileDeletedOnDisk(QString))); return 1; } QString PackageModel::package() const { if (m_package) { KConfigGroup cg(KGlobal::config(), "PackageModel::package"); cg.writeEntry("lastLoadedPackage", m_package->path()); cg.sync(); return m_package->path(); } return QString(); } KUrl PackageModel::urlForIndex(const QModelIndex &index) const { const char *key = static_cast(index.internalPointer()); QList named = m_namedFiles.value(key); int row = index.row() - 1; QString path; QString file; if (row < 0) { // 'New' entry, return the directory path path = m_package->filePath(key); } else if (row < named.count()) { path = m_package->path(); QString contents = m_package->structure()->contentsPrefix(); path = path.endsWith("/") ? path + contents : path + "/" + contents; file = m_package->structure()->path(named.at(row)); } else { row -= named.count(); QStringList l = m_files.value(key); if (row < l.count()) { path = m_package->filePath(key); file = l.at(row); } } if (!path.endsWith('/')) { path.append('/'); } return path + file; } QVariant PackageModel::data(const QModelIndex &index, int role) const { if (!m_package || !index.isValid()) { return QVariant(); } QModelIndex parentIndex = parent(index); const char *key = static_cast(index.internalPointer()); if (key) { // we have a child item switch (role) { case MimeTypeRole: { if (index.row() == 0) { if(!qstrcmp(key, "animations") && packageType() != "Plasma/Theme") { //add an exception. the plasmoid package also contains the key animations, //so if this isn't a theme package return the right mimetype return QStringList("[plasmate]/new"); } else if (m_dialogOptions.contains(key)) { return m_dialogOptions.value(key); } return QStringList("[plasmate]/new"); } const char *imagePrefix = "[plasmate]/themeImageDialog/"; if (!qstrcmp(key, "images") || !qstrncmp(key, imagePrefix, qstrlen(imagePrefix))) { return QStringList("[plasmate]/imageViewer"); } if (!qstrcmp(key, "config")) { return QStringList("[plasmate]/kconfigxteditor"); } return m_package->structure()->mimetypes(key); } break; case UrlRole: { return urlForIndex(index).pathOrUrl(); } break; case Qt::DisplayRole: { if (index.row() == 0) { if (!qstrcmp(m_topEntries.at(parentIndex.row()), "config") && !fileExists("mainconfigxml")) { return i18n("New configuration XML file"); } return i18n("New..."); } QList named = m_namedFiles.value(key); int row = index.row() - 1; if (row < named.count()) { //kDebug() << m_package->structure()->name(named.at(row)); return m_package->structure()->name(named.at(row)); } row -= named.count(); QStringList l = m_files.value(key); if (row < l.count()) { //kDebug() << "got" << l.at(index.row() - 1); return l.at(row); } } break; case PackagePathRole: { return m_package ? m_package->path() : QString(); } case Qt::DecorationRole: { if (index.row() == 0) { return KIcon("document-new"); } else { return KIcon(KMimeType::iconNameForUrl(urlForIndex(index))); } } break; case ContentsWithSubdirRole: { return contentsWithSubdirRole(parentIndex.row()); } } } else { // it's a top level item //kDebug() << "data for top level item" << index.row() << m_topEntries.count() << role << Qt::DisplayRole; switch (role) { case Qt::DisplayRole: { if (index.row() == m_topEntries.count()) { return i18n("Metadata"); } return m_structure->name(m_topEntries.at(index.row())); } break; case MimeTypeRole: { if (index.row() + 1 == m_topEntries.count()) { if (packageType() == "Plasma/Theme") { //kcolorscheme will share the same index for creating and read/write if (!fileExists("colors")) { return QStringList("[plasmate]/kcolorscheme"); } else { return m_package->structure()->mimetypes("colors"); } } else if (packageType() == "Plasma/Applet") { if (!fileExists("mainconfigui")) { return QStringList("[plasmate]/mainconfigui"); } } } if (index.row() == m_topEntries.count()) { return QStringList("[plasmate]/metadata"); } } break; case UrlRole: { if (index.row() == m_topEntries.count()) { return m_package->path() + "metadata.desktop"; } if (index.row() + 1 == m_topEntries.count()) { if (m_package) { return m_package->path() + contentsWithSubdirRole(index.row()); } } return QString(); } break; case PackagePathRole: { return m_package ? m_package->path() : QString(); } break; case ContentsWithSubdirRole: { return contentsWithSubdirRole(index.row()); } } } return QVariant(); } QString PackageModel::contentsWithSubdirRole(int indexRow) const { if (m_package && m_topEntries.size() > indexRow) { QString path; foreach(const QString& content, m_structure->contentsPrefixPaths()) { path.append(content); path = path.endsWith('/') ? path : path.append('/'); } const char* topEntry = m_topEntries.at(indexRow); if (m_structure->directories().contains(topEntry)) { path.append(topEntry); } if (m_structure->files().contains(topEntry)) { QStringList l = m_structure->path(topEntry).split('/'); path.append(l.at(0)); } return path; } return QString(); } bool PackageModel::fileExists(const QString& key) const { if (QFile::exists(m_package->filePath(key.toLatin1().data()))) { return true; } return false; } QModelIndex PackageModel::index(int row, int column, const QModelIndex &parent) const { if (parent.isValid()) { if (parent.row() >= m_topEntries.count() || parent.parent().isValid()) { //kDebug() << "FAIL" << row << column; return QModelIndex(); } const char *key = m_topEntries.at(parent.row()); if (row <= m_files[key].count() + m_namedFiles[key].count()) { //kDebug() << "going to return" << row << column << key; return createIndex(row, column, (void*)key); } else { //kDebug() << "FAIL"; return QModelIndex(); } } // top level indexes; do a sanity check first if (row < 0 || row > m_topEntries.count() || column < 0 || column > MAX_COLUMN) { return QModelIndex(); } return createIndex(row, column); } QModelIndex PackageModel::parent(const QModelIndex &index) const { const char *key = static_cast(index.internalPointer()); if (m_topEntries.contains(key)) { return createIndex(m_topEntries.indexOf(key), 0); } return QModelIndex(); } int PackageModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent) //FIXME: need to accommodate more information return MAX_COLUMN + 1; } int PackageModel::rowCount(const QModelIndex &parent) const { if (parent.isValid()) { if (parent.row() < m_topEntries.count()) { //const char *key = m_topEntries.at(parent.row()); const char *key = static_cast(parent.internalPointer()); if (!key) { key = m_topEntries.at(parent.row()); } else if (m_namedFiles.contains(key)) { //It is a leaf return 0; } //kDebug() << "looking for" << key << m_files[key].count() << m_namedFiles[key]<path()); Plasma::PackageStructure::Ptr structure = m_package->structure(); if (!dir.exists(structure->contentsPrefix())) { kDebug() << "This is not a valid package."; return false; } if (!dir.exists("metadata.desktop")) { KUser user; Plasma::PackageMetadata metadata; metadata.setAuthor(user.property(KUser::FullName).toString()); metadata.setLicense("GPL"); metadata.setName(dir.dirName()); metadata.setServiceType(structure->type()); metadata.write(dir.path() + "/metadata.desktop"); } QStringList contents = structure->contentsPrefixPaths(); foreach(const QString& content, contents) { if (!content.isEmpty()) { //now create a dir like contents/ dir.mkpath(content); dir.cd(content); } } const QList dirs = structure->requiredDirectories(); //now create all the required directories //Q: why just the required ones and not all of them? //A: we don't want to spam the project's dir with unnecessary dirs foreach (const char *key, dirs) { const QStringList paths = structure->searchPath(key); foreach(const QString& path, paths){ if (!dir.exists(path)) { dir.mkpath(path); } } } //just add the directories in the ui, we won't create them foreach(const char *key, structure->directories()) { m_topEntries.append(key); } //once again we don't want to spam the project's dir //with all the files but we want to add them in the ui QHash nonRequiredIndexedFiles; QHash requiredIndexedFiles; foreach (const char *key, structure->requiredFiles()) { QString path = structure->path(key); if (!dir.exists(path)) { QFileInfo info(dir.path() + '/' + path); dir.mkpath(dir.relativeFilePath(info.absolutePath())); // Create all files, but 'code/main', as this is replaced by a template if (path != "code/main") { QFile f(dir.path() + '/' + path); f.open(QIODevice::WriteOnly); } } requiredIndexedFiles.insert(path, key); } //from here we will take the data for the ui foreach (const char *key, structure->files()) { const QStringList tmpPaths = structure->searchPath(key); foreach (const QString& path, tmpPaths) { if (qstrcmp(key, "mainscript")) { //if the key is mainscript then we have the main scripting //file, we don't want to add it into the nonRequiredIndexedFiles because //we want to see its name and not "code/main" nonRequiredIndexedFiles.insert(path, key); } } } foreach (const char *key, structure->directories()) { QString path = structure->path(key); if (!path.endsWith('/')) { path += '/'; } QStringList files = m_package->entryList(key); QList namedFiles; QStringList userFiles; foreach (const QString &file, files) { QString filePath = path + file; if (nonRequiredIndexedFiles.contains(filePath)) { namedFiles.append(nonRequiredIndexedFiles.value(filePath)); //the requiredFiles and files have some common elements, //so if the files contains a filePath the requiredFiles will //definately contain it! //So just remove the filePath from both of them nonRequiredIndexedFiles.remove(filePath); requiredIndexedFiles.remove(filePath); } else if (!file.endsWith('~')) { userFiles.append(file); } } //kDebug() << "results for" << m_topEntries.indexOf(key) << key << "are:" << namedFiles.count() << userFiles.count(); m_namedFiles.insert(key, namedFiles); m_files.insert(key, userFiles); } //until now we have add all the files into the ui //except from the ones which //* doesn't exist //* are not required // but the are some packages which have files like //those and those files are important. //So add in the ui every file that has a single key. //Q: what is a simple key? //A: A key which is only one word like and its not its not //inside in a directory, like colors. foreach(const char* key, structure->files()) { const QString k(key); const QStringList l = k.split('/'); if (l.size() == 1 && //we handle the above different in the ui qstrcmp(key, "defaultconfig") && qstrcmp(key, "mainconfigxml") && qstrcmp(key,"mainscript" )) { m_topEntries.append(key); } } endResetModel(); //reload the model's ui emit reloadModel(); return true; } void PackageModel::fileAddedOnDisk(const QString &path) { if (QFileInfo(path).fileName().at(0) == QChar('.') || path.endsWith('~')) { // we ignore hidden files and backup files return; } const KUrl toAdd(path); KUrl toAddDir(toAdd.directory()); const int parentCount = rowCount(QModelIndex()); for (int i = 0; i < parentCount - 1; ++i) { const char *key = m_topEntries.at(i); QList named = m_namedFiles.value(key); KUrl target(m_package->filePath(key)); //make sure that our paths ends with a '/' //in order to avoid a compare failure due to a '/' target.adjustPath(KUrl::AddTrailingSlash); toAddDir.adjustPath(KUrl::AddTrailingSlash); if (target.pathOrUrl() == toAddDir.pathOrUrl()) { QModelIndex parent = index(i, 0, QModelIndex()); int ind = rowCount(parent); for (int ii = 0; ii < ind; ++ii) { QModelIndex child = index(ii, 0, parent); KUrl childPath(child.data(PackageModel::UrlRole).toString()); if (childPath.equals(toAdd)) { // let's not double-add return; } } beginInsertRows(parent, ind, ind); m_files[key].append(toAdd.fileName()); endInsertRows(); break; } } } void PackageModel::fileDeletedOnDisk(const QString &path) { if (QFile::exists(path)) { // KDirWatch seems overparanoid, so we quickcheck return; } // Probably not the most efficient way to do it but // it works :) const KUrl toDelete(path); // Iterate through every tree element and check if it matches // the deleted file const int parentCount = rowCount(QModelIndex()); for (int i = 0; i < parentCount; ++i) { QModelIndex parent = index(i, 0, QModelIndex()); int childCount = rowCount(parent); for (int ii = 1; ii < childCount; ++ii) { QModelIndex child = index(ii, 0, parent); KUrl childPath(child.data(PackageModel::UrlRole).toString()); if (childPath.equals(toDelete)) { // match!! remove it! beginRemoveRows(parent, ii, ii); const char *key = m_topEntries.at(i); QList &named = m_namedFiles[key]; int row = ii - 1; if (row < named.count()) { named.removeAt(row); } else { row -= named.count(); QStringList &l = m_files[key]; if (row < l.count()) { l.removeAt(row); } } endRemoveRows(); break; } } } } void PackageModel::directoryModifiedOnDisk(const QString& path) { QDir dirPath(path); foreach(const QFileInfo& fileInfo, dirPath.entryInfoList(QDir::AllEntries)) { if (fileInfo.isFile()) { //if there is no file the foreach //will end and the directory will be deleted return; } } KIO::del(dirPath.path()); } plasmate-1.0/plasmate/PaxHeaders.5990/CHANGELOG0000644000175000001440000000012712115142004017143 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/plasmate/CHANGELOG0000644000175000001440000002306612115142004017603 0ustar00kokeroulisusers00000000000000--March 20,2010-- - Added a stub runner previewer --March 14,2010-- - Exporting now prompts for overwrite permission if target file exists. --March 3, 2010-- - Added tooltips to project lists to help differentiate similar projects --February 27, 2010-- - Added support for PopupApplets. --February 25,2010-- - Implemented project notes as dockwidget. - Implemented import/export to GHNS. --February 22,2010-- - Implemented installing non-plasmoids via publisher. --February 19,2010-- - Publisher now publishes non-plasmoids as *.zip. Installing non-plasmoids disallowed - Delete project support added. --February 13,2010-- - Added sensible indentation/tab defaults for editor (katepart). --February 7, 2010-- - Prevented creation of "theme" projects since there are no templates for it. - Connected sourceDirectoryChanged() to a slot that destructive-refreshes any open editor's contents. Timeline works beautifully now! \o/ --February 6, 2010-- - Added basic git ignore capabilities - Added sourceDirectoryChanged to notify when the git repo is changed (now, we have to connect it to the editor, to refresh the view) --January 27, 2010-- - Limited recent project list on startpage to showing 5 projects. - Added "More Projects" button to startpage, as well as a beginning implementation of a Project Management Dialog, that currently only loads projects. --January 21, 2010-- - Added not-so-pretty-but-usable (I think :P ) find text functionality to documentation widget. --January 11, 2010-- - Added python runner template, fixed encoding signature and runner creation. - Fixed silly crash happening when starting PlasMate and then closing it. --December 9, 2009-- - Refactored the Sidebar in order to inherit from QTableWidget, now it can be placed both in vertical and horizontal position; btw it need some polishing yet =) - Fixed font rendering, now it doesn't cut the ending of the string - Updated older and obsolete includes --December 6,2009-- - Documentation widget now saves its current page on exit and restores it the next time PlasMate starts. --December 5, 2009-- - Rewritten the TimeLine widget in order to allow the user to place it both in vertical and horizontal position. --November 30,2009-- - Selecting the editor tab now loads the previous active editor (if exists) instead of showing the 'select a file' QWidget. --November 29,2009-- - The state of central widgets (editor, publisher, documentation etc) are no longer reloaded, but are remembered and restored as the user switches between them. --November 28,2009-- - Added simple documentation widget. --November 23,2009-- - Reverted 'Recent project list' to showing plasmoid names and fixed so it works. Import plasmoids now works. --November 21,2009-- - Added preliminary support for importing plasmoids. 'Recent project list' now shows project folder names instead of plasmoid names to avoid confusion. --November 15,2009-- - Added a simple, draft publisher widget. Exporting and installing plasmoids work, but online publishing doesn't for now. --November 14,2009-- - New files can now be added to the project by clicking 'New' in the editor tree, and existing files can be deleted by doing a right-click > Delete. --November 13,2009-- - Editor tree now dynamically reflects changes in the directory --October 27,2009-- - Restored previewer dockwidget (while retaining previewer tab for now). Previewer refresh button now asks the mainwindow to save any unsaved data so that the preview is up to date. Also added a 'Refresh Previewer' menubar item with a keyboard shortcut (Ctrl-F5 for now) that does the same. --October 26,2009-- - Editor contents are now automagically saved on swapping files/tabs and on exit. --October 19,2009-- - Metadata editor now loads properly (but still unable to save). Previewer is now in a tab of its own. --October 18,2009-- - Selecting metadata now brings up the metadata editor GUI - but it doesn't really work. --October 1,2009-- - Experimental separation of editor tree-widget into a QDockWidget. Still UGLY and BUGGY. --September 26,2009-- - Package metadata file is now visible and editable in the editor. --September 25, 2009-- - Fixed more editor issues : all tree widget entries are now correctly named and properly mapped to their respective files. --September 23, 2009-- - Fixed clicking certain files in the editor component tree widget causing plasmate to crash. Issues remaining for editor: - File entries are not properly named in editor's project structure tree. - metadata.desktop is not currently editable (or visible). --September 20, 2009-- - Editor component now makes a (buggy) attempt to load clicked project files with an editor kpart. Also fixed a bug causing editor kpart to not load the first time the editor component is loaded. --September 19, 2009-- - Fixed previewer refresh code: Refreshing now properly reflects changes since previous refresh. Also fixed issue with refreshed plasmoid being smaller than original. --September 12, 2009-- - Loading a project now also attempts to load a preview in previewer --August 29, 2009-- - Modified the newSavePoint() method to prevent a crash when the user want to store his first SavePoint, but then it discard the "new SavePoint" dialog. --August 22, 2009-- - Added titles to the previewer tool menus. --August 14, 2009-- - Updated the TimeLine test class, now it shows a simple widget with the TimeLine and a button used to create new SavePoints. - Removed useless header from timeline* sources. --August 13, 2009-- - Commented the remaining headers under /savesystem, removed unused files and the /vng dir. --August 12, 2009-- - Added to BranchDialog class a simple regexp validator, in order to avoid use of non-standard characters when the user types a new branch name. - Starting writing apidox documentation, removin useless methods and fixing style. --August 10, 2009-- - Fixed StartPage issue: opening/creating a project, when an other one is already open, now works. - TimeLine didn't reload properly when changing from an existing project to an other. Fixed. --August 9, 2009-- - Moved "New SavePoint" buttom from timeline to workflow dock widget. Changed workflow signals connection in order to restore the previous tab after setting a SavePoint. - Added bool GitRunner::hasNewChangesToCommit(), so New SavePoint dialog is triggered only if there are uncommitted changes. - Moved "On Section: " button on the top of TimeLine dock for usability reason, because if there are lots of SavePoints, the user has to scroll down each time he want to perfom an action Section-related. - Fixed plasma-containment-studiopreviewer.desktop file; now it doesn't interacts with "Desktop Settings" -> "Desktop Activity" entries. - Some fixes and coding style fix. --August 3, 2009-- - When creating a new project, metadata.desktop file is filled with the required fields - Added setAuthor and setEmail to GitRunner class, so now TimeLine can set that fields - Review createNewProject code. - Fixed some krazy warnings. --July 30, 2009-- - New Project page displays now two fields, Author and Email, defaulted to and @none.org. These values are inserted in the header contained int the main script file. --July 29, 2009-- - Fixed saving/reloading layout ( still need some fixing with previewer dimensions btw ) - Now templates are installed under $KDEDIR/share/apps/plasmate/templates - When creating a new project, PlasMate makes a copy of the corresponding template in the working directory, modify its file name and the main class to match the project name. --July 26, 2009-- - Added radio button to select the scripting language, connected KLineEdit::returnPressed() signal, saved docks position so the next time PlasMate is loaded, it reloads docks previous position ( need more fixing btw ). - Added templated folder, with simple sources for plasmoid and data engines. --July 25, 2009-- - The loading of a text editor at the Publish tab was unnecessary. Removed. - Cancel button added to new project screen. --July 21, 2009-- - Fixed the issue with the KRestrictedLine form; now it accepts correctly all names composed by characters a-z,A-Z,0-9, and "_", "." --July 19, 2009-- - Added merge capabilities to TimeLine class. --July 17, 2009-- - TimeLine now is able to create/delete branches, move to a selected commit ( creating also a new branch to preserve other commits ), restore the current state to whatever commit ( deleting all the commits performed after it, in the same branch ), init itself and save commits. --July 14, 2009-- - Now the TimeLine sets-up a menu for each item, available by right-clicking on it: implemented the switch branch feature. --July 12, 2009-- - Fixed a strange behaviour with GitRunner class which causes the app to continue runnig, even if the app is closed. Extended TimeLine class; now it shows in the main window the current branches and its related commits, and more infos are provided when moving the mouse over the icons. --July 7, 2009-- - Fixed DvcsJob behaviour when are performed sequential calls, like in the unit test. Added the following action in the GitRunner class: remove, status, log, reset, newBranch, switchBranch, branches. --July 5, 2009-- - Splitted the Sidebar class, coded the following git action: init, add, commit, isValidDirectory and clone ( only with local repo, for now ). Wrote a simple test case, and start integrating it in the timeline class. --June 1, 2009-- -Appropriate kpart shown when an item is selected from the tree in the Edit tab. --June 24, 2009-- -Simple 'Pick wallpaper plugin' functionality added to previewer plasmate-1.0/PaxHeaders.5990/engineexplorer0000644000175000001440000000012712115142004017074 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412560.66153226 29 ctime=1362412548.61064126 plasmate-1.0/engineexplorer/0000755000175000001440000000000012115142004017602 5ustar00kokeroulisusers00000000000000plasmate-1.0/engineexplorer/PaxHeaders.5990/serviceviewer.ui0000644000175000001440000000012712115142004022372 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/engineexplorer/serviceviewer.ui0000644000175000001440000000465412115142004023034 0ustar00kokeroulisusers00000000000000 ServiceViewer 0 0 405 275 %1 service for %2 DataEngine source %3 Qt::Horizontal false &Operation: m_operations false Qt::Horizontal 217 20 false Key Value Operation count KComboBox QComboBox
kcombobox.h
plasmate-1.0/engineexplorer/PaxHeaders.5990/serviceviewer.cpp0000644000175000001440000000012712115142004022537 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/engineexplorer/serviceviewer.cpp0000644000175000001440000001547412115142004023203 0ustar00kokeroulisusers00000000000000/* * Copyright 2008 Aaron Seigo * * 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, * 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. */ #include "serviceviewer.h" #include #include #include #include #include #include #include "engineexplorer.h" ServiceViewer::ServiceViewer(Plasma::DataEngine *engine, const QString &source, QWidget *parent) : KDialog(parent), m_engine(engine), m_service(0), m_source(source), m_operationCount(0) { setAttribute(Qt::WA_DeleteOnClose); QWidget* mainWidget = new QWidget(this); setMainWidget(mainWidget); setupUi(mainWidget); m_operationStatus->hide(); setButtons(KDialog::Close | KDialog::User1); setButtonText(KDialog::User1, i18n("Start Operation")); connect(this, SIGNAL(user1Clicked()), this, SLOT(startOperation())); enableButton(KDialog::User1, false); connect(m_operations, SIGNAL(currentIndexChanged(QString)), this, SLOT(operationSelected(QString))); QString engineName = i18nc("Plasma engine with unknown name", "Unknown"); QString serviceName = i18nc("Plasma service with unknown name", "Unknown"); if (m_engine) { engineName = KStringHandler::capwords(m_engine->name()); kDebug() << "########### CALLING SERVICE FOR SOURCE: " << m_source; m_service = m_engine->serviceForSource(m_source); if (m_service != 0) { serviceName = m_service->name(); updateOperations(); connect(m_service, SIGNAL(operationsChanged()), this, SLOT(updateOperations())); connect(m_engine, SIGNAL(destroyed(QObject*)), this, SLOT(engineDestroyed())); } else { KMessageBox::sorry(this, i18n("No valid service was returned. Verify that a service is available for this source.")); close(); } } setWindowTitle(i18nc("%1 is a Plasma service name", "%1 Service Explorer", serviceName)); QString title = i18nc("Source: name of the data, Service: writes data instead of fetching", "DataEngine: %1; Source: %2; Service: %3", engineName, m_source, serviceName); m_title->setText(title); m_operations->setFocus(); } ServiceViewer::~ServiceViewer() { delete m_service; m_engine = 0; } void ServiceViewer::updateOperations() { if (!m_engine) { return; } bool enable = false; m_operations->clear(); m_operationDescription->clear(); if (m_service) { const QStringList operations = m_service->operationNames(); if (!operations.isEmpty()) { enable = true; foreach (const QString& operation, operations) { m_operations->addItem(operation); } } } m_operations->setEnabled(enable); m_operationsLabel->setEnabled(enable); m_operationDescription->setEnabled(enable); } void ServiceViewer::startOperation() { if (!m_service) { return; } QString operation = m_operations->currentText(); KConfigGroup desc = m_service->operationDescription(operation); for (int i = 0; i < m_operationDescription->rowCount(); ++i) { QTableWidgetItem *item = m_operationDescription->item(i, 1); QString value = item->text(); if (value.isEmpty()) { continue; } item = m_operationDescription->item(i, 0); QString key = item->text(); desc.writeEntry(key, value); } updateJobCount(1); Plasma::ServiceJob *job = m_service->startOperationCall(desc); connect(job, SIGNAL(finished(KJob*)), this, SLOT(operationResult(KJob*))); } void ServiceViewer::operationSelected(const QString &operation) { if (!m_service) { return; } enableButton(KDialog::User1, true); QStringList headers; headers << i18n("Key") << i18n("Value"); m_operationDescription->setHorizontalHeaderLabels(headers); KConfigGroup desc = m_service->operationDescription(operation); int i = 0; const QStringList keys = desc.keyList(); m_operationDescription->setRowCount(keys.count()); foreach (const QString &key, keys) { QTableWidgetItem *item = new QTableWidgetItem(key); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_operationDescription->setItem(i, 0, item); item = new QTableWidgetItem(desc.readEntry(key, QString())); m_operationDescription->setItem(i, 1, item); ++i; } } void ServiceViewer::operationResult(KJob *j) { if (!m_service) { return; } Plasma::ServiceJob *job = qobject_cast(j); if (!job) { return; } updateJobCount(-1); if (job->error()) { KMessageBox::information(this, i18n("'%1' operation with destination '%2' failed. " "

The error was: '%3: %4'

", job->operationName(), job->destination(), job->error(), job->errorString()), i18n("Operation Result")); } else { QString result = EngineExplorer::convertToString(job->result()); if (result.isEmpty()) { result = i18n("No response from job."); } KMessageBox::information(this, i18n("'%1' operation with destination '%2' returned successfully. " "

The result was: '%3'

", job->operationName(), job->destination(), result), i18n("Operation Result")); } kDebug() << "operation results are in!"; } void ServiceViewer::engineDestroyed() { m_service = 0; m_engine = 0; hide(); deleteLater(); } void ServiceViewer::updateJobCount(int numberOfJobs) { m_operationCount += numberOfJobs; if (m_operationCount < 1) { m_operationCount = 0; m_operationStatus->hide(); } else { m_operationStatus->setText(i18np("One active operation...", "%1 operations active...", m_operationCount)); m_operationStatus->show(); } } #include "serviceviewer.moc" plasmate-1.0/engineexplorer/PaxHeaders.5990/engineexplorer.cpp0000644000175000001440000000013212115142004022677 xustar000000000000000030 mtime=1362412548.609641275 30 atime=1362412548.609641275 30 ctime=1362412548.609641275 plasmate-1.0/engineexplorer/engineexplorer.cpp0000644000175000001440000004132312115142004023337 0ustar00kokeroulisusers00000000000000/* * Copyright 2007 Aaron Seigo * * 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, * 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. */ #include "engineexplorer.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef FOUND_SOPRANO #include Q_DECLARE_METATYPE(Soprano::Node) #endif // FOUND_SOPRANO Q_DECLARE_METATYPE(Plasma::DataEngine::Data) #include #include "serviceviewer.h" #include "titlecombobox.h" EngineExplorer::EngineExplorer(QWidget* parent) : KDialog(parent), m_engine(0), m_sourceCount(0), m_requestingSource(false) { #ifdef FOUND_SOPRANO (void) qRegisterMetaType(); #endif setWindowTitle(i18n("Plasma Engine Explorer")); QWidget* mainWidget = new QWidget(this); setMainWidget(mainWidget); setupUi(mainWidget); m_engineManager = Plasma::DataEngineManager::self(); m_dataModel = new QStandardItemModel(this); KIcon pix("plasma"); int size = IconSize(KIconLoader::Dialog); m_title->setPixmap(pix.pixmap(size, size)); connect(m_engines, SIGNAL(activated(QString)), this, SLOT(showEngine(QString))); connect(m_sourceRequesterButton, SIGNAL(clicked(bool)), this, SLOT(requestSource())); connect(m_serviceRequesterButton, SIGNAL(clicked(bool)), this, SLOT(requestServiceForSource())); m_data->setModel(m_dataModel); m_data->setWordWrap(true); m_searchLine->setTreeView(m_data); m_searchLine->setClickMessage(i18n("Search")); listEngines(); m_engines->setFocus(); setButtons(KDialog::Close | KDialog::User1 | KDialog::User2); setButtonText(KDialog::User1, i18n("Collapse All")); setButtonText(KDialog::User2, i18n("Expand All")); connect(this, SIGNAL(user1Clicked()), m_data, SLOT(collapseAll())); connect(this, SIGNAL(user2Clicked()), m_data, SLOT(expandAll())); enableButton(KDialog::User1, false); enableButton(KDialog::User2, false); addAction(KStandardAction::quit(qApp, SLOT(quit()), this)); connect(m_data, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showDataContextMenu(QPoint))); m_data->setContextMenuPolicy(Qt::CustomContextMenu); connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(cleanUp())); } EngineExplorer::~EngineExplorer() { } void EngineExplorer::cleanUp() { if (!m_engineName.isEmpty()) { m_engineManager->unloadEngine(m_engineName); } } void EngineExplorer::setApp(const QString &app) { m_app = app; if (m_engines->count() > 0) { listEngines(); } } void EngineExplorer::setEngine(const QString &engine) { //find the engine in the combo box int index = m_engines->findText(engine); if (index != -1) { kDebug() << QString("Engine %1 found!").arg(engine); m_engines->setCurrentIndex(index); showEngine(engine); } } void EngineExplorer::setInterval(const int interval) { m_updateInterval->setValue(interval); } void EngineExplorer::dataUpdated(const QString& source, const Plasma::DataEngine::Data& data) { QList items = m_dataModel->findItems(source, 0); if (items.isEmpty()) { return; } QStandardItem* parent = items.first(); int rows = showData(parent, data); while (parent->rowCount() > rows) { parent->removeRow(rows); } } void EngineExplorer::listEngines() { m_engines->clear(); KPluginInfo::List engines = m_engineManager->listEngineInfo(m_app); qSort(engines); foreach (const KPluginInfo engine, engines) { m_engines->addItem(KIcon(engine.icon()), engine.pluginName()); } m_engines->setCurrentIndex(-1); } void EngineExplorer::showEngine(const QString& name) { m_sourceRequester->setEnabled(false); m_sourceRequesterButton->setEnabled(false); m_serviceRequester->setEnabled(false); m_serviceRequesterButton->setEnabled(false); enableButton(KDialog::User1, false); enableButton(KDialog::User2, false); m_dataModel->clear(); m_dataModel->setColumnCount(4); QStringList headers; headers << i18n("DataSource") << i18n("Key") << i18n("Value") << i18n("Type"); m_dataModel->setHorizontalHeaderLabels(headers); m_engine = 0; m_sourceCount = 0; if (!m_engineName.isEmpty()) { m_engineManager->unloadEngine(m_engineName); } m_engineName = name; if (m_engineName.isEmpty()) { updateTitle(); return; } m_engine = m_engineManager->loadEngine(m_engineName); if (!m_engine) { m_engineName.clear(); updateTitle(); return; } //kDebug() << "showing engine " << m_engine->objectName(); //kDebug() << "we have " << sources.count() << " data sources"; connect(m_engine, SIGNAL(sourceAdded(QString)), this, SLOT(addSource(QString))); connect(m_engine, SIGNAL(sourceRemoved(QString)), this, SLOT(removeSource(QString))); foreach (const QString& source, m_engine->sources()) { //kDebug() << "adding " << source; addSource(source); } m_sourceRequesterButton->setEnabled(true); m_updateInterval->setEnabled(true); m_sourceRequester->setEnabled(true); m_sourceRequester->setFocus(); m_serviceRequester->setEnabled(true); m_serviceRequesterButton->setEnabled(true); updateTitle(); } void EngineExplorer::addSource(const QString& source) { //kDebug() << "adding" << source; QList items = m_dataModel->findItems(source, 0); if (!items.isEmpty()) { kDebug() << "er... already there?"; return; } QStandardItem* parent = new QStandardItem(source); m_dataModel->appendRow(parent); //kDebug() << "getting data for source " << source; if (!m_requestingSource || m_sourceRequester->text() != source) { //kDebug() << "connecting up now"; m_engine->connectSource(source, this); } ++m_sourceCount; updateTitle(); enableButton(KDialog::User1, true); enableButton(KDialog::User2, true); } void EngineExplorer::removeSource(const QString& source) { QList items = m_dataModel->findItems(source, 0); if (items.count() < 1) { return; } foreach (QStandardItem* item, items) { m_dataModel->removeRow(item->row()); } --m_sourceCount; m_engine->disconnectSource(source, this); updateTitle(); } void EngineExplorer::requestSource() { requestSource(m_sourceRequester->text()); } void EngineExplorer::requestServiceForSource() { ServiceViewer *viewer = new ServiceViewer(m_engine, m_serviceRequester->text()); viewer->show(); } void EngineExplorer::requestSource(const QString &source) { if (!m_engine || source.isEmpty()) { return; } kDebug() << "request source" << source; m_requestingSource = true; m_engine->connectSource(source, this, (uint)m_updateInterval->value()); m_requestingSource = false; } void EngineExplorer::showDataContextMenu(const QPoint &point) { QModelIndex index = m_data->indexAt(point); if (index.isValid()) { if (index.parent().isValid()) { index = index.parent(); } if (index.column() != 0) { index = m_dataModel->index(index.row(), 0); } const QString source = index.data().toString(); KMenu menu; menu.addTitle(source); QAction *service = menu.addAction(i18n("Get associated service")); QAction *update = menu.addAction(i18n("Update source now")); QAction *remove = menu.addAction(i18n("Remove source")); QAction *activated = menu.exec(m_data->viewport()->mapToGlobal(point)); if (activated == service) { ServiceViewer *viewer = new ServiceViewer(m_engine, source); viewer->show(); } else if (activated == update) { m_engine->connectSource(source, this); Plasma::DataEngine::Data data = m_engine->query(source); } else if (activated == remove) { removeSource(source); } } } QString EngineExplorer::convertToString(const QVariant &value) { switch (value.type()) { case QVariant::BitArray: { return i18np("<1 bit>", "<%1 bits>", value.toBitArray().size()); } case QVariant::Bitmap: { QBitmap bitmap = value.value(); return QString("<%1x%2px - %3bpp>").arg(bitmap.width()).arg(bitmap.height()).arg(bitmap.depth()); } case QVariant::ByteArray: { // Return the array size if it is not displayable if (value.toString().isEmpty()) { return i18np("<1 byte>", "<%1 bytes>", value.toByteArray().size()); } else { return value.toString(); } } case QVariant::Image: { QImage image = value.value(); return QString("<%1x%2px - %3bpp>").arg(image.width()).arg(image.height()).arg(image.depth()); } case QVariant::Line: { QLine line = value.toLine(); return QString("").arg(line.x1()).arg(line.y1()).arg(line.x2()).arg(line.y2()); } case QVariant::LineF: { QLineF lineF = value.toLineF(); return QString("").arg(lineF.x1()).arg(lineF.y1()).arg(lineF.x2()).arg(lineF.y2()); } case QVariant::Locale: { return QString("%1").arg(value.toLocale().name()); } case QVariant::Map: { QVariantMap map = value.toMap(); QString str = i18np("<1 item>", "<%1 items>", map.size()); QMapIterator it(map); while (it.hasNext()) { it.next(); str += "\n" + it.key() + ": " + convertToString(it.value()); } return str; } case QVariant::Pixmap: { QPixmap pixmap = value.value(); return QString("<%1x%2px - %3bpp>").arg(pixmap.width()).arg(pixmap.height()).arg(pixmap.depth()); } case QVariant::Point: { QPoint point = value.toPoint(); return QString("").arg(point.x()).arg(point.y()); } case QVariant::PointF: { QPointF pointF = value.toPointF(); return QString("").arg(pointF.x()).arg(pointF.y()); } case QVariant::Rect: { QRect rect = value.toRect(); return QString("").arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height()); } case QVariant::RectF: { QRectF rectF = value.toRectF(); return QString("").arg(rectF.x()).arg(rectF.y()).arg(rectF.width()).arg(rectF.height()); } case QVariant::RegExp: { return QString("%1").arg(value.toRegExp().pattern()); } case QVariant::Region: { QRect region = value.value().boundingRect(); return QString("").arg(region.x()).arg(region.y()).arg(region.width()).arg(region.height()); } case QVariant::Size: { QSize size = value.toSize(); return QString("").arg(size.width()).arg(size.height()); } case QVariant::SizeF: { QSizeF sizeF = value.toSizeF(); return QString("").arg(sizeF.width()).arg(sizeF.height()); } case QVariant::Url: { return QString("%1").arg(value.toUrl().toString()); } case QVariant::StringList: { return QString("%1").arg(value.toStringList().join(", ")); } case QVariant::Date: { return QString("%1").arg(value.toDate().toString()); } case QVariant::DateTime: { return QString("%1").arg(value.toDateTime().toString()); } case QVariant::Time: { return QString("%1").arg(value.toTime().toString()); } default: { #ifdef FOUND_SOPRANO if (QLatin1String(value.typeName()) == "Soprano::Node") { Soprano::Node node = value.value(); if (node.isLiteral()) { return convertToString(node.literal().variant()); } else if (node.isResource()) { return node.uri().toString(); } else if (node.isBlank()) { return QString("_:%1").arg(node.identifier()); } } #endif if (QLatin1String(value.typeName()) == "KDateTime") { return QString("%1").arg(value.value().toString()); } Plasma::DataEngine::Data data = value.value(); if (!data.isEmpty()) { QStringList result; QHashIterator it(data); while (it.hasNext()) { it.next(); result << (it.key() + ": " + convertToString(it.value())); } return result.join("\n"); } else if (value.canConvert(QVariant::String)) { if (value.toString().isEmpty()) { return i18nc("The user did a query to a dataengine and it returned empty data", ""); } else { return value.toString(); } } return i18nc("A the dataengine returned something that the humble view on the engineexplorer can't display, like a picture", ""); } } } int EngineExplorer::showData(QStandardItem* parent, Plasma::DataEngine::Data data) { int rowCount = 0; Plasma::DataEngine::DataIterator it(data); // parent->insertRows(0, data.count()); // parent->setColumnCount(3); while (it.hasNext()) { it.next(); parent->setChild(rowCount, 1, new QStandardItem(it.key())); if (it.value().canConvert(QVariant::List) /* && ! it.value().type() == QVariant::StringList */) { bool first = true; foreach (const QVariant &var, it.value().toList()) { QStandardItem *item = new QStandardItem(convertToString(var)); if (!first) { parent->setChild(rowCount, 1, new QStandardItem(QString())); } item->setToolTip(item->text()); parent->setChild(rowCount, 2, item); parent->setChild(rowCount, 3, new QStandardItem(var.typeName())); first = false; ++rowCount; } } else { QStandardItem *item; if (it.value().canConvert()) { item = new QStandardItem(it.value().value(), ""); } else { item = new QStandardItem(convertToString(it.value())); } item->setToolTip(item->text()); parent->setChild(rowCount, 2, item); parent->setChild(rowCount, 3, new QStandardItem(it.value().typeName())); ++rowCount; } } return rowCount; } void EngineExplorer::updateTitle() { if (!m_engine) { m_title->setPixmap(KIcon("plasma").pixmap(IconSize(KIconLoader::Dialog))); m_title->setText(i18n("Plasma DataEngine Explorer")); return; } m_title->setText(ki18ncp("The name of the engine followed by the number of data sources", "%1 Engine - 1 data source", "%1 Engine - %2 data sources") .subs(KStringHandler::capwords(m_engine->name())) .subs(m_sourceCount).toString()); if (m_engine->icon().isEmpty()) { m_title->setPixmap(KIcon("plasma").pixmap(IconSize(KIconLoader::Dialog))); } else { //m_title->setPixmap(KIcon("alarmclock").pixmap(IconSize(KIconLoader::Dialog))); m_title->setPixmap(KIcon(m_engine->icon()).pixmap(IconSize(KIconLoader::Dialog))); } } #include "engineexplorer.moc" plasmate-1.0/engineexplorer/PaxHeaders.5990/titlecombobox.h0000644000175000001440000000012712115142004022174 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/engineexplorer/titlecombobox.h0000644000175000001440000000322112115142004022623 0ustar00kokeroulisusers00000000000000/* * Copyright 2008 Aaron Seigo * * 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, * 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. */ #ifndef TITLECOMBOBOX_H #define TITLECOMBOBOX_H #include #include #include #include class TitleComboBox : public QComboBox { public: TitleComboBox(QWidget *parent = 0) : QComboBox(parent) { } protected: void paintEvent(QPaintEvent *event) { QComboBox::paintEvent(event); if (currentIndex() != -1) { return; } QPainter p(this); /*QFont bold = p.font(); bold.setBold(true); p.setFont(bold);*/ p.setPen(palette().color(QPalette::Disabled, QPalette::WindowText)); int frameWidth = style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth); QRect r = rect().adjusted(frameWidth, frameWidth, frameWidth, frameWidth); p.drawText(QStyle::visualRect(layoutDirection(), rect(), r), i18n("Data Engines")); } }; #endif plasmate-1.0/engineexplorer/PaxHeaders.5990/engineexplorer.h0000644000175000001440000000013212115142004022344 xustar000000000000000030 mtime=1362412548.609641275 30 atime=1362412548.609641275 30 ctime=1362412548.609641275 plasmate-1.0/engineexplorer/engineexplorer.h0000644000175000001440000000442712115142004023010 0ustar00kokeroulisusers00000000000000/* * Copyright 2007 Aaron Seigo * * 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, * 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. */ #ifndef ENGINEEXPLORER_H #define ENGINEEXPLORER_H class QStandardItemModel; class QStandardItem; #include #include "ui_engineexplorer.h" namespace Plasma { class DataEngineManager; class DataEngine; } // namespace Plasma class EngineExplorer : public KDialog, public Ui::EngineExplorer { Q_OBJECT public: explicit EngineExplorer(QWidget *parent = 0); ~EngineExplorer(); void setApp(const QString &app); void setEngine(const QString &engine); void setInterval(const int interval); void requestSource(const QString &source); static QString convertToString(const QVariant &value); public slots: void dataUpdated(const QString& source, const Plasma::DataEngine::Data& data); private slots: void showEngine(const QString& engine); void addSource(const QString& source); void removeSource(const QString& source); void requestSource(); void requestServiceForSource(); void showDataContextMenu(const QPoint &point); void cleanUp(); private: void listEngines(); int showData(QStandardItem* parent, Plasma::DataEngine::Data data); void updateTitle(); Plasma::DataEngineManager* m_engineManager; QStandardItemModel* m_dataModel; QString m_app; QString m_engineName; Plasma::DataEngine* m_engine; int m_sourceCount; bool m_requestingSource; }; #endif // multiple inclusion guard plasmate-1.0/engineexplorer/PaxHeaders.5990/Messages.sh0000644000175000001440000000013212115142004021250 xustar000000000000000030 mtime=1362412548.609641275 30 atime=1362412548.609641275 30 ctime=1362412548.609641275 plasmate-1.0/engineexplorer/Messages.sh0000755000175000001440000000016412115142004021711 0ustar00kokeroulisusers00000000000000#! /usr/bin/env bash $EXTRACTRC *.ui >> rc.cpp $XGETTEXT *.cpp *.h -o $podir/plasmaengineexplorer.pot rm -f rc.cpp plasmate-1.0/engineexplorer/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004021705 xustar000000000000000030 mtime=1362412548.609641275 30 atime=1362412548.609641275 30 ctime=1362412548.609641275 plasmate-1.0/engineexplorer/CMakeLists.txt0000644000175000001440000000172412115142004022346 0ustar00kokeroulisusers00000000000000set(plasmaengineexplorer_SRCS engineexplorer.cpp ktreeviewsearchline.cpp main.cpp serviceviewer.cpp ) macro_optional_find_package(Soprano) macro_log_feature(Soprano_FOUND "Soprano" "Semantic Desktop Storing" "http://soprano.sourceforge.net" FALSE "" "Adds support for the Soprano data type to Plasma Engine Explorer.") if (Soprano_FOUND) include_directories( ${SOPRANO_INCLUDE_DIR} ) add_definitions( -DFOUND_SOPRANO=1 ) endif (Soprano_FOUND) kde4_add_ui_files(plasmaengineexplorer_SRCS engineexplorer.ui serviceviewer.ui) kde4_add_executable(plasmaengineexplorer ${plasmaengineexplorer_SRCS}) target_link_libraries(plasmaengineexplorer ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS}) if (Soprano_FOUND) target_link_libraries(plasmaengineexplorer ${SOPRANO_LIBRARIES}) endif (Soprano_FOUND) install(TARGETS plasmaengineexplorer ${INSTALL_TARGETS_DEFAULT_ARGS}) kde4_create_manpage(man-plasmaengineexplorer.1.docbook 1 INSTALL_DESTINATION ${MAN_INSTALL_DIR}) plasmate-1.0/engineexplorer/PaxHeaders.5990/main.cpp0000644000175000001440000000013212115142004020575 xustar000000000000000030 mtime=1362412548.609641275 30 atime=1362412548.609641275 30 ctime=1362412548.609641275 plasmate-1.0/engineexplorer/main.cpp0000644000175000001440000001063612115142004021240 0ustar00kokeroulisusers00000000000000/* * Copyright 2006 Aaron Seigo * * 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, * 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. */ #include #include #include #include #include #include #include "engineexplorer.h" static const char description[] = I18N_NOOP("Explore the data published by Plasma DataEngines"); static const char version[] = "0.2"; void listEngines() { int maxLen = 0; QMap engines; foreach (const KPluginInfo &info, Plasma::DataEngineManager::listEngineInfo()) { if (info.property("NoDisplay").toBool()) { continue; } int len = info.pluginName().length(); if (len > maxLen) { maxLen = len; } QString name = info.pluginName(); QString comment = info.comment(); if (comment.isEmpty()) { comment = i18n("No description available"); } engines.insert(name, comment); } QMap::const_iterator it; for (it = engines.constBegin(); it != engines.constEnd(); ++it) { QString engine("%1 - %2"); engine = engine.arg(it.key().leftJustified(maxLen, ' ')).arg(it.value()); std::cout << engine.toLocal8Bit().data() << std::endl; } } int main(int argc, char **argv) { KAboutData aboutData("plasmaengineexplorer", 0, ki18n("Plasma Engine Explorer"), version, ki18n(description), KAboutData::License_GPL, ki18n("(c) 2006, The KDE Team")); aboutData.addAuthor(ki18n("Aaron J. Seigo"), ki18n( "Author and maintainer" ), "aseigo@kde.org"); aboutData.setProgramIconName("plasma"); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineOptions options; options.add("list", ki18n("Displays a list of known engines and their descriptions")); options.add("height ", ki18n("The desired height in pixels")); options.add("width ", ki18n("The desired width in pixels")); options.add("x ", ki18n("The desired x position in pixels")); options.add("y ", ki18n("The desired y position in pixels")); options.add("engine ", ki18n("The data engine to use")); options.add("source ", ki18n("The source to request")); options.add("interval ", ki18n("Update interval in milliseconds")); options.add("app ", ki18n("Only show engines associated with the parent application; " "maps to the X-KDE-ParentApp entry in the DataEngine's .desktop file.")); KCmdLineArgs::addCmdLineOptions(options); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); if (args->isSet("list")) { listEngines(); return 0; } KApplication app; EngineExplorer* w = new EngineExplorer; bool ok1, ok2 = false; //get size int x = args->getOption("height").toInt(&ok1); int y = args->getOption("width").toInt(&ok2); if (ok1 && ok2) { w->resize(x,y); } //get pos if available x = args->getOption("x").toInt(&ok1); y = args->getOption("y").toInt(&ok2); if (ok1 && ok2) { w->move(x,y); } //set interval int interval = args->getOption("interval").toInt(&ok1); if (ok1) { w->setInterval(interval); } //set engine QString engine = args->getOption("engine"); if (!engine.isEmpty()) { w->setEngine(engine); QString source = args->getOption("source"); if (!source.isEmpty()) { w->requestSource(source); } } if (args->isSet("app")) { w->setApp(args->getOption("app")); } args->clear(); w->show(); return app.exec(); } plasmate-1.0/engineexplorer/PaxHeaders.5990/ktreeviewsearchline.h0000644000175000001440000000013212115142004023361 xustar000000000000000030 mtime=1362412548.609641275 30 atime=1362412548.609641275 30 ctime=1362412548.609641275 plasmate-1.0/engineexplorer/ktreeviewsearchline.h0000644000175000001440000002335212115142004024023 0ustar00kokeroulisusers00000000000000/* Copyright (c) 2003 Scott Wheeler Copyright (c) 2005 Rafal Rzepecki Copyright (c) 2006 Hamish Rodda Copyright 2007 Pino Toscano 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. */ #ifndef KTREEVIEWSEARCHLINE_H #define KTREEVIEWSEARCHLINE_H #include class QModelIndex; class QTreeView; /** * This class makes it easy to add a search line for filtering the items in * listviews based on a simple text search. * * No changes to the application other than instantiating this class with * appropriate QTreeViews should be needed. */ class KTreeViewSearchLine : public KLineEdit { Q_OBJECT Q_PROPERTY( Qt::CaseSensitivity caseSensitity READ caseSensitivity WRITE setCaseSensitivity ) Q_PROPERTY( bool keepParentsVisible READ keepParentsVisible WRITE setKeepParentsVisible ) public: /** * Constructs a KTreeViewSearchLine with \a treeView being the QTreeView to * be filtered. * * If \a treeView is null then the widget will be disabled until listviews * are set with setTreeView(), setTreeViews() or added with addTreeView(). */ explicit KTreeViewSearchLine( QWidget *parent = 0, QTreeView *treeView = 0 ); /** * Constructs a KTreeViewSearchLine with \a treeViews being the list of * pointers to QTreeViews to be filtered. * * If \a treeViews is empty then the widget will be disabled until listviews * are set with setTreeView(), setTreeViews() or added with addTreeView(). */ KTreeViewSearchLine( QWidget *parent, const QList &treeViews ); /** * Destroys the KTreeViewSearchLine. */ virtual ~KTreeViewSearchLine(); /** * Returns true if the search is case sensitive. This defaults to false. * * @see setCaseSensitive() */ Qt::CaseSensitivity caseSensitivity() const; /** * Returns the current list of columns that will be searched. If the * returned list is empty all visible columns will be searched. * * @see setSearchColumns */ QList searchColumns() const; /** * If this is true (the default) then the parents of matched items will also * be shown. * * @see setKeepParentsVisible() */ bool keepParentsVisible() const; /** * Returns the listview that is currently filtered by the search. * If there are multiple listviews filtered, it returns 0. * * @see setTreeView(), treeView() */ QTreeView *treeView() const; /** * Returns the list of pointers to listviews that are currently filtered by * the search. * * @see setTreeViews(), addTreeView(), treeView() */ QList treeViews() const; public Q_SLOTS: /** * Adds a QTreeView to the list of listviews filtered by this search line. * If \a treeView is null then the widget will be disabled. * * @see treeView(), setTreeViews(), removeTreeView() */ void addTreeView( QTreeView *treeView ); /** * Removes a QTreeView from the list of listviews filtered by this search * line. Does nothing if \a treeView is 0 or is not filtered by the quick search * line. * * @see listVew(), setTreeView(), addTreeView() */ void removeTreeView( QTreeView *treeView ); /** * Updates search to only make visible the items that match \a pattern. If * \a s is null then the line edit's text will be used. */ virtual void updateSearch( const QString &pattern = QString() ); /** * Make the search case sensitive or case insensitive. * * @see caseSenstivity() */ void setCaseSensitivity( Qt::CaseSensitivity caseSensitivity ); /** * When a search is active on a list that's organized into a tree view if * a parent or ancesestor of an item is does not match the search then it * will be hidden and as such so too will any children that match. * * If this is set to true (the default) then the parents of matching items * will be shown. * * @see keepParentsVisible */ void setKeepParentsVisible( bool value ); /** * Sets the list of columns to be searched. The default is to search all, * visible columns which can be restored by passing \a columns as an empty * list. * If listviews to be filtered have different numbers or labels of columns * this method has no effect. * * @see searchColumns */ void setSearchColumns( const QList &columns ); /** * Sets the QTreeView that is filtered by this search line, replacing any * previously filtered listviews. If \a treeView is null then the widget will be * disabled. * * @see treeView(), setTreeViews() */ void setTreeView( QTreeView *treeView ); /** * Sets QTreeViews that are filtered by this search line, replacing any * previously filtered listviews. If \a treeViews is empty then the widget will * be disabled. * * @see treeViews(), addTreeView(), setTreeView() */ void setTreeViews( const QList &treeViews ); protected: /** * Returns true if \a item matches the search \a pattern. This will be evaluated * based on the value of caseSensitive(). This can be overridden in * subclasses to implement more complicated matching schemes. */ virtual bool itemMatches( const QModelIndex &item, int row, const QString &pattern ) const; /** * Re-implemented for internal reasons. API not affected. */ virtual void contextMenuEvent( QContextMenuEvent* ); /** * Updates search to only make visible appropriate items in \a treeView. If * \a treeView is null then nothing is done. */ virtual void updateSearch( QTreeView *treeView ); /** * Connects signals of this listview to the appropriate slots of the search * line. */ virtual void connectTreeView( QTreeView* ); /** * Disconnects signals of a listviews from the search line. */ virtual void disconnectTreeView( QTreeView* ); /** * Checks columns in all listviews and decides whether choosing columns to * filter on makes any sense. * * Returns false if either of the following is true: * * there are no listviews connected, * * the listviews have different numbers of columns, * * the listviews have only one column, * * the listviews differ in column labels. * * Otherwise it returns true. * * @see setSearchColumns() */ virtual bool canChooseColumnsCheck(); protected Q_SLOTS: /** * When keys are pressed a new search string is created and a timer is * activated. The most recent search is activated when this timer runs out * if another key has not yet been pressed. * * This method makes @param search the most recent search and starts the * timer. * * Together with activateSearch() this makes it such that searches are not * started until there is a short break in the users typing. * * @see activateSearch() */ void queueSearch( const QString &search ); /** * When the timer started with queueSearch() expires this slot is called. * If there has been another timer started then this slot does nothing. * However if there are no other pending searches this starts the list view * search. * * @see queueSearch() */ void activateSearch(); private: class Private; Private* const d; Q_PRIVATE_SLOT( d, void rowsInserted( const QModelIndex&, int, int ) const ) Q_PRIVATE_SLOT( d, void treeViewDeleted( QObject* ) ) Q_PRIVATE_SLOT( d, void slotColumnActivated( QAction* ) ) Q_PRIVATE_SLOT( d, void slotAllVisibleColumns() ) }; /** * Creates a widget featuring a KTreeViewSearchLine, a label with the text * "Search" and a button to clear the search. */ class KTreeViewSearchLineWidget : public QWidget { Q_OBJECT public: /** * Creates a KTreeViewSearchLineWidget for \a treeView with \a parent as the * parent. */ explicit KTreeViewSearchLineWidget( QWidget *parent = 0, QTreeView *treeView = 0 ); /** * Destroys the KTreeViewSearchLineWidget */ ~KTreeViewSearchLineWidget(); /** * Returns a pointer to the search line. */ KTreeViewSearchLine *searchLine() const; protected Q_SLOTS: /** * Creates the widgets inside of the widget. This is called from the * constructor via a single shot timer so that it it guaranteed to run * after construction is complete. This makes it suitable for overriding in * subclasses. */ virtual void createWidgets(); protected: /** * Creates the search line. This can be useful to reimplement in cases where * a KTreeViewSearchLine subclass is used. * * It is const because it is be called from searchLine(), which to the user * doesn't conceptually alter the widget. */ virtual KTreeViewSearchLine *createSearchLine( QTreeView *treeView ) const; private: class Private; Private* const d; }; #endif plasmate-1.0/engineexplorer/PaxHeaders.5990/serviceviewer.h0000644000175000001440000000012712115142004022204 xustar000000000000000029 mtime=1362412548.61064126 29 atime=1362412548.61064126 29 ctime=1362412548.61064126 plasmate-1.0/engineexplorer/serviceviewer.h0000644000175000001440000000304712115142004022641 0ustar00kokeroulisusers00000000000000/* * Copyright 2008 Aaron Seigo * * 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, * 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. */ #ifndef SERVICEVIEWER_H #define SERVICEVIEWER_H #include #include "ui_serviceviewer.h" class KJob; namespace Plasma { class DataEngine; class Service; } // namespace Plasma class ServiceViewer : public KDialog, public Ui::ServiceViewer { Q_OBJECT public: ServiceViewer(Plasma::DataEngine *engine, const QString &m_source, QWidget *parent = 0); ~ServiceViewer(); private: void updateJobCount(int numberOfJobs); private slots: void updateOperations(); void startOperation(); void operationSelected(const QString &operation); void operationResult(KJob *job); void engineDestroyed(); private: Plasma::DataEngine *m_engine; Plasma::Service *m_service; QString m_source; int m_operationCount; }; #endif plasmate-1.0/engineexplorer/PaxHeaders.5990/man-plasmaengineexplorer.1.docbook0000644000175000001440000000013212115142004025643 xustar000000000000000030 mtime=1362412548.609641275 30 atime=1362412548.609641275 30 ctime=1362412548.609641275 plasmate-1.0/engineexplorer/man-plasmaengineexplorer.1.docbook0000644000175000001440000001253712115142004026310 0ustar00kokeroulisusers00000000000000 ]> KDE User's Manual 2010-10-06 K Desktop Environment plasmaengineexplorer 1 plasmaengineexplorer Provides direct access to plasma data engines plasmaengineexplorer pixels pixels pixels pixels data engine data engine ms application plasmaengineexplorer KDE Generic Options Qt Generic Options Description plasmaengineexplorer is a graphical tool allowing developers to test Plasma data engines without writing a Plasma applet. If no options are given, it will start without any data engine selected. The required data engine can be selected from a drop-down list. Only installed data engines will be found. kbuildsycoca4 may need to be run for newly-installed data engines to be found. Options Displays a list of known engines and their descriptions. Sets the height of the window, in pixels. Sets the width of the window, in pixels. Sets the x (horizontal) co-ordinate of the top left corner of the window, in pixels. Sets the y (vertical) co-ordinate of the top left corner of the window, in pixels. Start plasmaengineexplorer with the given data engine selected. data engine is the internal name of the data engine given by the X-KDE-PluginInfo-Name key of the desktop file. Only valid in conjunction with . Requests a specific source from the data engine when plasmaengineexplorer is started. Sets the default update interval for requested sources to time milliseconds. If not set, the source will update on demand (for some sources, this will be when new data is available). If is specified, this is the update interval that will be used when requesting that source. Only show engines associated with the parent application; maps to the X-KDE-ParentApp entry in the DataEngine's .desktop file. See Also More detailed user documentation is available from help:/plasma-desktop (either enter this URL into &konqueror;, or run khelpcenter help:/plasma-desktop). Examples Load the time data engine, showing the local time and updating every second: plasmaengineexplorer Authors plasmaengineexplorer was written by AaronSeigo aseigo@kde.org. plasmate-1.0/engineexplorer/PaxHeaders.5990/engineexplorer.ui0000644000175000001440000000013212115142004022532 xustar000000000000000030 mtime=1362412548.609641275 30 atime=1362412548.609641275 30 ctime=1362412548.609641275 plasmate-1.0/engineexplorer/engineexplorer.ui0000644000175000001440000001166612115142004023201 0ustar00kokeroulisusers00000000000000 EngineExplorer 0 0 374 207 Plasma DataEngine Explorer false 100 0 Source name true false 130 0 Update on demand ms Update every 0 10000000 50 0 false Request Source false 120 0 Service for source true false Request Service for Source QAbstractItemView::NoEditTriggers true KLineEdit QLineEdit
klineedit.h
KIntSpinBox QSpinBox
knuminput.h
KTitleWidget QWidget
ktitlewidget.h
KTreeViewSearchLine QWidget
ktreeviewsearchline.h
TitleComboBox QComboBox
titlecombobox.h
m_engines m_sourceRequester m_updateInterval m_sourceRequesterButton m_serviceRequester m_serviceRequesterButton m_data m_updateInterval editingFinished() m_sourceRequesterButton animateClick() 375 91 447 94
plasmate-1.0/engineexplorer/PaxHeaders.5990/ktreeviewsearchline.cpp0000644000175000001440000000013212115142004023714 xustar000000000000000030 mtime=1362412548.609641275 30 atime=1362412548.609641275 30 ctime=1362412548.609641275 plasmate-1.0/engineexplorer/ktreeviewsearchline.cpp0000644000175000001440000004174712115142004024366 0ustar00kokeroulisusers00000000000000/* Copyright (c) 2003 Scott Wheeler Copyright (c) 2005 Rafal Rzepecki Copyright (c) 2006 Hamish Rodda Copyright 2007 Pino Toscano 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 "ktreeviewsearchline.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class KTreeViewSearchLine::Private { public: Private( KTreeViewSearchLine *_parent ) : parent( _parent ), caseSensitive( Qt::CaseInsensitive ), activeSearch( false ), keepParentsVisible( true ), canChooseColumns( true ), queuedSearches( 0 ) { } KTreeViewSearchLine *parent; QList treeViews; Qt::CaseSensitivity caseSensitive; bool activeSearch; bool keepParentsVisible; bool canChooseColumns; QString search; int queuedSearches; QList searchColumns; void rowsInserted(const QModelIndex & parent, int start, int end) const; void treeViewDeleted( QObject *treeView ); void slotColumnActivated(QAction* action); void slotAllVisibleColumns(); void checkColumns(); void checkItemParentsNotVisible(QTreeView *treeView); bool checkItemParentsVisible(QTreeView *treeView, const QModelIndex &index); }; //////////////////////////////////////////////////////////////////////////////// // private slots //////////////////////////////////////////////////////////////////////////////// void KTreeViewSearchLine::Private::rowsInserted( const QModelIndex & parentIndex, int start, int end ) const { QAbstractItemModel* model = qobject_cast( parent->sender() ); if ( !model ) return; QTreeView* widget = 0L; foreach ( QTreeView* tree, treeViews ) if ( tree->model() == model ) { widget = tree; break; } if ( !widget ) return; for ( int i = start; i <= end; ++i ) { widget->setRowHidden( i, parentIndex, !parent->itemMatches( parentIndex, i, parent->text() ) ); } } void KTreeViewSearchLine::Private::treeViewDeleted( QObject *object ) { treeViews.removeAll( static_cast( object ) ); parent->setEnabled( treeViews.isEmpty() ); } void KTreeViewSearchLine::Private::slotColumnActivated( QAction *action ) { if ( !action ) return; bool ok; int column = action->data().toInt( &ok ); if ( !ok ) return; if ( action->isChecked() ) { if ( !searchColumns.isEmpty() ) { if ( !searchColumns.contains( column ) ) searchColumns.append( column ); if ( searchColumns.count() == treeViews.first()->header()->count() - treeViews.first()->header()->hiddenSectionCount() ) searchColumns.clear(); } else { searchColumns.append( column ); } } else { if ( searchColumns.isEmpty() ) { QHeaderView* const header = treeViews.first()->header(); for ( int i = 0; i < header->count(); i++ ) { if ( i != column && !header->isSectionHidden( i ) ) searchColumns.append( i ); } } else if ( searchColumns.contains( column ) ) { searchColumns.removeAll( column ); } } parent->updateSearch(); } void KTreeViewSearchLine::Private::slotAllVisibleColumns() { if ( searchColumns.isEmpty() ) searchColumns.append( 0 ); else searchColumns.clear(); parent->updateSearch(); } //////////////////////////////////////////////////////////////////////////////// // private methods //////////////////////////////////////////////////////////////////////////////// void KTreeViewSearchLine::Private::checkColumns() { canChooseColumns = parent->canChooseColumnsCheck(); } void KTreeViewSearchLine::Private::checkItemParentsNotVisible( QTreeView *treeView ) { Q_UNUSED(treeView) // TODO: PORT ME #if 0 QTreeWidgetItemIterator it( treeWidget ); for ( ; *it; ++it ) { QTreeWidgetItem *item = *it; item->treeWidget()->setItemHidden( item, !parent->itemMatches( item, search ) ); } #endif } /** Check whether \p item, its siblings and their descendents should be shown. Show or hide the items as necessary. * * \p item The list view item to start showing / hiding items at. Typically, this is the first child of another item, or the * the first child of the list view. * \return \c true if an item which should be visible is found, \c false if all items found should be hidden. If this function * returns true and \p highestHiddenParent was not 0, highestHiddenParent will have been shown. */ bool KTreeViewSearchLine::Private::checkItemParentsVisible( QTreeView *treeView, const QModelIndex &index ) { bool childMatch = false; const int rowcount = treeView->model()->rowCount( index ); for ( int i = 0; i < rowcount; ++i ) childMatch |= checkItemParentsVisible( treeView, treeView->model()->index( i, 0, index ) ); // Should this item be shown? It should if any children should be, or if it matches. const QModelIndex parentindex = index.parent(); if ( childMatch || parent->itemMatches( parentindex, index.row(), search ) ) { treeView->setRowHidden( index.row(), parentindex, false ); return true; } treeView->setRowHidden( index.row(), parentindex, true ); return false; } //////////////////////////////////////////////////////////////////////////////// // public methods //////////////////////////////////////////////////////////////////////////////// KTreeViewSearchLine::KTreeViewSearchLine( QWidget *parent, QTreeView *treeView ) : KLineEdit( parent ), d( new Private( this ) ) { connect( this, SIGNAL(textChanged(QString)), this, SLOT(queueSearch(QString)) ); setClearButtonShown( true ); setTreeView( treeView ); if ( !treeView ) { setEnabled( false ); } } KTreeViewSearchLine::KTreeViewSearchLine( QWidget *parent, const QList &treeViews ) : KLineEdit( parent ), d( new Private( this ) ) { connect( this, SIGNAL(textChanged(QString)), this, SLOT(queueSearch(QString)) ); setClearButtonShown( true ); setTreeViews( treeViews ); } KTreeViewSearchLine::~KTreeViewSearchLine() { delete d; } Qt::CaseSensitivity KTreeViewSearchLine::caseSensitivity() const { return d->caseSensitive; } QList KTreeViewSearchLine::searchColumns() const { if ( d->canChooseColumns ) return d->searchColumns; else return QList(); } bool KTreeViewSearchLine::keepParentsVisible() const { return d->keepParentsVisible; } QTreeView *KTreeViewSearchLine::treeView() const { if ( d->treeViews.count() == 1 ) return d->treeViews.first(); else return 0; } QList KTreeViewSearchLine::treeViews() const { return d->treeViews; } //////////////////////////////////////////////////////////////////////////////// // public slots //////////////////////////////////////////////////////////////////////////////// void KTreeViewSearchLine::addTreeView( QTreeView *treeView ) { if ( treeView ) { connectTreeView( treeView ); d->treeViews.append( treeView ); setEnabled( !d->treeViews.isEmpty() ); d->checkColumns(); } } void KTreeViewSearchLine::removeTreeView( QTreeView *treeView ) { if ( treeView ) { int index = d->treeViews.indexOf( treeView ); if ( index != -1 ) { d->treeViews.removeAt( index ); d->checkColumns(); disconnectTreeView( treeView ); setEnabled( !d->treeViews.isEmpty() ); } } } void KTreeViewSearchLine::updateSearch( const QString &pattern ) { d->search = pattern.isNull() ? text() : pattern; foreach ( QTreeView* treeView, d->treeViews ) updateSearch( treeView ); } void KTreeViewSearchLine::updateSearch( QTreeView *treeView ) { if ( !treeView || !treeView->model()->rowCount() ) return; // If there's a selected item that is visible, make sure that it's visible // when the search changes too (assuming that it still matches). QModelIndex currentIndex = treeView->currentIndex(); bool wasUpdateEnabled = treeView->updatesEnabled(); treeView->setUpdatesEnabled( false ); if ( d->keepParentsVisible ) for ( int i = 0; i < treeView->model()->rowCount(); ++i ) d->checkItemParentsVisible( treeView, treeView->rootIndex() ); else d->checkItemParentsNotVisible( treeView ); treeView->setUpdatesEnabled( wasUpdateEnabled ); if ( currentIndex.isValid() ) treeView->scrollTo( currentIndex ); } void KTreeViewSearchLine::setCaseSensitivity( Qt::CaseSensitivity caseSensitive ) { if ( d->caseSensitive != caseSensitive ) { d->caseSensitive = caseSensitive; updateSearch(); } } void KTreeViewSearchLine::setKeepParentsVisible( bool visible ) { if ( d->keepParentsVisible != visible ) { d->keepParentsVisible = visible; updateSearch(); } } void KTreeViewSearchLine::setSearchColumns( const QList &columns ) { if ( d->canChooseColumns ) d->searchColumns = columns; } void KTreeViewSearchLine::setTreeView( QTreeView *treeView ) { setTreeViews( QList() ); addTreeView( treeView ); } void KTreeViewSearchLine::setTreeViews( const QList &treeViews ) { foreach ( QTreeView* treeView, d->treeViews ) disconnectTreeView( treeView ); d->treeViews = treeViews; foreach ( QTreeView* treeView, d->treeViews ) connectTreeView( treeView ); d->checkColumns(); setEnabled( !d->treeViews.isEmpty() ); } //////////////////////////////////////////////////////////////////////////////// // protected members //////////////////////////////////////////////////////////////////////////////// bool KTreeViewSearchLine::itemMatches( const QModelIndex &index, int row, const QString &pattern ) const { if ( pattern.isEmpty() ) return true; if ( !index.isValid() ) return false; // If the search column list is populated, search just the columns // specifified. If it is empty default to searching all of the columns. const int columncount = index.model()->columnCount( index ); if ( !d->searchColumns.isEmpty() ) { QList::ConstIterator it = d->searchColumns.constBegin(); for ( ; it != d->searchColumns.constEnd(); ++it ) { if ( *it < columncount && index.child( row, *it ).data( Qt::DisplayRole ).toString().indexOf( pattern, 0, d->caseSensitive ) >= 0 ) return true; } } else { for ( int i = 0; i < columncount; ++i) { if ( index.child( row, i ).data( Qt::DisplayRole ).toString().indexOf( pattern, 0, d->caseSensitive ) >= 0 ) return true; } } return false; } void KTreeViewSearchLine::contextMenuEvent( QContextMenuEvent *event ) { QMenu *popup = KLineEdit::createStandardContextMenu(); if ( d->canChooseColumns ) { popup->addSeparator(); QMenu *subMenu = popup->addMenu( i18n("Search Columns") ); QAction* allVisibleColumnsAction = subMenu->addAction( i18n("All Visible Columns"), this, SLOT(slotAllVisibleColumns()) ); allVisibleColumnsAction->setCheckable( true ); allVisibleColumnsAction->setChecked( !d->searchColumns.count() ); subMenu->addSeparator(); bool allColumnsAreSearchColumns = true; QActionGroup* group = new QActionGroup( popup ); group->setExclusive( false ); connect( group, SIGNAL(triggered(QAction*)), SLOT(slotColumnActivated(QAction*)) ); QHeaderView* const header = d->treeViews.first()->header(); for ( int j = 0; j < header->count(); j++ ) { int i = header->logicalIndex( j ); if ( header->isSectionHidden( i ) ) continue; QString columnText = header->model()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString(); QAction* columnAction = subMenu->addAction( qvariant_cast( header->model()->headerData( i, Qt::Horizontal, Qt::DecorationRole ) ), columnText ); columnAction->setCheckable( true ); columnAction->setChecked( d->searchColumns.isEmpty() || d->searchColumns.contains( i ) ); columnAction->setData( i ); columnAction->setActionGroup( group ); if ( d->searchColumns.isEmpty() || d->searchColumns.indexOf( i ) != -1 ) columnAction->setChecked( true ); else allColumnsAreSearchColumns = false; } allVisibleColumnsAction->setChecked( allColumnsAreSearchColumns ); // searchColumnsMenuActivated() relies on one possible "all" representation if ( allColumnsAreSearchColumns && !d->searchColumns.isEmpty() ) d->searchColumns.clear(); } popup->exec( event->globalPos() ); delete popup; } void KTreeViewSearchLine::connectTreeView( QTreeView *treeView ) { connect( treeView, SIGNAL(destroyed(QObject*)), this, SLOT(treeViewDeleted(QObject*)) ); connect( treeView->model(), SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(rowsInserted(QModelIndex,int,int)) ); } void KTreeViewSearchLine::disconnectTreeView( QTreeView *treeView ) { disconnect( treeView, SIGNAL(destroyed(QObject*)), this, SLOT(treeViewDeleted(QObject*)) ); disconnect( treeView->model(), SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(rowsInserted(QModelIndex,int,int)) ); } bool KTreeViewSearchLine::canChooseColumnsCheck() { // This is true if either of the following is true: // there are no listviews connected if ( d->treeViews.isEmpty() ) return false; const QTreeView *first = d->treeViews.first(); const int numcols = first->model()->columnCount(); // the listviews have only one column, if ( numcols < 2 ) return false; QStringList headers; for ( int i = 0; i < numcols; ++i ) headers.append( first->header()->model()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString() ); QList::ConstIterator it = d->treeViews.constBegin(); for ( ++it /* skip the first one */; it != d->treeViews.constEnd(); ++it ) { // the listviews have different numbers of columns, if ( (*it)->model()->columnCount() != numcols ) return false; // the listviews differ in column labels. QStringList::ConstIterator jt; int i; for ( i = 0, jt = headers.constBegin(); i < numcols; ++i, ++jt ) { Q_ASSERT( jt != headers.constEnd() ); if ( (*it)->header()->model()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString() != *jt ) return false; } } return true; } //////////////////////////////////////////////////////////////////////////////// // protected slots //////////////////////////////////////////////////////////////////////////////// void KTreeViewSearchLine::queueSearch( const QString &search ) { d->queuedSearches++; d->search = search; QTimer::singleShot( 200, this, SLOT(activateSearch()) ); } void KTreeViewSearchLine::activateSearch() { --(d->queuedSearches); if ( d->queuedSearches == 0 ) updateSearch( d->search ); } //////////////////////////////////////////////////////////////////////////////// // KTreeViewSearchLineWidget //////////////////////////////////////////////////////////////////////////////// class KTreeViewSearchLineWidget::Private { public: Private() : treeView( 0 ), searchLine( 0 ) { } QTreeView *treeView; KTreeViewSearchLine *searchLine; }; KTreeViewSearchLineWidget::KTreeViewSearchLineWidget( QWidget *parent, QTreeView *treeView ) : QWidget( parent ), d( new Private ) { d->treeView = treeView; QTimer::singleShot( 0, this, SLOT(createWidgets()) ); } KTreeViewSearchLineWidget::~KTreeViewSearchLineWidget() { delete d; } KTreeViewSearchLine *KTreeViewSearchLineWidget::createSearchLine( QTreeView *treeView ) const { return new KTreeViewSearchLine( const_cast(this), treeView ); } void KTreeViewSearchLineWidget::createWidgets() { QLabel *label = new QLabel( i18n("S&earch:"), this ); label->setObjectName( QLatin1String("kde toolbar widget") ); searchLine()->show(); label->setBuddy( d->searchLine ); label->show(); QHBoxLayout* layout = new QHBoxLayout( this ); layout->setSpacing( 5 ); layout->setMargin( 0 ); layout->addWidget( label ); layout->addWidget( d->searchLine ); } KTreeViewSearchLine *KTreeViewSearchLineWidget::searchLine() const { if ( !d->searchLine ) d->searchLine = createSearchLine( d->treeView ); return d->searchLine; } #include "ktreeviewsearchline.moc" plasmate-1.0/PaxHeaders.5990/wallpaperviewer0000644000175000001440000000013212115142004017253 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.636641028 30 ctime=1362412548.623641145 plasmate-1.0/wallpaperviewer/0000755000175000001440000000000012115142004017765 5ustar00kokeroulisusers00000000000000plasmate-1.0/wallpaperviewer/PaxHeaders.5990/wallpaperwidget.cpp0000644000175000001440000000013212115142004023227 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/wallpaperviewer/wallpaperwidget.cpp0000644000175000001440000002122312115142004023664 0ustar00kokeroulisusers00000000000000/* * Copyright 2009 Aaron Seigo * * 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, * 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. */ #include "wallpaperwidget.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include WallpaperWidget::WallpaperWidget(const QString &paper, const QString &mode, QWidget *parent) : QWidget(parent), m_wallpaper(Plasma::Wallpaper::load(paper)), m_configDialog(0) { if (m_wallpaper) { if (!mode.isEmpty()) { m_wallpaper->setRenderingMode(mode); } connect(m_wallpaper, SIGNAL(update(QRectF)), this, SLOT(updatePaper(QRectF))); connect(m_wallpaper, SIGNAL(configNeedsSaving()), this, SLOT(syncConfig())); } addAction(KStandardAction::quit(this, SLOT(quit()), this)); KGlobal::ref(); } WallpaperWidget::~WallpaperWidget() { } void WallpaperWidget::quit() { close(); } void WallpaperWidget::closeEvent(QCloseEvent *) { if (m_wallpaper && m_wallpaper->isInitialized()) { KConfigGroup config = configGroup(); m_wallpaper->save(config); delete m_wallpaper; m_wallpaper = 0; } KGlobal::deref(); } void WallpaperWidget::paintEvent(QPaintEvent *event) { if (m_wallpaper) { if (!m_wallpaper->isInitialized()) { // delayed paper initialization m_wallpaper->restore(configGroup()); } QPainter p(this); m_wallpaper->paint(&p, event->rect()); } } void WallpaperWidget::resizeEvent(QResizeEvent *event) { Q_UNUSED(event) if (m_wallpaper) { m_wallpaper->setBoundingRect(rect()); } } void WallpaperWidget::mousePressEvent(QMouseEvent *event) { if (m_wallpaper && m_wallpaper->isInitialized()) { m_mousePressPoint = event->pos(); m_mousePressScreenPoint = event->globalPos(); m_mouseMovePoint = m_mousePressPoint; m_mouseMoveScreenPoint = m_mousePressScreenPoint; QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMousePress); mouseEvent.setWidget(this); mouseEvent.setButtonDownScenePos(event->button(), event->pos()); mouseEvent.setButtonDownScreenPos(event->button(), event->pos()); mouseEvent.setScenePos(m_mousePressPoint); mouseEvent.setScreenPos(m_mousePressScreenPoint); mouseEvent.setLastScenePos(m_mousePressPoint); mouseEvent.setLastScreenPos(m_mousePressScreenPoint); mouseEvent.setButtons(event->buttons()); mouseEvent.setButton(event->button()); mouseEvent.setModifiers(event->modifiers()); mouseEvent.setAccepted(false); m_wallpaper->mousePressEvent(&mouseEvent); if (mouseEvent.isAccepted()) { return; } } QWidget::mousePressEvent(event); } void WallpaperWidget::mouseMoveEvent(QMouseEvent *event) { if (m_wallpaper && m_wallpaper->isInitialized()) { QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMousePress); mouseEvent.setWidget(this); mouseEvent.setButtonDownScenePos(event->button(), m_mousePressPoint); mouseEvent.setButtonDownScreenPos(event->button(), m_mousePressScreenPoint); mouseEvent.setScenePos(event->pos()); mouseEvent.setScreenPos(event->globalPos()); mouseEvent.setLastScenePos(m_mouseMovePoint); mouseEvent.setLastScreenPos(m_mouseMoveScreenPoint); mouseEvent.setButtons(event->buttons()); mouseEvent.setButton(event->button()); mouseEvent.setModifiers(event->modifiers()); mouseEvent.setAccepted(false); m_mouseMovePoint = event->pos(); m_mouseMoveScreenPoint = event->globalPos(); m_wallpaper->mouseMoveEvent(&mouseEvent); if (mouseEvent.isAccepted()) { return; } } QWidget::mouseMoveEvent(event); } void WallpaperWidget::mouseReleaseEvent(QMouseEvent *event) { if (m_wallpaper && m_wallpaper->isInitialized()) { QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMouseRelease); mouseEvent.setWidget(this); mouseEvent.setButtonDownScenePos(event->button(), m_mousePressPoint); mouseEvent.setButtonDownScreenPos(event->button(), m_mousePressScreenPoint); mouseEvent.setScenePos(event->pos()); mouseEvent.setScreenPos(event->globalPos()); mouseEvent.setLastScenePos(m_mouseMovePoint); mouseEvent.setLastScreenPos(m_mouseMoveScreenPoint); mouseEvent.setButtons(event->buttons()); mouseEvent.setButton(event->button()); mouseEvent.setModifiers(event->modifiers()); mouseEvent.setAccepted(false); m_wallpaper->mouseReleaseEvent(&mouseEvent); if (mouseEvent.isAccepted()) { return; } } QWidget::mouseReleaseEvent(event); } void WallpaperWidget::wheelEvent(QWheelEvent *event) { if (m_wallpaper && m_wallpaper->isInitialized()) { QGraphicsSceneWheelEvent wheelEvent(QEvent::GraphicsSceneWheel); wheelEvent.setWidget(this); wheelEvent.setScenePos(event->pos()); wheelEvent.setScreenPos(event->globalPos()); wheelEvent.setButtons(event->buttons()); wheelEvent.setModifiers(event->modifiers()); wheelEvent.setDelta(event->delta()); wheelEvent.setOrientation(event->orientation()); wheelEvent.setAccepted(false); m_wallpaper->wheelEvent(&wheelEvent); if (wheelEvent.isAccepted()) { return; } } QWidget::wheelEvent(event); } void WallpaperWidget::contextMenuEvent(QContextMenuEvent *event) { QMenu m; if (m_wallpaper) { QList actions = m_wallpaper->contextualActions(); foreach (QAction *action, actions) { m.addAction(action); } if (actions.count() > 1) { m.addSeparator(); } } m.addAction(KStandardAction::preferences(this, SLOT(configure()), &m)); m.exec(event->globalPos()); } void WallpaperWidget::updatePaper(const QRectF &exposedRect) { update(exposedRect.toRect()); } void WallpaperWidget::configure() { if (m_wallpaper) { if (!m_wallpaper->isInitialized()) { // delayed paper initialization m_wallpaper->restore(configGroup()); } if (!m_configDialog) { m_configDialog = new KDialog(this); m_configDialog->setCaption(i18n("Configure %1 Wallpaper", m_wallpaper->name())); m_configDialog->setButtons(KDialog::Ok | KDialog::Apply | KDialog::Cancel); QWidget *w = new WallpaperConfigWidget(m_configDialog); QVBoxLayout *layout = new QVBoxLayout(w); layout->addWidget(m_wallpaper->createConfigurationInterface(w)); m_configDialog->setMainWidget(w); connect(w, SIGNAL(modified(bool)), m_configDialog, SLOT(enableButtonApply(bool))); connect(m_configDialog, SIGNAL(applyClicked()), this, SLOT(saveConfig())); connect(m_configDialog, SIGNAL(okClicked()), this, SLOT(saveConfig())); connect(m_configDialog, SIGNAL(finished()), this, SLOT(configDone())); } m_configDialog->show(); m_configDialog->raise(); } } void WallpaperWidget::saveConfig() { if (m_wallpaper) { KConfigGroup config = configGroup(); m_wallpaper->save(config); m_wallpaper->restore(config); } } void WallpaperWidget::syncConfig() { KGlobal::config()->sync(); } void WallpaperWidget::configDone() { m_configDialog->deleteLater(); m_configDialog = 0; } KConfigGroup WallpaperWidget::configGroup() { KConfigGroup wallpaperConfig(KGlobal::config(), "Wallpaper"); if (m_wallpaper) { wallpaperConfig = KConfigGroup(&wallpaperConfig, m_wallpaper->pluginName()); } return wallpaperConfig; } #include "wallpaperwidget.moc" plasmate-1.0/wallpaperviewer/PaxHeaders.5990/wallpaperwidget.h0000644000175000001440000000013212115142004022674 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/wallpaperviewer/wallpaperwidget.h0000644000175000001440000000454412115142004023340 0ustar00kokeroulisusers00000000000000/* * Copyright 2009 Aaron Seigo * * 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, * 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. */ #ifndef WALLPAPERWIDGET_H #define WALLPAPERWIDGET_H #include #include class KDialog; namespace Plasma { class Wallpaper; } // namespace Plasma class WallpaperWidget : public QWidget { Q_OBJECT public: WallpaperWidget(const QString &paper, const QString &mode, QWidget *parent = 0); ~WallpaperWidget(); void configure(); protected: void closeEvent(QCloseEvent *event); void paintEvent(QPaintEvent *event); void resizeEvent(QResizeEvent *event); void mouseMoveEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); void wheelEvent(QWheelEvent *event); void contextMenuEvent(QContextMenuEvent *event); protected Q_SLOTS: void quit(); void updatePaper(const QRectF &exposedRect); void saveConfig(); void configDone(); void syncConfig(); private: KConfigGroup configGroup(); Plasma::Wallpaper *m_wallpaper; KDialog *m_configDialog; QPoint m_mousePressPoint; QPoint m_mousePressScreenPoint; QPoint m_mouseMovePoint; QPoint m_mouseMoveScreenPoint; }; // WallpaperConfigWidget is passed the wallpaper // in createConfigurationInterface so it can notify // of changes (used to enable the apply button) class WallpaperConfigWidget :public QWidget { Q_OBJECT public: WallpaperConfigWidget(QWidget *parent) : QWidget(parent) { } signals: void modified(bool isModified); public slots: void settingsChanged(bool isModified) { emit modified(isModified); } }; #endif plasmate-1.0/wallpaperviewer/PaxHeaders.5990/Messages.sh0000644000175000001440000000013212115142004021433 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/wallpaperviewer/Messages.sh0000755000175000001440000000010012115142004022062 0ustar00kokeroulisusers00000000000000#! /bin/sh $XGETTEXT *.cpp -o $podir/plasmawallpaperviewer.pot plasmate-1.0/wallpaperviewer/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004022070 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/wallpaperviewer/CMakeLists.txt0000644000175000001440000000043312115142004022525 0ustar00kokeroulisusers00000000000000set(plasmawallpaperviewer_SRCS main.cpp wallpaperwidget.cpp ) kde4_add_executable(plasmawallpaperviewer ${plasmawallpaperviewer_SRCS}) target_link_libraries(plasmawallpaperviewer ${KDE4_PLASMA_LIBS}) install(TARGETS plasmawallpaperviewer ${INSTALL_TARGETS_DEFAULT_ARGS}) plasmate-1.0/wallpaperviewer/PaxHeaders.5990/main.cpp0000644000175000001440000000013212115142004020760 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/wallpaperviewer/main.cpp0000644000175000001440000001133512115142004021420 0ustar00kokeroulisusers00000000000000/* * Copyright 2009 Aaron Seigo * * 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, * 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. */ #include #include #include #include #include #include #include "wallpaperwidget.h" static const char description[] = I18N_NOOP("Viewer for Plasma wallpapers"); static const char version[] = "0.0"; void listWallpapers() { int maxLen = 0; QMap wallpapers; QHash modes; foreach (const KPluginInfo &info, Plasma::Wallpaper::listWallpaperInfo()) { if (info.property("NoDisplay").toBool()) { continue; } int len = info.pluginName().length(); if (len > maxLen) { maxLen = len; } QString name = info.pluginName(); QString comment = info.comment(); if (comment.isEmpty()) { comment = i18n("No description available"); } wallpapers.insert(name, comment); const QList& modeActions = info.service()->actions(); QStringList modeStrings; if (!modeActions.isEmpty()) { foreach (const KServiceAction& mode, modeActions) { modeStrings << mode.name(); } qStableSort(modeStrings); modes[name] = modeStrings.join(", "); } } QMap::const_iterator it; QString spaces; spaces.fill(' ', maxLen + 3); if (wallpapers.isEmpty()) { std::cout << i18n("No wallpaper plugins installed.").toLocal8Bit().data() << std::endl << std::endl; return; } std::cout << i18n("Installed wallpaper plugins:").toLocal8Bit().data() << std::endl << std::endl; for (it = wallpapers.constBegin(); it != wallpapers.constEnd(); ++it) { QString wallpaper = QString("%1 - %2").arg(it.key().leftJustified(maxLen, ' ')).arg(it.value()); std::cout << wallpaper.toLocal8Bit().data() << std::endl; QString modeString = modes.value(it.key()); if (!modeString.isEmpty()) { std::cout << spaces.toLocal8Bit().data() << i18n("Modes: %1", modeString).toLocal8Bit().data() << std::endl; } } } int main(int argc, char **argv) { KAboutData aboutData("plasmawallpaperviewer", 0, ki18n("Plasma Wallpaper Viewer"), version, ki18n(description), KAboutData::License_GPL, ki18n("(c) 2009, Aaron J. Seigo")); aboutData.addAuthor(ki18n("Aaron J. Seigo"), ki18n( "Author and maintainer" ), "aseigo@kde.org"); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineOptions options; options.add("h"); options.add("height ", ki18n("The desired height in pixels")); options.add("w"); options.add("width ", ki18n("The desired width in pixels")); options.add("p"); options.add("wallpaper ", ki18n("The wallpaper plugin to use"), "image"); options.add("m"); options.add("mode ", ki18n("The mode to put the wallpaper in"), "SingleImage"); options.add("list", ki18n("List all the known wallpapers and their modes")); options.add("configure", ki18n("Open configuration dialog additionally to show the wallpaper plugin")); KCmdLineArgs::addCmdLineOptions(options); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); KApplication app; app.setQuitOnLastWindowClosed(false); KGlobal::setAllowQuit(true); if (args->isSet("list")) { listWallpapers(); exit(0); } // set wallpaper QString pluginName = args->getOption("wallpaper"); QString mode = args->getOption("mode"); WallpaperWidget w(pluginName, mode); bool ok1, ok2 = false; // get size int width = args->getOption("width").toInt(&ok2); int height = args->getOption("height").toInt(&ok1); if (ok1 && ok2) { w.resize(width, height); } w.show(); if(args->isSet("configure")) { w.configure(); } args->clear(); return app.exec(); } plasmate-1.0/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004016657 xustar000000000000000030 mtime=1362412548.608641289 30 atime=1362412548.608641289 30 ctime=1362412548.608641289 plasmate-1.0/CMakeLists.txt0000644000175000001440000000060312115142004017313 0ustar00kokeroulisusers00000000000000project(plasma-sdk) find_package(KDE4 REQUIRED) find_package(KDeclarative REQUIRED) include(MacroLibrary) include(KDE4Defaults) include_directories(${KDE4_INCLUDES} ${KDECLARATIVE_INCLUDE_DIR} ) add_subdirectory(engineexplorer) add_subdirectory(plasmoidviewer) add_subdirectory(remote-widgets-browser) add_subdirectory(wallpaperviewer) add_subdirectory(plasmate) plasmate-1.0/PaxHeaders.5990/INSTALL0000644000175000001440000000013212115142004015150 xustar000000000000000030 mtime=1362412548.609641275 30 atime=1362412548.609641275 30 ctime=1362412548.609641275 plasmate-1.0/INSTALL0000644000175000001440000000022012115142004015577 0ustar00kokeroulisusers00000000000000==========How To Install Plasmate============== * cd plasmate * mkdir build/ * cd build/ * cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` plasmate-1.0/PaxHeaders.5990/remote-widgets-browser0000644000175000001440000000013212115142004020462 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.636641028 30 ctime=1362412548.623641145 plasmate-1.0/remote-widgets-browser/0000755000175000001440000000000012115142004021174 5ustar00kokeroulisusers00000000000000plasmate-1.0/remote-widgets-browser/PaxHeaders.5990/main.qml0000644000175000001440000000013212115142004022176 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/remote-widgets-browser/main.qml0000644000175000001440000000563612115142004022645 0ustar00kokeroulisusers00000000000000import QtQuick 1.0 import org.kde.qtextracomponents 0.1 import org.kde.plasma.graphicswidgets 0.1 Rectangle { id: page width: 500; height: 500 color: "white" Component { id: appDelegate Item { width: 200; height: 100 Rectangle { id: background width: parent.width - 2 height: parent.height anchors.centerIn: parent radius: 5 color: "lightsteelblue" opacity: 0 Behavior on opacity { NumberAnimation { duration: 200 easing.type: Easing.InOutCubic } } } QIconItem { id: iconItem width: 64; height: 64 y: 10; anchors.horizontalCenter: parent.horizontalCenter icon: decoration } Text { anchors { top: iconItem.bottom; horizontalCenter: parent.horizontalCenter } text: display width: parent.width - 8 elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter } MouseArea { anchors.fill: parent hoverEnabled: true onClicked: { var point = mapToItem(gridView, mouse.x, mouse.y) var index = gridView.indexAt(point.x, point.y) gridView.currentIndex = index var modelIndex = filterModel.modelIndex(index) if (hasModelChildren) { filterModel.rootIndex = modelIndex } else { plasmaModel.runIndex(modelIndex) } } onEntered: background.opacity = 0.5 onExited: background.opacity = 0 } } } Component { id: appHighlight Rectangle { radius: 5 border.color: "black" border.width: 2 } } Component { id: backBar Rectangle { height: backButton.height + 8 width: parent.width color: "transparent" PushButton { id: backButton anchors.verticalCenter: parent.verticalCenter x: 4 text: i18n("Back") onClicked: { filterModel.rootIndex = filterModel.parentModelIndex } } } } VisualDataModel { id: filterModel model: plasmaModel delegate: appDelegate } GridView { id: gridView anchors.fill: parent cellWidth: 206; cellHeight: 106 header: backBar highlight: appHighlight focus: true model: filterModel } } plasmate-1.0/remote-widgets-browser/PaxHeaders.5990/Messages.sh0000644000175000001440000000013212115142004022642 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/remote-widgets-browser/Messages.sh0000755000175000001440000000012512115142004023300 0ustar00kokeroulisusers00000000000000#! /usr/bin/env bash $XGETTEXT *.cpp *.h *.qml -o $podir/remote-widgets-browser.pot plasmate-1.0/remote-widgets-browser/PaxHeaders.5990/plasmafiltermodel.h0000644000175000001440000000013212115142004024414 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/remote-widgets-browser/plasmafiltermodel.h0000644000175000001440000000270212115142004025052 0ustar00kokeroulisusers00000000000000/* Copyright 2011 Kevin Ottens 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 PLASMAFILTERMODEL_H #define PLASMAFILTERMODEL_H #include class PlasmaFilterModel : public KRecursiveFilterProxyModel { Q_OBJECT public: PlasmaFilterModel(QObject *parent = 0); virtual ~PlasmaFilterModel(); virtual bool filterAcceptsColumn(int sourceColumn, const QModelIndex &sourceParent) const; virtual bool acceptRow(int sourceRow, const QModelIndex &sourceParent) const; public slots: void runIndex(const QModelIndex &index); }; #endif plasmate-1.0/remote-widgets-browser/PaxHeaders.5990/CMakeLists.txt0000644000175000001440000000013212115142004023277 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/remote-widgets-browser/CMakeLists.txt0000644000175000001440000000072012115142004023733 0ustar00kokeroulisusers00000000000000set(plasma-remote_widgets_browser_SRCS main.cpp plasmafiltermodel.cpp ) qt4_add_resources(plasma-remote_widgets_browser_SRCS resources.qrc) kde4_add_executable(plasma-remote-widgets-browser ${plasma-remote_widgets_browser_SRCS}) target_link_libraries(plasma-remote-widgets-browser ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS} ${KDECLARATIVE_LIBRARIES} ${QT_QTDECLARATIVE_LIBRARY}) install(TARGETS plasma-remote-widgets-browser ${INSTALL_TARGETS_DEFAULT_ARGS}) plasmate-1.0/remote-widgets-browser/PaxHeaders.5990/main.cpp0000644000175000001440000000013212115142004022167 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/remote-widgets-browser/main.cpp0000644000175000001440000000577612115142004022643 0ustar00kokeroulisusers00000000000000/* Copyright 2011 Kevin Ottens 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 #include #include #include #include #include #include #include #include "plasmafiltermodel.h" static const char description[] = I18N_NOOP("Explore the Plasma Widgets shared on the network"); static const char version[] = "0.1"; int main(int argc, char **argv) { KAboutData aboutData("plasma-remote-widgets-browser", 0, ki18n("Plasma Remote Widgets Browser"), version, ki18n(description), KAboutData::License_GPL, ki18n("(c) 2011 The KDE Team")); aboutData.addAuthor(ki18n("Kevin Ottens"), ki18n( "Author" ), "ervin@kde.org"); aboutData.setProgramIconName("plasma"); KCmdLineArgs::init(argc, argv, &aboutData); KApplication app; QDeclarativeView *view = new QDeclarativeView; KDirModel *model = new KDirModel(view); KDirLister *lister = new KDirLister(view); QSortFilterProxyModel *sorter = new QSortFilterProxyModel(view); PlasmaFilterModel *filter = new PlasmaFilterModel(view); lister->openUrl(KUrl("network:/"), KDirLister::Keep); model->setDirLister(lister); sorter->setSourceModel(model); filter->setSourceModel(sorter); sorter->setDynamicSortFilter(true); sorter->sort(0); KDeclarative kdeclarative; kdeclarative.setDeclarativeEngine(view->engine()); kdeclarative.initialize(); //binds things like kconfig and icons kdeclarative.setupBindings(); view->setResizeMode(QDeclarativeView::SizeRootObjectToView); foreach (const QString &importPath, KGlobal::dirs()->findDirs("module", "imports")) { view->engine()->addImportPath(importPath); } view->rootContext()->setContextProperty("plasmaModel", filter); view->setSource(QUrl("qrc:/main.qml")); view->show(); return app.exec(); } plasmate-1.0/remote-widgets-browser/PaxHeaders.5990/plasmafiltermodel.cpp0000644000175000001440000000013212115142004024747 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/remote-widgets-browser/plasmafiltermodel.cpp0000644000175000001440000000360112115142004025404 0ustar00kokeroulisusers00000000000000/* Copyright 2011 Kevin Ottens 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 any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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 "plasmafiltermodel.h" #include #include PlasmaFilterModel::PlasmaFilterModel(QObject *parent) : KRecursiveFilterProxyModel(parent) { setDynamicSortFilter(true); } PlasmaFilterModel::~PlasmaFilterModel() { } bool PlasmaFilterModel::filterAcceptsColumn(int sourceColumn, const QModelIndex&) const { return sourceColumn==0; } bool PlasmaFilterModel::acceptRow(int sourceRow, const QModelIndex &sourceParent) const { QModelIndex sourceChild = sourceModel()->index(sourceRow, 0, sourceParent); if (sourceModel()->canFetchMore(sourceChild)) { sourceModel()->fetchMore(sourceChild); } KFileItem file = sourceChild.data(KDirModel::FileItemRole).value(); return file.targetUrl().protocol()=="plasma"; } void PlasmaFilterModel::runIndex(const QModelIndex &index) { KFileItem file = index.data(KDirModel::FileItemRole).value(); new KRun(file.targetUrl(), 0); } plasmate-1.0/remote-widgets-browser/PaxHeaders.5990/resources.qrc0000644000175000001440000000013212115142004023260 xustar000000000000000030 mtime=1362412548.623641145 30 atime=1362412548.623641145 30 ctime=1362412548.623641145 plasmate-1.0/remote-widgets-browser/resources.qrc0000644000175000001440000000013412115142004023713 0ustar00kokeroulisusers00000000000000 main.qml