summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp20
-rw-r--r--core/pim/todo/quickeditimpl.cpp14
-rw-r--r--core/pim/todo/tableview.cpp21
3 files changed, 31 insertions, 24 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 0ccf73e..d16d1ac 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -24,23 +24,23 @@
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include <unistd.h> 29#include <unistd.h>
30#include <stdio.h>
31 30
32#include <qmenubar.h> 31#include <qmenubar.h>
33#include <qmessagebox.h> 32#include <qmessagebox.h>
34#include <qtoolbar.h> 33#include <qtoolbar.h>
35#include <qpopupmenu.h> 34#include <qpopupmenu.h>
36#include <qwidgetstack.h> 35#include <qwidgetstack.h>
37#include <qaction.h> 36#include <qaction.h>
38#include <qtimer.h> 37#include <qtimer.h>
39#include <qvbox.h> 38#include <qvbox.h>
40#include <qlineedit.h> 39#include <qlineedit.h>
40#include <qwhatsthis.h>
41 41
42#include <qpe/applnk.h> 42#include <qpe/applnk.h>
43#include <qpe/config.h> 43#include <qpe/config.h>
44#include <qpe/ir.h> 44#include <qpe/ir.h>
45#include <qpe/resource.h> 45#include <qpe/resource.h>
46#include <qpe/qpemessagebox.h> 46#include <qpe/qpemessagebox.h>
@@ -60,15 +60,14 @@
60 60
61 61
62using namespace Todo; 62using namespace Todo;
63 63
64MainWindow::MainWindow( QWidget* parent, 64MainWindow::MainWindow( QWidget* parent,
65 const char* name ) 65 const char* name )
66 : OPimMainWindow("Todolist", parent, name) 66 : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp )
67{ 67{
68
69 m_syncing = false; 68 m_syncing = false;
70 m_counter = 0; 69 m_counter = 0;
71 m_tempManager = new TemplateManager(); 70 m_tempManager = new TemplateManager();
72 m_tempManager->load(); 71 m_tempManager->load();
73 72
74 initUI(); 73 initUI();
@@ -93,19 +92,21 @@ void MainWindow::initActions() {
93 -1, 0 ); 92 -1, 0 );
94 93
95 QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ), 94 QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ),
96 QString::null, 0, this, 0 ); 95 QString::null, 0, this, 0 );
97 connect(a, SIGNAL( activated() ), 96 connect(a, SIGNAL( activated() ),
98 this, SLOT( slotNew() ) ); 97 this, SLOT( slotNew() ) );
98 a->setWhatsThis( 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( 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->addTo( m_tool ); 107 a->addTo( m_tool );
107 a->addTo( m_edit ); 108 a->addTo( m_edit );
108 m_editAction = a; 109 m_editAction = a;
109 110
110 a = new QAction( QString::null, tr("View Task"), 0, this, 0 ); 111 a = new QAction( QString::null, tr("View Task"), 0, this, 0 );
111 connect(a, SIGNAL( activated() ), 112 connect(a, SIGNAL( activated() ),
@@ -115,12 +116,13 @@ void MainWindow::initActions() {
115 m_edit->insertSeparator(); 116 m_edit->insertSeparator();
116 117
117 a = new QAction( tr("Delete..."), Resource::loadIconSet( "trash" ), 118 a = new QAction( tr("Delete..."), Resource::loadIconSet( "trash" ),
118 QString::null, 0, this, 0 ); 119 QString::null, 0, this, 0 );
119 connect(a, SIGNAL(activated() ), 120 connect(a, SIGNAL(activated() ),
120 this, SLOT(slotDelete() ) ); 121 this, SLOT(slotDelete() ) );
122 a->setWhatsThis( tr( "Click here to remove the current task." ) );
121 a->addTo( m_tool ); 123 a->addTo( m_tool );
122 a->addTo( m_edit ); 124 a->addTo( m_edit );
123 m_deleteAction = a; 125 m_deleteAction = a;
124 126
125 a = new QAction( QString::null, tr("Delete all..."), 0, this, 0 ); 127 a = new QAction( QString::null, tr("Delete all..."), 0, this, 0 );
126 connect(a, SIGNAL( activated() ), 128 connect(a, SIGNAL( activated() ),
@@ -144,18 +146,17 @@ void MainWindow::initActions() {
144 a->addTo(m_edit ); 146 a->addTo(m_edit );
145 m_duplicateAction = a; 147 m_duplicateAction = a;
146 148
147 m_edit->insertSeparator(); 149 m_edit->insertSeparator();
148 150
149 if ( Ir::supported() ) { 151 if ( Ir::supported() ) {
150 a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), 152 a = new QAction( tr( "Beam" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 );
151 QString::null, 0, this, 0 ); 153 connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) );
152 connect( a, SIGNAL( activated() ), 154 a->setWhatsThis( tr( "Click here to send the current task to another device." ) );
153 this, SLOT( slotBeam() ) ); 155 a->addTo( m_edit );
154 a->addTo( m_edit ); 156 a->addTo( m_tool );
155 a->addTo( m_tool );
156 } 157 }
157 158
158 // Options menu 159 // Options menu
159 a = new QAction( tr("Find"), Resource::loadIconSet( "mag" ), 160 a = new QAction( tr("Find"), Resource::loadIconSet( "mag" ),
160 QString::null, 0, this, 0 ); 161 QString::null, 0, this, 0 );
161 connect(a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); 162 connect(a, SIGNAL( activated() ), this, SLOT( slotFind() ) );
@@ -233,12 +234,13 @@ void MainWindow::initUI() {
233 this, SLOT(setCategory(int) ) ); 234 this, SLOT(setCategory(int) ) );
234 connect(m_template, SIGNAL(activated(int) ), 235 connect(m_template, SIGNAL(activated(int) ),
235 this, SLOT(slotNewFromTemplate(int) ) ); 236 this, SLOT(slotNewFromTemplate(int) ) );
236} 237}
237void MainWindow::initViews() { 238void MainWindow::initViews() {
238 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." ) );
239 m_stack->addWidget( tableView, m_counter++ ); 241 m_stack->addWidget( tableView, m_counter++ );
240 m_views.append( tableView ); 242 m_views.append( tableView );
241 m_curView = tableView; 243 m_curView = tableView;
242 connectBase( tableView ); 244 connectBase( tableView );
243 /* add QString type + QString configname to 245 /* add QString type + QString configname to
244 * the View menu 246 * the View menu
diff --git a/core/pim/todo/quickeditimpl.cpp b/core/pim/todo/quickeditimpl.cpp
index cadec03..7664ee4 100644
--- a/core/pim/todo/quickeditimpl.cpp
+++ b/core/pim/todo/quickeditimpl.cpp
@@ -1,8 +1,9 @@
1#include <qaction.h> 1#include <qaction.h>
2#include <qlineedit.h> 2#include <qlineedit.h>
3#include <qwhatsthis.h>
3 4
4#include <qpe/resource.h> 5#include <qpe/resource.h>
5 6
6#include <opie/oclickablelabel.h> 7#include <opie/oclickablelabel.h>
7 8
8#include "mainwindow.h" 9#include "mainwindow.h"
@@ -15,34 +16,37 @@ QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible )
15 16
16 // Load priority icons 17 // Load priority icons
17 // TODO - probably should be done globally somewhere else, see also tableview.cpp/h 18 // TODO - probably should be done globally somewhere else, see also tableview.cpp/h
18 priority1 = Resource::loadPixmap( "todo/priority1" ); 19 priority1 = Resource::loadPixmap( "todo/priority1" );
19 priority3 = Resource::loadPixmap( "todo/priority3" ); 20 priority3 = Resource::loadPixmap( "todo/priority3" );
20 priority5 = Resource::loadPixmap( "todo/priority5" ); 21 priority5 = Resource::loadPixmap( "todo/priority5" );
21 22
22
23 // TODO - come up with icons and replace text priority values
24 m_lbl = new OClickableLabel( this ); 23 m_lbl = new OClickableLabel( this );
25 m_lbl->setMinimumWidth(15); 24 m_lbl->setMinimumWidth( 15 );
26 m_lbl->setPixmap( priority3 ); 25 m_lbl->setPixmap( priority3 );
27 connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) ); 26 connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) );
27 QWhatsThis::add( m_lbl, tr( "Click here to set the priority of new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
28 28
29 m_edit = new QLineEdit( this ); 29 m_edit = new QLineEdit( this );
30 setStretchableWidget( m_edit ); 30 setStretchableWidget( m_edit );
31 31 QWhatsThis::add( m_edit, tr( "Enter description of new task here.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
32
32 QAction *a = new QAction( tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 ); 33 QAction *a = new QAction( tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 );
33 connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) ); 34 connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) );
34 a->addTo( this ); 35 a->addTo( this );
36 a->setWhatsThis( tr( "Click here to enter additional information for new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
35 37
36 a = new QAction( tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); 38 a = new QAction( tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 );
37 connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) ); 39 connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) );
38 a->addTo( this ); 40 a->addTo( this );
41 a->setWhatsThis( tr( "Click here to add new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
39 42
40 a = new QAction( tr( "Cancel" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 43 a = new QAction( tr( "Cancel" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
41 connect( a, SIGNAL( activated() ), this, SLOT( slotCancel() ) ); 44 connect( a, SIGNAL( activated() ), this, SLOT( slotCancel() ) );
42 a->addTo( this ); 45 a->addTo( this );
46 a->setWhatsThis( tr( "Click here to reset new task information.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) );
43 47
44 m_visible = visible; 48 m_visible = visible;
45 if ( !m_visible ) { 49 if ( !m_visible ) {
46 hide(); 50 hide();
47 } 51 }
48 52
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp
index d229f52..cd6740a 100644
--- a/core/pim/todo/tableview.cpp
+++ b/core/pim/todo/tableview.cpp
@@ -56,12 +56,23 @@ void TableView::initConfig() {
56 config.setGroup( "Options" ); 56 config.setGroup( "Options" );
57 m_completeStrokeWidth = config.readNumEntry( "CompleteStrokeWidth", 8 ); 57 m_completeStrokeWidth = config.readNumEntry( "CompleteStrokeWidth", 8 );
58} 58}
59 59
60TableView::TableView( MainWindow* window, QWidget* wid ) 60TableView::TableView( MainWindow* window, QWidget* wid )
61 : QTable( wid ), TodoView( window ) { 61 : QTable( wid ), TodoView( window ) {
62
63 // Load icons
64 // TODO - probably should be done globally somewhere else, see also quickeditimpl.cpp/h
65 m_pic_completed = Resource::loadPixmap( "todo/completed" );
66 QString namestr;
67 for ( unsigned int i = 1; i < 6; i++ ) {
68 namestr = "todo/priority";
69 namestr.append( QString::number( i ) );
70 m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr );
71 }
72
62 setUpdatesEnabled( false ); 73 setUpdatesEnabled( false );
63 viewport()->setUpdatesEnabled( false ); 74 viewport()->setUpdatesEnabled( false );
64 m_enablePaint = false; 75 m_enablePaint = false;
65 setNumRows(0); 76 setNumRows(0);
66 setNumCols(4); 77 setNumCols(4);
67 78
@@ -96,22 +107,12 @@ TableView::TableView( MainWindow* window, QWidget* wid )
96 viewport()->setUpdatesEnabled( true ); 107 viewport()->setUpdatesEnabled( true );
97 viewport()->update(); 108 viewport()->update();
98 setSortOrder( 0 ); 109 setSortOrder( 0 );
99 setAscending( TRUE ); 110 setAscending( TRUE );
100 m_first = true; 111 m_first = true;
101 112
102 // Load icons
103 // TODO - probably should be done globally somewhere else, see also quickeditimpl.cpp/h
104 m_pic_completed = Resource::loadPixmap( "todo/completed" );
105 QString namestr;
106 for ( unsigned int i = 1; i < 6; i++ ) {
107 namestr = "todo/priority";
108 namestr.append( QString::number( i ) );
109 m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr );
110 }
111
112 /* now let's init the config */ 113 /* now let's init the config */
113 initConfig(); 114 initConfig();
114} 115}
115/* a new day has started 116/* a new day has started
116 * update the day 117 * update the day
117 */ 118 */