author | zecke <zecke> | 2002-11-02 13:47:01 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-11-02 13:47:01 (UTC) |
commit | d21d693d91af8ee8fb54478a6db67f5a0590a767 (patch) (unidiff) | |
tree | b38c34f39d70d056fb99cdd35515e2308b06c74a | |
parent | f655415f77b200f9edfbe5732cd5f8da2b4dec47 (diff) | |
download | opie-d21d693d91af8ee8fb54478a6db67f5a0590a767.zip opie-d21d693d91af8ee8fb54478a6db67f5a0590a767.tar.gz opie-d21d693d91af8ee8fb54478a6db67f5a0590a767.tar.bz2 |
Cut some warning
and applied trekres customStrokeWidth patch
-rw-r--r-- | core/pim/todo/tableview.cpp | 14 | ||||
-rw-r--r-- | core/pim/todo/tableview.h | 2 | ||||
-rw-r--r-- | core/pim/todo/todoview.cpp | 4 |
3 files changed, 17 insertions, 3 deletions
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp index 6299113..743deb7 100644 --- a/core/pim/todo/tableview.cpp +++ b/core/pim/todo/tableview.cpp | |||
@@ -13,50 +13,59 @@ | |||
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
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 | #include <stdlib.h> | 28 | #include <stdlib.h> |
29 | #include <cmath> | ||
29 | 30 | ||
30 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
31 | #include <qtimer.h> | 32 | #include <qtimer.h> |
32 | #include <qpoint.h> | 33 | #include <qpoint.h> |
33 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
34 | 35 | ||
36 | #include <qpe/config.h> | ||
37 | |||
35 | #include "mainwindow.h" | 38 | #include "mainwindow.h" |
36 | //#include "tableitems.h" | 39 | //#include "tableitems.h" |
37 | #include "tableview.h" | 40 | #include "tableview.h" |
38 | 41 | ||
39 | using namespace Todo; | 42 | using namespace Todo; |
40 | 43 | ||
41 | namespace { | 44 | namespace { |
42 | static const int BoxSize = 14; | 45 | static const int BoxSize = 14; |
43 | static const int RowHeight = 20; | 46 | static const int RowHeight = 20; |
44 | } | 47 | } |
45 | 48 | ||
46 | 49 | ||
50 | void TableView::initConfig() { | ||
51 | Config config( "todo" ); | ||
52 | config.setGroup( "Options" ); | ||
53 | m_completeStrokeWidth = config.readNumEntry( "CompleteStrokeWidth", 8 ); | ||
54 | } | ||
55 | |||
47 | TableView::TableView( MainWindow* window, QWidget* wid ) | 56 | TableView::TableView( MainWindow* window, QWidget* wid ) |
48 | : QTable( wid ), TodoView( window ) { | 57 | : QTable( wid ), TodoView( window ) { |
49 | setUpdatesEnabled( false ); | 58 | setUpdatesEnabled( false ); |
50 | viewport()->setUpdatesEnabled( false ); | 59 | viewport()->setUpdatesEnabled( false ); |
51 | m_enablePaint = false; | 60 | m_enablePaint = false; |
52 | setNumRows(0); | 61 | setNumRows(0); |
53 | setNumCols(4); | 62 | setNumCols(4); |
54 | 63 | ||
55 | setSorting( TRUE ); | 64 | setSorting( TRUE ); |
56 | setSelectionMode( NoSelection ); | 65 | setSelectionMode( NoSelection ); |
57 | // setColumnStretchable( 2, TRUE ); | 66 | // setColumnStretchable( 2, TRUE ); |
58 | setColumnStretchable( 3, FALSE ); | 67 | setColumnStretchable( 3, FALSE ); |
59 | setColumnWidth(0, 20 ); | 68 | setColumnWidth(0, 20 ); |
60 | setColumnWidth(1, 35 ); | 69 | setColumnWidth(1, 35 ); |
61 | setColumnWidth(3, 18 ); | 70 | setColumnWidth(3, 18 ); |
62 | 71 | ||
@@ -83,32 +92,35 @@ TableView::TableView( MainWindow* window, QWidget* wid ) | |||
83 | connect((QTable*)this, SIGNAL(valueChanged(int, int) ), | 92 | connect((QTable*)this, SIGNAL(valueChanged(int, int) ), |
84 | this, SLOT( slotValueChanged(int, int) ) ); | 93 | this, SLOT( slotValueChanged(int, int) ) ); |
85 | connect((QTable*)this, SIGNAL(currentChanged(int, int) ), | 94 | connect((QTable*)this, SIGNAL(currentChanged(int, int) ), |
86 | this, SLOT( slotCurrentChanged(int, int) ) ); | 95 | this, SLOT( slotCurrentChanged(int, int) ) ); |
87 | 96 | ||
88 | m_menuTimer = new QTimer( this ); | 97 | m_menuTimer = new QTimer( this ); |
89 | connect( m_menuTimer, SIGNAL(timeout()), | 98 | connect( m_menuTimer, SIGNAL(timeout()), |
90 | this, SLOT(slotShowMenu()) ); | 99 | this, SLOT(slotShowMenu()) ); |
91 | 100 | ||
92 | m_enablePaint = true; | 101 | m_enablePaint = true; |
93 | setUpdatesEnabled( true ); | 102 | setUpdatesEnabled( true ); |
94 | viewport()->setUpdatesEnabled( true ); | 103 | viewport()->setUpdatesEnabled( true ); |
95 | viewport()->update(); | 104 | viewport()->update(); |
96 | setSortOrder( 0 ); | 105 | setSortOrder( 0 ); |
97 | setAscending( TRUE ); | 106 | setAscending( TRUE ); |
98 | m_first = true; | 107 | m_first = true; |
108 | |||
109 | /* now let's init the config */ | ||
110 | initConfig(); | ||
99 | } | 111 | } |
100 | /* a new day has started | 112 | /* a new day has started |
101 | * update the day | 113 | * update the day |
102 | */ | 114 | */ |
103 | void TableView::newDay() { | 115 | void TableView::newDay() { |
104 | clear(); | 116 | clear(); |
105 | updateView(); | 117 | updateView(); |
106 | } | 118 | } |
107 | TableView::~TableView() { | 119 | TableView::~TableView() { |
108 | 120 | ||
109 | } | 121 | } |
110 | void TableView::slotShowMenu() { | 122 | void TableView::slotShowMenu() { |
111 | QPopupMenu *menu = todoWindow()->contextMenu( current() ); | 123 | QPopupMenu *menu = todoWindow()->contextMenu( current() ); |
112 | menu->exec(QCursor::pos() ); | 124 | menu->exec(QCursor::pos() ); |
113 | delete menu; | 125 | delete menu; |
114 | } | 126 | } |
@@ -475,31 +487,31 @@ void TableView::timerEvent( QTimerEvent* ev ) { | |||
475 | 487 | ||
476 | // We want a strike through completed ;) | 488 | // We want a strike through completed ;) |
477 | // durchstreichen to complete | 489 | // durchstreichen to complete |
478 | /* | 490 | /* |
479 | * MouseTracking is off this mean we only receive | 491 | * MouseTracking is off this mean we only receive |
480 | * these events if the mouse button is pressed | 492 | * these events if the mouse button is pressed |
481 | * We've the previous point saved | 493 | * We've the previous point saved |
482 | * We check if the previous and current Point are | 494 | * We check if the previous and current Point are |
483 | * in the same row. | 495 | * in the same row. |
484 | * Then we check if they're some pixel horizontal away | 496 | * Then we check if they're some pixel horizontal away |
485 | * if the distance between the two points is greater than | 497 | * if the distance between the two points is greater than |
486 | * 8 we mark the underlying todo as completed and do a repaint | 498 | * 8 we mark the underlying todo as completed and do a repaint |
487 | */ | 499 | */ |
488 | void TableView::contentsMouseReleaseEvent( QMouseEvent* e) { | 500 | void TableView::contentsMouseReleaseEvent( QMouseEvent* e) { |
489 | int row = rowAt(m_prevP.y()); | 501 | int row = rowAt(m_prevP.y()); |
490 | if ( row == rowAt( e->y() ) && row != -1 ) { | 502 | if ( row == rowAt( e->y() ) && row != -1 ) { |
491 | if ( abs( m_prevP.x() - e->x() ) >= 8 ) { | 503 | if ( ::abs( m_prevP.x() - e->x() ) >= m_completeStrokeWidth ) { |
492 | qWarning("current row %d", row ); | 504 | qWarning("current row %d", row ); |
493 | OTodo todo = sorted()[row]; | 505 | OTodo todo = sorted()[row]; |
494 | todo.setCompleted( !todo.isCompleted() ); | 506 | todo.setCompleted( !todo.isCompleted() ); |
495 | TodoView::update( todo.uid(), todo ); | 507 | TodoView::update( todo.uid(), todo ); |
496 | updateView(); | 508 | updateView(); |
497 | return; | 509 | return; |
498 | } | 510 | } |
499 | } | 511 | } |
500 | QTable::contentsMouseReleaseEvent( e ); | 512 | QTable::contentsMouseReleaseEvent( e ); |
501 | } | 513 | } |
502 | void TableView::contentsMouseMoveEvent( QMouseEvent* e ) { | 514 | void TableView::contentsMouseMoveEvent( QMouseEvent* e ) { |
503 | m_menuTimer->stop(); | 515 | m_menuTimer->stop(); |
504 | QTable::contentsMouseMoveEvent( e ); | 516 | QTable::contentsMouseMoveEvent( e ); |
505 | } | 517 | } |
diff --git a/core/pim/todo/tableview.h b/core/pim/todo/tableview.h index 0c3e865..e47b38f 100644 --- a/core/pim/todo/tableview.h +++ b/core/pim/todo/tableview.h | |||
@@ -85,22 +85,24 @@ namespace Todo { | |||
85 | void contentsMouseReleaseEvent( QMouseEvent* ); | 85 | void contentsMouseReleaseEvent( QMouseEvent* ); |
86 | void contentsMouseMoveEvent( QMouseEvent* ); | 86 | void contentsMouseMoveEvent( QMouseEvent* ); |
87 | void timerEvent( QTimerEvent* e ); | 87 | void timerEvent( QTimerEvent* e ); |
88 | QWidget* createEditor(int row, int col, bool initFromCell )const; | 88 | QWidget* createEditor(int row, int col, bool initFromCell )const; |
89 | void setCellContentFromEditor( int row, int col ); | 89 | void setCellContentFromEditor( int row, int col ); |
90 | 90 | ||
91 | private slots: | 91 | private slots: |
92 | void slotShowMenu(); | 92 | void slotShowMenu(); |
93 | void slotClicked(int, int, int, | 93 | void slotClicked(int, int, int, |
94 | const QPoint& ); | 94 | const QPoint& ); |
95 | void slotPressed(int, int, int, | 95 | void slotPressed(int, int, int, |
96 | const QPoint& ); | 96 | const QPoint& ); |
97 | void slotValueChanged(int, int); | 97 | void slotValueChanged(int, int); |
98 | void slotCurrentChanged(int, int ); | 98 | void slotCurrentChanged(int, int ); |
99 | void slotPriority(); | 99 | void slotPriority(); |
100 | private: | 100 | private: |
101 | void initConfig(); | ||
102 | int m_completeStrokeWidth; | ||
101 | bool m_row : 1; | 103 | bool m_row : 1; |
102 | QPoint m_prevP; | 104 | QPoint m_prevP; |
103 | }; | 105 | }; |
104 | }; | 106 | }; |
105 | 107 | ||
106 | #endif | 108 | #endif |
diff --git a/core/pim/todo/todoview.cpp b/core/pim/todo/todoview.cpp index 639fa66..4cf7d30 100644 --- a/core/pim/todo/todoview.cpp +++ b/core/pim/todo/todoview.cpp | |||
@@ -58,22 +58,22 @@ OTodoAccess::List TodoView::sorted()const{ | |||
58 | return m_sort; | 58 | return m_sort; |
59 | } | 59 | } |
60 | void TodoView::sort() { | 60 | void TodoView::sort() { |
61 | m_sort = todoWindow()->sorted(m_asc,m_sortOrder ); | 61 | m_sort = todoWindow()->sorted(m_asc,m_sortOrder ); |
62 | qWarning("m_sort.count() = %d", m_sort.count() ); | 62 | qWarning("m_sort.count() = %d", m_sort.count() ); |
63 | } | 63 | } |
64 | void TodoView::sort(int sort) { | 64 | void TodoView::sort(int sort) { |
65 | m_sort = todoWindow()->sorted(m_asc, m_sortOrder, sort ); | 65 | m_sort = todoWindow()->sorted(m_asc, m_sortOrder, sort ); |
66 | } | 66 | } |
67 | void TodoView::setSortOrder( int order ) { | 67 | void TodoView::setSortOrder( int order ) { |
68 | m_sortOrder = order; | 68 | m_sortOrder = order; |
69 | } | 69 | } |
70 | void TodoView::setAscending( bool b ) { | 70 | void TodoView::setAscending( bool b ) { |
71 | qWarning("setAscending %d", b ); | 71 | qWarning("setAscending %d", b ); |
72 | m_asc = b; | 72 | m_asc = b; |
73 | } | 73 | } |
74 | void TodoView::update(int uid, const SmallTodo& to ) { | 74 | void TodoView::update(int, const SmallTodo& ) { |
75 | //m_main->slotUpate1( uid, to ); | 75 | //m_main->slotUpate1( uid, to ); |
76 | } | 76 | } |
77 | void TodoView::update(int uid, const OTodo& ev ) { | 77 | void TodoView::update(int , const OTodo& ev ) { |
78 | m_main->updateTodo( ev ); | 78 | m_main->updateTodo( ev ); |
79 | } | 79 | } |