Bug 88262 - Support for remote protocol
Summary: Support for remote protocol
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-WebService-Piwigo (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-28 00:20 UTC by Sander Devrieze
Modified: 2023-02-25 09:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sander Devrieze 2004-08-28 00:20:43 UTC
Version:            (using KDE KDE 3.2.3)

It would be great to see support for the Gallery Remote protocol in Digikam.

IMO this should be implemented transparant to the user: he only needs to specify the URL and his account information in Digikam and then Digikam will download/upload/cache albums and images automagically.

The specs can be found at: http://gallery.menalto.com/modules.php?op=modload&name=GalleryDocs&file=index&page=gallery-remote.protocol.php

As you can see Bug 73496 'Gallery kio based on GR protocol 2' is related but I'm not sure if then all features of the protocol can be used. So maybe you can close this wishlist.
Comment 1 Steven Michalske 2004-09-06 21:48:19 UTC
I am willing to donate funds for this plug-in.
Comment 2 Riku Voipio 2004-10-24 23:19:15 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Renchi Raju 2004-11-07 01:37:45 UTC
moving this to kipi-plugins, as its best implemented as a common plugin shareable by different kde applications.

just to let you know, i have started work on a kioslave for the which will act as the backend for the plugin gui.
Comment 4 Renchi Raju 2004-12-01 12:29:32 UTC
CVS commit by pahlibar: 


Initial implementation of remote gallery export kipi-plugin
What works now:
* logging into remote gallery
* listing albums
* listing photos in individual albums
* showing thumbnails for photos
* clicking on thumbnails will open up the actual image in kde standard imageviewer

Things to do:
* implement adding new albums
* implement adding new photos
* kwallet integration for saving/restoring remote-url/username/password

So currently only read-only support. putting this in so that we 
can get some user testing done for remote url access and also 
modify the GUI based on user input.
Screenshot at: http://pooh.tam.uiuc.edu/gallery_export.png 
CCBUG: 88262


  A            galleryexport/.cvsignore   1.1
  A            galleryexport/Makefile.am   1.1
  A            galleryexport/galleryitem.h   1.1 [GPL]
  A            galleryexport/gallerylogin.cpp   1.1 [GPL]
  A            galleryexport/gallerylogin.h   1.1 [GPL]
  A            galleryexport/gallerytalker.cpp   1.1 [GPL]
  A            galleryexport/gallerytalker.h   1.1 [GPL]
  A            galleryexport/galleryviewitem.h   1.1 [GPL]
  A            galleryexport/gallerywidget.cpp   1.1 [GPL]
  A            galleryexport/gallerywidget.h   1.1 [GPL]
  A            galleryexport/gallerywindow.cpp   1.1 [GPL]
  A            galleryexport/gallerywindow.h   1.1 [GPL]
  A            galleryexport/kipiplugin_galleryexport.desktop   1.1
  A            galleryexport/plugin_galleryexport.cpp   1.1 [GPL]
  A            galleryexport/plugin_galleryexport.h   1.1 [GPL]
  M +1 -1      Makefile.am   1.28


--- kdeextragear-libs-1/kipi-plugins/Makefile.am  #1.27:1.28
@@ -19,5 +19,5 @@
 SUBDIRS = printwizard calendar mpegencoder cdarchiving imagesgallery \
         sendimages acquireimages batchprocessimages \
-        wallpaper rawconverter findimages \
+        wallpaper rawconverter findimages galleryexport \
         $(SLIDESHOWDIR) $(KAMERAKLIENTDIR) $(JPEGLOSSLESSDIR) \
         $(TIMEADJUSTDIR)


Comment 5 Renchi Raju 2004-12-01 20:42:57 UTC
CVS commit by pahlibar: 


* implemented creating new albums
CCBUG: 88262


  A            galleryalbumdialog.ui   1.1
  M +1 -1      Makefile.am   1.2
  M +0 -2      gallerylogin.h   1.2
  M +143 -24   gallerytalker.cpp   1.2
  M +8 -1      gallerytalker.h   1.2
  M +73 -1     gallerywindow.cpp   1.2
  M +3 -0      gallerywindow.h   1.2



Comment 6 Sander Devrieze 2004-12-02 13:47:20 UTC
On Wo, 1 december, 2004 12:29, Renchi Raju zei:
> Initial implementation of remote gallery export kipi-plugin

Great! Just some question: I can't use the Java application Gallery Remote
as my gallery is only accessible via SSL and the certificate is
self-signed. Gallery Remote can't handle these: has this KIPI plugin the
same problem, or will it work better? If you need the URL of my Gallery to
test just send me an email (I don't want to get it indexed by Google).

Comment 7 Renchi Raju 2004-12-02 16:41:16 UTC
the plugin can access https sites. the usual certificate "expired" messages will popup (similar to that of konqueror). 
Comment 8 Sander Devrieze 2004-12-02 16:51:27 UTC
> ------- the plugin can access https sites. the usual certificate "expired"
> messages will popup (similar to that of konqueror).

Nice, that means it will work :-) Do you know when the next release of Digikam 
with this plugin will be released? ;-)

