Changeset d4a8bbf
- Timestamp:
- 01/20/10 16:27:11 (13 years ago)
- Branches:
- master, qt5
- Children:
- a5c1179
- Parents:
- f2ef735
- Location:
- src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/alarm/alarm.cpp
rf2ef735 rd4a8bbf 2 2 3 3 #include <QDateTime> 4 5 #include <QApplication> 6 #include <QDir> 4 7 5 8 int Alarm::addAlarm(int aEventId, const QDateTime &aDateTime) … … 19 22 /* Add exec command action */ 20 23 action = alarm_event_add_actions(event, 1); 21 QString command = Q String("/home/maemo/work/fosdem-maemo/bin/fosdem%1").arg(QString::number(aEventId));24 QString command = QDir::currentPath() + "/" + *qApp->argv() + QString(" %1").arg(QString::number(aEventId)); 22 25 alarm_action_set_exec_command(action, command.toLocal8Bit().data()); 23 26 action->flags |= ALARM_ACTION_TYPE_EXEC; -
src/app/main.cpp
rf2ef735 rd4a8bbf 23 23 if(argc==3) 24 24 window = new AlarmDialog(argc,argv); 25 else if(argc==2) // display Event dialog automatically 26 window = new MainWindow(atoi(argv[1])); // eventId = argv[1] 25 27 else 26 28 window = new MainWindow; -
src/gui/alarmdialog.cpp
rf2ef735 rd4a8bbf 6 6 7 7 #include <QDir> 8 #include <QProcess> 8 9 9 10 const int SNOOZE_TIME = 5; // in minutes … … 48 49 void AlarmDialog::runApp() 49 50 { 50 qWarning("runApp(): NOT IMPLEMENTED YET"); 51 QString program = QDir::currentPath() + "/" + *qApp->argv(); 52 QProcess::startDetached(program,QStringList()<<QString::number(mEventId)); 53 qApp->quit(); 51 54 } 52 55 -
src/gui/alarmdialog.ui
rf2ef735 rd4a8bbf 69 69 <widget class="QPushButton" name="stopPB" > 70 70 <property name="text" > 71 <string> Stop</string>71 <string>Cancel</string> 72 72 </property> 73 73 </widget> -
src/gui/eventdialog.cpp
rf2ef735 rd4a8bbf 3 3 #include <QScrollBar> 4 4 5 EventDialog::EventDialog(const QModelIndex &aIndex, QWidget *aParent)5 EventDialog::EventDialog(const int &aEventId, QWidget *aParent) 6 6 : QDialog(aParent) 7 , m Index(aIndex)7 , mEventId(aEventId) 8 8 { 9 9 setupUi(this); 10 11 const int confId = 1; 12 Event event = Event::getById(aEventId,confId); 10 13 11 14 abstract->setStyleSheet("background-color : transparent;"); … … 28 31 description->verticalScrollBar()->setPalette(p2); 29 32 30 Event *event = static_cast<Event *>(mIndex.internalPointer()); 31 title->setText(event->title()); 32 persons->setText(event->persons().join(" and ")); 33 abstract->setPlainText(event->abstract()); 34 description->setPlainText(event->description()); 33 title->setText(event.title()); 34 persons->setText(event.persons().join(" and ")); 35 abstract->setPlainText(event.abstract()); 36 description->setPlainText(event.description()); 35 37 } 36 38 -
src/gui/eventdialog.h
rf2ef735 rd4a8bbf 3 3 4 4 #include <QDialog> 5 #include <QModelIndex>6 5 #include "ui_eventdialog.h" 7 6 #include <event.h> … … 10 9 { 11 10 public: 12 EventDialog(const QModelIndex &aIndex, QWidget *aParent = NULL);11 EventDialog(const int &aEventId, QWidget *aParent = NULL); 13 12 ~EventDialog() {} 14 13 private: 15 QModelIndex mIndex;14 int mEventId; 16 15 }; 17 16 -
src/gui/mainwindow.cpp
rf2ef735 rd4a8bbf 21 21 const int confId = 1; 22 22 23 MainWindow::MainWindow( QWidget *parent)24 : QMainWindow( parent)23 MainWindow::MainWindow(int aEventId, QWidget *aParent) 24 : QMainWindow(aParent) 25 25 { 26 26 setupUi(this); … … 116 116 connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTab(int))); 117 117 118 // open dialog for given Event ID 119 // this is used in case Alarm Dialog request application to start 120 if(aEventId) 121 { 122 EventDialog dialog(aEventId,this); 123 dialog.exec(); 124 } 118 125 } 119 126 … … 229 236 return; 230 237 231 EventDialog dialog( aIndex,this);238 EventDialog dialog(static_cast<Event*>(aIndex.internalPointer())->id(),this); 232 239 dialog.exec(); 233 240 } -
src/gui/mainwindow.h
rf2ef735 rd4a8bbf 13 13 Q_OBJECT 14 14 public: 15 MainWindow(QWidget *parent = 0); 15 // aEventId is used to inform widget to automatically open 16 // Event dialog for given Event ID 17 MainWindow(int aEventId = 0, QWidget *aParent = NULL); 16 18 ~MainWindow(); 17 19 private slots:
Note: See TracChangeset
for help on using the changeset viewer.