example/DemoGUI/ToolBar.cpp
author cgandhi
Thu, 05 Aug 2010 16:35:33 +0530
changeset 16 b78fa4cdbf2b
permissions -rw-r--r--
pushing the demo application
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     1
#include "ToolBar.h"
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     2
#include "ScreenSize.h"
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     3
#include <qinputdialog.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     4
#include <qplaintextedit.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     5
#include <qdir.h>   //Checl lateer
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     6
#include <qmessagebox.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     7
#include <qdebug.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     8
#include <qtooltip.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
     9
//#include <apacmdln.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    10
//#include <apgcli.h>
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    11
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    12
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    13
//MACRO
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    14
#define KNullUid TUid::Null()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    15
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    16
//Forward declaration
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    17
class ScreenSize;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    18
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    19
ToolBar::ToolBar()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    20
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    21
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    22
}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    23
ToolBar::~ToolBar()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    24
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    25
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    26
}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    27
void ToolBar::GetToolBar(QMainWindow *Mainwindow,QStringList aListOfActions)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    28
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    29
    //iMainWindow = new QMainWindow;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    30
    iMainWindow = Mainwindow;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    31
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    32
    QHBoxLayout* layout = new QHBoxLayout;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    33
    QToolBar* tool = new QToolBar(Mainwindow);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    34
    QToolButton* button1 = new QToolButton(Mainwindow);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    35
    QToolButton* button2 = new QToolButton(Mainwindow);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    36
    QToolButton* button3 = new QToolButton(Mainwindow);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    37
    QToolButton* button4 = new QToolButton(Mainwindow);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    38
    
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    39
    tool->setGeometry(0,ScreenSize::GetScreenRect().height() - (ToolbarIconHeight + KWidgetGapFactor),(ScreenSize::GetScreenRect().width()-(KWidgetGapFactor)),ToolbarIconHeight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    40
    
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    41
    //ToDo :- Ankit to check on button resizing
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    42
    const int IconWidth = ScreenSize::GetScreenRect().width()/7;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    43
    button1->setGeometry(0,ScreenSize::GetScreenRect().height() - (ToolbarIconHeight + KWidgetGapFactor),IconWidth,ToolbarIconHeight);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    44
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    45
    button1->setFixedWidth(IconWidth);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    46
    button2->setFixedWidth(IconWidth);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    47
    button3->setFixedWidth(IconWidth);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    48
    button4->setFixedWidth(IconWidth);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    49
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    50
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    51
    QIcon icon1("E:/Images/SMF/home.svg");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    52
	QIcon icon2("E:/Images/SMF/all_friends.svg"); //next.PNG
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    53
	QIcon icon3("E:/Images/SMF/mail-message-new.svg");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    54
	QIcon icon4("E:/Images/SMF/Phone.svg");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    55
	QIcon icon5("E:/Images/SMF/system-log-out.svg");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    56
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    57
    button1->setIcon(icon1);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    58
    button2->setIcon(icon3);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    59
    button3->setIcon(icon4);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    60
    button4->setIcon(icon5);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    61
    
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    62
    button1->setToolTip("Home");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    63
    
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    64
    menu = new QMenu(Mainwindow);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    65
    icon2.actualSize(QSize(IconWidth-10,ToolbarIconHeight));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    66
    //menu->setFixedWidth(IconWidth+10);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    67
    menu->setIcon(icon2);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    68
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    69
    QMenu *addServ = new QMenu(Mainwindow);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    70
    addServ->setTitle(aListOfActions.at(0));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    71
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    72
    //For Facebook and Flickr SP
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    73
    QAction *addServ_Facebk = new QAction("FaceBook",Mainwindow);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    74
    QAction *addServ_Flickr = new QAction("Flickr",Mainwindow);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    75
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    76
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    77
    addServ->addAction(addServ_Facebk);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    78
    addServ->addAction(addServ_Flickr);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    79
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    80
   // }
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    81
    //Create Actions
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    82
    //newAction1 = new QAction(aListOfActions.at(1),Mainwindow);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    83
    //newAction2 = new QAction(aListOfActions.at(2),Mainwindow);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    84
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    85
    //need to be modified
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    86
    //menu->addAction(newAction1);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    87
    //menu->addAction(newAction2);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    88
    
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    89
    //to add services to the menu button
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    90
    menu->addMenu(addServ);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    91
    
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    92
    //TODO: button to be disabled
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    93
    //button2->setEnabled(false);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    94
    //button3->setEnabled(false);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    95
    
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    96
    tool->addWidget(button1);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    97
    tool->addAction(menu->menuAction());
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    98
    tool->addWidget(button2);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
    99
    tool->addWidget(button3);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   100
    tool->addWidget(button4);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   101
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   102
    layout->addWidget(tool);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   103
    
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   104
    //connect actions
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   105
   connect(button1,SIGNAL(clicked()),this,SLOT(homeView()));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   106
   connect(button2,SIGNAL(clicked()),this,SLOT(msg()));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   107
   connect(button3,SIGNAL(clicked()),this,SLOT(call()));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   108
   connect(button4,SIGNAL(clicked()),this,SLOT(exitApp()));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   109
   //connect(newAction1,SIGNAL(triggered()),this,SLOT(post()));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   110
   //connect(newAction2,SIGNAL(triggered()),this,SLOT(reply()));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   111
   
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   112
   //connect for authentication
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   113
   connect(addServ_Facebk,SIGNAL(triggered()),this,SLOT(authApp_Fb()));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   114
   connect(addServ_Flickr,SIGNAL(triggered()),this,SLOT(authApp_Flkr()));
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   115
   
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   116
}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   117
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   118
//changing to home view
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   119
void ToolBar::homeView()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   120
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   121
    //debug
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   122
    qDebug()<<"Inside View_Change()";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   123
}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   124
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   125
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   126
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   127
//slot for post comment
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   128
/*void ToolBar::post()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   129
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   130
    //debug purpose
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   131
    qDebug()<<"Inside My Post";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   132
    bool ok;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   133
    QInputDialog inptDialg;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   134
    inptDialg.setStyleSheet("background: black;");//rgb(255,255,255);");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   135
    QString text = inptDialg.getText(iMainWindow, tr("QInputDialog::getText()"),tr("Post"),
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   136
                                         QLineEdit::Normal,QString::null, &ok,Qt::Window);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   137
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   138
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   139
    if ( ok && !text.isEmpty() ) {
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   140
    // user entered something and pressed OK
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   141
    } else {
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   142
    // user entered nothing or pressed Cancel
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   143
    }
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   144
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   145
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   146
}*/
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   147
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   148
//slot for reply comment
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   149
/*void ToolBar::reply()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   150
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   151
    //debug purpose
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   152
    qDebug()<<"Inside Reply";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   153
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   154
    bool ok;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   155
    QString text = QInputDialog::getText(iMainWindow, tr("QInputDialog::getText()"),tr("Reply To Post"),
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   156
                                         QLineEdit::Normal,QString::null, &ok,Qt::Window);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   157
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   158
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   159
    if ( ok && !text.isEmpty() ) {
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   160
    // user entered something and pressed OK
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   161
    } else {
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   162
    // user entered nothing or pressed Cancel
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   163
    }
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   164
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   165
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   166
}*/
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   167
//calling 
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   168
//calling 
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   169
void ToolBar::call()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   170
	{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   171
		QMessageBox msgbox;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   172
		QString msg ("Calling not configured!");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   173
		msgbox.setText(msg);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   174
		msgbox.exec();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   175
	}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   176
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   177
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   178
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   179
//msging
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   180
void ToolBar::msg()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   181
	{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   182
		QMessageBox msgbox;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   183
		QString msg ("Messaging not configured!");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   184
		msgbox.setText(msg);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   185
		msgbox.exec();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   186
	}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   187
