Changeset 6831c6a


Ignore:
Timestamp:
02/01/10 14:05:49 (12 years ago)
Author:
hanzes <hanzes@…>
Branches:
master, qt5
Children:
927eac4
Parents:
8c4d4f7
Message:

Alarm dbus connection added

Location:
src
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • src/alarm/alarm.cpp

    r8c4d4f7 r6831c6a  
    55#include <QApplication>
    66#include <QDir>
     7#include <QDebug>
     8
     9#include <dbus-1.0/dbus/dbus-protocol.h>
    710
    811int Alarm::addAlarm(int aEventId, const QDateTime &aDateTime)
     
    1720
    1821    /* for Deleting purposes */
    19     alarm_event_set_message(eve, QString::number(aEventId).toLocal8Bit().data()); 
     22    alarm_event_set_message(eve, QString::number(aEventId).toLocal8Bit().data());
    2023
    2124    /* Use absolute time triggering */
    2225    eve->alarm_time = time(0) + 5; //aDateTime.toTime_t();
    2326    eve->flags = ALARM_EVENT_BOOT;
    24 
    25     QString command = QDir::currentPath() + "/" + *qApp->argv() +
    26       QString(" %1").arg(QString::number(aEventId));
    2727
    2828    /* Add exec command action */
     
    3333    act->flags |= ALARM_ACTION_WHEN_RESPONDED;
    3434    act->flags |= ALARM_ACTION_TYPE_DBUS;
    35    
    36     // DBus params for this action 
    37     alarm_action_set_dbus_interface(act, "org.freedesktop.Notifications");
    38     alarm_action_set_dbus_service(act, "org.freedesktop.Notifications");
    39     alarm_action_set_dbus_path(act, "/org/freedesktop/Notifications");
    40     alarm_action_set_dbus_name(act, "SystemNoteDialog");
    41    
     35
     36    // DBus params for this action
     37    alarm_action_set_dbus_interface(act, "org.fosdem.schedule.AlarmInterface");
     38    alarm_action_set_dbus_service(act, "org.fosdem.schedule");
     39    alarm_action_set_dbus_path(act, "/Fosdem");
     40    alarm_action_set_dbus_name(act, "Alarm");
     41
    4242    // DBus arguments for the action
    43     alarm_action_set_dbus_args(act, aEventId);
     43    alarm_action_set_dbus_args(act,  DBUS_TYPE_INT32, &aEventId, DBUS_TYPE_INVALID);
    4444
    4545    //    act->flags |= ALARM_ACTION_TYPE_EXEC;
     
    4747    //    alarm_event_set_icon(eve, "fosdem");
    4848    //    alarm_event_set_title(eve, "FOSDEM'10");
    49     // adds assigned cookie at the end of command string 
    50     //    act->flags |= ALARM_ACTION_EXEC_ADD_COOKIE; 
     49    // adds assigned cookie at the end of command string
     50    //    act->flags |= ALARM_ACTION_EXEC_ADD_COOKIE;
    5151
    5252    /* Add stop button action */
     
    5656    act->flags |= ALARM_ACTION_WHEN_RESPONDED;
    5757    act->flags |= ALARM_ACTION_TYPE_NOP;
    58  
     58
    5959    /* Add snooze button action */
    6060    act = alarm_event_add_actions(eve, 1);
  • src/alarm/alarm.pro

    r8c4d4f7 r6831c6a  
    22TARGET = qalarm
    33DESTDIR = ../bin
    4 CONFIG += static
     4CONFIG += static qdbus
     5QT += sql dbus
    56
    67# module dependencies
     
    89DEPENDPATH += .
    910
    10 HEADERS += alarm.h
     11HEADERS += alarm.h \
     12                   alarmdbus.h \
     13                   alarmdbusadaptorp.h
    1114
    12 SOURCES += alarm.cpp
     15SOURCES += alarm.cpp \
     16                   alarmdbus.cpp \
     17                   alarmdbusadaptor.cpp
    1318
     19INCLUDEPATH += ../gui \
     20    ../mvc \
     21    ../orm \
     22    ../sql
     23   
     24
     25
  • src/app/app.pro

    r8c4d4f7 r6831c6a  
    33TARGET = fosdem-schedule
    44DESTDIR = ../bin
    5 QT += sql xml network
     5QT += sql xml network dbus
    66
    77# module dependencies
  • src/app/main.cpp

    r8c4d4f7 r6831c6a  
    22
    33#include <QtGui/QApplication>
    4 #ifdef MAEMO
    5 #include <alarmdialog.h>
    6 #endif /* MAEMO */
     4//#ifdef MAEMO
     5//#include <alarmdialog.h>
     6//#endif /* MAEMO */
    77
    88#include <sqlengine.h>
     9
     10#include "alarmdbus.h"
     11#include "alarmdbusadaptorp.h"
    912
    1013int main(int argc, char *argv[])
     
    2528    // Usage: $ ./fosdem eventId alarmId
    2629    // Example: $ ./fosdem 521 13
    27     if(argc==3)
    28         window = new AlarmDialog(argc,argv);
    29     else if(argc==2) // display Event dialog automatically
    30         window = new MainWindow(atoi(argv[1])); // eventId = argv[1]
    31     else
     30//    if(argc==3)
     31//        window = new AlarmDialog(argc,argv);
     32//    else if(argc==2) // display Event dialog automatically
     33//        window = new MainWindow(atoi(argv[1])); // eventId = argv[1]
     34//    else
    3235        window = new MainWindow;
    3336#else
     
    3538#endif /* MAEMO */
    3639    window->show();
     40
     41    // Alarm Dbus
     42
     43    CAlarmDBus *alarmDBus = new CAlarmDBus(window);
     44    new AlarmDBusAdaptor(alarmDBus);
     45    //QDBusConnection connection = QDBusConnection::sessionBus();
     46    QDBusConnection connection = QDBusConnection::sessionBus();
     47
     48    if(connection.registerObject("/Fosdem", alarmDBus) == true)
     49    {
     50        if( connection.registerService("org.fosdem.schedule") == false)
     51        {
     52                qDebug() << "dbus register service failed";
     53        }
     54    }
     55
    3756    return a.exec();
    3857}
  • src/gui/gui.pro

    r8c4d4f7 r6831c6a  
    8484    proxysettingsdialog.cpp
    8585
    86 maemo {
    87     FORMS += alarmdialog.ui
    88     HEADERS += alarmdialog.h
    89     SOURCES += alarmdialog.cpp
    90 }
     86#maemo {
     87#    FORMS += alarmdialog.ui
     88#    HEADERS += alarmdialog.h
     89#    SOURCES += alarmdialog.cpp
     90#}
  • src/mvc/treeview.cpp

    r8c4d4f7 r6831c6a  
    3333
    3434// returns bool if some Control was clicked
    35 bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint) 
     35bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint)
    3636{
    3737    bool handled = false;
     
    6969                for(int i=0; i<conflicts.count(); i++)
    7070                    emit(eventHasChanged(conflicts[i].id()));
    71                
     71
    7272                // since the Favourite icon has changed, update TreeViews accordingly
    7373                // all TreeViews have to listen on this signal
     
    142142    if(!index.parent().isValid()) // time-group
    143143    {
    144         if(isExpanded(index)) 
     144        if(isExpanded(index))
    145145            setExpanded(index, false);
    146146        else
  • src/src.pro

    r8c4d4f7 r6831c6a  
    11include(global.pri)
    22TEMPLATE = subdirs
     3SUBDIRS  += orm mvc sql gui app
    34maemo : SUBDIRS += alarm
    4 SUBDIRS  += orm mvc sql gui app
    55#SUBDIRS += test
    66CONFIG += ordered
Note: See TracChangeset for help on using the changeset viewer.