OSDN Git Service

Before delete before publishing.
authorunknown <\90¹@.(none)>
Thu, 11 Aug 2011 09:00:37 +0000 (18:00 +0900)
committerunknown <\90¹@.(none)>
Thu, 11 Aug 2011 09:00:37 +0000 (18:00 +0900)
CommandoJikkyouSennyou.pro
extrapushbutton.cpp
extrapushbutton.h
separatorline.cpp [deleted file]
separatorline.h [deleted file]
widget.cpp
widget.h
widget.ui

index 1ba4601..4def948 100644 (file)
@@ -12,13 +12,11 @@ TEMPLATE = app
 
 SOURCES += main.cpp\
     widget.cpp \
-    extrapushbutton.cpp \
-    separatorline.cpp
+    extrapushbutton.cpp
 
 HEADERS  += \
     widget.h \
-    extrapushbutton.h \
-    separatorline.h
+    extrapushbutton.h
 
 FORMS    += \
     widget.ui
index bb9e6bb..2bee041 100644 (file)
@@ -1,6 +1,10 @@
 #include "extrapushbutton.h"
 #include <QDebug>
+#include <QEvent>
 
+/*
+  public functions
+  */
 ExtraPushButton::ExtraPushButton(QString shortCutKey, QString string, QWidget *parent)
     :QPushButton(shortCutKey + ":" + string, parent),
       _shortCutKey(shortCutKey),
@@ -14,6 +18,16 @@ ExtraPushButton::ExtraPushButton(QString shortCutKey, QString string, QWidget *p
     setMinimumSize(130,23);
 }
 
+QString ExtraPushButton::getShortCutKey()
+{
+    return _shortCutKey;
+}
+
+QString ExtraPushButton::getString()
+{
+    return _string;
+}
+
 /*
   public slots
   */
@@ -21,3 +35,29 @@ void ExtraPushButton::click()
 {
     emit clicked(_string);
 }
+
+/*
+  private functions
+  */
+void ExtraPushButton::enterEvent(QEvent *e)
+{
+    switch(e->type())
+    {
+    case QEvent::Enter:
+    {
+        if(this->toolTip().size()==0)
+        {
+            qDebug("Tool Tip of Button Error");
+            return;
+        }
+        if(this->isEnabled()==false)
+        {
+            return;
+        }
+        emit showingToolTip(toolTip());
+        break;
+    }
+    default:
+        break;
+    }
+}
index 3b25f80..e43d73b 100644 (file)
@@ -7,15 +7,21 @@ class ExtraPushButton : public QPushButton
     Q_OBJECT
 public:
     ExtraPushButton(QString shortCutKey, QString string, QWidget *parent=0);
+    QString getShortCutKey();
+    QString getString();
 
 public slots:
     void click();
 
+protected:
+    virtual void enterEvent(QEvent *e);
+
 private:
     QString _shortCutKey, _string;
 
 signals:
     void clicked(QString string);
+    void showingToolTip(QString toolTipString);
 };
 
 #endif // EXTRAPUSHBUTTON_H
diff --git a/separatorline.cpp b/separatorline.cpp
deleted file mode 100644 (file)
index 8c7eef8..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "separatorline.h"
-#include <QMouseEvent>
-separatorLine::separatorLine(QWidget *parent) :
-    QFrame(parent)
-{
-    setFrameStyle(QFrame::HLine);
-    setCursor(Qt::SizeVerCursor);
-}
-
-void separatorLine::mousePressEvent(QMouseEvent *e)
-{
-    emit mousePressed(e->pos());
-}
-
-void separatorLine::mouseReleaseEvent(QMouseEvent *e)
-{
-    emit mouseReleased(e->pos());
-}
diff --git a/separatorline.h b/separatorline.h
deleted file mode 100644 (file)
index 64e3b64..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef SEPARATORLINE_H
-#define SEPARATORLINE_H
-
-#include <QFrame>
-
-class separatorLine : public QFrame
-{
-    Q_OBJECT
-public:
-    explicit separatorLine(QWidget *parent = 0);
-
-protected:
-    void mousePressEvent(QMouseEvent *e);
-    void mouseReleaseEvent(QMouseEvent *e);
-
-private:
-
-signals:
-    void mousePressed(QPoint pos);
-    void mouseReleased(QPoint pos);
-
-public slots:
-
-};
-
-#endif // SEPARATORLINE_H
index f5837ef..2614ddf 100644 (file)
@@ -8,7 +8,6 @@
 #include <QSettings>
 #include <QKeyEvent>
 #include "extrapushbutton.h"
-#include "separatorline.h"
 #include <cmath>
 #include <QLayoutItem>
 #include <QSslCertificate>
@@ -18,7 +17,8 @@
 #include <QSslConfiguration>
 #include <QtAlgorithms>
 #include <qjson-qjson/src/parser.h>
-#include <qjson-qjson/src/serializer.h>
+#include <QDateTime>
+#include <QShortcut>
 /*
   publidc functions
   */