//exiting application
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   188
void ToolBar::exitApp()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   189
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   190
    //qDebug()<<"Inside Exit_App()";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   191
    QApplication::exit();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   192
}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   193
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   194
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   195
//Auth_App for FaceBook
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   196
void ToolBar::authApp_Fb()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   197
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   198
    //debug
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   199
    qDebug()<<"Inside Auth app of faceBook";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   200
    launchFB();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   201
}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   202
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   203
//Auth App for Flickr
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   204
void ToolBar::authApp_Flkr()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   205
{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   206
    //debug
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   207
    qDebug()<<"Inside Auth App of Flickr";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   208
    launchFlickr();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   209
}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   210
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   211
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   212
//Facebook AuthApp Launch
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   213
void ToolBar::launchFB()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   214
	{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   215
	qDebug()<<"Inside Launch FB AuthApp";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   216
	QMessageBox msgbox;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   217
	QString msg ("Please Login Using Facebook Auth App!");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   218
	msgbox.setText(msg);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   219
	msgbox.exec();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   220
	/*TInt result;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   221
	_LIT(KExecutableName,"release\\winscw\\udeb\\AuthApp.exe");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   222
	
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   223
	//we can ignore using UID
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   224
	//const TProcessId FBUid(KFBUid3);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   225
	RProcess fbProc;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   226
	result = fbProc.Create(KExecutableName,KNullDesC);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   227
	if(result != KErrNone)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   228
		{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   229
		qDebug()<<"FB Can't be opened";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   230
		return;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   231
		}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   232
	qDebug()<<"FB AuthApp Launched";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   233
	fbProc.Resume();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   234
	fbProc.Close();*/
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   235
	return;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   236
	
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   237
	}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   238
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   239
void ToolBar::launchFlickr()
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   240
	{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   241
	qDebug()<<"Inside Launch FB AuthApp";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   242
	QMessageBox msgbox;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   243
	QString msg ("Please Login Using Flickr Auth App!");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   244
	msgbox.setText(msg);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   245
	msgbox.exec();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   246
	/*TInt result;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   247
	_LIT(KExecutableName,"release\\winscw\\udeb\\Flickr.exe");
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   248
	
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   249
	//we can ignore using UID
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   250
	//const TProcessId FBUid(KFBUid3);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   251
	RProcess flickrProc;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   252
	result = flickrProc.Create(KExecutableName,KNullDesC);
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   253
	if(result != KErrNone)
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   254
		{
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   255
		qDebug()<<"Flickr Can't be opened";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   256
		return;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   257
		}
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   258
	qDebug()<<"Flickr AuthApp Launched";
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   259
	flickrProc.Resume();
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   260
	flickrProc.Close();*/
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   261
	return;
b78fa4cdbf2b pushing the demo application
cgandhi
parents:
diff changeset
   262
	}