void Dialog::addTrayMenu(){
QSystemTrayIcon *tray=new QSystemTrayIcon(QIcon("icon/trayIcon.png"),this);
tray->setVisible(true);
QMenu *trayMenu=new QMenu("Easy Google Translate"); QAction *aboutProgram=new QAction(QIcon("icon/about.png"),"About",trayMenu);
aboutProgram->setIconVisibleInMenu(true);
connect(aboutProgram,SIGNAL(triggered()),this,SLOT(about()));
QAction *copy=new QAction(QIcon("icon/copy.png"),"Copy",trayMenu);
copy->setIconVisibleInMenu(true);
connect(copy,SIGNAL(triggered()),this,SLOT(copy()));
QAction *paste=new QAction(QIcon("icon/paste.png"),"Paste",trayMenu);
paste->setIconVisibleInMenu(true);
connect(paste,SIGNAL(triggered()),this,SLOT(paste()));
QAction *translate=new QAction(QIcon("icon/translate.png"),"Translate clipboard",trayMenu);
translate->setIconVisibleInMenu(true);
connect(translate,SIGNAL(triggered()),this,SLOT(trClipboard()));
QAction *quit=new QAction(QIcon("icon/close.png"),"Quit",trayMenu);
quit->setIconVisibleInMenu(true);
connect(quit,SIGNAL(triggered()),this,SLOT(close()));
trayMenu->addAction(aboutProgram);
trayMenu->addAction(copy);
trayMenu->addAction(paste);
trayMenu->addAction(translate);
trayMenu->addAction(quit);
tray->setContextMenu(trayMenu);
tray->setToolTip("Easy Google Translate");
connect(tray,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(activeProgram(QSystemTrayIcon::ActivationReason)));
// tray->activated(QSystemTrayIcon::Trigger); //click
}//trayMenu