Systray::Systray(QObject *parent) : QObject(parent) { s.setEmptyToDefaults(); createActions(); createTrayIcon(); connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked())); connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); setTrayIcon(":/images/puush-qt.png"); trayIcon->show(); trayIcon->setToolTip("puush-qt"); history = new History(); connect(history, SIGNAL(historyDone(QList<ApiHist::HistData>)), this, SLOT(updateHistoryMenu(QList<ApiHist::HistData>))); // Get the history after the app starts. For some reason the context // menu hangs when getting the history, even though it's asynchronous. // So just call it soon (waiting for wifi or something to come up after starting on boot...). updateHistoryAfterTimeout(); }
//////////////////////////////////////////////////////////////////////////////// /// CTreeNodeEditor::CTreeNodeEditor /// /// @description This is the default constructor for the CTreeNodeEditor /// class. It initializes member variables. /// @pre None /// @post Member variables are initialized. /// /// @param canvas: This is a pointer to the canvas. /// /// @limitations None /// //////////////////////////////////////////////////////////////////////////////// CTreeNodeEditor::CTreeNodeEditor( QWidget *canvas ) : QObject(canvas) { m_canvas = canvas; m_isAddingChildNode = false; m_selNode = NULL; m_oldParent = NULL; //Setup the line edit used for editing node history values. m_historyEdit = new QLineEdit( m_canvas ); m_historyEdit->setAlignment( Qt::AlignCenter ); m_historyEdit->hide(); connect( m_historyEdit, SIGNAL( editingFinished() ), this, SLOT( historyDone() ) ); //Setup the line edit used for editing node names. m_nameEdit = new QLineEdit( m_canvas ); m_nameEdit->setAlignment( Qt::AlignCenter ); m_nameEdit->hide(); connect( m_nameEdit, SIGNAL( editingFinished() ), this, SLOT( nameDone() ) ); //Setup the line edit used for editing node values. m_valueEdit = new QLineEdit( m_canvas ); m_valueEdit->setAlignment( Qt::AlignCenter ); m_valueEdit->hide(); connect( m_valueEdit, SIGNAL( editingFinished() ), this, SLOT( valueDone() ) ); //Setup actions and menus. setupActions(); setupMenus(); }
/** * Update the history object due to outside changes, like api url changes. * We could create a new history every time in updateHistoryMenu, * but then we loose the chaching aspect. * @brief Systray::updateHistory */ void Systray::updateHistory() { delete history; history = new History(); connect(history, SIGNAL(historyDone(QList<ApiHist::HistData>)), this, SLOT(updateHistoryMenu(QList<ApiHist::HistData>))); historyPlaceholder(); }