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

List:       kde-commits
Subject:    branches/kblogger/kblogger-0.7
From:       Antonio Aloisio <antonio.aloisio () gmail ! com>
Date:       2007-06-13 21:45:03
Message-ID: 1181771103.310728.11033.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 675280 by aloisio:

'Blog\!' button replaced with a simple kblogger icon

 M  +8 -8      kblogger.kdevelop  
 M  +19 -58    src/kblogger.cpp  
 M  +2 -6      src/kblogger.h  
 M  +0 -35     src/kbloggereditor.cpp  
 M  +0 -3      src/kbloggereditor.h  


--- branches/kblogger/kblogger-0.7/kblogger.kdevelop #675279:675280
@@ -14,8 +14,8 @@
     <ignoreparts/>
     <projectdirectory>.</projectdirectory>
     <absoluteprojectpath>false</absoluteprojectpath>
-    <description></description>
-    <defaultencoding></defaultencoding>
+    <description/>
+    <defaultencoding/>
     <versioncontrol>kdevsubversion</versioncontrol>
   </general>
   <kdevfileview>
@@ -75,10 +75,10 @@
   <kdevdebugger>
     <general>
       <dbgshell>libtool</dbgshell>
-      <gdbpath></gdbpath>
-      <configGdbScript></configGdbScript>
-      <runShellScript></runShellScript>
-      <runGdbScript></runGdbScript>
+      <gdbpath/>
+      <configGdbScript/>
+      <runShellScript/>
+      <runGdbScript/>
       <breakonloadinglibs>true</breakonloadinglibs>
       <separatetty>false</separatetty>
       <floatingtoolbar>false</floatingtoolbar>
@@ -105,7 +105,7 @@
       <root>/usr/share/qt3</root>
       <designerintegration>EmbeddedKDevDesigner</designerintegration>
       <qmake>/usr/bin/qmake-qt3</qmake>
-      <designer></designer>
+      <designer>/usr/bin/designer-qt3</designer>
       <designerpluginpaths/>
     </qt>
     <codecompletion>
@@ -132,7 +132,7 @@
       <includePaths>.;</includePaths>
     </codecompletion>
     <creategettersetter>
-      <prefixGet></prefixGet>
+      <prefixGet/>
       <prefixSet>set</prefixSet>
       <prefixVariable>m_,_</prefixVariable>
       <parameterName>theValue</parameterName>
--- branches/kblogger/kblogger-0.7/src/kblogger.cpp #675279:675280
@@ -47,10 +47,6 @@
 
 #include "kblogger.h"
 
-// #if KDE_IS_VERSION(3,5,0)
-// #include "kbloggerbutton.h"
-// #endif
-
 #include "kbloggermenu.h"
 #include "kbloggerconfigdialog.h"
 #include "kbloggerconfig.h"
@@ -65,38 +61,32 @@
 class KBloggerMenu;
 
 KBlogger::KBlogger ( const QString& configFile, Type type, int actions, QWidget \
                *parent, const char *name )