@@ -33,8 +33,7 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){
     ui->setupUi(this);
 
     QString oauthIniName = qApp->applicationDirPath()
-            + QDir::separator()
-            + "QtTC.ini";
+            + "/verification.ini";
     _oauthSettings = new QSettings(oauthIniName, QSettings::IniFormat);
     _oauthSettings->setIniCodec("utf-8");
     //-------------------------
@@ -44,18 +43,22 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){
 
     _oauthManager->setNetworkManager(new QNetworkAccessManager);
 
+    connect(_oauthManager, SIGNAL(authorizedRequestDone()),
+            this, SLOT(onAuthorizedRequestDone()));
+
     _oauthRequest->setEnableDebugOutput(true); // デバッグ出力ON
     //  _oauthRequest->setEnableDebugOutput(false); // デバッグ出力OFF
     //-------------------------
 
-    if (_oauthSettings->childKeys().size() == 2) {
+    if (_oauthSettings->childKeys().size() == 3) {
         // 既に認証キー取得済みならボタン2を有効にする
         ui->pushButton_2->setEnabled(true);
+
+        ui->lineEdit->setText(_oauthSettings->value("number").toString());
     }
 
     QString shortCutKeysIniName = qApp->applicationDirPath()
-            + QDir::separator()
-            + "key.txt";
+            + "/key.txt";
     _shortCutKeysSettings = new QSettings(shortCutKeysIniName, QSettings::IniFormat);
     _shortCutKeysSettings->setIniCodec("utf-8");
     QStringList keyKeys = _shortCutKeysSettings->childKeys();
@@ -70,15 +73,12 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){
         ui->buttonsGridLayout->addWidget(p,0,i);
         // Succession of slots can not go well.
         connect(p, SIGNAL(clicked()), p, SLOT(click()));
-        //connect(p, SIGNAL(clicked(QString)), this, SLOT(sendTweet(QString)));
+        connect(p, SIGNAL(clicked(QString)), this, SLOT(sendTweet(QString)));
+        connect(p, SIGNAL(showingToolTip(QString)), ui->plainTextEdit, SLOT(setPlainText(QString)));
     }
 
-    separatorLine *sl = new separatorLine(this);
-    ui->timeLienVerticalLayout->addWidget(sl);
-
     QString sizeIniName = qApp->applicationDirPath()
-            + QDir::separator()
-            + "size.ini";
+            + "/size.ini";
     _sizeSettings = new QSettings(sizeIniName, QSettings::IniFormat);
     if(_sizeSettings->allKeys().count()==2)
     {
@@ -89,7 +89,27 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){
         resize(200,200);
     }
 
-    QList<QSslCertificate> cList;
+    // Short Cut Key for Post.
+    QShortcut *post1 = new QShortcut(ui->lineEdit_2);
+    QShortcut *post2 = new QShortcut(ui->lineEdit_3);
+    QShortcut *post3 = new QShortcut(ui->lineEdit_4);
+    QShortcut *post4 = new QShortcut(ui->lineEdit_5);
+    QShortcut *post5 = new QShortcut(ui->lineEdit_6);
+    QList<QShortcut*> postShortCutList;
+    postShortCutList << post1 << post2 << post3 << post4 << post5;
+    for(int i=0;i<postShortCutList.size();++i)
+    {
+        this->setShortCutKeyAndContext(postShortCutList.at(i), QKeyStandard(Qt::CTRL + Qt::Key_Return), Qt::WidgetShortcut);
+    }
+
+    connect(post1, SIGNAL(activated()), ui->pushButton_4, SLOT(click()));
+    connect(post2, SIGNAL(activated()), ui->pushButton_4, SLOT(click()));
+    connect(post3, SIGNAL(activated()), ui->pushButton_4, SLOT(click()));
+    connect(post4, SIGNAL(activated()), ui->pushButton_4, SLOT(click()));
+    connect(post5, SIGNAL(activated()), ui->pushButton_4, SLOT(click()));
+
+    //initializeOwnPostsWidgets();
+    /*   QList<QSslCertificate> cList;
 
     QFile f1(qApp->applicationDirPath() + "\\" + "v.cer");
     f1.open(QIODevice::ReadOnly);
@@ -122,8 +142,8 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){
     sock->setCaCertificates(cList);
     qDebug() << "[CLIENT]:  Attempting Connection...";
     //sock->connectToHostEncrypted("userstream.twitter.com/2/user.json", 443);
-    //sock->connectToHostEncrypted("userstream.twitter.com", 443);
-    sock->connectToHostEncrypted("api.twitter.com", 443);
+    sock->connectToHostEncrypted("userstream.twitter.com", 443);
+    //sock->connectToHostEncrypted("api.twitter.com", 443);
 
     if(sock->waitForConnected())
     {
@@ -150,10 +170,11 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){
     }
 
     qDebug("Writing");
-    if(true)
+    if(false)
     {
-        QUrl url("https://api.twitter.com/1/statuses/home_timeline.json");
+        //QUrl url("https://api.twitter.com/1/statuses/home_timeline.json");
         //QUrl url("https://userstream.twitter.com/2/user.json");
+        QUrl url("http://stream.twitter.com/1/filter.json");
         _oauthRequest->initRequest(KQOAuthRequest::AuthorizedRequest, url);
         _oauthRequest->setHttpMethod(KQOAuthRequest::GET); // GET指定
         _oauthRequest->setConsumerKey("nXrjGagSLIQxCC4AmJ1J3g");
@@ -170,7 +191,7 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){
                 this, SLOT(onAuthorizedRequestDone()));
         //    _oauthManager->executeRequest(_oauthRequest);
     }
-    else
+    else if(false)
     {
         QUrl url("https://api.twitter.com/1/statuses/update.xml");
         _oauthRequest->initRequest(KQOAuthRequest::AuthorizedRequest,url);
@@ -186,7 +207,47 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){
         _oauthRequest->setAdditionalParameters(params);
         //    _oauthManager->executeRequest(_oauthRequest);
     }
+    else if(false)
+    {
+        QUrl url("http://stream.twitter.com/1/statuses/filter.json");
+        _oauthRequest->initRequest(KQOAuthRequest::AuthorizedRequest,url);
+        _oauthRequest->setHttpMethod(KQOAuthRequest::POST); // POST指定
+        _oauthRequest->setConsumerKey("nXrjGagSLIQxCC4AmJ1J3g");
+        _oauthRequest->setConsumerSecretKey("QkTRr36zT6wAMERWqKUefyshxXIeaGzPKxB5pwMN0tg");
+        _oauthRequest->setToken(_oauthSettings->value("oauth_token").toString());
+        _oauthRequest->setTokenSecret(_oauthSettings->value("oauth_token_secret").toString());
 
+        KQOAuthParameters params;
+        params.insert("follow", "2062439");
+        _oauthRequest->setAdditionalParameters(params);
+
+        connect(sock, SIGNAL(readyRead()), this, SLOT(readyRead()));
+        disconnect(_oauthManager, SIGNAL(requestReady(QByteArray)));
+        connect(_oauthManager, SIGNAL(requestReady(QByteArray)),
+                this, SLOT(onRequestReadyTimeline(QByteArray)));
+        connect(_oauthManager, SIGNAL(authorizedRequestDone()),
+                this, SLOT(onAuthorizedRequestDone()));
+        //    _oauthManager->executeRequest(_oauthRequest);
+    }
+    else
+    {
+        QUrl url("http://stream.twitter.com/1/sample.json");
+        _oauthRequest->initRequest(KQOAuthRequest::AuthorizedRequest, url);
+        _oauthRequest->setHttpMethod(KQOAuthRequest::GET); // GET指定
+        _oauthRequest->setConsumerKey("nXrjGagSLIQxCC4AmJ1J3g");
+        _oauthRequest->setConsumerSecretKey("QkTRr36zT6wAMERWqKUefyshxXIeaGzPKxB5pwMN0tg");
+        _oauthRequest->setToken(_oauthSettings->value("oauth_token").toString());
+        _oauthRequest->setTokenSecret(
+                    _oauthSettings->value("oauth_token_secret").toString());
+
+        connect(sock, SIGNAL(readyRead()), this, SLOT(readyRead()));
+        disconnect(_oauthManager, SIGNAL(requestReady(QByteArray)));
+        connect(_oauthManager, SIGNAL(requestReady(QByteArray)),
+                this, SLOT(onRequestReadyTimeline(QByteArray)));
+        connect(_oauthManager, SIGNAL(authorizedRequestDone()),
+                this, SLOT(onAuthorizedRequestDone()));
+        //    _oauthManager->executeRequest(_oauthRequest);
+    }
     QNetworkRequest networkRequest;
     networkRequest.setUrl( _oauthRequest->requestEndpoint() );
 
@@ -236,25 +297,26 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){
 
         // Submit the request including the params.
         //QNetworkReply *reply = d->networkManager->get(networkRequest);
-        QNetworkReply *reply = _oauthManager->networkManager()->get(networkRequest);
+        //QNetworkReply *reply = _oauthManager->networkManager()->get(networkRequest);
         //qDebug() << reply->readAll();
 
         //QByteArray array("GET /1/statuses/home_timeline.json");
-        QByteArray array("GET /2/user.json");
+        //QByteArray array("GET /2/user.json");
+        QByteArray array("GET /1/statuses/sample.json");
         array.append("\r\nAuthorization: " + authHeader);
-        //            array.append("HTTP/1.1\r\n");
-        //                        .append("Accept: */* \r\n")
-        //                        .append("Accept-Language: ja\r\n")
-        //                        .append("If-Modified-Since: Mon,04 Dec 2000 00:11:45 GMT; length=35\r\n")
-        //                        .append("User-Agent: Mozilla/4.0(compatible; MSIE 5.5; Windows NT 5.0)\r\n")
-        //array.append("Host: ").append("api.twitter.com").append("\r\n");
-        //            array.append("Host: ").append("userstream.twitter.com").append("\r\n");
-        //                        .append("Connection: Keep-Alive")
-        //qDebug() << array;
-        //sock->write(array);
-
-        connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),
-                this, SLOT(slotError(QNetworkReply::NetworkError)));
+        //        array.append("HTTP/1.1\r\n");
+        //        .append("Accept: *\/\* \r\n")
+        //                .append("Accept-Language: ja\r\n")
+        //                .append("If-Modified-Since: Mon,04 Dec 2000 00:11:45 GMT; length=35\r\n")
+        //                .append("User-Agent: Mozilla/4.0(compatible; MSIE 5.5; Windows NT 5.0)\r\n");
+        //        array.append("Host: ").append("api.twitter.com").append("\r\n");
+        //        array.append("Host: ").append("userstream.twitter.com").append("\r\n");
+        //        .append("Connection: Keep-Alive");
+        qDebug() << array;
+        sock->write(array);
+
+//        connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),
+//                this, SLOT(slotError(QNetworkReply::NetworkError)));
     }
     else if (_oauthRequest->httpMethod() == KQOAuthRequest::POST) {
 
@@ -268,7 +330,7 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){
         if (_oauthRequest->contentType() == "application/x-www-form-urlencoded") {
             //reply = d->networkManager->post(networkRequest, _oauthRequest->requestBody());
             reply = _oauthManager->networkManager()->post(networkRequest, _oauthRequest->requestBody());
-            qDebug() << "pp" << _oauthRequest->requestBody();
+            qDebug() << "pp" << _oauthRequest->requestBody() << reply->readAll();
         } else {
             //reply = d->networkManager->post(networkRequest, _oauthRequest->rawData());
             reply = _oauthManager->networkManager()->post(networkRequest, _oauthRequest->rawData());
@@ -279,12 +341,48 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget){
                 this, SLOT(slotError(QNetworkReply::NetworkError)));
     }
 
