[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/pim/kblogger
From:       Antonio Aloisio <antonio.aloisio () gmail ! com>
Date:       2007-05-12 11:10:58
Message-ID: 1178968258.854306.20612.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 663805 by aloisio:

upload and image manager class ported

 M  +7 -2      ChangeLog  
 M  +0 -166    INSTALL  
 M  +2 -2      README  
 M  +4 -8      src/CMakeLists.txt  
 M  +4 -3      src/kbloggerimagemanager.cpp  
 M  +1 -1      src/kbloggerimagemanager.h  
 M  +3 -2      src/kbloggermenu.h  
 M  +11 -10    src/kbloggerupload.cpp  
 M  +4 -3      src/kbloggerupload.h  
 M  +4 -20     src/kbloggeruploadblank.ui  


--- trunk/playground/pim/kblogger/ChangeLog #663804:663805
@@ -1,6 +1,11 @@
-KBlogger 0.6.6
+KBlogger 0.8
+ - ported to KDE4
+
+KBlogger 0.7
  - Timestamp support (with timezone)
  - RMB Menu improved
  - Improved the basic Visual Editor
  - Added Html Editor
- - Added a basic Post Preview 
+ - Added a basic Post Preview
+
+KBlogger 0.6.5 (too old) 
--- trunk/playground/pim/kblogger/INSTALL #663804:663805
@@ -1,167 +1 @@
-Basic Installation
-==================
 
-   These are generic installation instructions.
-
-   The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation.  It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions.  Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
-
-   If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release.  If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
-
-   The file `configure.in' is used to create `configure' by a program
-called `autoconf'.  You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
-  1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.  If you're
-     using `csh' on an old version of System V, you might need to type
-     `sh ./configure' instead to prevent `csh' from trying to execute
-     `configure' itself.
-
-     Running `configure' takes a while.  While running, it prints some
-     messages telling which features it is checking for.
-
-  2. Type `make' to compile the package.
-
-  3. Type `make install' to install the programs and any data files and
-     documentation.
-
-  4. You can remove the program binaries and object files from the
-     source code directory by typing `make clean'.  
-
-Compilers and Options
-=====================
-
-   Some systems require unusual options for compilation or linking that
-the `configure' script does not know about.  You can give `configure'
-initial values for variables by setting them in the environment.  Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
-     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
-
-Or on systems that have the `env' program, you can do it like this:
-     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
-
-Compiling For Multiple Architectures
-====================================
-
-   You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory.  To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'.  `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
-   If you have to use a `make' that does not supports the `VPATH'
-variable, you have to compile the package for one architecture at a time
-in the source code directory.  After you have installed the package for
-one architecture, use `make distclean' before reconfiguring for another
-architecture.
-
-Installation Names
-==================
-
-   By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc.  You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
-
-   You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files.  If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
-   If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
-   Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System).  The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
-   For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
-   There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host the package
-will run on.  Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option.  TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
-     CPU-COMPANY-SYSTEM
-
-See the file `config.sub' for the possible values of each field.  If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the host type.
-
-   If you are building compiler tools for cross-compiling, you can also
-use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
-
-Sharing Defaults
-================
-
-   If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists.  Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Operation Controls
-==================
-
-   `configure' recognizes the following options to control how it
-operates.
-
-`--cache-file=FILE'
-     Use and save the results of the tests in FILE instead of
-     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
-     debugging `configure'.
-
-`--help'
-     Print a summary of the options to `configure', and exit.
-
-`--quiet'
-`--silent'
-`-q'
-     Do not print messages saying which checks are being made.
-
-`--srcdir=DIR'
-     Look for the package's source code in directory DIR.  Usually
-     `configure' can determine that directory automatically.
-
-`--version'
-     Print the version of Autoconf used to generate the `configure'
-     script, and exit.
-
-`configure' also accepts some other, not widely useful, options.
-
--- trunk/playground/pim/kblogger/README #663804:663805
@@ -1,7 +1,7 @@
-KBlogger is a panel object (resp. applet) that can post to weblogs using
+KBlogger is a kde4 application that can post to weblogs using
 Blogger.com API 1.0 or MetaWeblog API
 
 It currently supports Blogger.com/Blogspot.com and all weblogs which support
-the MetaWeblog API
+the MetaWeblog API such as Wordpress, Drupal...
 
 http://kblogger.pwsp.net
--- trunk/playground/pim/kblogger/src/CMakeLists.txt #663804:663805
@@ -1,6 +1,3 @@
-#project(kblogger)
-#find_package(KDE4 REQUIRED)
-#find_package(KdepimLibs REQUIRED)
 include (KDE4Defaults)
 include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} )
 
@@ -10,10 +7,9 @@
    kbloggereditor.cpp
    kbloggerlinkdialog.cpp
    kbloggerconfigdialog.cpp
-   #kbloggerimagemanager.cpp NOT PORTED YET
-   #kbloggerupload.cpp NOT PORTED YET
-   #kbloggermenu.cpp NOT PORTED YET
-   #
+   kbloggerimagemanager.cpp
+   kbloggerupload.cpp
+   #kbloggermenu.cpp
 )
 
 kde4_automoc(${kblogger_SRCS})
@@ -23,7 +19,7 @@
 kde4_add_kcfg_files( kblogger_SRCS kbloggerconfig.kcfgc )
 kde4_add_executable( kblogger ${kblogger_SRCS})
 
-target_link_libraries( kblogger kblog ${KDE4_KDEUI_LIBS} ${KDE4_KDECORE_LIBS})
+target_link_libraries( kblogger kblog ${KDE4_KHTML_LIBRARY} ${KDE4_KDEUI_LIBS} \
${KDE4_KDECORE_LIBS})  
 install( TARGETS kblogger DESTINATION ${BIN_INSTALL_DIR} )
 
--- trunk/playground/pim/kblogger/src/kbloggerimagemanager.cpp #663804:663805
@@ -20,8 +20,9 @@
 #include "kbloggerimagemanager.h"
 
 KBloggerImageManager::KBloggerImageManager(QDir* tmpDir, QWidget *parent, const char \
                *name)
-    :KBloggerImageManagerBlank(parent, name), m_Image(0), m_tempDir(tmpDir)
+    :QWidget(parent), m_Image(0), m_tempDir(tmpDir)
 {
+	setupUi(this);
 	m_Image=new QImage();
 }
 
@@ -31,7 +32,7 @@
 	m_filename=filename;
 	if (! m_Image->load(filename)) return;
 
-	preview128=m_Image->scale(128,128,QImage::ScaleMin);
+	preview128=m_Image->scaled(128,128,Qt::KeepAspectRatio,Qt::FastTransformation);
 	imagePreviewLabel->setPixmap ( QPixmap(preview128));
 
 	resizeWidthtLine->setEnabled(false);
@@ -100,7 +101,7 @@
 	scaledImageFilename.addPath(origFile.fileName());
 	kDebug() << "KBloggerImageManager::saveResize() file saved:" << \
scaledImageFilename.path() << endl;  if (ext.upper()=="JPG") ext="JPEG";
-	if (!scaledImage.save(scaledImageFilename.path(),ext.upper()) )
+	if (!scaledImage.save(scaledImageFilename.path()))//,ext.upper().toAscii()) )
 		KMessageBox::sorry ( 0, i18n ( "File %1 not saved" ).arg ( \
scaledImageFilename.path() ) );  else
 		imageResized(scaledImageFilename.path());
--- trunk/playground/pim/kblogger/src/kbloggerimagemanager.h #663804:663805
@@ -10,7 +10,7 @@
 
 #include "ui_kbloggerimagemanagerblank.h"
 
-class KBloggerImageManager: public KBloggerImageManagerBlank {
+class KBloggerImageManager: public QWidget, public Ui::KBloggerImageManagerBlank {
 	Q_OBJECT
 	
 	QImage *m_Image;
--- trunk/playground/pim/kblogger/src/kbloggermenu.h #663804:663805
@@ -28,12 +28,13 @@
 
 
 #include <kmenu.h>
-#include "kblogger.h" // KBlog::APIBlog
+//#include "kblogger.h" // KBlog::APIBlog
+#include <kblog/blog.h>
 //Added by qt3to4:
 #include <QMouseEvent>
 #include <Q3ValueList>
 #include <QLabel>
-#include <kvbox.h>
+//#include <kvbox.h>
 
 class KBlogger;
 class Q3ProgressBar;
--- trunk/playground/pim/kblogger/src/kbloggerupload.cpp #663804:663805
@@ -39,13 +39,14 @@
 #include "kbloggerimagemanager.h"
 
 KBloggerUpload::KBloggerUpload( KBlog::APIBlog* backend, QString& filename,  \
                mimeType filter,QDir* tmpDir,QWidget *parent, const char *name)
-    :KBloggerUploadBlank(parent, name), m_backend(backend), m_media (new \
KBlog::BlogMedia()), m_imageManager(0), m_tmpDir(tmpDir) +    :QWidget(parent), \
m_backend(backend), m_media (new KBlog::BlogMedia()), m_imageManager(0), \
m_tmpDir(tmpDir)  {
+	setupUi((QDialog*)this);
 	kDebug() << "KBloggerUpload::KBloggerUpload()" << endl;
 	
 	
 	if( !filename.isEmpty() )
-		FilekURLRequester->setURL( filename );
+		FilekURLRequester->setUrl( filename );
 	
 	switch (filter){
 		case Images:
@@ -54,7 +55,7 @@
 			FilekURLRequester->setFilter( "Images ( *.png *.jpg *.gif )" );
 			m_imageManager= new KBloggerImageManager(m_tmpDir,genericGroupBox,"Image \
Manager");  m_imageManager->show();
-			genericGroupBoxLayout->addWidget( m_imageManager, 0, 0 );
+			layout()->addWidget( m_imageManager);//, 0, 0 );
 			connect(m_imageManager,SIGNAL(imageResized(const \
QString&)),SLOT(setFileNameOnServer(const QString&)));  adjustSize();
 		}	
@@ -109,32 +110,32 @@
 
 void KBloggerUpload::handleFileJobResult( KIO::Job* job ){
 	if( job->error() ){
-	        job->showErrorDialog();
+	        job->showErrorDialog(); //FIXME DEPRECATED
 		return;
 	}
 	kDebug() << "KBloggerUpload::handleFileJobResult() got file successfully" << endl;
-	m_media->setBlogID( KBloggerConfig::blogId() );
-	m_media->setName( NameLineEdit->text() );
+	/*FIXME m_media->setBlogID( KBloggerConfig::blogId() );
+	 m_media->setName( NameLineEdit->text() );
 	KIO::Job* uploadJob=m_backend->createUploadMediaJob( KUrl::KUrl( \
KBloggerConfig::url() ), m_media );  connect( uploadJob, SIGNAL( result( KIO::Job* ) \
),  m_backend, SLOT( interpretUploadMediaJob( KIO::Job* ) ) );
 	connect (m_backend, SIGNAL(mediaInfoRetrieved( const QString& )), //Url
-		parent(), SLOT(fileUploadedSlot( const QString& ))); //url
+		parent(), SLOT(fileUploadedSlot( const QString& ))); //url */
 }
 
 void KBloggerUpload::setFileNameOnServer(const QString& filename)
 {
 	int filesize;
 	if (filename.isEmpty()) return; 
-	FilekURLRequester->setURL(filename);
+	FilekURLRequester->setUrl(filename);
 	QFileInfo fileToUpload(filename);
 	NameLineEdit->setText(fileToUpload.fileName());
 	filesize=fileToUpload.size();
 	if ( filesize > MAX_FILE_SIZE_WARNING ){
-		filesizeLabel->setText(i18n ("File size: <font color='red'>" + \
QString::number(filesize) + "</font> bytes")); +		filesizeLabel->setText(i18n ("File \
size: <font color='red'>") + QString::number(filesize) + i18n("</font> bytes"));  \
KMessageBox::sorry ( this, i18n ( "Please don't upload big files!!" ) );  }else{
-		filesizeLabel->setText(i18n ("File size: <font color='green'>" + \
QString::number(filesize) + "</font> bytes")); +		filesizeLabel->setText(i18n ("File \
size: <font color='green'>") + QString::number(filesize) + i18n("</font> bytes"));  }
 	if (m_imageManager)
 		m_imageManager->setImage(filename);
--- trunk/playground/pim/kblogger/src/kbloggerupload.h #663804:663805
@@ -21,14 +21,15 @@
 #define KBLOGGERUPLOAD_H
 
 #include <QDir>
+#include <QWidget>
 
 #include "ui_kbloggeruploadblank.h"
 //#include "API_Blog.h"
-#include <kblog/kblog.h>
-#include <kvbox.h>
+#include <kblog/blog.h>
+//#include <kvbox.h>
 class KBloggerImageManager;
 
-class KBloggerUpload: public KBloggerUploadBlank {
+class KBloggerUpload: public QWidget, public Ui::KBloggerUploadBlank {
 Q_OBJECT
 public:
 	enum mimeType{Generic=0, Images};
--- trunk/playground/pim/kblogger/src/kbloggeruploadblank.ui #663804:663805
@@ -12,7 +12,7 @@
   <property name="windowTitle" >
    <string>KBlogger - Upload...</string>
   </property>
-  <property name="icon" >
+  <property name="icon" stdset="0" >
    <iconset/>
   </property>
   <layout class="QGridLayout" >
@@ -35,7 +35,7 @@
       </widget>
      </item>
      <item>
-      <widget class="KURLRequester" native="1" name="FilekURLRequester" />
+      <widget class="KUrlRequester" name="FilekURLRequester" />
      </item>
     </layout>
    </item>
@@ -175,8 +175,8 @@
    <header>kseparator.h</header>
   </customwidget>
   <customwidget>
-   <class>KURLRequester</class>
-   <extends>QWidget</extends>
+   <class>KUrlRequester</class>
+   <extends>QFrame</extends>
    <header>kurlrequester.h</header>
   </customwidget>
  </customwidgets>
@@ -208,22 +208,6 @@
    </hints>
   </connection>
   <connection>
-   <sender>FilekURLRequester</sender>
-   <signal>textChanged(QString)</signal>
-   <receiver>KBloggerUploadBlank</receiver>
-   <slot>setFileNameOnServer(QString)</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>20</x>
-     <y>20</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>20</x>
-     <y>20</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
    <sender>cancelButton</sender>
    <signal>clicked()</signal>
    <receiver>KBloggerUploadBlank</receiver>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic