extragear/multimedia/amarok

Leo Franchi lfranchi at kde.org
Fri Jun 12 22:00:42 CEST 2009


SVN commit 981118 by lfranchi:

add amarok's copy of the plasma plasmapkg tool and javascript
scriptengine.

ideally it should just depend on the one in kdebase-runtime, but it
won't be there until 4.4, so we can't exactly put a dependency on
kdebase svn.

however doing it this way also allows us to customize the scriptengine,
and expose more amarok-specific methods

CCMAIL: amarok-devel at kde.org

 M  +1 -1      playground/src/context/applets/jssample/metadata.desktop  
 M  +2 -0      src/context/CMakeLists.txt  
 M  +2 -55     src/context/ToolbarView.cpp  
 M  +2 -1      src/context/amarokapplets.knsrc  
 A             src/context/scriptengine (directory)  
 A             src/context/scriptengine/javascript (directory)  
 A             src/context/scriptengine/javascript/CMakeLists.txt  
 A             src/context/scriptengine/javascript/Messages.sh  
 A             src/context/scriptengine/javascript/amarok-scriptengine-applet-simple-javascript.desktop  
 A             src/context/scriptengine/javascript/amarok-scriptengine-runner-javascript.desktop  
 A             src/context/scriptengine/javascript/appletinterface.cpp   [License: LGPL (v2+)]
 A             src/context/scriptengine/javascript/appletinterface.h   [License: LGPL (v2+)]
 A             src/context/scriptengine/javascript/backportglobal.h   [License: GPL (v2)]
 A             src/context/scriptengine/javascript/bind_dataengine.h   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/javascriptrunner.cpp   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/javascriptrunner.h   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/qtgui (directory)  
 A             src/context/scriptengine/javascript/qtgui/font.cpp   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/qtgui/graphicsitem.cpp   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/qtgui/linearlayout.cpp   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/qtgui/painter.cpp   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/qtgui/point.cpp   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/qtgui/rect.cpp   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/qtgui/size.cpp   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/qtgui/timer.cpp   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/qtgui/url.cpp   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/simplejavascriptapplet.cpp   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/simplejavascriptapplet.h   [License: LGPL (v2)]
 A             src/context/scriptengine/javascript/uiloader.cpp   [License: LGPL (v2+)]
 A             src/context/scriptengine/javascript/uiloader.h   [License: LGPL (v2+)]
 A             src/context/tools (directory)  
 A             src/context/tools/CMakeLists.txt  
 A             src/context/tools/Messages.sh  
 A             src/context/tools/amarokpkg.cpp   [License: GPL (v2+)]
 M  +1 -1      src/context/widgets/ToolBoxMenu.cpp  


--- trunk/extragear/multimedia/amarok/playground/src/context/applets/jssample/metadata.desktop #981117:981118
@@ -4,7 +4,7 @@
 Type=Service
 ServiceTypes=Plasma/Applet
 Icon=chronometer
-X-Plasma-API=javascript
+X-Plasma-API=amarok_javascript
 X-Plasma-MainScript=code/main.js
 X-KDE-PluginInfo-Author=Leo Franchi
 X-KDE-PluginInfo-Email=lfranchi at kde.org
--- trunk/extragear/multimedia/amarok/src/context/CMakeLists.txt #981117:981118
@@ -1,6 +1,8 @@
 add_subdirectory( applets )
 add_subdirectory( engines )
 add_subdirectory( containments )
+add_subdirectory( tools )
+add_subdirectory( scriptengine/javascript )
 
 
 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}
