-rw-r--r-- | core/pim/todo/mainwindow.cpp | 2 | ||||
-rw-r--r-- | libopie/colorpopupmenu.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 294f37c..5609211 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -23,97 +23,97 @@ | |||
23 | #define QTOPIA_INTERNAL_FD | 23 | #define QTOPIA_INTERNAL_FD |
24 | 24 | ||
25 | #include "mainwindow.h" | 25 | #include "mainwindow.h" |
26 | #include "todoentryimpl.h" | 26 | #include "todoentryimpl.h" |
27 | #include "todotable.h" | 27 | #include "todotable.h" |
28 | #include "todolabel.h" | 28 | #include "todolabel.h" |
29 | 29 | ||
30 | #include <opie/tododb.h> | 30 | #include <opie/tododb.h> |
31 | #include <opie/todovcalresource.h> | 31 | #include <opie/todovcalresource.h> |
32 | #include <opie/ofontmenu.h> | 32 | #include <opie/ofontmenu.h> |
33 | 33 | ||
34 | #include <qpe/qpeapplication.h> | 34 | #include <qpe/qpeapplication.h> |
35 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
36 | #include <qpe/finddialog.h> | 36 | #include <qpe/finddialog.h> |
37 | #include <qpe/global.h> | 37 | #include <qpe/global.h> |
38 | #include <qpe/ir.h> | 38 | #include <qpe/ir.h> |
39 | #include <qpe/qpemenubar.h> | 39 | #include <qpe/qpemenubar.h> |
40 | #include <qpe/qpemessagebox.h> | 40 | #include <qpe/qpemessagebox.h> |
41 | #include <qpe/resource.h> | 41 | #include <qpe/resource.h> |
42 | //#include <qpe/task.h> | 42 | //#include <qpe/task.h> |
43 | #include <qpe/qpetoolbar.h> | 43 | #include <qpe/qpetoolbar.h> |
44 | 44 | ||
45 | #include <qaction.h> | 45 | #include <qaction.h> |
46 | #include <qarray.h> | 46 | #include <qarray.h> |
47 | #include <qdatastream.h> | 47 | #include <qdatastream.h> |
48 | #include <qdatetime.h> | 48 | #include <qdatetime.h> |
49 | #include <qfile.h> | 49 | #include <qfile.h> |
50 | #include <qmessagebox.h> | 50 | #include <qmessagebox.h> |
51 | #include <qpopupmenu.h> | 51 | #include <qpopupmenu.h> |
52 | #include <qwidgetstack.h> | 52 | #include <qwidgetstack.h> |
53 | 53 | ||
54 | #include <sys/stat.h> | 54 | #include <sys/stat.h> |
55 | #include <sys/types.h> | 55 | #include <sys/types.h> |
56 | #include <fcntl.h> | 56 | #include <fcntl.h> |
57 | #include <unistd.h> | 57 | #include <unistd.h> |
58 | 58 | ||
59 | #include <stdlib.h> | 59 | #include <stdlib.h> |
60 | 60 | ||
61 | static QString todolistXMLFilename() | 61 | static QString todolistXMLFilename() |
62 | { | 62 | { |
63 | return Global::applicationFileName("todolist","todolist.xml"); | 63 | return Global::applicationFileName("todolist","todolist.xml"); |
64 | } | 64 | } |
65 | 65 | ||
66 | static QString categoriesXMLFilename() | 66 | static QString categoriesXMLFilename() |
67 | { | 67 | { |
68 | return Global::applicationFileName("todolist","categories.xml"); | 68 | return Global::applicationFileName("todolist","categories.xml"); |
69 | } | 69 | } |
70 | 70 | ||
71 | TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | 71 | TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f ) : |
72 | QMainWindow( parent, name, f ), syncing(FALSE) | 72 | QMainWindow( parent, name, f ), syncing(FALSE) |
73 | { | 73 | { |
74 | // QTime t; | 74 | // QTime t; |
75 | // t.start(); | 75 | // t.start(); |
76 | mView = 0l; | 76 | mView = 0l; |
77 | mStack = new QWidgetStack(this, "main stack"); | 77 | mStack = new QWidgetStack(this, "main stack"); |
78 | setCaption( tr("Todo") ); | 78 | setCaption( tr("Todo") ); |
79 | QString str; | 79 | QString str; |
80 | table = new TodoTable( this ); | 80 | table = new TodoTable( this ); |
81 | table->setColumnWidth( 2, 10 ); | 81 | table->setColumnWidth( 2, 10 ); |
82 | table->setPaintingEnabled( FALSE ); | 82 | table->setPaintingEnabled( FALSE ); |
83 | table->setUpdatesEnabled( FALSE ); | 83 | table->setUpdatesEnabled( FALSE ); |
84 | table->viewport()->setUpdatesEnabled( FALSE ); | 84 | table->viewport()->setUpdatesEnabled( FALSE ); |
85 | 85 | ||
86 | { | 86 | { |
87 | str = todolistXMLFilename(); | 87 | str = todolistXMLFilename(); |
88 | if ( str.isNull() ) | 88 | if ( str.isNull() ) |
89 | QMessageBox::critical( this, | 89 | QMessageBox::critical( this, |
90 | tr("Out of Space"), | 90 | tr("Out of Space"), |
91 | tr("Unable to create startup files\n" | 91 | tr("Unable to create startup files\n" |
92 | "Free up some space\n" | 92 | "Free up some space\n" |
93 | "before you enter any data") ); | 93 | "before you enter any data") ); |
94 | else | 94 | else |
95 | table->load( str ); | 95 | table->load( str ); |
96 | } | 96 | } |
97 | 97 | ||
98 | // repeat for categories... | 98 | // repeat for categories... |
99 | str = categoriesXMLFilename(); | 99 | str = categoriesXMLFilename(); |
100 | if ( str.isNull() ) | 100 | if ( str.isNull() ) |
101 | QMessageBox::critical( this, | 101 | QMessageBox::critical( this, |
102 | tr( "Out of Space" ), | 102 | tr( "Out of Space" ), |
103 | tr( "Unable to create startup files\n" | 103 | tr( "Unable to create startup files\n" |
104 | "Free up some space\n" | 104 | "Free up some space\n" |
105 | "before you enter any data") ); | 105 | "before you enter any data") ); |
106 | 106 | ||
107 | mStack->addWidget(table, 1 ); | 107 | mStack->addWidget(table, 1 ); |
108 | mStack->raiseWidget( 1 ); | 108 | mStack->raiseWidget( 1 ); |
109 | setCentralWidget( mStack ); | 109 | setCentralWidget( mStack ); |
110 | setToolBarsMovable( FALSE ); | 110 | setToolBarsMovable( FALSE ); |
111 | 111 | ||
112 | // qDebug("after load: t=%d", t.elapsed() ); | 112 | // qDebug("after load: t=%d", t.elapsed() ); |
113 | 113 | ||
114 | Config config( "todo" ); | 114 | Config config( "todo" ); |
115 | config.setGroup( "View" ); | 115 | config.setGroup( "View" ); |
116 | bool complete = config.readBoolEntry( "ShowComplete", true ); | 116 | bool complete = config.readBoolEntry( "ShowComplete", true ); |
117 | table->setShowCompleted( complete ); | 117 | table->setShowCompleted( complete ); |
118 | 118 | ||
119 | bool showdeadline = config.readBoolEntry("ShowDeadLine", true); | 119 | bool showdeadline = config.readBoolEntry("ShowDeadLine", true); |
diff --git a/libopie/colorpopupmenu.cpp b/libopie/colorpopupmenu.cpp index 9b50a8b..17e2c0a 100644 --- a/libopie/colorpopupmenu.cpp +++ b/libopie/colorpopupmenu.cpp | |||
@@ -42,97 +42,97 @@ ColorPanelButton::~ColorPanelButton() | |||
42 | void ColorPanelButton::setActive( bool active ) | 42 | void ColorPanelButton::setActive( bool active ) |
43 | { | 43 | { |
44 | m_active = active; | 44 | m_active = active; |
45 | 45 | ||
46 | if ( m_active ) { | 46 | if ( m_active ) { |
47 | setFrameStyle( Panel | Sunken ); | 47 | setFrameStyle( Panel | Sunken ); |
48 | } else { | 48 | } else { |
49 | setFrameStyle( NoFrame ); | 49 | setFrameStyle( NoFrame ); |
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
53 | void ColorPanelButton::enterEvent( QEvent* e ) | 53 | void ColorPanelButton::enterEvent( QEvent* e ) |
54 | { | 54 | { |
55 | Q_UNUSED( e ) | 55 | Q_UNUSED( e ) |
56 | 56 | ||
57 | if ( !m_active ) { | 57 | if ( !m_active ) { |
58 | setFrameStyle( Panel | Sunken ); | 58 | setFrameStyle( Panel | Sunken ); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | void ColorPanelButton::leaveEvent( QEvent* e ) | 62 | void ColorPanelButton::leaveEvent( QEvent* e ) |
63 | { | 63 | { |
64 | Q_UNUSED( e ) | 64 | Q_UNUSED( e ) |
65 | 65 | ||
66 | if ( !m_active ) { | 66 | if ( !m_active ) { |
67 | setFrameStyle( NoFrame ); | 67 | setFrameStyle( NoFrame ); |
68 | } | 68 | } |
69 | } | 69 | } |
70 | 70 | ||
71 | void ColorPanelButton::paintEvent( QPaintEvent* e ) | 71 | void ColorPanelButton::paintEvent( QPaintEvent* e ) |
72 | { | 72 | { |
73 | QFrame::paintEvent( e ); | 73 | QFrame::paintEvent( e ); |
74 | 74 | ||
75 | QPainter painter; | 75 | QPainter painter; |
76 | painter.begin( this ); | 76 | painter.begin( this ); |
77 | painter.fillRect( 2, 2, 12, 12, m_color ); | 77 | painter.fillRect( 2, 2, 12, 12, m_color ); |
78 | painter.setPen( Qt::black ); | 78 | painter.setPen( Qt::black ); |
79 | painter.drawRect( 2, 2, 12, 12 ); | 79 | painter.drawRect( 2, 2, 12, 12 ); |
80 | painter.end(); | 80 | painter.end(); |
81 | } | 81 | } |
82 | 82 | ||
83 | void ColorPanelButton::mouseReleaseEvent( QMouseEvent* e ) | 83 | void ColorPanelButton::mouseReleaseEvent( QMouseEvent* e ) |
84 | { | 84 | { |
85 | Q_UNUSED( e ) | 85 | Q_UNUSED( e ) |
86 | 86 | ||
87 | emit selected( m_color ); | 87 | emit selected( m_color ); |
88 | } | 88 | } |
89 | 89 | ||
90 | ColorPopupMenu::ColorPopupMenu( const QColor& color, QWidget* parent = 0, const char* name = 0 ) | 90 | ColorPopupMenu::ColorPopupMenu( const QColor& color, QWidget* parent, const char* name ) |
91 | : QPopupMenu( parent, name ) | 91 | : QPopupMenu( parent, name ) |
92 | { | 92 | { |
93 | m_color = color; | 93 | m_color = color; |
94 | 94 | ||
95 | colorPanel = new QWidget( this ); | 95 | colorPanel = new QWidget( this ); |
96 | 96 | ||
97 | colorLayout = new QGridLayout(colorPanel, 5, 6); | 97 | colorLayout = new QGridLayout(colorPanel, 5, 6); |
98 | 98 | ||
99 | addColor(QColor(255, 255, 255), 0, 1); | 99 | addColor(QColor(255, 255, 255), 0, 1); |
100 | addColor(QColor(192, 192, 192), 0, 2); | 100 | addColor(QColor(192, 192, 192), 0, 2); |
101 | addColor(QColor(128, 128, 128), 0, 3); | 101 | addColor(QColor(128, 128, 128), 0, 3); |
102 | addColor(QColor(64, 64, 64), 0, 4); | 102 | addColor(QColor(64, 64, 64), 0, 4); |
103 | addColor(QColor(0, 0, 0), 0, 5); | 103 | addColor(QColor(0, 0, 0), 0, 5); |
104 | 104 | ||
105 | addColor(QColor(255, 0, 0), 1, 0); | 105 | addColor(QColor(255, 0, 0), 1, 0); |
106 | addColor(QColor(255, 128, 0), 1, 1); | 106 | addColor(QColor(255, 128, 0), 1, 1); |
107 | addColor(QColor(255, 255, 0), 1, 2); | 107 | addColor(QColor(255, 255, 0), 1, 2); |
108 | addColor(QColor(128, 255, 0), 1, 3); | 108 | addColor(QColor(128, 255, 0), 1, 3); |
109 | addColor(QColor(0, 255, 0), 1, 4); | 109 | addColor(QColor(0, 255, 0), 1, 4); |
110 | addColor(QColor(0, 255, 128), 1, 5); | 110 | addColor(QColor(0, 255, 128), 1, 5); |
111 | 111 | ||
112 | addColor(QColor(128, 0, 0), 2, 0); | 112 | addColor(QColor(128, 0, 0), 2, 0); |
113 | addColor(QColor(128, 64, 0), 2, 1); | 113 | addColor(QColor(128, 64, 0), 2, 1); |
114 | addColor(QColor(128, 128, 0), 2, 2); | 114 | addColor(QColor(128, 128, 0), 2, 2); |
115 | addColor(QColor(64, 128, 0), 2, 3); | 115 | addColor(QColor(64, 128, 0), 2, 3); |
116 | addColor(QColor(0, 128, 0), 2, 4); | 116 | addColor(QColor(0, 128, 0), 2, 4); |
117 | addColor(QColor(0, 128, 64), 2, 5); | 117 | addColor(QColor(0, 128, 64), 2, 5); |
118 | 118 | ||
119 | addColor(QColor(0, 255, 255), 3, 0); | 119 | addColor(QColor(0, 255, 255), 3, 0); |
120 | addColor(QColor(0, 128, 255), 3, 1); | 120 | addColor(QColor(0, 128, 255), 3, 1); |
121 | addColor(QColor(0, 0, 255), 3, 2); | 121 | addColor(QColor(0, 0, 255), 3, 2); |
122 | addColor(QColor(128, 0, 255), 3, 3); | 122 | addColor(QColor(128, 0, 255), 3, 3); |
123 | addColor(QColor(255, 0, 255), 3, 4); | 123 | addColor(QColor(255, 0, 255), 3, 4); |
124 | addColor(QColor(255, 0, 128), 3, 5); | 124 | addColor(QColor(255, 0, 128), 3, 5); |
125 | 125 | ||
126 | addColor(QColor(0, 128, 128), 4, 0); | 126 | addColor(QColor(0, 128, 128), 4, 0); |
127 | addColor(QColor(0, 64, 128), 4, 1); | 127 | addColor(QColor(0, 64, 128), 4, 1); |
128 | addColor(QColor(0, 0, 128), 4, 2); | 128 | addColor(QColor(0, 0, 128), 4, 2); |
129 | addColor(QColor(64, 0, 128), 4, 3); | 129 | addColor(QColor(64, 0, 128), 4, 3); |
130 | addColor(QColor(128, 0, 128), 4, 4); | 130 | addColor(QColor(128, 0, 128), 4, 4); |
131 | addColor(QColor(128, 0, 64), 4, 5); | 131 | addColor(QColor(128, 0, 64), 4, 5); |
132 | 132 | ||
133 | insertItem( colorPanel ); | 133 | insertItem( colorPanel ); |
134 | insertSeparator(); | 134 | insertSeparator(); |
135 | QAction* chooseColorAction = new QAction( tr( "More" ), tr( "More..." ), 0, colorPanel, "More" ); | 135 | QAction* chooseColorAction = new QAction( tr( "More" ), tr( "More..." ), 0, colorPanel, "More" ); |
136 | connect( chooseColorAction, SIGNAL( activated() ), this, SLOT( moreColorClicked() ) ); | 136 | connect( chooseColorAction, SIGNAL( activated() ), this, SLOT( moreColorClicked() ) ); |
137 | chooseColorAction->addTo( this ); | 137 | chooseColorAction->addTo( this ); |
138 | activateItemAt( 0 ); | 138 | activateItemAt( 0 ); |