-		: KPanelApplet ( configFile, type, actions, parent, name ), m_button ( 0 ), \
m_editor(0), m_menu(0), m_tempDir(0) +		: KPanelApplet ( configFile, type, actions, \
parent, name ), m_editor(0), m_menu(0), m_tempDir(0)  
 {
 	m_iconLoader=KGlobal::iconLoader();
 
-	//create Temp directory
+	// create Temp directory
 	m_tempDir= new KTempDir(locateLocal("tmp", "kblogger",true));
 	m_tempDir->setAutoDelete (true);
 
-	//create backend
+	// create backend
 	updateBackend();
 
 	// create menu
 	m_menu=new KBloggerMenu ( m_backend, this, "menu" );
-	//setCustomMenu ( m_menu );
 
 	// create the applet-widget
 	kdDebug() << "KBlogger::KBlogger - Creating Applet-widget" << endl;
-	/* #if KDE_IS_VERSION(3,5,0)
-		     kdDebug() << " for >3.5.0" << endl;
-		     m_button =  new KBloggerButton(this);
-		     m_button->setPanelPosition( position() );
-		   #else
-	         // Old code, maybe check for kde 3.5
-		  kdDebug() << " for <3.5.0" << endl; */
-	QVBoxLayout *appletlay = new QVBoxLayout ( this );
-	m_button = new QPushButton ( i18n ( "Blog!" ),this );
-	//m_button->setToggleButton (true);
-	appletlay->addWidget ( m_button );
-	connect ( m_button, SIGNAL ( clicked() ), this, SLOT ( slotClicked() ) );
-	// #endif
 
+	// create the panel button.
+	panelIcon= new QPixmap( m_iconLoader->loadIcon("kblogger",KIcon::Panel ) );
+// 	QVBoxLayout *appletlay = new QVBoxLayout ( this );
+	m_label= new QLabel(this);
+	m_label->setPixmap(*panelIcon);
+// 	m_button = new QPushButton ( i18n ( "Blog" ),this );
+// 	appletlay->addWidget ( m_label );
+// 	connect ( m_button, SIGNAL ( clicked() ), this, SLOT ( slotClicked() ) );
 	if ( !parent )
 		setBackgroundMode ( X11ParentRelative );
 
@@ -104,7 +94,7 @@
 
 	// initialize about data
 	m_aboutData = new KAboutData ( "kblogger", I18N_NOOP ( "KBlogger - Your voice on \
                the Net" ),
-	                               "0.6.6alpha", I18N_NOOP ( "A kicker applet for \
blogging" ), KAboutData::License_GPL, +	                               "0.7beta1", \
                I18N_NOOP ( "A kicker applet for blogging" ), \
                KAboutData::License_GPL,
 	                               0, 0, "http://kblogger.pwsp.net", \
"christian_weilbach@web.de" );  m_aboutData->addAuthor ( "Christian Weilbach", \
                I18N_NOOP ( "Main developer" ),
 	                         I18N_NOOP ( "christian_weilbach@web.de" ), I18N_NOOP ( \
"http://whiletaker.homeip.net" ) ); @@ -132,18 +122,18 @@
 
 void KBlogger::slotClicked()
 {
-// 	mFileItem.run();
 	editorSlot();
 }
 
 KBlogger::~KBlogger()
 {
 	kdDebug() << "KBlogger::~KBlogger()" << endl;
-	delete m_backend; //OK
+	delete m_backend;
 	delete m_aboutData;
 	delete m_configwd;
 	delete m_configDialog;
-	//delete m_editor;
+	delete m_label;
+	delete panelIcon;
 }
 
 void KBlogger::handleSuccess ( const QString& string )
@@ -180,7 +170,6 @@
 
 		default:
 		{
-			//KMessageBox::error ( 0, i18n ( "API Type not found. You have to configure \
first." ) );  QPixmap icon( m_iconLoader->loadIcon("kblogger/warning",KIcon::Panel \
));  KPassivePopup::message ( "KBlogger Warning","API Type not found. You have to \
configure first.",icon,this,"Passive Error Message" );  m_backend=0;
@@ -191,7 +180,6 @@
 	m_backend->setUsername ( KBloggerConfig::user() );
 	m_backend->setPassword ( KBloggerConfig::password() );
 	QPixmap icon( m_iconLoader->loadIcon("kblogger",KIcon::Panel ));
-	KPassivePopup::message ( "Welcome to KBlogger","Your voice on the \
net...",icon,this,"Passive Welcome Message" );  }
 
 
@@ -247,7 +235,6 @@
 		QPixmap icon( m_iconLoader->loadIcon("kblogger/warning.png",KIcon::Panel ));
 		kdDebug() << "KBlogger::handleBackendError - error " << error << endl;
 		KPassivePopup::message ( "KBlogger error:",error,icon,this,"Passive Error Message" \
                );
-		//KMessageBox::error( this, error  );
 	}
 }
 void KBlogger::editorClosedSlot()
@@ -281,48 +268,22 @@
 	m_configDialog->show();
 }
 
-
 int KBlogger::widthForHeight( int height ) const
 {
-	return m_button->width();
+	return panelIcon->width();
 }
 
 int KBlogger::heightForWidth( int width ) const
 {
-	return m_button->height();
+	return panelIcon->height();
 }
-/* REMOVE it' a unsed code!
-void KBlogger::resizeEvent( QResizeEvent * )
-{
- #if KDE_IS_VERSION(3,5,0)
-	if (!m_button)
-	{
-		return;
-	}
 
-	int size = 1;
-
- 	size = std::max( size,
-			 orientation() == Qt::Vertical ?
-			 	m_button->heightForWidth( width() ) :
-				m_button->widthForHeight( height() ) );
-
-
-	if(orientation() == Vertical)
-	{
-		m_button->resize( width(), size );
-	}
-	else
- 	{
-		m_button->resize( size, height() );
-	}
- #endif
-}*/
-
 void KBlogger::mousePressEvent ( QMouseEvent *e )
 {
 	if ( e->button() == QMouseEvent::RightButton )
 		menuSlot();
+	if ( e->button() == QMouseEvent::LeftButton )
+		slotClicked();
 }
 
 
--- branches/kblogger/kblogger-0.7/src/kblogger.h #675279:675280
@@ -83,7 +83,6 @@
 
 protected:
 	KIconLoader *m_iconLoader;
-	// void resizeEvent(QResizeEvent *); REMOVE?
 	void mousePressEvent(QMouseEvent *);
 
 private:
