Changeset cfd615d for src


Ignore:
Timestamp:
01/19/10 16:42:59 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
02c1e09
Parents:
6bd729b
Message:

work on alarm

Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/alarm/alarm.h

    r6bd729b rcfd615d  
    1010}
    1111
    12 #define APPID "alarm-example"
     12#define APPID "fosdem-alarm"
    1313
    1414class Alarm : public QObject
  • src/gui/alarmdialog.cpp

    r6bd729b rcfd615d  
    33#include <QApplication>
    44#include <alarm.h>
     5#include <event.h>
     6
     7#include <QDir>
    58
    69const int SNOOZE_TIME = 5; // in minutes
     10
     11const int confId = 1;
    712
    813AlarmDialog::AlarmDialog(int argc, char *argv[], QWidget *aParent)
     
    2732    }
    2833
    29     connect(stopPB, SIGNAL(clicked()), qApp, SLOT(quit()));
     34    connect(stopPB, SIGNAL(clicked()), SLOT(closeDialog()));
    3035    connect(appPB, SIGNAL(clicked()), SLOT(runApp()));
    3136    connect(snoozePB, SIGNAL(clicked()), SLOT(snooze()));
    3237
     38    QSqlDatabase database = QSqlDatabase::addDatabase("QSQLITE");
     39    database.setDatabaseName(QDir::homePath() + "/.fosdem/fosdem.sqlite");
     40    database.open();
     41
     42    Event event = Event::getById(mEventId,confId);
    3343    message->setText(QString(argv[1]).append("-").append(QString(argv[2])));
     44    message->setText(event.title());
     45    setWindowTitle(event.title());
    3446}
    3547
    3648void AlarmDialog::runApp()
    3749{
     50    qWarning("runApp(): NOT IMPLEMENTED YET");
    3851}
    3952
     
    4861}
    4962
     63void AlarmDialog::closeDialog()
     64{
     65    // before closing the dialog, it is necessary to remove alarm flag from the DB
     66    Event event = Event::getById(mEventId,confId);
     67    event.setHasAlarm(false);
     68    event.update("alarm");
     69    qApp->quit();
     70}
     71
  • src/gui/alarmdialog.h

    r6bd729b rcfd615d  
    1414        void runApp();
    1515        void snooze();
     16        void closeDialog();
    1617    private:
    1718        int mEventId; // event ID obtained from 'schedule'
  • src/sql/sqlengine.cpp

    r6bd729b rcfd615d  
    5252        QDir::home().mkdir(".fosdem");
    5353    databaseName = QDir::homePath() + "/.fosdem/" + "fosdem.sqlite";
    54 qDebug()<<databaseName;
    5554    login("QSQLITE",databaseName);
    5655}
  • src/src.pro

    r6bd729b rcfd615d  
    44maemo : SUBDIRS += alarm
    55#SUBDIRS += test
    6 CONFIG += ordered debug
     6CONFIG += ordered
    77
Note: See TracChangeset for help on using the changeset viewer.