3 #include "w_timeline.h"
5 w_Timeline::w_Timeline(QString usr
, QString pass
, QWidget
*parent
)
8 le_message
->setFocus();
13 // Send message button (Squawk!)
14 QObject::connect(pb_update
, SIGNAL(clicked()), this, SLOT(sendUpdate()));
15 //Result of the button press
16 // QObject::connect( twitterSocket, SIGNAL( result(bool,QString) ), this, SLOT( updateResult(bool, QString) ) );
18 //Refresh the timeline ever so often...
19 timer
= new QTimer(this);
20 QObject::connect(timer
, SIGNAL(timeout()), this, SLOT(refresh()));
25 void w_Timeline::sendUpdate()
27 pb_update
->setEnabled(false);
28 le_message
->setEnabled(false);
30 TwitterSocket
*tmp
= new TwitterSocket(user
,password
);
31 QObject::connect( tmp
, SIGNAL( result(bool,QString
,QString
) ), this, SLOT( updateResult(bool, QString
) ) );
32 tmp
->update(le_message
->text());
35 void w_Timeline::updateResult(bool error
, QString errorstring
)
37 le_message
->setEnabled(true);
38 pb_update
->setEnabled(true);
42 void w_Timeline::refresh()
44 TwitterSocket
*tmp
= new TwitterSocket(user
,password
);
45 QObject::connect( tmp
, SIGNAL( result(bool,QString
,QString
) ), this, SLOT( refreshResult(bool, QString
, QString
) ) );
49 void w_Timeline::refreshResult(bool error
, QString errorstring
, QString contents
)
51 qDebug() << "Refresh result:" << error
;
52 qDebug() << "Contents:" << contents
;