@@ -95,12 +94,9 @@
 	KBloggerEditor* m_editor;
 	KBloggerUpload* m_upload;
 	KTempDir *m_tempDir;
+	QLabel *m_label;
+	QPixmap* panelIcon;
 
-// #if KDE_IS_VERSION(3,5,0) 
-// 	KBloggerButton* m_button;
-// #else
-	QPushButton* m_button;
-// #endif
 
 private slots:
 	void updateBackend(); //Create a new backend or update the beckend's settings
--- branches/kblogger/kblogger-0.7/src/kbloggereditor.cpp #675279:675280
@@ -306,7 +306,6 @@
 		//Note works only with wordpress?
 		thumbnailImage=uploadedImage.dirPath()+"/"+uploadedImage.baseName(true)+".thumbnail."+uploadedImage.extension();
  insertTag(url,uploadedImage.fileName(),thumbnailImage,imglinked);
-		//append("<a href=\""+url+"\"><img alt=\""+uploadedImage.fileName()+"\" \
src=\""+thumbnailImage+"\" ></a>");  }
 }
 
@@ -316,38 +315,11 @@
 	             dynamic_cast<QObject*> ( this ), SLOT ( getCategoriesSlot ( const \
QString&, const QString& ) ) );  }
 
-/* TODO REMOVE?
-bool KBloggerEditor::addRemoveTags(const QString& startTag, const QString& endTag) \
                //EXPERIMENTAL
-{
-  QString selectedText;
-  selectedText=sanitizeText(VisualTextEditor->selectedText());
-  kdDebug() << "KBloggerEditor::addRemoveTags selectedText='" << selectedText<<"' \
                all text='"<< VisualTextEditor->text() <<"'" <<endl;
-
-  if ( selectedText.isEmpty() ) return false ;
-  if ( startTag.isEmpty() || endTag.isEmpty()) return false;
-  QRegExp rxStart(startTag), rxEnd(endTag);
-  if (rxStart.search(selectedText) != -1 || rxEnd.search(selectedText) != -1)
-  { //Tag Exits! => Remove Tags
-    kdDebug() << "KBloggerEditor::addRemoveTags remove tags "<< startTag << " and " \
                << endTag << endl;
-    selectedText.remove(rxStart);
-    selectedText.remove(rxEnd);
-    insertTag(selectedText);
-  }else{
-    //Add Tags.
-     kdDebug() << "KBloggerEditor::addRemoveTags add tags "<< startTag << " and " << \
                endTag << endl;
-    insertTag(startTag+selectedText+endTag);
-  }
-  return true;
-}
-*/
-
 void KBloggerEditor::linkDialogSlot()
 {
 	//TODO: EDIT LINK
 	QString selectedText;
 	selectedText=VisualTextEditor->selectedText();
-	//VisualTextEditor->removeSelectedText (0);
-	//VisualTextEditor->getCursorPosition ( int * para, int * index );
 	kdDebug() << "KBloggerEditor::linkDialogSlot()" << selectedText << endl;
 	if ( selectedText.isEmpty() ) //Add a link at the cursor position
 	{
@@ -384,7 +356,6 @@
 void KBloggerEditor::addHtmlLink ( const QString& target, const QString& name )
 {
 	insertTag (target,name,0,link);
-	//insertTag ( "<a href=\"" + target + "\">" + name + "</a>" );
 }
 
 void KBloggerEditor::insertTag (const QString& textA, const QString& textB, const \
QString& textC, tags tag) //HACK? @@ -700,12 +671,6 @@
   QWidget::close(true);
 }
 
-void KBloggerEditor::updateActionButton() //EXPERIMENTAL 
-{/*
-	if ( VisualTextEditor->italic() )
-	if ( VisualTextEditor->bold() )
-	if ( VisualTextEditor->italic() )*/
-}
 
 
 
--- branches/kblogger/kblogger-0.7/src/kbloggereditor.h #675279:675280
@@ -28,7 +28,6 @@
 #include <ktextedit.h>
 
 #include "kbloggereditorblank.h"
-//#include "kbloggerlinkdialog.h"
 #include "API_Blog.h"
 
 class KToolBar;
@@ -56,7 +55,6 @@
 protected slots:
 	virtual void setCategDesc(int);
 	void writeOnPreview(const QString& text);
-	virtual void updateActionButton();
 
 private:
 	//Vars
@@ -84,7 +82,6 @@
 private slots:
 	void loadPostSlot(KBlog::BlogPosting &posting);
 	void disconnectCategoriesSlot();
-	//REMOVE? bool addRemoveTags(const QString& startTag, const QString& endTag); \
//EXPERIMENTAL Add remove HTML tag from a selected text.  
 	//Visual Editor private slots.
 	void toggleItalic();


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

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