Comment 9 Renchi Raju 2004-12-02 16:57:05 UTC
you don't have to have a "new" digikam release to use this plugin. the plugins follow their own release cycle and should work with current and future releases of digikam (till we break binary/source compatiblity for libkipi, which is not going to be anytime soon). there are no fixed dates yet on when the next release of kipi-plugins will be.
Comment 10 Renchi Raju 2004-12-03 08:13:41 UTC
CVS commit by pahlibar: 


* implemented uploading photos (with host application provided captions) 
  into remote gallery
* now, generate the upload form data using multipart. 
* show captions under thumbnails

Note to users: the code hasn't undergone a whole lot of testing. I would like
reports back, if things are broken. Might be prudent to test on non-production
remote gallery 

BUG: 88262


  A            gallerympform.cpp   1.1 [GPL]
  A            gallerympform.h   1.1 [GPL]
  M +1 -1      Makefile.am   1.3
  M +21 -24    galleryalbumdialog.ui   1.2
  M +4 -0      galleryitem.h   1.2
  M +5 -0      gallerylogin.cpp   1.2
  M +5 -0      gallerylogin.h   1.3
  M +147 -48   gallerytalker.cpp   1.3
  M +14 -2     gallerytalker.h   1.3
  M +5 -0      galleryviewitem.h   1.2
  M +4 -0      gallerywidget.cpp   1.2
  M +5 -0      gallerywidget.h   1.2
  M +120 -3    gallerywindow.cpp   1.3
  M +25 -2     gallerywindow.h   1.3
  M +9 -2      plugin_galleryexport.cpp   1.2



Comment 11 Renchi Raju 2004-12-04 00:46:35 UTC
CVS commit by pahlibar: 


* kwallet integration for saving/restoring password (for kde > 3.1). for kde <= 3.1,
  only the url and username are saved restored.
* promote the album title as the main text (in the album treeview list)

galleryexport to be considered feature-complete for kipi-plugins 0.1 release, pending
user input

CCBUG: 88262


  M +2 -2      galleryviewitem.cpp   1.2
  M +61 -4     gallerywindow.cpp   1.5
  M +6 -0      gallerywindow.h   1.4


