emailuis/nmailuiengine/src/nmbaseclientplugin.cpp
changeset 75 47d84de1c893
parent 72 64e38f08e49c
equal deleted inserted replaced
72:64e38f08e49c 75:47d84de1c893
   599 			break;
   599 			break;
   600 		}
   600 		}
   601         case NmActionToolbar:
   601         case NmActionToolbar:
   602         {
   602         {
   603             mViewerViewRequest = request;
   603             mViewerViewRequest = request;
   604 			Qt::Orientation orientation = Qt::Horizontal;
       
   605 			HbMainWindow *mainWindow = static_cast<HbMainWindow*>(HbApplication::activeWindow());
       
   606 			if( mainWindow ) {
       
   607             	orientation = mainWindow->orientation();
       
   608 			}
       
   609 
   604 
   610             // ToolBar Reply action
   605             // ToolBar Reply action
   611             NmAction *replyAction = new NmAction(0);
   606             NmAction *replyAction = new NmAction(0);
   612             if (Qt::Horizontal == orientation) {
       
   613                 replyAction->setText(hbTrId("txt_mail_button_reply"));
       
   614             }
       
   615             replyAction->setToolTip(hbTrId("txt_mail_button_reply"));
   607             replyAction->setToolTip(hbTrId("txt_mail_button_reply"));
   616             replyAction->setIcon(NmIcons::getIcon(NmIcons::NmIconReply));
   608             replyAction->setIcon(NmIcons::getIcon(NmIcons::NmIconReply));
   617             replyAction->setObjectName("baseclientplugin_reply");
   609             replyAction->setObjectName("baseclientplugin_reply");
   618             connect(replyAction, SIGNAL(triggered()), this, SLOT(replyMail()));
   610             connect(replyAction, SIGNAL(triggered()), this, SLOT(replyMail()));
   619             actionList.append(replyAction);
   611             actionList.append(replyAction);
   620 
   612 
   621             // ToolBar Reply all action
   613             // ToolBar Reply all action
   622             NmAction *replyAllAction = new NmAction(0);
   614             NmAction *replyAllAction = new NmAction(0);
   623             if (Qt::Horizontal == orientation) {
       
   624                 replyAllAction->setText(hbTrId("txt_mail_button_reply_all"));
       
   625             }
       
   626             replyAllAction->setToolTip(hbTrId("txt_mail_button_reply_all"));
   615             replyAllAction->setToolTip(hbTrId("txt_mail_button_reply_all"));
   627             replyAllAction->setIcon(NmIcons::getIcon(NmIcons::NmIconReplyAll));
   616             replyAllAction->setIcon(NmIcons::getIcon(NmIcons::NmIconReplyAll));
   628             replyAllAction->setObjectName("baseclientplugin_reply_all");
   617             replyAllAction->setObjectName("baseclientplugin_reply_all");
   629             connect(replyAllAction, SIGNAL(triggered()), this, SLOT(replyAllMail()));
   618             connect(replyAllAction, SIGNAL(triggered()), this, SLOT(replyAllMail()));
   630             actionList.append(replyAllAction);
   619             actionList.append(replyAllAction);
   631 
   620 
   632             // ToolBar Forward action
   621             // ToolBar Forward action
   633             NmAction *forwardAction = new NmAction(0);
   622             NmAction *forwardAction = new NmAction(0);
   634             if (Qt::Horizontal == orientation) {
       
   635                 forwardAction->setText(hbTrId("txt_mail_button_forward"));
       
   636             }
       
   637             forwardAction->setToolTip(hbTrId("txt_mail_button_forward"));
   623             forwardAction->setToolTip(hbTrId("txt_mail_button_forward"));
   638             forwardAction->setIcon(NmIcons::getIcon(NmIcons::NmIconForward));
   624             forwardAction->setIcon(NmIcons::getIcon(NmIcons::NmIconForward));
   639             forwardAction->setObjectName("baseclientplugin_forward");
   625             forwardAction->setObjectName("baseclientplugin_forward");
   640             connect(forwardAction, SIGNAL(triggered()), this, SLOT(forwardMail()));
   626             connect(forwardAction, SIGNAL(triggered()), this, SLOT(forwardMail()));
   641             actionList.append(forwardAction);
   627             actionList.append(forwardAction);
   642 
   628 
   643             // ToolBar Delete action
   629             // ToolBar Delete action
   644             NmAction *deleteAction = new NmAction(0);
   630             NmAction *deleteAction = new NmAction(0);
   645             if (Qt::Horizontal == orientation) {
       
   646                 deleteAction->setText(hbTrId("txt_mail_button_delete"));
       
   647             }
       
   648             deleteAction->setToolTip(hbTrId("txt_mail_button_delete"));
   631             deleteAction->setToolTip(hbTrId("txt_mail_button_delete"));
   649             deleteAction->setIcon(NmIcons::getIcon(NmIcons::NmIconDelete));
   632             deleteAction->setIcon(NmIcons::getIcon(NmIcons::NmIconDelete));
   650             deleteAction->setObjectName("baseclientplugin_delete");
   633             deleteAction->setObjectName("baseclientplugin_delete");
   651             connect(deleteAction, SIGNAL(triggered()),
   634             connect(deleteAction, SIGNAL(triggered()),
   652                     this, SLOT(deleteMessageFromViewerView()));
   635                     this, SLOT(deleteMessageFromViewerView()));
   680             mEditorToolBarRequest = request;
   663             mEditorToolBarRequest = request;
   681 
   664 
   682             // ToolBar Attach action
   665             // ToolBar Attach action
   683             NmAction *attachAction = new NmAction(0);
   666             NmAction *attachAction = new NmAction(0);
   684             attachAction->setObjectName("baseclientplugin_attachaction");
   667             attachAction->setObjectName("baseclientplugin_attachaction");
   685             attachAction->setText(hbTrId("txt_mail_button_attach"));
       
   686             attachAction->setIcon(NmIcons::getIcon(NmIcons::NmIconAttach));
   668             attachAction->setIcon(NmIcons::getIcon(NmIcons::NmIconAttach));
   687             // Action only available when attachment can be added
   669             // Action only available when attachment can be added
   688             attachAction->setAvailabilityCondition(NmAction::NmAttachable);
   670             attachAction->setAvailabilityCondition(NmAction::NmAttachable);
   689             // connect action/add toolbar extensions
   671             // connect action/add toolbar extensions
   690             connect(attachAction, SIGNAL(triggered()), this, SLOT(attach()));
   672             connect(attachAction, SIGNAL(triggered()), this, SLOT(attach()));
   691             actionList.append(attachAction);
   673             actionList.append(attachAction);
   692 
   674 
   693             // ToolBar Send action
   675             // ToolBar Send action
   694             NmAction *sendAction = new NmAction(0);
   676             NmAction *sendAction = new NmAction(0);
   695             sendAction->setObjectName("baseclientplugin_sendaction");
   677             sendAction->setObjectName("baseclientplugin_sendaction");
   696             sendAction->setText(hbTrId("txt_common_button_send"));
       
   697             sendAction->setIcon(NmIcons::getIcon(NmIcons::NmIconSend));
   678             sendAction->setIcon(NmIcons::getIcon(NmIcons::NmIconSend));
   698             // Action only available when the message related to it can be sent.
   679             // Action only available when the message related to it can be sent.
   699             sendAction->setAvailabilityCondition(NmAction::NmSendable);
   680             sendAction->setAvailabilityCondition(NmAction::NmSendable);
   700             connect(sendAction, SIGNAL(triggered()), this, SLOT(sendMail()));
   681             connect(sendAction, SIGNAL(triggered()), this, SLOT(sendMail()));
   701             actionList.append(sendAction);
   682             actionList.append(sendAction);