-    return;
-
+*/
     //        sock->disconnectFromHost();
     //    }
 }
 
+bool Widget::setShortCutKeyAndContext(QShortcut *sc, QKeySequence s, Qt::ShortcutContext c)
+{
+    sc->setKey(s);
+    sc->setContext(c);
+}
+
+bool Widget::initializeOwnPostsWidgets()
+{
+    QUrl url("https://api.twitter.com/1/statuses/user_timeline.json");
+    _oauthRequest->initRequest(KQOAuthRequest::AuthorizedRequest, url);
+    _oauthRequest->setHttpMethod(KQOAuthRequest::GET); // GET指定
+    _oauthRequest->setConsumerKey("nXrjGagSLIQxCC4AmJ1J3g");
+    _oauthRequest->setConsumerSecretKey("QkTRr36zT6wAMERWqKUefyshxXIeaGzPKxB5pwMN0tg");
+    _oauthRequest->setToken(_oauthSettings->value("oauth_token").toString());
+    _oauthRequest->setTokenSecret(
+                _oauthSettings->value("oauth_token_secret").toString());
+
+    KQOAuthParameters params;
+    params.insert("count", "131");
+    _oauthRequest->setAdditionalParameters(params);
+
+
+    qDebug() << _oauthSettings->value("oauth_token").toString();
+    qDebug() << _oauthSettings->value("oauth_token_secret").toString();
+
+    disconnect(_oauthManager, SIGNAL(requestReady(QByteArray)));
+    connect(_oauthManager, SIGNAL(requestReady(QByteArray)),
+            this, SLOT(onRequestReadyOwnPosts(QByteArray)));
+
+    connect(_oauthManager, SIGNAL(authorizedRequestDone()),
+            this, SLOT(onAuthorizedRequestDone()));
+
+    _oauthManager->executeRequest(_oauthRequest);
+
+    return true;
+}
+
 void Widget::slotError(QNetworkReply::NetworkError e)
 {
     qDebug() << "1" << e;
@@ -297,7 +395,8 @@ void Widget::cState(QAbstractSocket::SocketState s)
 
 void Widget::readyRead()
 {
-    qDebug() << "3" << sock->readAll();
+    qDebug() << "3";
+    qDebug() << sock->readAll();
 }
 
 void Widget::cError(QAbstractSocket::SocketError e)
@@ -366,7 +465,8 @@ void Widget::keyPressEvent(QKeyEvent *ke)
         qDebug() << ke->text() << _keyString << ke->count();
         for(int i=0;i<ui->buttonsGridLayout->count();++i)
         {
-            if(dynamic_cast<ExtraPushButton*>(ui->buttonsGridLayout->itemAt(i)->widget())->text().contains(QRegExp("^" + _keyString))==false)
+            ExtraPushButton *p = dynamic_cast<ExtraPushButton*>(ui->buttonsGridLayout->itemAt(i)->widget());
+            if(p->getShortCutKey().indexOf(_keyString)==-1)
             {
                 ui->buttonsGridLayout->itemAt(i)->widget()->setEnabled(false);
             }
@@ -382,49 +482,59 @@ void Widget::keyReleaseEvent(QKeyEvent *ke)
     }
     if( ( ke->key()==Qt::Key_Control) && (_keyString.size()>0) )
     {
-        for(int i=0;i<ui->buttonsGridLayout->count();++i)
-        {
-            if(!dynamic_cast<ExtraPushButton*>(ui->buttonsGridLayout->itemAt(i)->widget())->text().contains(QRegExp("^" + _keyString)));
-            {
-                ui->buttonsGridLayout->itemAt(i)->widget()->setEnabled(true);
-            }
-        }
         qDebug() << "ctrl!" << _keyString;
         QString tweet;
-        QList<QString> list = _keysHash->keys();
         int matchedKeysNumber = 0;
+        QList<QString> list = _keysHash->keys();
         for(int i=0;i<list.size();++i)
         {
-            if(list.at(i).contains(QRegExp("^" + _keyString.toLower())))
+            if(list.at(i).indexOf(_keyString)==0)
             {
+                // Match
+                if(list.at(i).length() == _keyString.length())
+                {
+                    tweet = _keysHash->value(list.at(i));
+                    matchedKeysNumber = -1;
+                    break;
+                }
                 ++matchedKeysNumber;
                 tweet = _keysHash->value(list.at(i));
             }
-            if(matchedKeysNumber>1)
-            {
-                break;
-            }
         }
-        if(matchedKeysNumber!=1)
+
+        if(matchedKeysNumber>1)
         {
             tweet.clear();
         }
         _keyString.clear();
-        if(tweet.size()==0)
-        {
-            qDebug() << "There is not such a short cut key.";
-            return;
-        }
         if(tweet.contains(QRegExp("\\(\\d.*\\)")))
         {
-            qDebug("ho");
+            ui->plainTextEdit->setPlainText(tweet);
+            for(int i=0;i<ui->buttonsGridLayout->count();++i)
+            {
+                if(ui->buttonsGridLayout->itemAt(i)->widget()->isEnabled()==true)
+                {
+                    ui->buttonsGridLayout->itemAt(i)->widget()->setEnabled(false);
+                }
+            }
             ui->lineEdit_2->setFocus();
         }
         else
         {
-            //sendTweet(tweet);
+            for(int i=0;i<ui->buttonsGridLayout->count();++i)
+            {
+                if(ui->buttonsGridLayout->itemAt(i)->widget()->isEnabled()==false)
+                {
+                    ui->buttonsGridLayout->itemAt(i)->widget()->setEnabled(true);
+                }
+            }
+            if(tweet.size()==0)
+            {
+                qDebug() << "There is not such a short cut key.";
+                return;
+            }
+            sendTweet(tweet);
         }
-        qDebug() << "send " << tweet;
         tweet.clear();
     }
 }