--- trunk/extragear/multimedia/amarok/src/context/ToolbarView.cpp #981117:981118
@@ -244,67 +244,14 @@
 {
     DEBUG_BLOCK
 
-    /*
-    // TODO this hsould open the GHNS dialog, for now just allow user to specify package
-    QString appletFile = KFileDialog::getOpenFileName( KUrl(), "*.amarokapplet.zip", this, "Please select Amarok Applet to install" );
-
-    debug() << "installing amarok applet file:" << appletFile;
-    QString packageRoot = "plasma/plasmoids/";
-    packageRoot = KStandardDirs::locateLocal("data", packageRoot);
-
-    Plasma::PackageStructure* installer = new Plasma::PackageStructure();
-    installer->setServicePrefix( "amarok-context-applet-" );
-    // always uninstall before installing, as it doesn't auto overwrite.
-    installer->setPath( appletFile );
-    Plasma::PackageMetadata metadata = installer->metadata();
-    installer->uninstallPackage( metadata.pluginName(), packageRoot );
-    if( !installer->installPackage( appletFile, packageRoot ) )
-    {
-        debug() << "ERROR in trying to install the package.";
-    }
-    */
-
     KNS::Engine engine(0);
     if (engine.init("amarokapplets.knsrc")) {
         KNS::Entry::List entries = engine.downloadDialogModal(this);
-
-        if (entries.size() > 0)
-        {
-            
-            // go through and manually install/uninstall
-            foreach( KNS::Entry* entry, entries )
-            {
-                if( entry->status() == KNS::Entry::Installed )
-                {
-                    debug() << "got an entry called: " << entry->name().translated( "en" ) << "with installed files:" << entry->installedFiles();
-
-                    QString packageRoot = "plasma/plasmoids/";
-                    packageRoot = KStandardDirs::locateLocal("data", packageRoot);
-
-                    Plasma::PackageStructure* installer = new Plasma::PackageStructure();
-                    installer->setServicePrefix( "amarok-context-applet-" );
-                    // always uninstall before installing, as it doesn't auto overwrite.
-                    //installer->setPath( appletFile );
-                    Plasma::PackageMetadata metadata = installer->metadata();
-                    installer->uninstallPackage( metadata.pluginName(), packageRoot );
-                    if( !installer->installPackage( entry->installedFiles()[ 0 ], packageRoot ) )
-                    {
-                        debug() << "ERROR in trying to install the package.";
-                    }
-                } else if( entry->status() == KNS::Entry::Deleted )
-                {
-                    debug() << "got an entry called: " << entry->name().translated( "en" ) << "with uninstalled files:" << entry->uninstalledFiles();
-                }
-
-            }
-        // do something with the modified entries here if you want
-
-            // such as rescaning your data folder or whatnot
-            //m_model->reload();
-        }
     }
     
     QDBusInterface dbus("org.kde.kded", "/kbuildsycoca", "org.kde.kbuildsycoca");
     dbus.call(QDBus::Block, "recreate");
+
+    recreateOverlays();
 }
 #include "ToolbarView.moc"
--- trunk/extragear/multimedia/amarok/src/context/amarokapplets.knsrc #981117:981118
@@ -1,6 +1,7 @@
 [KNewStuff2]
 ProvidersUrl=http://download.kde.org/khotnewstuff/amarokapplets-providers.xml
-Uncompress=never
 Checksumpolicy=ifpossible
 SignaturePolicy=ifpossible
 StandardResource=tmp
+InstallationCommand=amarokpkg -i %f
+UninstallationCommand=amarokpkg -r %f
--- trunk/extragear/multimedia/amarok/src/context/widgets/ToolBoxMenu.cpp #981117:981118
@@ -120,7 +120,7 @@
     m_installScriptedApplet = new ToolBoxIcon( this );
     m_installScriptedApplet->setDrawBackground( true );
     m_installScriptedApplet->setOrientation( Qt::Horizontal );
-    m_installScriptedApplet->setText( i18n( "Install Applets" ) );
+    m_installScriptedApplet->setText( i18n( "Install New Applets" ) );
     const QSizeF size( ENTRY_WIDTH - 60, ENTRY_HEIGHT - 9 );
     m_installScriptedApplet->setMinimumSize( size );
     m_installScriptedApplet->setMaximumSize( size );


More information about the Amarok-devel mailing list