Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index d16d1ac..c90166b 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -79,133 +79,133 @@ MainWindow::MainWindow( QWidget* parent, | |||
79 | initTemplate(); | 79 | initTemplate(); |
80 | 80 | ||
81 | populateTemplates(); | 81 | populateTemplates(); |
82 | raiseCurrentView(); | 82 | raiseCurrentView(); |
83 | QTimer::singleShot(0, this, SLOT(populateCategories() ) ); | 83 | QTimer::singleShot(0, this, SLOT(populateCategories() ) ); |
84 | } | 84 | } |
85 | void MainWindow::initTemplate() { | 85 | void MainWindow::initTemplate() { |
86 | m_curTempEd = new TemplateEditor( this, templateManager() ); | 86 | m_curTempEd = new TemplateEditor( this, templateManager() ); |
87 | } | 87 | } |
88 | void MainWindow::initActions() { | 88 | void MainWindow::initActions() { |
89 | 89 | ||
90 | // Data menu | 90 | // Data menu |
91 | m_edit->insertItem(tr("New from template"), m_template, | 91 | m_edit->insertItem(QWidget::tr("New from template"), m_template, |
92 | -1, 0 ); | 92 | -1, 0 ); |
93 | 93 | ||
94 | QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ), | 94 | QAction* a = new QAction( QWidget::tr("New Task" ), Resource::loadPixmap( "new" ), |
95 | QString::null, 0, this, 0 ); | 95 | QString::null, 0, this, 0 ); |
96 | connect(a, SIGNAL( activated() ), | 96 | connect(a, SIGNAL( activated() ), |
97 | this, SLOT( slotNew() ) ); | 97 | this, SLOT( slotNew() ) ); |
98 | a->setWhatsThis( tr( "Click here to create a new task." ) ); | 98 | a->setWhatsThis( QWidget::tr( "Click here to create a new task." ) ); |
99 | a->addTo(m_tool ); | 99 | a->addTo(m_tool ); |
100 | a->addTo(m_edit ); | 100 | a->addTo(m_edit ); |
101 | 101 | ||
102 | a = new QAction( tr("Edit Task"), Resource::loadIconSet( "edit" ), | 102 | a = new QAction( QWidget::tr("Edit Task"), Resource::loadIconSet( "edit" ), |
103 | QString::null, 0, this, 0 ); | 103 | QString::null, 0, this, 0 ); |
104 | connect(a, SIGNAL(activated() ), | 104 | connect(a, SIGNAL(activated() ), |
105 | this, SLOT( slotEdit() ) ); | 105 | this, SLOT( slotEdit() ) ); |
106 | a->setWhatsThis( tr( "Click here to modify the current task." ) ); | 106 | a->setWhatsThis( QWidget::tr( "Click here to modify the current task." ) ); |
107 | a->addTo( m_tool ); | 107 | a->addTo( m_tool ); |
108 | a->addTo( m_edit ); | 108 | a->addTo( m_edit ); |
109 | m_editAction = a; | 109 | m_editAction = a; |
110 | 110 | ||
111 | a = new QAction( QString::null, tr("View Task"), 0, this, 0 ); | 111 | a = new QAction( QString::null, QWidget::tr("View Task"), 0, this, 0 ); |
112 | connect(a, SIGNAL( activated() ), | 112 | connect(a, SIGNAL( activated() ), |
113 | this, SLOT( slotShowDetails() ) ); | 113 | this, SLOT( slotShowDetails() ) ); |
114 | a->addTo( m_edit ); | 114 | a->addTo( m_edit ); |
115 | 115 | ||
116 | m_edit->insertSeparator(); | 116 | m_edit->insertSeparator(); |
117 | 117 | ||
118 | a = new QAction( tr("Delete..."), Resource::loadIconSet( "trash" ), | 118 | a = new QAction( QWidget::tr("Delete..."), Resource::loadIconSet( "trash" ), |
119 | QString::null, 0, this, 0 ); | 119 | QString::null, 0, this, 0 ); |
120 | connect(a, SIGNAL(activated() ), | 120 | connect(a, SIGNAL(activated() ), |
121 | this, SLOT(slotDelete() ) ); | 121 | this, SLOT(slotDelete() ) ); |
122 | a->setWhatsThis( tr( "Click here to remove the current task." ) ); | 122 | a->setWhatsThis( QWidget::tr( "Click here to remove the current task." ) ); |
123 | a->addTo( m_tool ); | 123 | a->addTo( m_tool ); |
124 | a->addTo( m_edit ); | 124 | a->addTo( m_edit ); |
125 | m_deleteAction = a; | 125 | m_deleteAction = a; |
126 | 126 | ||
127 | a = new QAction( QString::null, tr("Delete all..."), 0, this, 0 ); | 127 | a = new QAction( QString::null, QWidget::tr("Delete all..."), 0, this, 0 ); |
128 | connect(a, SIGNAL( activated() ), | 128 | connect(a, SIGNAL( activated() ), |
129 | this, SLOT( slotDeleteAll() ) ); | 129 | this, SLOT( slotDeleteAll() ) ); |
130 | a->addTo(m_edit ); | 130 | a->addTo(m_edit ); |
131 | m_deleteAllAction = a; | 131 | m_deleteAllAction = a; |
132 | 132 | ||
133 | a = new QAction( QString::null, tr("Delete completed"), | 133 | a = new QAction( QString::null, QWidget::tr("Delete completed"), |
134 | 0, this, 0 ); | 134 | 0, this, 0 ); |
135 | connect(a, SIGNAL( activated() ), | 135 | connect(a, SIGNAL( activated() ), |
136 | this, SLOT( slotDeleteCompleted() ) ); | 136 | this, SLOT( slotDeleteCompleted() ) ); |
137 | a->addTo(m_edit ); | 137 | a->addTo(m_edit ); |
138 | a->setEnabled( TRUE ); | 138 | a->setEnabled( TRUE ); |
139 | m_deleteCompleteAction = a; | 139 | m_deleteCompleteAction = a; |
140 | 140 | ||
141 | m_edit->insertSeparator(); | 141 | m_edit->insertSeparator(); |
142 | 142 | ||
143 | a = new QAction( QString::null, tr("Duplicate"), 0, this, 0 ); | 143 | a = new QAction( QString::null, QWidget::tr("Duplicate"), 0, this, 0 ); |
144 | connect(a, SIGNAL( activated() ), | 144 | connect(a, SIGNAL( activated() ), |
145 | this, SLOT( slotDuplicate() ) ); | 145 | this, SLOT( slotDuplicate() ) ); |
146 | a->addTo(m_edit ); | 146 | a->addTo(m_edit ); |
147 | m_duplicateAction = a; | 147 | m_duplicateAction = a; |
148 | 148 | ||
149 | m_edit->insertSeparator(); | 149 | m_edit->insertSeparator(); |
150 | 150 | ||
151 | if ( Ir::supported() ) { | 151 | if ( Ir::supported() ) { |
152 | a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 ); | 152 | a = new QAction( QWidget::tr( "Beam" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 ); |
153 | connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); | 153 | connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); |
154 | a->setWhatsThis( tr( "Click here to send the current task to another device." ) ); | 154 | a->setWhatsThis( QWidget::tr( "Click here to send the current task to another device." ) ); |
155 | a->addTo( m_edit ); | 155 | a->addTo( m_edit ); |
156 | a->addTo( m_tool ); | 156 | a->addTo( m_tool ); |
157 | } | 157 | } |
158 | 158 | ||
159 | // Options menu | 159 | // Options menu |
160 | a = new QAction( tr("Find"), Resource::loadIconSet( "mag" ), | 160 | a = new QAction( QWidget::tr("Find"), Resource::loadIconSet( "mag" ), |
161 | QString::null, 0, this, 0 ); | 161 | QString::null, 0, this, 0 ); |
162 | connect(a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); | 162 | connect(a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); |
163 | a->addTo( m_options ); | 163 | a->addTo( m_options ); |
164 | m_findAction = a; | 164 | m_findAction = a; |
165 | 165 | ||
166 | m_options->insertSeparator(); | 166 | m_options->insertSeparator(); |
167 | 167 | ||
168 | m_completedAction = new QAction( QString::null, tr("Show completed tasks"), | 168 | m_completedAction = new QAction( QString::null, QWidget::tr("Show completed tasks"), |
169 | 0, this, 0, TRUE ); | 169 | 0, this, 0, TRUE ); |
170 | m_completedAction->addTo( m_options ); | 170 | m_completedAction->addTo( m_options ); |
171 | m_completedAction->setOn( showCompleted() ); | 171 | m_completedAction->setOn( showCompleted() ); |
172 | connect(m_completedAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowCompleted(bool) ) ); | 172 | connect(m_completedAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowCompleted(bool) ) ); |
173 | 173 | ||
174 | a = new QAction( QString::null, tr("Show only over-due tasks"), | 174 | a = new QAction( QString::null, QWidget::tr("Show only over-due tasks"), |
175 | 0, this, 0, TRUE ); | 175 | 0, this, 0, TRUE ); |
176 | a->addTo( m_options ); | 176 | a->addTo( m_options ); |
177 | a->setOn( showOverDue() ); | 177 | a->setOn( showOverDue() ); |
178 | connect(a, SIGNAL(toggled(bool)), this, SLOT(slotShowDue(bool) ) ); | 178 | connect(a, SIGNAL(toggled(bool)), this, SLOT(slotShowDue(bool) ) ); |
179 | 179 | ||
180 | m_showDeadLineAction = new QAction( QString::null, tr("Show task deadlines"), | 180 | m_showDeadLineAction = new QAction( QString::null, QWidget::tr("Show task deadlines"), |
181 | 0, this, 0, TRUE ); | 181 | 0, this, 0, TRUE ); |
182 | m_showDeadLineAction->addTo( m_options ); | 182 | m_showDeadLineAction->addTo( m_options ); |
183 | m_showDeadLineAction->setOn( showDeadline() ); | 183 | m_showDeadLineAction->setOn( showDeadline() ); |
184 | connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), this, SLOT( slotShowDeadLine( bool ) ) ); | 184 | connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), this, SLOT( slotShowDeadLine( bool ) ) ); |
185 | 185 | ||
186 | m_showQuickTaskAction = new QAction( QString::null, tr("Show quick task bar"), | 186 | m_showQuickTaskAction = new QAction( QString::null, QWidget::tr("Show quick task bar"), |
187 | 0, this, 0, TRUE ); | 187 | 0, this, 0, TRUE ); |
188 | m_showQuickTaskAction->addTo( m_options ); | 188 | m_showQuickTaskAction->addTo( m_options ); |
189 | m_showQuickTaskAction->setOn( showQuickTask() ); | 189 | m_showQuickTaskAction->setOn( showQuickTask() ); |
190 | connect(m_showQuickTaskAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowQuickTask(bool) ) ); | 190 | connect(m_showQuickTaskAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowQuickTask(bool) ) ); |
191 | 191 | ||
192 | m_options->insertSeparator(); | 192 | m_options->insertSeparator(); |
193 | 193 | ||
194 | m_bar->insertItem( tr("Data") ,m_edit ); | 194 | m_bar->insertItem( QWidget::tr("Data") ,m_edit ); |
195 | m_bar->insertItem( tr("Category"), m_catMenu ); | 195 | m_bar->insertItem( QWidget::tr("Category"), m_catMenu ); |
196 | m_bar->insertItem( tr("Options"), m_options ); | 196 | m_bar->insertItem( QWidget::tr("Options"), m_options ); |
197 | 197 | ||
198 | m_curQuick = new QuickEditImpl( this, m_quicktask ); | 198 | m_curQuick = new QuickEditImpl( this, m_quicktask ); |
199 | addToolBar( (QPEToolBar *)m_curQuick->widget(), tr( "QuickEdit" ), QMainWindow::Top, TRUE ); | 199 | addToolBar( (QPEToolBar *)m_curQuick->widget(), QWidget::tr( "QuickEdit" ), QMainWindow::Top, TRUE ); |
200 | m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) ); | 200 | m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) ); |
201 | 201 | ||
202 | } | 202 | } |
203 | /* m_curCat from Config */ | 203 | /* m_curCat from Config */ |
204 | void MainWindow::initConfig() { | 204 | void MainWindow::initConfig() { |
205 | Config config( "todo" ); | 205 | Config config( "todo" ); |
206 | config.setGroup( "View" ); | 206 | config.setGroup( "View" ); |
207 | m_completed = config.readBoolEntry( "ShowComplete", TRUE ); | 207 | m_completed = config.readBoolEntry( "ShowComplete", TRUE ); |
208 | m_curCat = config.readEntry( "Category", QString::null ); | 208 | m_curCat = config.readEntry( "Category", QString::null ); |
209 | m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE); | 209 | m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE); |
210 | m_overdue = config.readBoolEntry("ShowOverDue", FALSE ); | 210 | m_overdue = config.readBoolEntry("ShowOverDue", FALSE ); |
211 | m_quicktask = config.readBoolEntry("ShowQuickTask", TRUE); | 211 | m_quicktask = config.readBoolEntry("ShowQuickTask", TRUE); |
@@ -228,25 +228,25 @@ void MainWindow::initUI() { | |||
228 | m_template = new QPopupMenu( this ); | 228 | m_template = new QPopupMenu( this ); |
229 | 229 | ||
230 | m_catMenu->setCheckable( TRUE ); | 230 | m_catMenu->setCheckable( TRUE ); |
231 | m_template->setCheckable( TRUE ); | 231 | m_template->setCheckable( TRUE ); |
232 | 232 | ||
233 | connect(m_catMenu, SIGNAL(activated(int) ), | 233 | connect(m_catMenu, SIGNAL(activated(int) ), |
234 | this, SLOT(setCategory(int) ) ); | 234 | this, SLOT(setCategory(int) ) ); |
235 | connect(m_template, SIGNAL(activated(int) ), | 235 | connect(m_template, SIGNAL(activated(int) ), |
236 | this, SLOT(slotNewFromTemplate(int) ) ); | 236 | this, SLOT(slotNewFromTemplate(int) ) ); |
237 | } | 237 | } |
238 | void MainWindow::initViews() { | 238 | void MainWindow::initViews() { |
239 | TableView* tableView = new TableView( this, m_stack ); | 239 | TableView* tableView = new TableView( this, m_stack ); |
240 | QWhatsThis::add( tableView, tr( "This is a listing of all current tasks.\n\nThe list displays the following information:\n1. Completed - A green checkmark indicates task is completed. Click here to complete a task.\n2. Priority - a graphical representation of task priority. Double-click here to modify.\n3. Description - description of task. Click here to select the task.\n4. Deadline - shows when task is due. This column can be shown or hidden by selecting Options->'Show task deadlines' from the menu above." ) ); | 240 | QWhatsThis::add( tableView, QWidget::tr( "This is a listing of all current tasks.\n\nThe list displays the following information:\n1. Completed - A green checkmark indicates task is completed. Click here to complete a task.\n2. Priority - a graphical representation of task priority. Double-click here to modify.\n3. Description - description of task. Click here to select the task.\n4. Deadline - shows when task is due. This column can be shown or hidden by selecting Options->'Show task deadlines' from the menu above." ) ); |
241 | m_stack->addWidget( tableView, m_counter++ ); | 241 | m_stack->addWidget( tableView, m_counter++ ); |
242 | m_views.append( tableView ); | 242 | m_views.append( tableView ); |
243 | m_curView = tableView; | 243 | m_curView = tableView; |
244 | connectBase( tableView ); | 244 | connectBase( tableView ); |
245 | /* add QString type + QString configname to | 245 | /* add QString type + QString configname to |
246 | * the View menu | 246 | * the View menu |
247 | * and subdirs for multiple views | 247 | * and subdirs for multiple views |
248 | */ | 248 | */ |
249 | } | 249 | } |
250 | void MainWindow::initEditor() { | 250 | void MainWindow::initEditor() { |
251 | m_curEdit = new Editor(); | 251 | m_curEdit = new Editor(); |
252 | } | 252 | } |
@@ -286,39 +286,39 @@ QPopupMenu* MainWindow::options() { | |||
286 | } | 286 | } |
287 | QPopupMenu* MainWindow::edit() { | 287 | QPopupMenu* MainWindow::edit() { |
288 | return m_edit; | 288 | return m_edit; |
289 | } | 289 | } |
290 | QToolBar* MainWindow::toolbar() { | 290 | QToolBar* MainWindow::toolbar() { |
291 | return m_tool; | 291 | return m_tool; |
292 | } | 292 | } |
293 | OTodoAccess::List MainWindow::list()const { | 293 | OTodoAccess::List MainWindow::list()const { |
294 | return m_todoMgr.list(); | 294 | return m_todoMgr.list(); |
295 | } | 295 | } |
296 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { | 296 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) { |
297 | int cat = 0; | 297 | int cat = 0; |
298 | if ( m_curCat != tr("All Categories") ) | 298 | if ( m_curCat != QWidget::tr("All Categories") ) |
299 | cat = currentCatId(); | 299 | cat = currentCatId(); |
300 | 300 | ||
301 | int filter = 1; | 301 | int filter = 1; |
302 | 302 | ||
303 | if (!m_completed ) | 303 | if (!m_completed ) |
304 | filter |= 4; | 304 | filter |= 4; |
305 | if (m_overdue) | 305 | if (m_overdue) |
306 | filter |= 2; | 306 | filter |= 2; |
307 | 307 | ||
308 | return m_todoMgr.sorted( asc, sortOrder, filter, cat ); | 308 | return m_todoMgr.sorted( asc, sortOrder, filter, cat ); |
309 | } | 309 | } |
310 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { | 310 | OTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { |
311 | int cat = 0; | 311 | int cat = 0; |
312 | if ( m_curCat != tr("All Categories") ) | 312 | if ( m_curCat != QWidget::tr("All Categories") ) |
313 | cat = currentCatId(); | 313 | cat = currentCatId(); |
314 | 314 | ||
315 | return m_todoMgr.sorted(asc, sortOrder, addFilter, cat ); | 315 | return m_todoMgr.sorted(asc, sortOrder, addFilter, cat ); |
316 | } | 316 | } |
317 | OTodo MainWindow::event( int uid ) { | 317 | OTodo MainWindow::event( int uid ) { |
318 | return m_todoMgr.event( uid ); | 318 | return m_todoMgr.event( uid ); |
319 | } | 319 | } |
320 | bool MainWindow::isSyncing()const { | 320 | bool MainWindow::isSyncing()const { |
321 | return m_syncing; | 321 | return m_syncing; |
322 | } | 322 | } |
323 | TemplateManager* MainWindow::templateManager() { | 323 | TemplateManager* MainWindow::templateManager() { |
324 | return m_tempManager; | 324 | return m_tempManager; |
@@ -344,26 +344,26 @@ void MainWindow::closeEvent( QCloseEvent* e ) { | |||
344 | * we should have flushed and now we're still saving | 344 | * we should have flushed and now we're still saving |
345 | * so there is no need to flush | 345 | * so there is no need to flush |
346 | */ | 346 | */ |
347 | if (m_syncing ) { | 347 | if (m_syncing ) { |
348 | e->accept(); | 348 | e->accept(); |
349 | return; | 349 | return; |
350 | } | 350 | } |
351 | bool quit = false; | 351 | bool quit = false; |
352 | if ( m_todoMgr.saveAll() ){ | 352 | if ( m_todoMgr.saveAll() ){ |
353 | qWarning("saved"); | 353 | qWarning("saved"); |
354 | quit = true; | 354 | quit = true; |
355 | }else { | 355 | }else { |
356 | if ( QMessageBox::critical( this, tr("Out of space"), | 356 | if ( QMessageBox::critical( this, QWidget::tr("Out of space"), |
357 | tr("Todo was unable\n" | 357 | QWidget::tr("Todo was unable\n" |
358 | "to save your changes.\n" | 358 | "to save your changes.\n" |
359 | "Free up some space\n" | 359 | "Free up some space\n" |
360 | "and try again.\n" | 360 | "and try again.\n" |
361 | "\nQuit Anyway?"), | 361 | "\nQuit Anyway?"), |
362 | QMessageBox::Yes|QMessageBox::Escape, | 362 | QMessageBox::Yes|QMessageBox::Escape, |
363 | QMessageBox::No|QMessageBox::Default) | 363 | QMessageBox::No|QMessageBox::Default) |
364 | != QMessageBox::No ) { | 364 | != QMessageBox::No ) { |
365 | e->accept(); | 365 | e->accept(); |
366 | quit = true; | 366 | quit = true; |
367 | }else | 367 | }else |
368 | e->ignore(); | 368 | e->ignore(); |
369 | 369 | ||
@@ -412,77 +412,77 @@ void MainWindow::slotNewFromTemplate( int id ) { | |||
412 | event.setUid( -1 ); | 412 | event.setUid( -1 ); |
413 | currentView()->addEvent( event ); | 413 | currentView()->addEvent( event ); |
414 | m_todoMgr.add( event ); | 414 | m_todoMgr.add( event ); |
415 | 415 | ||
416 | populateCategories(); | 416 | populateCategories(); |
417 | } | 417 | } |
418 | } | 418 | } |
419 | void MainWindow::slotNew() { | 419 | void MainWindow::slotNew() { |
420 | create(); | 420 | create(); |
421 | } | 421 | } |
422 | void MainWindow::slotDuplicate() { | 422 | void MainWindow::slotDuplicate() { |
423 | if(m_syncing) { | 423 | if(m_syncing) { |
424 | QMessageBox::warning(this, tr("Todo"), | 424 | QMessageBox::warning(this, QWidget::tr("Todo"), |
425 | tr("Can not edit data, currently syncing")); | 425 | QWidget::tr("Can not edit data, currently syncing")); |
426 | return; | 426 | return; |
427 | } | 427 | } |
428 | OTodo ev = m_todoMgr.event( currentView()->current() ); | 428 | OTodo ev = m_todoMgr.event( currentView()->current() ); |
429 | /* let's generate a new uid */ | 429 | /* let's generate a new uid */ |
430 | ev.setUid(-1); | 430 | ev.setUid(-1); |
431 | m_todoMgr.add( ev ); | 431 | m_todoMgr.add( ev ); |
432 | 432 | ||
433 | currentView()->addEvent( ev ); | 433 | currentView()->addEvent( ev ); |
434 | raiseCurrentView(); | 434 | raiseCurrentView(); |
435 | } | 435 | } |
436 | void MainWindow::slotDelete() { | 436 | void MainWindow::slotDelete() { |
437 | if (!currentView()->current() ) | 437 | if (!currentView()->current() ) |
438 | return; | 438 | return; |
439 | 439 | ||
440 | if(m_syncing) { | 440 | if(m_syncing) { |
441 | QMessageBox::warning(this, tr("Todo"), | 441 | QMessageBox::warning(this, QWidget::tr("Todo"), |
442 | tr("Can not edit data, currently syncing")); | 442 | QWidget::tr("Can not edit data, currently syncing")); |
443 | return; | 443 | return; |
444 | } | 444 | } |
445 | QString strName = currentView()->currentRepresentation(); | 445 | QString strName = currentView()->currentRepresentation(); |
446 | if (!QPEMessageBox::confirmDelete(this, tr("Todo"), strName ) ) | 446 | if (!QPEMessageBox::confirmDelete(this, QWidget::tr("Todo"), strName ) ) |
447 | return; | 447 | return; |
448 | 448 | ||
449 | m_todoMgr.remove( currentView()->current() ); | 449 | m_todoMgr.remove( currentView()->current() ); |
450 | currentView()->removeEvent( currentView()->current() ); | 450 | currentView()->removeEvent( currentView()->current() ); |
451 | raiseCurrentView(); | 451 | raiseCurrentView(); |
452 | } | 452 | } |
453 | void MainWindow::slotDeleteAll() { | 453 | void MainWindow::slotDeleteAll() { |
454 | if(m_syncing) { | 454 | if(m_syncing) { |
455 | QMessageBox::warning(this, tr("Todo"), | 455 | QMessageBox::warning(this, QWidget::tr("Todo"), |
456 | tr("Can not edit data, currently syncing")); | 456 | QWidget::tr("Can not edit data, currently syncing")); |
457 | return; | 457 | return; |
458 | } | 458 | } |
459 | 459 | ||
460 | 460 | ||
461 | if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("all tasks?") ) ) | 461 | if ( !QPEMessageBox::confirmDelete( this, QWidget::tr( "Todo" ), QWidget::tr("all tasks?") ) ) |
462 | return; | 462 | return; |
463 | 463 | ||
464 | m_todoMgr.removeAll(); | 464 | m_todoMgr.removeAll(); |
465 | currentView()->clear(); | 465 | currentView()->clear(); |
466 | 466 | ||
467 | raiseCurrentView(); | 467 | raiseCurrentView(); |
468 | } | 468 | } |
469 | void MainWindow::slotDeleteCompleted() { | 469 | void MainWindow::slotDeleteCompleted() { |
470 | if(m_syncing) { | 470 | if(m_syncing) { |
471 | QMessageBox::warning(this, tr("Todo"), | 471 | QMessageBox::warning(this, QWidget::tr("Todo"), |
472 | tr("Can not edit data, currently syncing")); | 472 | QWidget::tr("Can not edit data, currently syncing")); |
473 | return; | 473 | return; |
474 | } | 474 | } |
475 | 475 | ||
476 | if ( !QPEMessageBox::confirmDelete( this, tr( "Todo" ), tr("all completed tasks?") ) ) | 476 | if ( !QPEMessageBox::confirmDelete( this, QWidget::tr( "Todo" ), QWidget::tr("all completed tasks?") ) ) |
477 | return; | 477 | return; |
478 | 478 | ||
479 | 479 | ||
480 | m_todoMgr.removeCompleted(); | 480 | m_todoMgr.removeCompleted(); |
481 | currentView()->updateView( ); | 481 | currentView()->updateView( ); |
482 | } | 482 | } |
483 | void MainWindow::slotFind() { | 483 | void MainWindow::slotFind() { |
484 | 484 | ||
485 | } | 485 | } |
486 | void MainWindow::slotEdit() { | 486 | void MainWindow::slotEdit() { |
487 | slotEdit( currentView()->current() ); | 487 | slotEdit( currentView()->current() ); |
488 | } | 488 | } |
@@ -490,32 +490,32 @@ void MainWindow::slotEdit() { | |||
490 | * set the category | 490 | * set the category |
491 | */ | 491 | */ |
492 | void MainWindow::setCategory( int c) { | 492 | void MainWindow::setCategory( int c) { |
493 | if ( c <= 0 ) return; | 493 | if ( c <= 0 ) return; |
494 | 494 | ||
495 | 495 | ||
496 | qWarning("Iterating over cats %d", c ); | 496 | qWarning("Iterating over cats %d", c ); |
497 | for ( unsigned int i = 1; i < m_catMenu->count(); i++ ) | 497 | for ( unsigned int i = 1; i < m_catMenu->count(); i++ ) |
498 | m_catMenu->setItemChecked(i, c == (int)i ); | 498 | m_catMenu->setItemChecked(i, c == (int)i ); |
499 | 499 | ||
500 | if (c == 1 ) { | 500 | if (c == 1 ) { |
501 | m_curCat = QString::null; | 501 | m_curCat = QString::null; |
502 | setCaption( tr("Todo") + " - " + tr("All Categories" ) ); | 502 | setCaption( QWidget::tr("Todo") + " - " + QWidget::tr("All Categories" ) ); |
503 | 503 | ||
504 | }else if ( c == (int)m_catMenu->count() - 1 ) { | 504 | }else if ( c == (int)m_catMenu->count() - 1 ) { |
505 | m_curCat = tr("Unfiled"); | 505 | m_curCat = QWidget::tr("Unfiled"); |
506 | setCaption( tr("Todo") + " - " + tr("Unfiled") ); | 506 | setCaption( QWidget::tr("Todo") + " - " + QWidget::tr("Unfiled") ); |
507 | }else { | 507 | }else { |
508 | m_curCat = m_todoMgr.categories()[c-2]; | 508 | m_curCat = m_todoMgr.categories()[c-2]; |
509 | setCaption( tr("Todo") + " - " + m_curCat ); | 509 | setCaption( QWidget::tr("Todo") + " - " + m_curCat ); |
510 | } | 510 | } |
511 | m_catMenu->setItemChecked( c, true ); | 511 | m_catMenu->setItemChecked( c, true ); |
512 | 512 | ||
513 | currentView()->setShowCategory( m_curCat ); | 513 | currentView()->setShowCategory( m_curCat ); |
514 | raiseCurrentView(); | 514 | raiseCurrentView(); |
515 | } | 515 | } |
516 | void MainWindow::slotShowDeadLine( bool dead) { | 516 | void MainWindow::slotShowDeadLine( bool dead) { |
517 | m_deadline = dead; | 517 | m_deadline = dead; |
518 | currentView()->setShowDeadline( dead ); | 518 | currentView()->setShowDeadline( dead ); |
519 | } | 519 | } |
520 | void MainWindow::slotShowCompleted( bool show) { | 520 | void MainWindow::slotShowCompleted( bool show) { |
521 | m_completed = show; | 521 | m_completed = show; |
@@ -544,27 +544,27 @@ void MainWindow::slotBeam() { | |||
544 | beam( currentView()->current() ); | 544 | beam( currentView()->current() ); |
545 | } | 545 | } |
546 | void MainWindow::beamDone( Ir* ir) { | 546 | void MainWindow::beamDone( Ir* ir) { |
547 | delete ir; | 547 | delete ir; |
548 | ::unlink( beamfile ); | 548 | ::unlink( beamfile ); |
549 | } | 549 | } |
550 | void MainWindow::receiveFile( const QString& filename ) { | 550 | void MainWindow::receiveFile( const QString& filename ) { |
551 | OTodoAccessVCal* cal = new OTodoAccessVCal(filename ); | 551 | OTodoAccessVCal* cal = new OTodoAccessVCal(filename ); |
552 | OTodoAccess acc( cal ); | 552 | OTodoAccess acc( cal ); |
553 | acc.load(); | 553 | acc.load(); |
554 | OTodoAccess::List list = acc.allRecords(); | 554 | OTodoAccess::List list = acc.allRecords(); |
555 | 555 | ||
556 | QString message = tr("<P>%1 new tasks arrived.<p>Would you like to add them to your Todolist?").arg(list.count() ); | 556 | QString message = QWidget::tr("<P>%1 new tasks arrived.<p>Would you like to add them to your Todolist?").arg(list.count() ); |
557 | 557 | ||
558 | if ( QMessageBox::information(this, tr("New Tasks"), | 558 | if ( QMessageBox::information(this, QWidget::tr("New Tasks"), |
559 | message, QMessageBox::Ok, | 559 | message, QMessageBox::Ok, |
560 | QMessageBox::Cancel ) == QMessageBox::Ok ) { | 560 | QMessageBox::Cancel ) == QMessageBox::Ok ) { |
561 | OTodoAccess::List::Iterator it; | 561 | OTodoAccess::List::Iterator it; |
562 | for ( it = list.begin(); it != list.end(); ++it ) | 562 | for ( it = list.begin(); it != list.end(); ++it ) |
563 | m_todoMgr.add( (*it) ); | 563 | m_todoMgr.add( (*it) ); |
564 | 564 | ||
565 | currentView()->updateView(); | 565 | currentView()->updateView(); |
566 | } | 566 | } |
567 | } | 567 | } |
568 | 568 | ||
569 | void MainWindow::slotFlush() { | 569 | void MainWindow::slotFlush() { |
570 | m_syncing = FALSE; | 570 | m_syncing = FALSE; |
@@ -576,28 +576,28 @@ void MainWindow::slotShowDetails() { | |||
576 | /* | 576 | /* |
577 | * populate the Categories | 577 | * populate the Categories |
578 | * Menu | 578 | * Menu |
579 | */ | 579 | */ |
580 | void MainWindow::populateCategories() { | 580 | void MainWindow::populateCategories() { |
581 | m_todoMgr.load(); | 581 | m_todoMgr.load(); |
582 | 582 | ||
583 | m_catMenu->clear(); | 583 | m_catMenu->clear(); |
584 | int id, rememberId; | 584 | int id, rememberId; |
585 | id = 1; | 585 | id = 1; |
586 | rememberId = 1; | 586 | rememberId = 1; |
587 | 587 | ||
588 | m_catMenu->insertItem( tr( "All Categories" ), id++ ); | 588 | m_catMenu->insertItem( QWidget::tr( "All Categories" ), id++ ); |
589 | m_catMenu->insertSeparator(); | 589 | m_catMenu->insertSeparator(); |
590 | QStringList categories = m_todoMgr.categories(); | 590 | QStringList categories = m_todoMgr.categories(); |
591 | categories.append( tr( "Unfiled" ) ); | 591 | categories.append( QWidget::tr( "Unfiled" ) ); |
592 | for ( QStringList::Iterator it = categories.begin(); | 592 | for ( QStringList::Iterator it = categories.begin(); |
593 | it != categories.end(); ++it ) { | 593 | it != categories.end(); ++it ) { |
594 | m_catMenu->insertItem( *it, id ); | 594 | m_catMenu->insertItem( *it, id ); |
595 | if ( *it == currentCategory() ) | 595 | if ( *it == currentCategory() ) |
596 | rememberId = id; | 596 | rememberId = id; |
597 | ++id; | 597 | ++id; |
598 | } | 598 | } |
599 | setCategory( rememberId ); | 599 | setCategory( rememberId ); |
600 | } | 600 | } |
601 | bool MainWindow::showCompleted()const { | 601 | bool MainWindow::showCompleted()const { |
602 | return m_completed; | 602 | return m_completed; |
603 | } | 603 | } |
@@ -622,26 +622,26 @@ void MainWindow::raiseCurrentView() { | |||
622 | void MainWindow::slotShowDue(bool ov) { | 622 | void MainWindow::slotShowDue(bool ov) { |
623 | m_overdue = ov; | 623 | m_overdue = ov; |
624 | currentView()->showOverDue( ov ); | 624 | currentView()->showOverDue( ov ); |
625 | raiseCurrentView(); | 625 | raiseCurrentView(); |
626 | } | 626 | } |
627 | void MainWindow::slotShow( int uid ) { | 627 | void MainWindow::slotShow( int uid ) { |
628 | qWarning("slotShow"); | 628 | qWarning("slotShow"); |
629 | currentShow()->slotShow( event( uid ) ); | 629 | currentShow()->slotShow( event( uid ) ); |
630 | m_stack->raiseWidget( currentShow()->widget() ); | 630 | m_stack->raiseWidget( currentShow()->widget() ); |
631 | } | 631 | } |
632 | void MainWindow::slotEdit( int uid ) { | 632 | void MainWindow::slotEdit( int uid ) { |
633 | if(m_syncing) { | 633 | if(m_syncing) { |
634 | QMessageBox::warning(this, tr("Todo"), | 634 | QMessageBox::warning(this, QWidget::tr("Todo"), |
635 | tr("Can not edit data, currently syncing")); | 635 | QWidget::tr("Can not edit data, currently syncing")); |
636 | return; | 636 | return; |
637 | } | 637 | } |
638 | 638 | ||
639 | OTodo todo = m_todoMgr.event( uid ); | 639 | OTodo todo = m_todoMgr.event( uid ); |
640 | 640 | ||
641 | todo = currentEditor()->edit(this, todo ); | 641 | todo = currentEditor()->edit(this, todo ); |
642 | 642 | ||
643 | /* if completed */ | 643 | /* if completed */ |
644 | if ( currentEditor()->accepted() ) { | 644 | if ( currentEditor()->accepted() ) { |
645 | qWarning("Replacing now" ); | 645 | qWarning("Replacing now" ); |
646 | m_todoMgr.update( todo.uid(), todo ); | 646 | m_todoMgr.update( todo.uid(), todo ); |
647 | currentView()->replaceEvent( todo ); | 647 | currentView()->replaceEvent( todo ); |
@@ -740,26 +740,26 @@ void MainWindow::slotComplete( const OTodo& todo ) { | |||
740 | currentView()->updateView(); | 740 | currentView()->updateView(); |
741 | raiseCurrentView(); | 741 | raiseCurrentView(); |
742 | } | 742 | } |
743 | void MainWindow::flush() { | 743 | void MainWindow::flush() { |
744 | slotFlush(); | 744 | slotFlush(); |
745 | } | 745 | } |
746 | void MainWindow::reload() { | 746 | void MainWindow::reload() { |
747 | slotReload(); | 747 | slotReload(); |
748 | } | 748 | } |
749 | int MainWindow::create() { | 749 | int MainWindow::create() { |
750 | int uid = 0; | 750 | int uid = 0; |
751 | if(m_syncing) { | 751 | if(m_syncing) { |
752 | QMessageBox::warning(this, tr("Todo"), | 752 | QMessageBox::warning(this, QWidget::tr("Todo"), |
753 | tr("Can not edit data, currently syncing")); | 753 | QWidget::tr("Can not edit data, currently syncing")); |
754 | return uid; | 754 | return uid; |
755 | } | 755 | } |
756 | 756 | ||
757 | 757 | ||
758 | OTodo todo = currentEditor()->newTodo( currentCatId(), | 758 | OTodo todo = currentEditor()->newTodo( currentCatId(), |
759 | this ); | 759 | this ); |
760 | 760 | ||
761 | if ( currentEditor()->accepted() ) { | 761 | if ( currentEditor()->accepted() ) { |
762 | //todo.assignUid(); | 762 | //todo.assignUid(); |
763 | uid = todo.uid(); | 763 | uid = todo.uid(); |
764 | m_todoMgr.add( todo ); | 764 | m_todoMgr.add( todo ); |
765 | currentView()->addEvent( todo ); | 765 | currentView()->addEvent( todo ); |