--- kdeextragear-libs-1/kipi-plugins/galleryexport/galleryviewitem.cpp  #1.1:1.2
@@ -62,5 +62,5 @@ void GAlbumViewItem::paintCell(QPainter 
     int r = lv->itemMargin() + iconWidth;
     int h = lv->fontMetrics().height() + 2;
-    p->drawText(r, 0, width-r, h, Qt::AlignVCenter, album.name);
+    p->drawText(r, 0, width-r, h, Qt::AlignVCenter, album.title);
 
     QFont fn(lv->font());
@@ -69,5 +69,5 @@ void GAlbumViewItem::paintCell(QPainter 
     p->setFont(fn);
     p->setPen(isSelected() ? cg.highlightedText() : Qt::gray);
-    p->drawText(r, h, width-r, h, Qt::AlignVCenter, album.title);
+    p->drawText(r, h, width-r, h, Qt::AlignVCenter, album.name);
 }
 

--- kdeextragear-libs-1/kipi-plugins/galleryexport/gallerywindow.cpp  #1.4:1.5
@@ -36,4 +36,9 @@
 #include <krun.h>
 #include <kdebug.h>
+#include <kconfig.h>
+#include <kdeversion.h>
+#if KDE_IS_VERSION(3,2,0)
+#include <kwallet.h>
+#endif
 
 #include <libkipi/interface.h>
@@ -57,4 +62,5 @@ GalleryWindow::GalleryWindow(KIPI::Inter
     m_uploadCount = 0;
     m_uploadTotal = 0;
+    m_wallet      = 0;
 
     GalleryWidget* widget = new GalleryWidget( this );
@@ -107,4 +113,9 @@ GalleryWindow::GalleryWindow(KIPI::Inter
              SLOT( slotAddPhotos() ) );
 
+    // read config
+    KConfig config("kipirc");
+    config.setGroup("GalleryExport Settings");
+    m_url  = config.readEntry("URL");
+    m_user = config.readEntry("User");
     
     QTimer::singleShot( 0, this,  SLOT( slotDoLogin() ) );
@@ -113,4 +124,15 @@ GalleryWindow::GalleryWindow(KIPI::Inter
 GalleryWindow::~GalleryWindow()
 {
+#if KDE_IS_VERSION(3,2,0)
+    if (m_wallet)
+        delete m_wallet;
+#endif
+
+    // write config
+    KConfig config("kipirc");
+    config.setGroup("GalleryExport Settings");
+    config.writeEntry("URL",  m_url);
+    config.writeEntry("User", m_user);
+    
     delete m_progressDlg;
     delete m_talker;
@@ -119,6 +141,35 @@ GalleryWindow::~GalleryWindow()
 void GalleryWindow::slotDoLogin()
 {
+    QString password;
+    
+#if KDE_IS_VERSION(3,2,0)
+    if (!m_wallet)
+        m_wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(),
+                                               winId(),
+                                               KWallet::Wallet::Synchronous );
+    if (!m_wallet)
+    {
+        kdWarning() << "Failed to open kwallet" << endl;
+    }
+    else
+    {
+        if (!m_wallet->hasFolder("KIPIGalleryExportPlugin"))
+        {
+            if (!m_wallet->createFolder("KIPIGalleryExportPlugin"))
+                kdWarning() << "Failed to create kwallet folder" << endl;
+        }
+
+        if (!m_wallet->setFolder("KIPIGalleryExportPlugin"))
+            kdWarning() << "Failed to set kwallet folder" << endl;
+        else
+        {
+            m_wallet->readPassword("password", password);
+        }
+    }
+#endif
+    
+        
     GalleryLogin dlg( this, i18n( "Login into remote gallery" ),
-                      m_url, m_user );
+                      m_url, m_user, password );
     if ( dlg.exec() != QDialog::Accepted )
     {
@@ -139,5 +190,11 @@ void GalleryWindow::slotDoLogin()
     m_user = dlg.name();
     
-    m_talker->login( url.url(), dlg.name(), dlg.password() );
+    QString newPassword = dlg.password();
+#if KDE_IS_VERSION(3,2,0)
+    if (newPassword != password && m_wallet)
+        m_wallet->writePassword("password", newPassword);
+#endif
+    
+    m_talker->login( url.url(), dlg.name(), newPassword );
 }
 

--- kdeextragear-libs-1/kipi-plugins/galleryexport/gallerywindow.h  #1.3:1.4
@@ -36,4 +36,9 @@ class Interface;
 }
 
+namespace KWallet
+{
+class Wallet;
+}
+
 namespace KIPIGalleryExportPlugin
 {
@@ -65,4 +70,5 @@ private:
     QString                   m_lastSelectedAlbum;
     KIPI::Interface          *m_interface;
+    KWallet::Wallet          *m_wallet;
 
     QProgressDialog                      *m_progressDlg;


Comment 12 Renchi Raju 2004-12-04 02:08:42 UTC
i have put up a snapshot of the new KIPI galleryexport plugin (exports
images to remote gallery [http://gallery.sf.net]) at this page:
http://pooh.tam.uiuc.edu/galleryexport/

screenshot at:
http://pooh.tam.uiuc.edu/gallery_export.png

this is to facilitate testing for users who are wary to compile the
entire kdeextragear-libs-1 from cvs.

Please report problems to kde-imaging@kde.org or bugs.kde.org (product
kipiplugins, component galleryexport)

renchi

Comment 13 Steven Michalske 2004-12-05 17:58:13 UTC
Renchi,

The plugin is great, thank you for making it.

Thoughts.

1.  Allow for Pre-processing the images that will be uploaded
        Looking mainly for scaling,  I know most people don't want 
        3000x2000 jpegs online,  this is more of a minor issue as gallery 
        provides two thumbnails, but my gallery provider would prefer that
        i don't upload tons of 2.5 MB photos.
2.  Allow for multiple saved galleries
3.  Allow for deleation and editing of comments. 
        (Nice to have but not required)

Comment 14 Steven Michalske 2004-12-05 18:56:29 UTC
When uploading multiple photos at once the order is reversed in the gallery as it adds the photo at the beginning of the gallery.  I don't know if this is a limitation of Gallery or the design of the plugin, but it would be nice to have the order preserved.
Comment 15 Renchi Raju 2004-12-05 21:48:44 UTC
replying to comment #13:
please file 1 and 2 as separate wishlist reports
3 is not possible. gallery protocol does not allow
Comment 16 Renchi Raju 2004-12-05 21:52:58 UTC
replying to comment #14:
each album in gallery has a property (when you login into the remote gallery and select properties of the album - not from the plugin, but from a browser), where you can specify how the images are to be added, to the beginning or the end. the gallery protocol allows a provision where you can override this property and specify where the images are to be added for an album. you can file a wishlist for this feature to added as well