Changeset 54a377c in confclerk_git for src/gui/mainwindow.cpp


Ignore:
Timestamp:
04/02/13 23:28:06 (9 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
b261e79
Parents:
cdf0332
Message:

Prepared to show an alarm message via tray icon on non-MAEMO systems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    rcdf0332 r54a377c  
    6464    mXmlParser = new ScheduleXmlParser(sqlEngine, this);
    6565    mNetworkAccessManager = new QNetworkAccessManager(this);
    66 
     66    systemTrayIcon = new QSystemTrayIcon(qApp->windowIcon(), this);
     67    alarmTimer = new QTimer(this);
     68
     69    alarmTimer->setInterval(60000);
     70    alarmTimer->start();
    6771    saved_title = windowTitle();
    6872
     
    101105    connect(searchTabContainer, SIGNAL(searchResultChanged()), SLOT(onSearchResultChanged()));
    102106
     107    // systm tray icon
     108    connect(systemTrayIcon, SIGNAL(messageClicked()), SLOT(onSystemTrayMessageClicked()));
     109
     110    // timer
     111    connect(alarmTimer, SIGNAL(timeout()), SLOT(onAlarmTimerTimeout()));
    103112
    104113    useConference(Conference::activeConference());
     
    115124    connect(mXmlParser, SIGNAL(parsingScheduleEnd(int)), conferenceModel, SLOT(newConferenceEnd(int)));
    116125}
     126
    117127
    118128void MainWindow::on_aboutAction_triggered()
     
    204214    // No results were found
    205215    searchTabContainer->redisplayDate(dayNavigator->curDate());
     216}
     217
     218
     219void MainWindow::onSystemTrayMessageClicked() {
     220    // TODO: Hide icon
     221}
     222
     223
     224void MainWindow::onAlarmTimerTimeout() {
     225    // TODO: Show Message if an alarm is set on an event that's starting soon and delete the corresponding alarm.
     226    /* Example:
     227    systemTrayIcon->show();
     228    systemTrayIcon->showMessage("title", "message", QSystemTrayIcon::Information, 1000);
     229    QApplication::alert(this);
     230    QApplication::beep();
     231    */
    206232}
    207233
Note: See TracChangeset for help on using the changeset viewer.