summaryrefslogtreecommitdiff
path: root/core/pim/todo/tableview.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/tableview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/tableview.cpp21
1 files changed, 11 insertions, 10 deletions
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
@@ -50,24 +50,35 @@ namespace {
50 static const int RowHeight = 20; 50 static const int RowHeight = 20;
51} 51}
52 52
53 53
54void TableView::initConfig() { 54void TableView::initConfig() {
55 Config config( "todo" ); 55 Config config( "todo" );
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
68 horizontalHeader()->setLabel( 0, tr("C.") ); 79 horizontalHeader()->setLabel( 0, tr("C.") );
69 horizontalHeader()->setLabel( 1, tr("Priority") ); 80 horizontalHeader()->setLabel( 1, tr("Priority") );
70 horizontalHeader()->setLabel( 2, tr("Description" ) ); 81 horizontalHeader()->setLabel( 2, tr("Description" ) );
71 horizontalHeader()->setLabel( 3, tr("Deadline") ); 82 horizontalHeader()->setLabel( 3, tr("Deadline") );
72 83
73 setShowDeadline( todoWindow()->showDeadline() ); 84 setShowDeadline( todoWindow()->showDeadline() );
@@ -90,34 +101,24 @@ TableView::TableView( MainWindow* window, QWidget* wid )
90 m_menuTimer = new QTimer( this ); 101 m_menuTimer = new QTimer( this );
91 connect( m_menuTimer, SIGNAL(timeout()), 102 connect( m_menuTimer, SIGNAL(timeout()),
92 this, SLOT(slotShowMenu()) ); 103 this, SLOT(slotShowMenu()) );
93 104
94 m_enablePaint = true; 105 m_enablePaint = true;
95 setUpdatesEnabled( true ); 106 setUpdatesEnabled( true );
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 */
118void TableView::newDay() { 119void TableView::newDay() {
119 clear(); 120 clear();
120 updateView(); 121 updateView();
121} 122}
122TableView::~TableView() { 123TableView::~TableView() {
123 124