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

List:       kde-commits
Subject:    KDE/kdepim/blogilo/src
From:       Mehrdad Momeny <mehrdad.momeny () gmail ! com>
Date:       2010-11-14 19:36:52
Message-ID: 20101114193652.62D4DAC89E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1197056 by momeny:

Pressing "Down" key on title edit widget will change focus to html or wysiwyg editor

 M  +1 -0      CMakeLists.txt  
 M  +11 -2     postentry.cpp  
 M  +1 -0      postentry.h  
 A             titlelineedit.cpp   [License: GPL (v2/3)]
 A             titlelineedit.h   [License: GPL (v2/3)]


--- trunk/KDE/kdepim/blogilo/src/CMakeLists.txt #1197055:1197056
@@ -6,6 +6,7 @@
  mainwindow.cpp
  toolbox.cpp
  addeditblog.cpp
+ titlelineedit.cpp
  postentry.cpp
  dbman.cpp
  global.cpp
--- trunk/KDE/kdepim/blogilo/src/postentry.cpp #1197055:1197056
@@ -53,6 +53,7 @@
 #include <ktexteditor/document.h>
 #include <QHBoxLayout>
 #include <KTabWidget>
+#include "titlelineedit.h"
 
 
 #define MINUTE 60000
@@ -64,7 +65,7 @@
     QGridLayout *gridLayout;
     QHBoxLayout *horizontalLayout;
     QLabel *labelTitle;
-    KLineEdit *txtTitle;
+    TitleLineEdit *txtTitle;
     QTimer *mTimer;
     BilboPost mCurrentPost;
     int mCurrentPostBlogId;
@@ -162,14 +163,22 @@
     d->labelTitle->setText( i18nc( "noun, the post title", "Title:" ) );
     d->horizontalLayout->addWidget( d->labelTitle );
 
-    d->txtTitle = new KLineEdit( this );
+    d->txtTitle = new TitleLineEdit( this );
     d->horizontalLayout->addWidget( d->txtTitle );
     d->labelTitle->setBuddy( d->txtTitle );
     connect( d->txtTitle, SIGNAL( textChanged( const QString& ) ), this,
              SLOT( slotTitleChanged( const QString& ) ) );
+    connect( d->txtTitle, SIGNAL(downKeyPressed()), SLOT(slotFocusEditor()) );
 
     d->gridLayout->addLayout( d->horizontalLayout, 0, 0, 1, 1 );
+}
 
+void PostEntry::slotFocusEditor()
+{
+    if(d->tabWidget->currentIndex() == 0)
+        d->wysiwygEditor->startEditing();
+    else if(d->tabWidget->currentIndex() == 1)
+        d->htmlEditor->setFocus();
 }
 
 void PostEntry::slotSyncEditors(int index)
--- trunk/KDE/kdepim/blogilo/src/postentry.h #1197055:1197056
@@ -124,6 +124,7 @@
     void deleteProgressBar();
     void saveTemporary();
     void slotPostModified();
+    void slotFocusEditor();
 
     /*!
      *  Sets the content of the current tab  as other tabs' contents, to apply recent
[prev in list] [next in list] [prev in thread] [next in thread] 

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