@@ -561,7 +671,7 @@ void Widget::onAccessTokenReceived(QString token, QString tokenSecret)
     qDebug() << "Access token received: " << token << tokenSecret;
 
     _oauthSettings->setValue(tr("oauth_token"), token);
-    _oauthSettings->setValue(tr("_oauth_token_secret"), tokenSecret);
+    _oauthSettings->setValue(tr("oauth_token_secret"), tokenSecret);
 
     qDebug() << "Access tokens now stored. "
                 "You are ready to send Tweets from user's account!";
@@ -580,6 +690,9 @@ void Widget::onRequestReady(QByteArray response)
 }
 
 void Widget::on_pushButton_clicked() {
+    ui->lineEdit->setEnabled(true);
+    ui->pushButton_3->setEnabled(true);
+
     //--------------------------
     // kQOAuthのスロットの登録
     connect(_oauthManager, SIGNAL(temporaryTokenReceived(QString,QString)),
@@ -622,9 +735,10 @@ void Widget::on_pushButton_clicked() {
 }
 
 void Widget::on_pushButton_2_clicked() {
-    ui->pushButton_2->setEnabled(false);
+    //ui->pushButton_2->setEnabled(false);
+    ui->listWidget->clear();
 
-    QUrl url("https://api.twitter.com/1/statuses/home_timeline.xml");
+    QUrl url("https://api.twitter.com/1/statuses/home_timeline.json");
     _oauthRequest->initRequest(KQOAuthRequest::AuthorizedRequest, url);
     _oauthRequest->setHttpMethod(KQOAuthRequest::GET); // GET指定
     _oauthRequest->setConsumerKey("nXrjGagSLIQxCC4AmJ1J3g");
@@ -636,12 +750,12 @@ void Widget::on_pushButton_2_clicked() {
     qDebug() << _oauthSettings->value("oauth_token").toString();
     qDebug() << _oauthSettings->value("oauth_token_secret").toString();
 
-    disconnect(_oauthManager, SIGNAL(requestReady(QByteArray)));
+    disconnect(_oauthManager, SIGNAL(requestReady(QByteArray)),0,0);
     connect(_oauthManager, SIGNAL(requestReady(QByteArray)),
             this, SLOT(onRequestReadyTimeline(QByteArray)));
 
-    connect(_oauthManager, SIGNAL(authorizedRequestDone()),
-            this, SLOT(onAuthorizedRequestDone()));
+    //    connect(_oauthManager, SIGNAL(authorizedRequestDone()),
+    //            this, SLOT(onAuthorizedRequestDone()));
 
     _oauthManager->executeRequest(_oauthRequest);
 }
@@ -649,6 +763,7 @@ void Widget::on_pushButton_2_clicked() {
 void Widget::onRequestReadyTimeline(QByteArray response) {
     qDebug() << "requestReady-Timeline";
     QDomDocument dom;
+    // For JSON
     if(dom.setContent(response)==false)
     {
         QJson::Parser parser;
@@ -656,157 +771,188 @@ void Widget::onRequestReadyTimeline(QByteArray response) {
         QVariant top = parser.parse(response, &ok);
         if(!ok)
         {
-            qDebug() << "json error";
+            qDebug() << response.size() << response << "json error";
             return;
         }
-        qDebug() << "top.list.size:" << top.toList().size();
-        qDebug() << "top.map.size:" << top.toMap().size();
 
         //QVariantMap result = top.toMap();
         QVariantList contentList = top.toList();
 
         foreach ( QVariant content, contentList ){
-            //qDebug() << contentList.toMap();
+            /*
             qDebug() <<
                         content.toMap()["contributors"] <<
-                        "\t" <<
+                        "\n" <<
                         content.toMap()["coordinates"] <<
-                        "-" <<
+                        "\n" <<
                         content.toMap()["created_at"].toString() <<
-                        "\t" <<
+                        "\n" <<
                         content.toMap()["geo"]<<
-                        "\t" <<
+                        "\n" <<
                         content.toMap()["id"].toLongLong() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["id_str"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["in_reply_to_screen_name"] <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["in_reply_to_status_id"]<<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["in_reply_to_status_id"] <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["in_reply_to_user_id"] <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["in_reply_to_user_id_str"] <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["place"] <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["possibly_sensitive"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["retweet_count"].toULongLong() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["retweeted"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["text"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["truncated"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["contributors_enabled"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["created_at"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["default_profile"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["default_profile_image"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["description"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["favourites_count"].toULongLong() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["followers_count"].toULongLong() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["following"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["friends_count"].toULongLong() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["geo_enabled"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["id"].toULongLong() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["id_str"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["is_translator"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["lang"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["listed_count"].toULongLong() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["location"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["profile_background_color"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["profile_background_image_url"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["profile_background_image_url_https"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["profile_background_tile"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["profile_image_url_https"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["profile_sidebar_border_color"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["profile_sidebar_fill_color"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["profile_text_color"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["profile_use_background_image"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["protected"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["screen_name"].toBool() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["show_all_inline_media"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["statuses_count"].toULongLong() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["time_zone"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["url"].toString() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["utc_offset"].toULongLong() <<
-                        ":" <<
+                        "\n" <<
                         content.toMap()["user"].toMap()["verified"].toBool() <<
                         "\n\n";
-
+*/
             ui->listWidget->addItem(content.toMap()["text"].toString());
         }
         return;
     }
-
-    // DOM からヘッダ情報を取得する
-    QDomElement root = dom.documentElement();
-    QDomNode node;
-    node = root.firstChild();
-    while ( !node.isNull() )
+    // for XML
+    else
     {
-        if ( node.isElement() && (node.nodeName() == "status" ) )
+        QDomElement root = dom.documentElement();
+        QDomNode node;
+        node = root.firstChild();
+        while ( !node.isNull() )
         {
-            QDomElement header = node.toElement();
-
-            QDomNode node = header.firstChild();
-            while ( !node.isNull() )
+            if ( node.isElement() && (node.nodeName() == "status" ) )
             {
-                if ( node.isElement() )
+                QDomElement header = node.toElement();
+
+                QDomNode node = header.firstChild();
+                while ( !node.isNull() )
                 {
-                    // いろいろなヘッダエントリの場合
-                    if ( node.nodeName() == "text" )
+                    if ( node.isElement() )
                     {
-                        QDomText textChild = node.firstChild().toText();
-                        if ( !textChild.isNull() )
+                        // いろいろなヘッダエントリの場合
+                        if ( node.nodeName() == "text" )
                         {
-                            qDebug() << textChild.nodeValue();
-                            ui->listWidget->addItem(textChild.nodeValue());
+                            QDomText textChild = node.firstChild().toText();
+                            if ( !textChild.isNull() )
+                            {
+                                ui->listWidget->addItem(textChild.nodeValue());
+                            }
                         }
                     }
+                    node = node.nextSibling();
                 }
-                node = node.nextSibling();
             }
+            node = node.nextSibling();
         }
-        node = node.nextSibling();
     }
 }
 
+void Widget::onRequestReadyOwnPosts(QByteArray response) {
+    qDebug() << "requestReady-OwnPosts";
+    // for JSON
+    QDomDocument dom;
+    if(dom.setContent(response)==false)
+    {
+        QJson::Parser parser;
+        bool ok =false;
+        QVariant top = parser.parse(response, &ok);
+        if(!ok)
+        {
+            qDebug() << response.size() << response << "json error";
+            return;
+        }
+        qDebug() << "top.list.size:" << top.toList().size();
+        qDebug() << "top.map.size:" << top.toMap().size();
+
+        //QVariantMap result = top.toMap();
+        QVariantList contentList = top.toList();
+
+        for(int i=0;i<contentList.size();++i)
+        {
+            QVariant content = contentList.at(i);
+            ui->tableWidget_2->setItem(ui->tableWidget_2->rowCount()-i-1, 0, new QTableWidgetItem(content.toMap()["created_at"].toString().mid(8,11)));
+            if(i<10)
+            {
+                ui->tableWidget->setItem(9-i,0, new QTableWidgetItem(content.toMap()["text"].toString()));
+            }
+        }
+        return;
+    }
+}
 
 void Widget::sendTweet(QString tweet) {
 
@@ -830,11 +976,24 @@ void Widget::sendTweet(QString tweet) {
     _oauthRequest->setAdditionalParameters(params);
 
     qDebug() << "Attempting send tweet such as " << tweet;
-    _oauthManager->executeRequest(_oauthRequest);
+    //_oauthManager->executeRequest(_oauthRequest);
+
+    ui->tableWidget->removeRow(0);
+    ui->tableWidget->setRowCount(ui->tableWidget->rowCount()+1);
+    ui->tableWidget->setItem(9,0,new QTableWidgetItem(tweet));
 
+    ui->tableWidget_2->removeRow(0);
+    ui->tableWidget_2->setRowCount(ui->tableWidget_2->rowCount()+1);
+    ui->tableWidget_2->setItem(129,0, new QTableWidgetItem( (QDateTime::currentDateTime().toString("dd hh:mm:ss"))));
     //    connect(_oauthManager, SIGNAL(authorizedRequestReady()),
     //         this, SLOT(onAuthorizedRequestReady()));
 
+    // LineEdits must cleare content.
+    ui->lineEdit_2->clear();
+    ui->lineEdit_3->clear();
+    ui->lineEdit_4->clear();
+    ui->lineEdit_5->clear();
+    ui->lineEdit_6->clear();
 }
 
 void Widget::showOAuthError(const int nErrNum)
@@ -844,6 +1003,9 @@ void Widget::showOAuthError(const int nErrNum)
 
 void Widget::on_pushButton_3_clicked()
 {
+    ui->lineEdit->setEnabled(false);
+    ui->pushButton_3->setEnabled(false);
+    _oauthSettings->setValue("number", ui->lineEdit->text());
     _oauthManager->onVerificationReceived1(ui->lineEdit->text());
 }
 
@@ -851,3 +1013,46 @@ void Widget::on_lineEdit_2_editingFinished()
 {
     //lineEditの継承クラスにCtrl+Enter押し下し時の処置:(\d)との置換:を記述する
 }
+
+void Widget::on_pushButton_4_clicked()
+{
+    QString tweet = ui->plainTextEdit->toPlainText();
+    tweet.replace(QRegExp("\\(\\d+:([^()]+)\\)"), "\\1");
+    sendTweet(tweet);
+}
+
+void Widget::on_lineEdit_2_textChanged(const QString &arg1)
+{
+    replacePlainTextEditContent(1, arg1);
+}
+
+void Widget::on_lineEdit_3_textChanged(const QString &arg1)
+{
+    replacePlainTextEditContent(1, arg1);
+}
+
+void Widget::on_lineEdit_4_textChanged(const QString &arg1)
+{
+    replacePlainTextEditContent(1, arg1);
+}
+
+void Widget::on_lineEdit_5_textChanged(const QString &arg1)
+{
+    replacePlainTextEditContent(1, arg1);
+}
+
+void Widget::on_lineEdit_6_textChanged(const QString &arg1)
+{
+    replacePlainTextEditContent(1, arg1);
+}
+
+bool Widget::replacePlainTextEditContent(int i, QString str)
+{
+    if(str.length()>0)
+    {
+        QString text = ui->plainTextEdit->toPlainText();
+        text.replace(QRegExp("(\\(" + QString::number(i) + ":)[^()]+(\\))"), "\\1" + str + "\\2");
+        ui->plainTextEdit->setPlainText(text);
+    }
+    return true;
+}
index 2821e61..5e4fd6b 100644 (file)
--- a/widget.h
+++ b/widget.h
@@ -14,6 +14,7 @@
 #include <QAbstractSocket>
 #include <QSslSocket>
 #include <QNetworkReply>
+#include <QShortcut>
 class KQOAuthManager;
 class KQOAuthRequest;
 //class KQOAuthRequest_XAuth;
@@ -28,13 +29,11 @@ class Widget : public QWidget {
 public:
     explicit Widget(QWidget *parent = 0);
     ~Widget();
+    bool initializeOwnPostsWidgets();
+    bool replacePlainTextEditContent(int i, QString str);
+    bool setShortCutKeyAndContext(QShortcut *sc, QKeySequence s, Qt::ShortcutContext c);
 
 public slots:
-    void receive(QList<QSslError> e);
-    void cError(QAbstractSocket::SocketError);
-    void readyRead();
-    void cState(QAbstractSocket::SocketState);
-    void slotError(QNetworkReply::NetworkError);
 
 protected:
     void keyPressEvent(QKeyEvent *);
@@ -49,13 +48,31 @@ private slots:
     void onAuthorizedRequestDone();
     void onRequestReady(QByteArray response);
     void onRequestReadyTimeline(QByteArray response);
+    void onRequestReadyOwnPosts(QByteArray);
     void sendTweet(QString tweet);
+    void receive(QList<QSslError> e);
+    void cError(QAbstractSocket::SocketError);
+    void readyRead();
+    void cState(QAbstractSocket::SocketState);
+    void slotError(QNetworkReply::NetworkError);
     void on_pushButton_clicked();
     void on_pushButton_2_clicked();
     void on_pushButton_3_clicked();
 
     void on_lineEdit_2_editingFinished();
 
+    void on_pushButton_4_clicked();
+
+    void on_lineEdit_2_textChanged(const QString &arg1);
+
+    void on_lineEdit_3_textChanged(const QString &arg1);
+
+    void on_lineEdit_4_textChanged(const QString &arg1);
+
+    void on_lineEdit_5_textChanged(const QString &arg1);
+
+    void on_lineEdit_6_textChanged(const QString &arg1);
+
 private:
     Ui::Widget *ui;
 
index b3ef00d..fea99a6 100644 (file)
--- a/widget.ui
+++ b/widget.ui
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>402</width>
-    <height>358</height>
+    <width>361</width>
+    <height>484</height>
    </rect>
   </property>
   <property name="focusPolicy">
-   <enum>Qt::TabFocus</enum>
+   <enum>Qt::ClickFocus</enum>
   </property>
-  <layout class="QGridLayout" name="gridLayout">
+  <layout class="QGridLayout" name="gridLayout_3">
    <property name="sizeConstraint">
-    <enum>QLayout::SetMaximumSize</enum>
+    <enum>QLayout::SetNoConstraint</enum>
    </property>
-   <item row="0" column="0" rowspan="2">
-    <layout class="QVBoxLayout" name="oauthVerticalLayout">
-     <item>
-      <widget class="QPushButton" name="pushButton">
-       <property name="minimumSize">
-        <size>
-         <width>75</width>
-         <height>23</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>75</width>
-         <height>23</height>
-        </size>
-       </property>
-       <property name="focusPolicy">
-        <enum>Qt::ClickFocus</enum>
-       </property>
-       <property name="text">
-        <string>OAuth</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLineEdit" name="lineEdit">
-       <property name="minimumSize">
-        <size>
-         <width>75</width>
-         <height>20</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>75</width>
-         <height>20</height>
-        </size>
-       </property>
-       <property name="focusPolicy">
-        <enum>Qt::ClickFocus</enum>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="pushButton_3">
-       <property name="minimumSize">
-        <size>
-         <width>75</width>
-         <height>23</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>75</width>
-         <height>23</height>
-        </size>
-       </property>
-       <property name="focusPolicy">
-        <enum>Qt::ClickFocus</enum>
-       </property>
-       <property name="text">
-        <string>Verification</string>
+   <item row="0" column="0">
+    <widget class="QSplitter" name="splitter">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <widget class="QWidget" name="layoutWidget">
+      <layout class="QGridLayout" name="gridLayout">
+       <item row="0" column="0">
+        <layout class="QVBoxLayout" name="oauthVerticalLayout">
+         <item>
+          <widget class="QPushButton" name="pushButton">
+           <property name="minimumSize">
+            <size>
+             <width>75</width>
+             <height>23</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>75</width>
+             <height>23</height>
+            </size>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::ClickFocus</enum>
+           </property>
+           <property name="text">
+            <string>OAuth</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="lineEdit">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>75</width>
+             <height>20</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>75</width>
+             <height>20</height>
+            </size>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::ClickFocus</enum>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="pushButton_3">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="minimumSize">
+            <size>
+             <width>75</width>
+             <height>23</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>75</width>
+             <height>23</height>
+            </size>
+           </property>
+           <property name="focusPolicy">
+            <enum>Qt::ClickFocus</enum>
+           </property>
+           <property name="text">
+            <string>Verification</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>Latest 130</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QTableWidget" name="tableWidget_2">
+           <property name="focusPolicy">
+            <enum>Qt::NoFocus</enum>
+           </property>
+           <property name="rowCount">
+            <number>130</number>
+           </property>
+           <attribute name="horizontalHeaderStretchLastSection">
+            <bool>true</bool>
+           </attribute>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <column>
+            <property name="text">
+             <string>日 時刻</string>
+            </property>
+           </column>
+           <column>
+            <property name="text">
+             <string>現時刻との差</string>
+            </property>
+           </column>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_2">
+           <property name="text">
+            <string>Latest 10</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QTableWidget" name="tableWidget">
+           <property name="focusPolicy">
+            <enum>Qt::NoFocus</enum>
+           </property>
+           <property name="rowCount">
+            <number>10</number>
+           </property>
+           <property name="columnCount">
+            <number>1</number>
+           </property>
+           <attribute name="horizontalHeaderStretchLastSection">
+            <bool>true</bool>
+           </attribute>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <row/>
+           <column>
+            <property name="text">
+             <string>POST</string>
+            </property>
+           </column>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item row="0" column="1">
+        <layout class="QVBoxLayout" name="timeLienVerticalLayout">
+         <item>
+          <widget class="QPushButton" name="pushButton_2">
+           <property name="text">
+            <string>TL</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QListWidget" name="listWidget"/>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="layoutWidget">
+      <layout class="QGridLayout" name="gridLayout_2">
+       <property name="sizeConstraint">
+        <enum>QLayout::SetMaximumSize</enum>
        </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="verticalSpacer">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
+       <item row="4" column="0">
+        <widget class="QLineEdit" name="lineEdit_2">
+         <property name="focusPolicy">
+          <enum>Qt::ClickFocus</enum>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="1">
+        <widget class="QLineEdit" name="lineEdit_3"/>
+       </item>
+       <item row="4" column="2">
+        <widget class="QLineEdit" name="lineEdit_4"/>
+       </item>
+       <item row="4" column="3">
+        <widget class="QLineEdit" name="lineEdit_5"/>
+       </item>
+       <item row="4" column="4">
+        <widget class="QLineEdit" name="lineEdit_6"/>
+       </item>
+       <item row="0" column="0" colspan="4">
+        <widget class="QPlainTextEdit" name="plainTextEdit">
+         <property name="enabled">
+          <bool>false</bool>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="4">
+        <widget class="QPushButton" name="pushButton_4">
+         <property name="text">
+          <string>POST
+Ctrl+Enter</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QGroupBox" name="groupBox">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="title">
+       <string>ctrl+</string>
+      </property>
+      <layout class="QGridLayout" name="gridLayout_4">
+       <property name="margin">
+        <number>0</number>
        </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>174</height>
-        </size>
+       <property name="spacing">
+        <number>0</number>
        </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item row="0" column="1" colspan="5">
-    <layout class="QVBoxLayout" name="timeLienVerticalLayout">
-     <item>
-      <widget class="QPushButton" name="pushButton_2">
-       <property name="text">
-        <string>TL</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QListWidget" name="listWidget"/>
-     </item>
-    </layout>
-   </item>
-   <item row="1" column="2">
-    <widget class="QLineEdit" name="lineEdit_3">
-     <property name="enabled">
-      <bool>false</bool>
-     </property>
+       <item row="0" column="0">
+        <widget class="QScrollArea" name="scrollArea">
+         <property name="widgetResizable">
+          <bool>true</bool>
+         </property>
+         <widget class="QWidget" name="scrollAreaWidgetContents">
+          <property name="geometry">
+           <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>339</width>
+            <height>69</height>
+           </rect>
+          </property>
+          <layout class="QGridLayout" name="gridLayout_6">
+           <item row="0" column="0">
+            <layout class="QGridLayout" name="buttonsGridLayout"/>
+           </item>
+          </layout>
+         </widget>
+        </widget>
+       </item>
+      </layout>
+     </widget>
     </widget>
    </item>
-   <item row="1" column="3">
-    <widget class="QLineEdit" name="lineEdit_4">
-     <property name="enabled">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="0" colspan="6">
-    <widget class="QPlainTextEdit" name="plainTextEdit"/>
-   </item>
-   <item row="3" column="0" colspan="6">
-    <widget class="QGroupBox" name="groupBox">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="title">
-      <string>ctrl+</string>
-     </property>
-     <layout class="QFormLayout" name="formLayout">
-      <item row="0" column="0">
-       <layout class="QGridLayout" name="buttonsGridLayout">
-        <property name="sizeConstraint">
-         <enum>QLayout::SetDefaultConstraint</enum>
-        </property>
-       </layout>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item row="1" column="4">
-    <widget class="QLineEdit" name="lineEdit_5">
-     <property name="enabled">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="5">
-    <widget class="QLineEdit" name="lineEdit_6">
-     <property name="enabled">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <widget class="QLineEdit" name="lineEdit_2"/>
-   </item>
   </layout>
  </widget>
  <tabstops>
-  <tabstop>lineEdit_2</tabstop>
-  <tabstop>lineEdit_3</tabstop>
-  <tabstop>lineEdit_4</tabstop>
-  <tabstop>lineEdit_5</tabstop>
-  <tabstop>lineEdit_6</tabstop>
   <tabstop>pushButton</tabstop>
   <tabstop>lineEdit</tabstop>
-  <tabstop>plainTextEdit</tabstop>
   <tabstop>pushButton_3</tabstop>
   <tabstop>pushButton_2</tabstop>
   <tabstop>listWidget</tabstop>