-rw-r--r-- | libopie/colordialog.cpp | 2 | ||||
-rw-r--r-- | libopie/colorpopupmenu.cpp | 1 | ||||
-rw-r--r-- | libopie/ocheckitem.cpp | 1 | ||||
-rw-r--r-- | libopie/ocolorbutton.cpp | 3 | ||||
-rw-r--r-- | libopie/odevice.cpp | 1 | ||||
-rw-r--r-- | libopie/odevicebutton.cpp | 2 | ||||
-rw-r--r-- | libopie/ofiledialog.cc | 3 | ||||
-rw-r--r-- | libopie/ofileselector.cpp | 5 | ||||
-rw-r--r-- | libopie/ofontselector.cpp | 1 | ||||
-rw-r--r-- | libopie/oprocctrl.cpp | 1 | ||||
-rw-r--r-- | libopie/oprocess.cpp | 1 | ||||
-rw-r--r-- | libopie/orecurrancewidget.cpp | 2 | ||||
-rw-r--r-- | libopie/oticker.cpp | 9 | ||||
-rw-r--r-- | libopie/otimepicker.cpp | 3 | ||||
-rw-r--r-- | libopie/owait.cpp | 2 | ||||
-rw-r--r-- | libopie/pim/ocontactaccessbackend_xml.cpp | 5 | ||||
-rw-r--r-- | libopie/pim/otodo.cpp | 3 |
17 files changed, 4 insertions, 41 deletions
diff --git a/libopie/colordialog.cpp b/libopie/colordialog.cpp index c7421ec..d46da41 100644 --- a/libopie/colordialog.cpp +++ b/libopie/colordialog.cpp | |||
@@ -1,99 +1,97 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** $Id$ | 2 | ** $Id$ |
3 | ** | 3 | ** |
4 | ** Implementation of OColorDialog class | 4 | ** Implementation of OColorDialog class |
5 | ** | 5 | ** |
6 | ** Created : 990222 | 6 | ** Created : 990222 |
7 | ** | 7 | ** |
8 | ** Copyright (C) 1999-2000 Trolltech AS. All rights reserved. | 8 | ** Copyright (C) 1999-2000 Trolltech AS. All rights reserved. |
9 | ** | 9 | ** |
10 | ** This file is part of the dialogs module of the Qt GUI Toolkit. | 10 | ** This file is part of the dialogs module of the Qt GUI Toolkit. |
11 | ** | 11 | ** |
12 | ** This file may be distributed under the terms of the Q Public License | 12 | ** This file may be distributed under the terms of the Q Public License |
13 | ** as defined by Trolltech AS of Norway and appearing in the file | 13 | ** as defined by Trolltech AS of Norway and appearing in the file |
14 | ** LICENSE.QPL included in the packaging of this file. | 14 | ** LICENSE.QPL included in the packaging of this file. |
15 | ** | 15 | ** |
16 | ** This file may be distributed and/or modified under the terms of the | 16 | ** This file may be distributed and/or modified under the terms of the |
17 | ** GNU General Public License version 2 as published by the Free Software | 17 | ** GNU General Public License version 2 as published by the Free Software |
18 | ** Foundation and appearing in the file LICENSE.GPL included in the | 18 | ** Foundation and appearing in the file LICENSE.GPL included in the |
19 | ** packaging of this file. | 19 | ** packaging of this file. |
20 | ** | 20 | ** |
21 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition | 21 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition |
22 | ** licenses may use this file in accordance with the Qt Commercial License | 22 | ** licenses may use this file in accordance with the Qt Commercial License |
23 | ** Agreement provided with the Software. | 23 | ** Agreement provided with the Software. |
24 | ** | 24 | ** |
25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 25 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 26 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
27 | ** | 27 | ** |
28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for | 28 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for |
29 | ** information about Qt Commercial License Agreements. | 29 | ** information about Qt Commercial License Agreements. |
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | 30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. |
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
32 | ** | 32 | ** |
33 | ** Contact info@trolltech.com if any conditions of this licensing are | 33 | ** Contact info@trolltech.com if any conditions of this licensing are |
34 | ** not clear to you. | 34 | ** not clear to you. |
35 | ** | 35 | ** |
36 | **********************************************************************/ | 36 | **********************************************************************/ |
37 | 37 | ||
38 | #include "colordialog.h" | 38 | #include "colordialog.h" |
39 | 39 | ||
40 | #include "qpainter.h" | 40 | #include "qpainter.h" |
41 | #include "qlayout.h" | 41 | #include "qlayout.h" |
42 | #include "qlabel.h" | 42 | #include "qlabel.h" |
43 | #include "qpushbutton.h" | 43 | #include "qpushbutton.h" |
44 | #include "qlineedit.h" | 44 | #include "qlineedit.h" |
45 | #include "qimage.h" | 45 | #include "qimage.h" |
46 | #include "qpixmap.h" | 46 | #include "qpixmap.h" |
47 | #include "qdrawutil.h" | 47 | #include "qdrawutil.h" |
48 | #include "qvalidator.h" | 48 | #include "qvalidator.h" |
49 | #include "qdragobject.h" | ||
50 | #include "qapplication.h" | 49 | #include "qapplication.h" |
51 | #include "qdragobject.h" | ||
52 | 50 | ||
53 | static inline void rgb2hsv( QRgb rgb, int&h, int&s, int&v ) | 51 | static inline void rgb2hsv( QRgb rgb, int&h, int&s, int&v ) |
54 | { | 52 | { |
55 | QColor c; | 53 | QColor c; |
56 | c.setRgb( rgb ); | 54 | c.setRgb( rgb ); |
57 | c.getHsv(h,s,v); | 55 | c.getHsv(h,s,v); |
58 | } | 56 | } |
59 | 57 | ||
60 | /* | 58 | /* |
61 | * avoid clashes with the original Qt | 59 | * avoid clashes with the original Qt |
62 | */ | 60 | */ |
63 | namespace { | 61 | namespace { |
64 | 62 | ||
65 | class QColorPicker : public QFrame | 63 | class QColorPicker : public QFrame |
66 | { | 64 | { |
67 | Q_OBJECT | 65 | Q_OBJECT |
68 | public: | 66 | public: |
69 | QColorPicker(QWidget* parent=0, const char* name=0); | 67 | QColorPicker(QWidget* parent=0, const char* name=0); |
70 | ~QColorPicker(); | 68 | ~QColorPicker(); |
71 | 69 | ||
72 | public slots: | 70 | public slots: |
73 | void setCol( int h, int s ); | 71 | void setCol( int h, int s ); |
74 | 72 | ||
75 | signals: | 73 | signals: |
76 | void newCol( int h, int s ); | 74 | void newCol( int h, int s ); |
77 | 75 | ||
78 | protected: | 76 | protected: |
79 | QSize sizeHint() const; | 77 | QSize sizeHint() const; |
80 | QSizePolicy sizePolicy() const; | 78 | QSizePolicy sizePolicy() const; |
81 | void drawContents(QPainter* p); | 79 | void drawContents(QPainter* p); |
82 | void mouseMoveEvent( QMouseEvent * ); | 80 | void mouseMoveEvent( QMouseEvent * ); |
83 | void mousePressEvent( QMouseEvent * ); | 81 | void mousePressEvent( QMouseEvent * ); |
84 | 82 | ||
85 | private: | 83 | private: |
86 | int hue; | 84 | int hue; |
87 | int sat; | 85 | int sat; |
88 | 86 | ||
89 | QPoint colPt(); | 87 | QPoint colPt(); |
90 | int huePt( const QPoint &pt ); | 88 | int huePt( const QPoint &pt ); |
91 | int satPt( const QPoint &pt ); | 89 | int satPt( const QPoint &pt ); |
92 | void setCol( const QPoint &pt ); | 90 | void setCol( const QPoint &pt ); |
93 | 91 | ||
94 | QPixmap *pix; | 92 | QPixmap *pix; |
95 | }; | 93 | }; |
96 | 94 | ||
97 | static int pWidth = 200; | 95 | static int pWidth = 200; |
98 | static int pHeight = 200; | 96 | static int pHeight = 200; |
99 | 97 | ||
diff --git a/libopie/colorpopupmenu.cpp b/libopie/colorpopupmenu.cpp index 5a8d77e..0d66fba 100644 --- a/libopie/colorpopupmenu.cpp +++ b/libopie/colorpopupmenu.cpp | |||
@@ -1,84 +1,83 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 S. Prud'homme <prudhomme@laposte.net> | 4 | Copyright (c) 2002 S. Prud'homme <prudhomme@laposte.net> |
5 | Dan Williams <williamsdr@acm.org> | 5 | Dan Williams <williamsdr@acm.org> |
6 | =. | 6 | =. |
7 | .=l. | 7 | .=l. |
8 | .>+-= | 8 | .>+-= |
9 | _;:, .> :=|. This program is free software; you can | 9 | _;:, .> :=|. This program is free software; you can |
10 | .> <`_, > . <= redistribute it and/or modify it under | 10 | .> <`_, > . <= redistribute it and/or modify it under |
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
12 | .="- .-=="i, .._ License as published by the Free Software | 12 | .="- .-=="i, .._ License as published by the Free Software |
13 | - . .-<_> .<> Foundation; either version 2 of the License, | 13 | - . .-<_> .<> Foundation; either version 2 of the License, |
14 | ._= =} : or (at your option) any later version. | 14 | ._= =} : or (at your option) any later version. |
15 | .%`+i> _;_. | 15 | .%`+i> _;_. |
16 | .i_,=:_. -<s. This program is distributed in the hope that | 16 | .i_,=:_. -<s. This program is distributed in the hope that |
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
18 | : .. .:, . . . without even the implied warranty of | 18 | : .. .:, . . . without even the implied warranty of |
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
21 | ..}^=.= = ; Library General Public License for more | 21 | ..}^=.= = ; Library General Public License for more |
22 | ++= -. .` .: details. | 22 | ++= -. .` .: details. |
23 | : = ...= . :.=- | 23 | : = ...= . :.=- |
24 | -. .:....=;==+<; You should have received a copy of the GNU | 24 | -. .:....=;==+<; You should have received a copy of the GNU |
25 | -_. . . )=. = Library General Public License along with | 25 | -_. . . )=. = Library General Public License along with |
26 | -- :-=` this library; see the file COPYING.LIB. | 26 | -- :-=` this library; see the file COPYING.LIB. |
27 | If not, write to the Free Software Foundation, | 27 | If not, write to the Free Software Foundation, |
28 | Inc., 59 Temple Place - Suite 330, | 28 | Inc., 59 Temple Place - Suite 330, |
29 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
30 | 30 | ||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #include "colorpopupmenu.h" | 33 | #include "colorpopupmenu.h" |
34 | #include "colordialog.h" | 34 | #include "colordialog.h" |
35 | 35 | ||
36 | #include <qaction.h> | ||
37 | #include <qlayout.h> | 36 | #include <qlayout.h> |
38 | #include <qpainter.h> | 37 | #include <qpainter.h> |
39 | 38 | ||
40 | OColorPanelButton::OColorPanelButton( const QColor& color, QWidget* parent, const char* name ) | 39 | OColorPanelButton::OColorPanelButton( const QColor& color, QWidget* parent, const char* name ) |
41 | : QFrame( parent, name ) | 40 | : QFrame( parent, name ) |
42 | { | 41 | { |
43 | m_color = color; | 42 | m_color = color; |
44 | 43 | ||
45 | setFixedSize( 16, 16 ); | 44 | setFixedSize( 16, 16 ); |
46 | setActive( FALSE ); | 45 | setActive( FALSE ); |
47 | } | 46 | } |
48 | 47 | ||
49 | OColorPanelButton::~OColorPanelButton() | 48 | OColorPanelButton::~OColorPanelButton() |
50 | { | 49 | { |
51 | } | 50 | } |
52 | 51 | ||
53 | void OColorPanelButton::setActive( bool active ) | 52 | void OColorPanelButton::setActive( bool active ) |
54 | { | 53 | { |
55 | m_active = active; | 54 | m_active = active; |
56 | 55 | ||
57 | if ( m_active ) { | 56 | if ( m_active ) { |
58 | setFrameStyle( Panel | Sunken ); | 57 | setFrameStyle( Panel | Sunken ); |
59 | } else { | 58 | } else { |
60 | setFrameStyle( NoFrame ); | 59 | setFrameStyle( NoFrame ); |
61 | } | 60 | } |
62 | } | 61 | } |
63 | 62 | ||
64 | void OColorPanelButton::enterEvent( QEvent* ) | 63 | void OColorPanelButton::enterEvent( QEvent* ) |
65 | { | 64 | { |
66 | if ( !m_active ) { | 65 | if ( !m_active ) { |
67 | setFrameStyle( Panel | Sunken ); | 66 | setFrameStyle( Panel | Sunken ); |
68 | } | 67 | } |
69 | } | 68 | } |
70 | 69 | ||
71 | void OColorPanelButton::leaveEvent( QEvent* ) | 70 | void OColorPanelButton::leaveEvent( QEvent* ) |
72 | { | 71 | { |
73 | if ( !m_active ) { | 72 | if ( !m_active ) { |
74 | setFrameStyle( NoFrame ); | 73 | setFrameStyle( NoFrame ); |
75 | } | 74 | } |
76 | } | 75 | } |
77 | 76 | ||
78 | void OColorPanelButton::paintEvent( QPaintEvent* e ) | 77 | void OColorPanelButton::paintEvent( QPaintEvent* e ) |
79 | { | 78 | { |
80 | QFrame::paintEvent( e ); | 79 | QFrame::paintEvent( e ); |
81 | 80 | ||
82 | QPainter painter; | 81 | QPainter painter; |
83 | painter.begin( this ); | 82 | painter.begin( this ); |
84 | painter.fillRect( 2, 2, 12, 12, m_color ); | 83 | painter.fillRect( 2, 2, 12, 12, m_color ); |
diff --git a/libopie/ocheckitem.cpp b/libopie/ocheckitem.cpp index 082d7a2..cd763c1 100644 --- a/libopie/ocheckitem.cpp +++ b/libopie/ocheckitem.cpp | |||
@@ -1,61 +1,60 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Stefan Eilers (se, eilers.stefan@epost.de | 2 | ** Copyright (C) 2002 Stefan Eilers (se, eilers.stefan@epost.de |
3 | ** | 3 | ** |
4 | ** This file may be distributed and/or modified under the terms of the | 4 | ** This file may be distributed and/or modified under the terms of the |
5 | ** GNU Library General Public License version 2 as published by the | 5 | ** GNU Library General Public License version 2 as published by the |
6 | ** Free Software Foundation and appearing in the file LICENSE.GPL | 6 | ** Free Software Foundation and appearing in the file LICENSE.GPL |
7 | ** included in the packaging of this file. | 7 | ** included in the packaging of this file. |
8 | ** | 8 | ** |
9 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 9 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
10 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 10 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
11 | **********************************************************************/ | 11 | **********************************************************************/ |
12 | 12 | ||
13 | #include <qpainter.h> | ||
14 | 13 | ||
15 | #include "ocheckitem.h" | 14 | #include "ocheckitem.h" |
16 | 15 | ||
17 | /** | 16 | /** |
18 | * Constructs an CheckItem with a QTable as parent | 17 | * Constructs an CheckItem with a QTable as parent |
19 | * and a sort key for. | 18 | * and a sort key for. |
20 | * The sort key will be used by QTable to sort the table later | 19 | * The sort key will be used by QTable to sort the table later |
21 | * @param t The parent QTable where the check item belongs | 20 | * @param t The parent QTable where the check item belongs |
22 | * @param key A sort key | 21 | * @param key A sort key |
23 | */ | 22 | */ |
24 | OCheckItem::OCheckItem( QTable *t, const QString &key ) | 23 | OCheckItem::OCheckItem( QTable *t, const QString &key ) |
25 | : QTableItem( t, Never, "" ), m_checked( FALSE ), m_sortKey( key ) | 24 | : QTableItem( t, Never, "" ), m_checked( FALSE ), m_sortKey( key ) |
26 | { | 25 | { |
27 | } | 26 | } |
28 | 27 | ||
29 | /** | 28 | /** |
30 | * reimplemted for internal reasons | 29 | * reimplemted for internal reasons |
31 | * @return Returns the sort key of the Item | 30 | * @return Returns the sort key of the Item |
32 | * @see QTableItem | 31 | * @see QTableItem |
33 | */ | 32 | */ |
34 | QString OCheckItem::key() const | 33 | QString OCheckItem::key() const |
35 | { | 34 | { |
36 | return m_sortKey; | 35 | return m_sortKey; |
37 | } | 36 | } |
38 | 37 | ||
39 | /** | 38 | /** |
40 | * This method can check or uncheck the item. It will | 39 | * This method can check or uncheck the item. It will |
41 | * call QTable to update the cell. | 40 | * call QTable to update the cell. |
42 | * | 41 | * |
43 | * @param b Whether to check or uncheck the item | 42 | * @param b Whether to check or uncheck the item |
44 | */ | 43 | */ |
45 | void OCheckItem::setChecked( bool b ) | 44 | void OCheckItem::setChecked( bool b ) |
46 | { | 45 | { |
47 | m_checked = b; | 46 | m_checked = b; |
48 | table()->updateCell( row(), col() ); | 47 | table()->updateCell( row(), col() ); |
49 | } | 48 | } |
50 | 49 | ||
51 | /** | 50 | /** |
52 | * This will toggle the item. If it is checked it'll get | 51 | * This will toggle the item. If it is checked it'll get |
53 | * unchecked by this method or vice versa. | 52 | * unchecked by this method or vice versa. |
54 | */ | 53 | */ |
55 | void OCheckItem::toggle() | 54 | void OCheckItem::toggle() |
56 | { | 55 | { |
57 | m_checked = !m_checked; | 56 | m_checked = !m_checked; |
58 | } | 57 | } |
59 | 58 | ||
60 | /** | 59 | /** |
61 | * This will return the state of the item. | 60 | * This will return the state of the item. |
diff --git a/libopie/ocolorbutton.cpp b/libopie/ocolorbutton.cpp index 113a77a..93fe5d0 100644 --- a/libopie/ocolorbutton.cpp +++ b/libopie/ocolorbutton.cpp | |||
@@ -1,81 +1,78 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
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 | 28 | ||
29 | #include <opie/colorpopupmenu.h> | 29 | #include <opie/colorpopupmenu.h> |
30 | #include <opie/ocolorbutton.h> | 30 | #include <opie/ocolorbutton.h> |
31 | #include <qcolor.h> | ||
32 | #include <qpixmap.h> | ||
33 | #include <qimage.h> | ||
34 | 31 | ||
35 | #include <qpe/resource.h> | 32 | #include <qpe/resource.h> |
36 | 33 | ||
37 | struct OColorButtonPrivate { | 34 | struct OColorButtonPrivate { |
38 | QPopupMenu *m_menu; | 35 | QPopupMenu *m_menu; |
39 | QColor m_color; | 36 | QColor m_color; |
40 | }; | 37 | }; |
41 | 38 | ||
42 | 39 | ||
43 | /** | 40 | /** |
44 | * This concstructs a Color Button with @param color as the start color | 41 | * This concstructs a Color Button with @param color as the start color |
45 | * It'll use a OColorPopupMenu internally | 42 | * It'll use a OColorPopupMenu internally |
46 | * | 43 | * |
47 | * @param parent The parent of the Color Button | 44 | * @param parent The parent of the Color Button |
48 | * @param color The color from where to start on | 45 | * @param color The color from where to start on |
49 | * @param name @see QObject | 46 | * @param name @see QObject |
50 | */ | 47 | */ |
51 | OColorButton::OColorButton ( QWidget *parent, const QColor &color, const char *name ) | 48 | OColorButton::OColorButton ( QWidget *parent, const QColor &color, const char *name ) |
52 | : QPushButton ( parent, name ) | 49 | : QPushButton ( parent, name ) |
53 | { | 50 | { |
54 | d = new OColorButtonPrivate; | 51 | d = new OColorButtonPrivate; |
55 | 52 | ||
56 | d-> m_menu = new OColorPopupMenu ( color, 0, 0 ); | 53 | d-> m_menu = new OColorPopupMenu ( color, 0, 0 ); |
57 | setPopup ( d-> m_menu ); | 54 | setPopup ( d-> m_menu ); |
58 | //setPopupDelay ( 0 ); | 55 | //setPopupDelay ( 0 ); |
59 | connect ( d-> m_menu, SIGNAL( colorSelected ( const QColor & )), this, SLOT( updateColor ( const QColor & ))); | 56 | connect ( d-> m_menu, SIGNAL( colorSelected ( const QColor & )), this, SLOT( updateColor ( const QColor & ))); |
60 | 57 | ||
61 | updateColor ( color ); | 58 | updateColor ( color ); |
62 | 59 | ||
63 | QSize s = sizeHint ( ) + QSize ( 12, 0 ); | 60 | QSize s = sizeHint ( ) + QSize ( 12, 0 ); |
64 | setMinimumSize ( s ); | 61 | setMinimumSize ( s ); |
65 | setMaximumSize ( s. width ( ) * 2, s. height ( )); | 62 | setMaximumSize ( s. width ( ) * 2, s. height ( )); |
66 | } | 63 | } |
67 | 64 | ||
68 | /** | 65 | /** |
69 | * This destructs the object | 66 | * This destructs the object |
70 | */ | 67 | */ |
71 | OColorButton::~OColorButton ( ) | 68 | OColorButton::~OColorButton ( ) |
72 | { | 69 | { |
73 | delete d; | 70 | delete d; |
74 | } | 71 | } |
75 | 72 | ||
76 | /** | 73 | /** |
77 | * @return Returns the current color of the button | 74 | * @return Returns the current color of the button |
78 | */ | 75 | */ |
79 | QColor OColorButton::color ( ) const | 76 | QColor OColorButton::color ( ) const |
80 | { | 77 | { |
81 | return d-> m_color; | 78 | return d-> m_color; |
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index c5342e1..c0b6efa 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -1,79 +1,78 @@ | |||
1 | /* This file is part of the OPIE libraries | 1 | /* This file is part of the OPIE libraries |
2 | Copyright (C) 2002 Robert Griebl (sandman@handhelds.org) | 2 | Copyright (C) 2002 Robert Griebl (sandman@handhelds.org) |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
21 | #include <unistd.h> | 21 | #include <unistd.h> |
22 | #include <fcntl.h> | 22 | #include <fcntl.h> |
23 | #include <sys/ioctl.h> | 23 | #include <sys/ioctl.h> |
24 | #include <signal.h> | 24 | #include <signal.h> |
25 | #include <sys/time.h> | 25 | #include <sys/time.h> |
26 | #ifndef QT_NO_SOUND | 26 | #ifndef QT_NO_SOUND |
27 | #include <linux/soundcard.h> | 27 | #include <linux/soundcard.h> |
28 | #endif | 28 | #endif |
29 | #include <math.h> | 29 | #include <math.h> |
30 | 30 | ||
31 | #include <qapplication.h> | ||
32 | 31 | ||
33 | #include <qfile.h> | 32 | #include <qfile.h> |
34 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
35 | #include <qpe/sound.h> | 34 | #include <qpe/sound.h> |
36 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
37 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
38 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
39 | 38 | ||
40 | #include "odevice.h" | 39 | #include "odevice.h" |
41 | 40 | ||
42 | #include <qwindowsystem_qws.h> | 41 | #include <qwindowsystem_qws.h> |
43 | 42 | ||
44 | #ifndef ARRAY_SIZE | 43 | #ifndef ARRAY_SIZE |
45 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 44 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
46 | #endif | 45 | #endif |
47 | 46 | ||
48 | // _IO and friends are only defined in kernel headers ... | 47 | // _IO and friends are only defined in kernel headers ... |
49 | 48 | ||
50 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) | 49 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) |
51 | 50 | ||
52 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | 51 | #define OD_IO(type,number) OD_IOC(0,type,number,0) |
53 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) | 52 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) |
54 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) | 53 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) |
55 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) | 54 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) |
56 | 55 | ||
57 | using namespace Opie; | 56 | using namespace Opie; |
58 | 57 | ||
59 | class ODeviceData { | 58 | class ODeviceData { |
60 | public: | 59 | public: |
61 | QString m_vendorstr; | 60 | QString m_vendorstr; |
62 | OVendor m_vendor; | 61 | OVendor m_vendor; |
63 | 62 | ||
64 | QString m_modelstr; | 63 | QString m_modelstr; |
65 | OModel m_model; | 64 | OModel m_model; |
66 | 65 | ||
67 | QString m_systemstr; | 66 | QString m_systemstr; |
68 | OSystem m_system; | 67 | OSystem m_system; |
69 | 68 | ||
70 | QString m_sysverstr; | 69 | QString m_sysverstr; |
71 | 70 | ||
72 | Transformation m_rotation; | 71 | Transformation m_rotation; |
73 | ODirection m_direction; | 72 | ODirection m_direction; |
74 | 73 | ||
75 | QValueList <ODeviceButton> *m_buttons; | 74 | QValueList <ODeviceButton> *m_buttons; |
76 | uint m_holdtime; | 75 | uint m_holdtime; |
77 | QStrList *m_cpu_frequencies; | 76 | QStrList *m_cpu_frequencies; |
78 | 77 | ||
79 | }; | 78 | }; |
diff --git a/libopie/odevicebutton.cpp b/libopie/odevicebutton.cpp index 314eb51..647ac4b 100644 --- a/libopie/odevicebutton.cpp +++ b/libopie/odevicebutton.cpp | |||
@@ -1,70 +1,68 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qpixmap.h> | ||
22 | #include <qstring.h> | ||
23 | 21 | ||
24 | #include <qpe/qcopenvelope_qws.h> | 22 | #include <qpe/qcopenvelope_qws.h> |
25 | #include <opie/odevicebutton.h> | 23 | #include <opie/odevicebutton.h> |
26 | 24 | ||
27 | using namespace Opie; | 25 | using namespace Opie; |
28 | 26 | ||
29 | 27 | ||
30 | class OQCopMessageData { | 28 | class OQCopMessageData { |
31 | public: | 29 | public: |
32 | QCString m_channel; | 30 | QCString m_channel; |
33 | QCString m_message; | 31 | QCString m_message; |
34 | QByteArray m_data; | 32 | QByteArray m_data; |
35 | }; | 33 | }; |
36 | 34 | ||
37 | 35 | ||
38 | OQCopMessage::OQCopMessage ( ) | 36 | OQCopMessage::OQCopMessage ( ) |
39 | : d ( 0 ) | 37 | : d ( 0 ) |
40 | { | 38 | { |
41 | init ( QCString ( ), QCString ( ), QByteArray ( )); | 39 | init ( QCString ( ), QCString ( ), QByteArray ( )); |
42 | } | 40 | } |
43 | 41 | ||
44 | OQCopMessage::OQCopMessage ( const OQCopMessage © ) | 42 | OQCopMessage::OQCopMessage ( const OQCopMessage © ) |
45 | : d ( 0 ) | 43 | : d ( 0 ) |
46 | { | 44 | { |
47 | init ( copy. channel ( ), copy. message ( ), copy. data ( )); | 45 | init ( copy. channel ( ), copy. message ( ), copy. data ( )); |
48 | } | 46 | } |
49 | 47 | ||
50 | OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign ) | 48 | OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign ) |
51 | { | 49 | { |
52 | init ( assign. channel ( ), assign. message ( ), assign. data ( )); | 50 | init ( assign. channel ( ), assign. message ( ), assign. data ( )); |
53 | return *this; | 51 | return *this; |
54 | } | 52 | } |
55 | 53 | ||
56 | OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg ) | 54 | OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg ) |
57 | : d ( 0 ) | 55 | : d ( 0 ) |
58 | { | 56 | { |
59 | init ( ch, m, arg ); | 57 | init ( ch, m, arg ); |
60 | } | 58 | } |
61 | 59 | ||
62 | void OQCopMessage::init ( const QCString &ch, const QCString &m, const QByteArray &arg ) | 60 | void OQCopMessage::init ( const QCString &ch, const QCString &m, const QByteArray &arg ) |
63 | { | 61 | { |
64 | if ( !d ) | 62 | if ( !d ) |
65 | d = new OQCopMessageData ( ); | 63 | d = new OQCopMessageData ( ); |
66 | d-> m_channel = ch; | 64 | d-> m_channel = ch; |
67 | d-> m_message = m; | 65 | d-> m_message = m; |
68 | d-> m_data = arg; | 66 | d-> m_data = arg; |
69 | } | 67 | } |
70 | 68 | ||
diff --git a/libopie/ofiledialog.cc b/libopie/ofiledialog.cc index 5511b24..47306b6 100644 --- a/libopie/ofiledialog.cc +++ b/libopie/ofiledialog.cc | |||
@@ -1,83 +1,80 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002,2003 <zecke@handhelds.org> | 3 | .=l. Copyright (c) 2002,2003 <zecke@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
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 | 28 | ||
29 | #include <qpe/applnk.h> | ||
30 | #include <qpe/config.h> | 29 | #include <qpe/config.h> |
31 | #include <qpe/qpeapplication.h> | 30 | #include <qpe/qpeapplication.h> |
32 | 31 | ||
33 | #include <qfileinfo.h> | 32 | #include <qfileinfo.h> |
34 | #include <qstring.h> | ||
35 | #include <qapplication.h> | ||
36 | #include <qlayout.h> | 33 | #include <qlayout.h> |
37 | 34 | ||
38 | 35 | ||
39 | #include "ofiledialog.h" | 36 | #include "ofiledialog.h" |
40 | 37 | ||
41 | 38 | ||
42 | namespace { | 39 | namespace { |
43 | /* | 40 | /* |
44 | * helper functions to load the start dir | 41 | * helper functions to load the start dir |
45 | * and to save it | 42 | * and to save it |
46 | * helper to extract the dir out of a file name | 43 | * helper to extract the dir out of a file name |
47 | */ | 44 | */ |
48 | /** | 45 | /** |
49 | * This method will use Config( argv[0] ); | 46 | * This method will use Config( argv[0] ); |
50 | * @param key The group key used | 47 | * @param key The group key used |
51 | */ | 48 | */ |
52 | QString lastUsedDir( const QString& key ) { | 49 | QString lastUsedDir( const QString& key ) { |
53 | if ( qApp->argc() < 1 ) | 50 | if ( qApp->argc() < 1 ) |
54 | return QString::null; | 51 | return QString::null; |
55 | 52 | ||
56 | Config cfg( QFileInfo(qApp->argv()[0]).fileName() ); // appname | 53 | Config cfg( QFileInfo(qApp->argv()[0]).fileName() ); // appname |
57 | cfg.setGroup( key ); | 54 | cfg.setGroup( key ); |
58 | return cfg.readEntry("LastDir", QPEApplication::documentDir() ); | 55 | return cfg.readEntry("LastDir", QPEApplication::documentDir() ); |
59 | } | 56 | } |
60 | 57 | ||
61 | void saveLastDir( const QString& key, const QString& file ) { | 58 | void saveLastDir( const QString& key, const QString& file ) { |
62 | if ( qApp->argc() < 1 ) | 59 | if ( qApp->argc() < 1 ) |
63 | return; | 60 | return; |
64 | 61 | ||
65 | Config cfg( QFileInfo(qApp->argv()[0]).fileName() ); | 62 | Config cfg( QFileInfo(qApp->argv()[0]).fileName() ); |
66 | cfg.setGroup( key ); | 63 | cfg.setGroup( key ); |
67 | QFileInfo inf( file ); | 64 | QFileInfo inf( file ); |
68 | cfg.writeEntry("LastDir", inf.dirPath( true ) ); | 65 | cfg.writeEntry("LastDir", inf.dirPath( true ) ); |
69 | } | 66 | } |
70 | }; | 67 | }; |
71 | 68 | ||
72 | /** | 69 | /** |
73 | * This constructs a modal dialog | 70 | * This constructs a modal dialog |
74 | * | 71 | * |
75 | * @param caption The caption of the dialog | 72 | * @param caption The caption of the dialog |
76 | * @param wid The parent widget | 73 | * @param wid The parent widget |
77 | * @param mode The mode of the OFileSelector @see OFileSelector | 74 | * @param mode The mode of the OFileSelector @see OFileSelector |
78 | * @param selector The selector of the OFileSelector | 75 | * @param selector The selector of the OFileSelector |
79 | * @param dirName the dir or resource to start from | 76 | * @param dirName the dir or resource to start from |
80 | * @param fileName a proposed or existing filename | 77 | * @param fileName a proposed or existing filename |
81 | * @param mimetypes The mimeTypes | 78 | * @param mimetypes The mimeTypes |
82 | */ | 79 | */ |
83 | OFileDialog::OFileDialog(const QString &caption, | 80 | OFileDialog::OFileDialog(const QString &caption, |
diff --git a/libopie/ofileselector.cpp b/libopie/ofileselector.cpp index 9ac2981..1ba94ae 100644 --- a/libopie/ofileselector.cpp +++ b/libopie/ofileselector.cpp | |||
@@ -1,60 +1,55 @@ | |||
1 | #include <qcombobox.h> | 1 | #include <qcombobox.h> |
2 | #include <qdir.h> | 2 | #include <qdir.h> |
3 | #include <qhbox.h> | ||
4 | #include <qheader.h> | ||
5 | #include <qlabel.h> | 3 | #include <qlabel.h> |
6 | #include <qlayout.h> | 4 | #include <qlayout.h> |
7 | #include <qlineedit.h> | 5 | #include <qlineedit.h> |
8 | #include <qlistview.h> | ||
9 | #include <qpopupmenu.h> | 6 | #include <qpopupmenu.h> |
10 | #include <qwidgetstack.h> | 7 | #include <qwidgetstack.h> |
11 | #include <qregexp.h> | ||
12 | #include <qobjectlist.h> | ||
13 | 8 | ||
14 | /* hacky but we need to get FileSelector::filter */ | 9 | /* hacky but we need to get FileSelector::filter */ |
15 | #define private public | 10 | #define private public |
16 | #include <qpe/fileselector.h> | 11 | #include <qpe/fileselector.h> |
17 | #undef private | 12 | #undef private |
18 | 13 | ||
19 | #include <qpe/qpeapplication.h> | 14 | #include <qpe/qpeapplication.h> |
20 | #include <qpe/mimetype.h> | 15 | #include <qpe/mimetype.h> |
21 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
22 | #include <qpe/storage.h> | 17 | #include <qpe/storage.h> |
23 | 18 | ||
24 | #include "ofileselector_p.h" | 19 | #include "ofileselector_p.h" |
25 | #include "ofileselector.h" | 20 | #include "ofileselector.h" |
26 | 21 | ||
27 | 22 | ||
28 | 23 | ||
29 | OFileViewInterface::OFileViewInterface( OFileSelector* selector ) | 24 | OFileViewInterface::OFileViewInterface( OFileSelector* selector ) |
30 | : m_selector( selector ) { | 25 | : m_selector( selector ) { |
31 | } | 26 | } |
32 | OFileViewInterface::~OFileViewInterface() { | 27 | OFileViewInterface::~OFileViewInterface() { |
33 | } | 28 | } |
34 | QString OFileViewInterface::name()const{ | 29 | QString OFileViewInterface::name()const{ |
35 | return m_name; | 30 | return m_name; |
36 | } | 31 | } |
37 | void OFileViewInterface::setName( const QString& name ) { | 32 | void OFileViewInterface::setName( const QString& name ) { |
38 | m_name = name; | 33 | m_name = name; |
39 | } | 34 | } |
40 | OFileSelector* OFileViewInterface::selector()const { | 35 | OFileSelector* OFileViewInterface::selector()const { |
41 | return m_selector; | 36 | return m_selector; |
42 | } | 37 | } |
43 | DocLnk OFileViewInterface::selectedDocument()const { | 38 | DocLnk OFileViewInterface::selectedDocument()const { |
44 | return DocLnk( selectedName() ); | 39 | return DocLnk( selectedName() ); |
45 | } | 40 | } |
46 | bool OFileViewInterface::showNew()const { | 41 | bool OFileViewInterface::showNew()const { |
47 | return selector()->showNew(); | 42 | return selector()->showNew(); |
48 | } | 43 | } |
49 | bool OFileViewInterface::showClose()const { | 44 | bool OFileViewInterface::showClose()const { |
50 | return selector()->showClose(); | 45 | return selector()->showClose(); |
51 | } | 46 | } |
52 | MimeTypes OFileViewInterface::mimeTypes()const { | 47 | MimeTypes OFileViewInterface::mimeTypes()const { |
53 | return selector()->mimeTypes(); | 48 | return selector()->mimeTypes(); |
54 | } | 49 | } |
55 | QStringList OFileViewInterface::currentMimeType()const { | 50 | QStringList OFileViewInterface::currentMimeType()const { |
56 | return selector()->currentMimeType(); | 51 | return selector()->currentMimeType(); |
57 | } | 52 | } |
58 | void OFileViewInterface::activate( const QString& ) { | 53 | void OFileViewInterface::activate( const QString& ) { |
59 | // not implemented here | 54 | // not implemented here |
60 | } | 55 | } |
diff --git a/libopie/ofontselector.cpp b/libopie/ofontselector.cpp index c8471cc..7e07008 100644 --- a/libopie/ofontselector.cpp +++ b/libopie/ofontselector.cpp | |||
@@ -1,81 +1,80 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
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 | 28 | ||
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qlistbox.h> | 30 | #include <qlistbox.h> |
31 | #include <qcombobox.h> | 31 | #include <qcombobox.h> |
32 | #include <qlabel.h> | 32 | #include <qlabel.h> |
33 | #include <qfont.h> | ||
34 | #include <qmultilineedit.h> | 33 | #include <qmultilineedit.h> |
35 | 34 | ||
36 | #include <qpe/fontdatabase.h> | 35 | #include <qpe/fontdatabase.h> |
37 | 36 | ||
38 | #include "ofontselector.h" | 37 | #include "ofontselector.h" |
39 | 38 | ||
40 | class OFontSelectorPrivate { | 39 | class OFontSelectorPrivate { |
41 | public: | 40 | public: |
42 | QListBox * m_font_family_list; | 41 | QListBox * m_font_family_list; |
43 | QComboBox * m_font_style_list; | 42 | QComboBox * m_font_style_list; |
44 | QComboBox * m_font_size_list; | 43 | QComboBox * m_font_size_list; |
45 | QMultiLineEdit *m_preview; | 44 | QMultiLineEdit *m_preview; |
46 | 45 | ||
47 | bool m_pointbug : 1; | 46 | bool m_pointbug : 1; |
48 | 47 | ||
49 | FontDatabase m_fdb; | 48 | FontDatabase m_fdb; |
50 | }; | 49 | }; |
51 | 50 | ||
52 | namespace { | 51 | namespace { |
53 | 52 | ||
54 | class FontListItem : public QListBoxText { | 53 | class FontListItem : public QListBoxText { |
55 | public: | 54 | public: |
56 | FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText ( ) | 55 | FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText ( ) |
57 | { | 56 | { |
58 | m_name = t; | 57 | m_name = t; |
59 | m_styles = styles; | 58 | m_styles = styles; |
60 | m_sizes = sizes; | 59 | m_sizes = sizes; |
61 | 60 | ||
62 | QString str = t; | 61 | QString str = t; |
63 | str [0] = str [0]. upper ( ); | 62 | str [0] = str [0]. upper ( ); |
64 | setText ( str ); | 63 | setText ( str ); |
65 | } | 64 | } |
66 | 65 | ||
67 | QString family ( ) const | 66 | QString family ( ) const |
68 | { | 67 | { |
69 | return m_name; | 68 | return m_name; |
70 | } | 69 | } |
71 | 70 | ||
72 | const QStringList &styles ( ) const | 71 | const QStringList &styles ( ) const |
73 | { | 72 | { |
74 | return m_styles; | 73 | return m_styles; |
75 | } | 74 | } |
76 | 75 | ||
77 | const QValueList<int> &sizes ( ) const | 76 | const QValueList<int> &sizes ( ) const |
78 | { | 77 | { |
79 | return m_sizes; | 78 | return m_sizes; |
80 | } | 79 | } |
81 | 80 | ||
diff --git a/libopie/oprocctrl.cpp b/libopie/oprocctrl.cpp index e7db622..df8da1e 100644 --- a/libopie/oprocctrl.cpp +++ b/libopie/oprocctrl.cpp | |||
@@ -1,90 +1,89 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at) | 2 | Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at) |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | // | 19 | // |
20 | // KPROCESSCONTROLLER -- A helper class for KProcess | 20 | // KPROCESSCONTROLLER -- A helper class for KProcess |
21 | // | 21 | // |
22 | // version 0.3.1, Jan, 8th 1997 | 22 | // version 0.3.1, Jan, 8th 1997 |
23 | // | 23 | // |
24 | // (C) Christian Czezatke | 24 | // (C) Christian Czezatke |
25 | // e9025461@student.tuwien.ac.at | 25 | // e9025461@student.tuwien.ac.at |
26 | // Ported by Holger Freyther | 26 | // Ported by Holger Freyther |
27 | // | 27 | // |
28 | 28 | ||
29 | //#include <config.h> | 29 | //#include <config.h> |
30 | 30 | ||
31 | #include <sys/types.h> | 31 | #include <sys/types.h> |
32 | #include <sys/socket.h> | 32 | #include <sys/socket.h> |
33 | 33 | ||
34 | #include <errno.h> | 34 | #include <errno.h> |
35 | #include <fcntl.h> | 35 | #include <fcntl.h> |
36 | #include <stdio.h> | 36 | #include <stdio.h> |
37 | #include <string.h> | 37 | #include <string.h> |
38 | #include <unistd.h> | 38 | #include <unistd.h> |
39 | #include <assert.h> | 39 | #include <assert.h> |
40 | 40 | ||
41 | #include <qsocketnotifier.h> | 41 | #include <qsocketnotifier.h> |
42 | #include "oprocess.h" | ||
43 | #include "oprocctrl.h" | 42 | #include "oprocctrl.h" |
44 | 43 | ||
45 | OProcessController *OProcessController::theOProcessController = 0; | 44 | OProcessController *OProcessController::theOProcessController = 0; |
46 | 45 | ||
47 | struct sigaction OProcessController::oldChildHandlerData; | 46 | struct sigaction OProcessController::oldChildHandlerData; |
48 | bool OProcessController::handlerSet = false; | 47 | bool OProcessController::handlerSet = false; |
49 | 48 | ||
50 | OProcessController::OProcessController() | 49 | OProcessController::OProcessController() |
51 | { | 50 | { |
52 | assert( theOProcessController == 0 ); | 51 | assert( theOProcessController == 0 ); |
53 | 52 | ||
54 | if (0 > pipe(fd)) | 53 | if (0 > pipe(fd)) |
55 | printf(strerror(errno)); | 54 | printf(strerror(errno)); |
56 | 55 | ||
57 | notifier = new QSocketNotifier(fd[0], QSocketNotifier::Read); | 56 | notifier = new QSocketNotifier(fd[0], QSocketNotifier::Read); |
58 | notifier->setEnabled(true); | 57 | notifier->setEnabled(true); |
59 | QObject::connect(notifier, SIGNAL(activated(int)), | 58 | QObject::connect(notifier, SIGNAL(activated(int)), |
60 | this, SLOT(slotDoHousekeeping(int))); | 59 | this, SLOT(slotDoHousekeeping(int))); |
61 | connect( &delayedChildrenCleanupTimer, SIGNAL( timeout()), | 60 | connect( &delayedChildrenCleanupTimer, SIGNAL( timeout()), |
62 | SLOT( delayedChildrenCleanup())); | 61 | SLOT( delayedChildrenCleanup())); |
63 | 62 | ||
64 | theOProcessController = this; | 63 | theOProcessController = this; |
65 | 64 | ||
66 | setupHandlers(); | 65 | setupHandlers(); |
67 | } | 66 | } |
68 | 67 | ||
69 | 68 | ||
70 | void OProcessController::setupHandlers() | 69 | void OProcessController::setupHandlers() |
71 | { | 70 | { |
72 | if( handlerSet ) | 71 | if( handlerSet ) |
73 | return; | 72 | return; |
74 | struct sigaction act; | 73 | struct sigaction act; |
75 | act.sa_handler=theSigCHLDHandler; | 74 | act.sa_handler=theSigCHLDHandler; |
76 | sigemptyset(&(act.sa_mask)); | 75 | sigemptyset(&(act.sa_mask)); |
77 | sigaddset(&(act.sa_mask), SIGCHLD); | 76 | sigaddset(&(act.sa_mask), SIGCHLD); |
78 | // Make sure we don't block this signal. gdb tends to do that :-( | 77 | // Make sure we don't block this signal. gdb tends to do that :-( |
79 | sigprocmask(SIG_UNBLOCK, &(act.sa_mask), 0); | 78 | sigprocmask(SIG_UNBLOCK, &(act.sa_mask), 0); |
80 | 79 | ||
81 | act.sa_flags = SA_NOCLDSTOP; | 80 | act.sa_flags = SA_NOCLDSTOP; |
82 | 81 | ||
83 | // CC: take care of SunOS which automatically restarts interrupted system | 82 | // CC: take care of SunOS which automatically restarts interrupted system |
84 | // calls (and thus does not have SA_RESTART) | 83 | // calls (and thus does not have SA_RESTART) |
85 | 84 | ||
86 | #ifdef SA_RESTART | 85 | #ifdef SA_RESTART |
87 | act.sa_flags |= SA_RESTART; | 86 | act.sa_flags |= SA_RESTART; |
88 | #endif | 87 | #endif |
89 | 88 | ||
90 | sigaction( SIGCHLD, &act, &oldChildHandlerData ); | 89 | sigaction( SIGCHLD, &act, &oldChildHandlerData ); |
diff --git a/libopie/oprocess.cpp b/libopie/oprocess.cpp index 5db2b6c..c19881a 100644 --- a/libopie/oprocess.cpp +++ b/libopie/oprocess.cpp | |||
@@ -8,97 +8,96 @@ | |||
8 | This library is free software; you can redistribute it and/or | 8 | This library is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU Library General Public | 9 | modify it under the terms of the GNU Library General Public |
10 | License as published by the Free Software Foundation; either | 10 | License as published by the Free Software Foundation; either |
11 | version 2 of the License, or (at your option) any later version. | 11 | version 2 of the License, or (at your option) any later version. |
12 | 12 | ||
13 | This library is distributed in the hope that it will be useful, | 13 | This library is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 | Library General Public License for more details. | 16 | Library General Public License for more details. |
17 | 17 | ||
18 | You should have received a copy of the GNU Library General Public License | 18 | You should have received a copy of the GNU Library General Public License |
19 | along with this library; see the file COPYING.LIB. If not, write to | 19 | along with this library; see the file COPYING.LIB. If not, write to |
20 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 20 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
21 | Boston, MA 02111-1307, USA. | 21 | Boston, MA 02111-1307, USA. |
22 | 22 | ||
23 | */ | 23 | */ |
24 | 24 | ||
25 | 25 | ||
26 | // | 26 | // |
27 | // KPROCESS -- A class for handling child processes in KDE without | 27 | // KPROCESS -- A class for handling child processes in KDE without |
28 | // having to take care of Un*x specific implementation details | 28 | // having to take care of Un*x specific implementation details |
29 | // | 29 | // |
30 | // version 0.3.1, Jan 8th 1998 | 30 | // version 0.3.1, Jan 8th 1998 |
31 | // | 31 | // |
32 | // (C) Christian Czezatke | 32 | // (C) Christian Czezatke |
33 | // e9025461@student.tuwien.ac.at | 33 | // e9025461@student.tuwien.ac.at |
34 | // | 34 | // |
35 | // Changes: | 35 | // Changes: |
36 | // | 36 | // |
37 | // March 2nd, 1998: Changed parameter list for KShellProcess: | 37 | // March 2nd, 1998: Changed parameter list for KShellProcess: |
38 | // Arguments are now placed in a single string so that | 38 | // Arguments are now placed in a single string so that |
39 | // <shell> -c <commandstring> is passed to the shell | 39 | // <shell> -c <commandstring> is passed to the shell |
40 | // to make the use of "operator<<" consistent with KProcess | 40 | // to make the use of "operator<<" consistent with KProcess |
41 | // | 41 | // |
42 | // | 42 | // |
43 | // Ported by Holger Freyther | 43 | // Ported by Holger Freyther |
44 | // <zekce> Harlekin: oprocess and say it was ported to Qt by the Opie developers an Qt 2 | 44 | // <zekce> Harlekin: oprocess and say it was ported to Qt by the Opie developers an Qt 2 |
45 | 45 | ||
46 | 46 | ||
47 | 47 | ||
48 | #include "oprocess.h" | 48 | #include "oprocess.h" |
49 | #define _MAY_INCLUDE_KPROCESSCONTROLLER_ | 49 | #define _MAY_INCLUDE_KPROCESSCONTROLLER_ |
50 | #include "oprocctrl.h" | 50 | #include "oprocctrl.h" |
51 | 51 | ||
52 | //#include <config.h> | 52 | //#include <config.h> |
53 | 53 | ||
54 | #include <qfile.h> | 54 | #include <qfile.h> |
55 | #include <qsocketnotifier.h> | 55 | #include <qsocketnotifier.h> |
56 | #include <qregexp.h> | ||
57 | 56 | ||
58 | #include <sys/time.h> | 57 | #include <sys/time.h> |
59 | #include <sys/types.h> | 58 | #include <sys/types.h> |
60 | #include <sys/stat.h> | 59 | #include <sys/stat.h> |
61 | #include <sys/socket.h> | 60 | #include <sys/socket.h> |
62 | 61 | ||
63 | #include <errno.h> | 62 | #include <errno.h> |
64 | #include <fcntl.h> | 63 | #include <fcntl.h> |
65 | #include <stdlib.h> | 64 | #include <stdlib.h> |
66 | #include <signal.h> | 65 | #include <signal.h> |
67 | #include <stdio.h> | 66 | #include <stdio.h> |
68 | #include <string.h> | 67 | #include <string.h> |
69 | #include <unistd.h> | 68 | #include <unistd.h> |
70 | #ifdef HAVE_SYS_SELECT_H | 69 | #ifdef HAVE_SYS_SELECT_H |
71 | #include <sys/select.h> | 70 | #include <sys/select.h> |
72 | #endif | 71 | #endif |
73 | #ifdef HAVE_INITGROUPS | 72 | #ifdef HAVE_INITGROUPS |
74 | #include <grp.h> | 73 | #include <grp.h> |
75 | #endif | 74 | #endif |
76 | #include <pwd.h> | 75 | #include <pwd.h> |
77 | 76 | ||
78 | #include <qapplication.h> | 77 | #include <qapplication.h> |
79 | #include <qmap.h> | 78 | #include <qmap.h> |
80 | //#include <kdebug.h> | 79 | //#include <kdebug.h> |
81 | 80 | ||
82 | ///////////////////////////// | 81 | ///////////////////////////// |
83 | // public member functions // | 82 | // public member functions // |
84 | ///////////////////////////// | 83 | ///////////////////////////// |
85 | 84 | ||
86 | class OProcessPrivate { | 85 | class OProcessPrivate { |
87 | public: | 86 | public: |
88 | OProcessPrivate() : useShell(false) { } | 87 | OProcessPrivate() : useShell(false) { } |
89 | 88 | ||
90 | bool useShell; | 89 | bool useShell; |
91 | QMap<QString,QString> env; | 90 | QMap<QString,QString> env; |
92 | QString wd; | 91 | QString wd; |
93 | QCString shell; | 92 | QCString shell; |
94 | }; | 93 | }; |
95 | 94 | ||
96 | 95 | ||
97 | OProcess::OProcess(QObject *parent, const char *name) | 96 | OProcess::OProcess(QObject *parent, const char *name) |
98 | : QObject(parent, name) | 97 | : QObject(parent, name) |
99 | { | 98 | { |
100 | init ( ); | 99 | init ( ); |
101 | } | 100 | } |
102 | 101 | ||
103 | OProcess::OProcess(const QString &arg0, QObject *parent, const char *name) | 102 | OProcess::OProcess(const QString &arg0, QObject *parent, const char *name) |
104 | : QObject(parent, name) | 103 | : QObject(parent, name) |
diff --git a/libopie/orecurrancewidget.cpp b/libopie/orecurrancewidget.cpp index be8ec30..d81851e 100644 --- a/libopie/orecurrancewidget.cpp +++ b/libopie/orecurrancewidget.cpp | |||
@@ -1,54 +1,52 @@ | |||
1 | #include <qapplication.h> | 1 | #include <qapplication.h> |
2 | #include <qlabel.h> | 2 | #include <qlabel.h> |
3 | #include <qpopupmenu.h> | ||
4 | #include <qspinbox.h> | 3 | #include <qspinbox.h> |
5 | 4 | ||
6 | #include <qpe/timestring.h> | ||
7 | 5 | ||
8 | #include "orecurrancewidget.h" | 6 | #include "orecurrancewidget.h" |
9 | 7 | ||
10 | // Global Templates for use in setting up the repeat label... | 8 | // Global Templates for use in setting up the repeat label... |
11 | // the problem is these strings get initialized before QPEApplication can install the translator -zecke | 9 | // the problem is these strings get initialized before QPEApplication can install the translator -zecke |
12 | namespace { | 10 | namespace { |
13 | QString strDayTemplate; | 11 | QString strDayTemplate; |
14 | QString strYearTemplate; | 12 | QString strYearTemplate; |
15 | QString strMonthDateTemplate; | 13 | QString strMonthDateTemplate; |
16 | QString strMonthDayTemplate; | 14 | QString strMonthDayTemplate; |
17 | QString strWeekTemplate; | 15 | QString strWeekTemplate; |
18 | QString dayLabel[7]; | 16 | QString dayLabel[7]; |
19 | } | 17 | } |
20 | 18 | ||
21 | /* | 19 | /* |
22 | * static linkage to not polute the symbol table... | 20 | * static linkage to not polute the symbol table... |
23 | * The problem is that const and static linkage are resolved prior to installing a translator | 21 | * The problem is that const and static linkage are resolved prior to installing a translator |
24 | * leading to that the above strings are translted but to the original we delay the init of these strings... | 22 | * leading to that the above strings are translted but to the original we delay the init of these strings... |
25 | * -zecke | 23 | * -zecke |
26 | */ | 24 | */ |
27 | static void fillStrings() { | 25 | static void fillStrings() { |
28 | strDayTemplate = QObject::tr("Every"); | 26 | strDayTemplate = QObject::tr("Every"); |
29 | strYearTemplate = QObject::tr("%1 %2 every "); | 27 | strYearTemplate = QObject::tr("%1 %2 every "); |
30 | strMonthDateTemplate = QObject::tr("The %1 every "); | 28 | strMonthDateTemplate = QObject::tr("The %1 every "); |
31 | strMonthDayTemplate = QObject::tr("The %1 %2 of every"); | 29 | strMonthDayTemplate = QObject::tr("The %1 %2 of every"); |
32 | strWeekTemplate = QObject::tr("Every "); | 30 | strWeekTemplate = QObject::tr("Every "); |
33 | dayLabel[0] = QObject::tr("Monday"); | 31 | dayLabel[0] = QObject::tr("Monday"); |
34 | dayLabel[1] = QObject::tr("Tuesday"); | 32 | dayLabel[1] = QObject::tr("Tuesday"); |
35 | dayLabel[2] = QObject::tr("Wednesday"); | 33 | dayLabel[2] = QObject::tr("Wednesday"); |
36 | dayLabel[3] = QObject::tr("Thursday"); | 34 | dayLabel[3] = QObject::tr("Thursday"); |
37 | dayLabel[4] = QObject::tr("Friday"); | 35 | dayLabel[4] = QObject::tr("Friday"); |
38 | dayLabel[5] = QObject::tr("Saturday"); | 36 | dayLabel[5] = QObject::tr("Saturday"); |
39 | dayLabel[6] = QObject::tr("Sunday"); | 37 | dayLabel[6] = QObject::tr("Sunday"); |
40 | } | 38 | } |
41 | 39 | ||
42 | static QString numberPlacing( int x );// return the proper word format for | 40 | static QString numberPlacing( int x );// return the proper word format for |
43 | // x (1st, 2nd, etc) | 41 | // x (1st, 2nd, etc) |
44 | static int week( const QDate &dt ); // what week in the month is dt? | 42 | static int week( const QDate &dt ); // what week in the month is dt? |
45 | 43 | ||
46 | /** | 44 | /** |
47 | * Constructs the Widget | 45 | * Constructs the Widget |
48 | * @param startOnMonday Does the week start on monday | 46 | * @param startOnMonday Does the week start on monday |
49 | * @param newStart The start date of the recurrence | 47 | * @param newStart The start date of the recurrence |
50 | * @param parent The parent widget | 48 | * @param parent The parent widget |
51 | * @param name the name of object | 49 | * @param name the name of object |
52 | * @param modal if the dialog should be modal | 50 | * @param modal if the dialog should be modal |
53 | * @param fl Additional window flags | 51 | * @param fl Additional window flags |
54 | */ | 52 | */ |
diff --git a/libopie/oticker.cpp b/libopie/oticker.cpp index 4fb5945..c05c2a8 100644 --- a/libopie/oticker.cpp +++ b/libopie/oticker.cpp | |||
@@ -1,89 +1,80 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | 3 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> |
4 | =. | 4 | =. |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | 28 | ||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <qpe/qpeapplication.h> | ||
32 | #include <qpe/resource.h> | ||
33 | #include <qpe/config.h> | 31 | #include <qpe/config.h> |
34 | 32 | ||
35 | #include <qwidget.h> | ||
36 | #include <qpixmap.h> | ||
37 | #include <qbutton.h> | ||
38 | #include <qpainter.h> | ||
39 | #include <qframe.h> | ||
40 | #include <qlayout.h> | ||
41 | #include <qdir.h> | ||
42 | #include <stdlib.h> | 33 | #include <stdlib.h> |
43 | #include <stdio.h> | 34 | #include <stdio.h> |
44 | 35 | ||
45 | #include "oticker.h" | 36 | #include "oticker.h" |
46 | 37 | ||
47 | OTicker::OTicker( QWidget* parent ) | 38 | OTicker::OTicker( QWidget* parent ) |
48 | : QLabel( parent ) { | 39 | : QLabel( parent ) { |
49 | // : QFrame( parent ) { | 40 | // : QFrame( parent ) { |
50 | setTextFormat(Qt::RichText); | 41 | setTextFormat(Qt::RichText); |
51 | Config cfg("qpe"); | 42 | Config cfg("qpe"); |
52 | cfg.setGroup("Appearance"); | 43 | cfg.setGroup("Appearance"); |
53 | backgroundcolor = QColor( cfg.readEntry( "Background", "#E5E1D5" ) ); | 44 | backgroundcolor = QColor( cfg.readEntry( "Background", "#E5E1D5" ) ); |
54 | foregroundcolor= Qt::black; | 45 | foregroundcolor= Qt::black; |
55 | updateTimerTime = 50; | 46 | updateTimerTime = 50; |
56 | scrollLength = 1; | 47 | scrollLength = 1; |
57 | } | 48 | } |
58 | 49 | ||
59 | OTicker::~OTicker() { | 50 | OTicker::~OTicker() { |
60 | } | 51 | } |
61 | 52 | ||
62 | void OTicker::setBackgroundColor(const QColor& backcolor) { | 53 | void OTicker::setBackgroundColor(const QColor& backcolor) { |
63 | backgroundcolor = backcolor; | 54 | backgroundcolor = backcolor; |
64 | update(); | 55 | update(); |
65 | } | 56 | } |
66 | 57 | ||
67 | void OTicker::setForegroundColor(const QColor& backcolor) { | 58 | void OTicker::setForegroundColor(const QColor& backcolor) { |
68 | foregroundcolor = backcolor; | 59 | foregroundcolor = backcolor; |
69 | update(); | 60 | update(); |
70 | } | 61 | } |
71 | 62 | ||
72 | void OTicker::setFrame(int frameStyle) { | 63 | void OTicker::setFrame(int frameStyle) { |
73 | setFrameStyle( frameStyle/*WinPanel | Sunken */); | 64 | setFrameStyle( frameStyle/*WinPanel | Sunken */); |
74 | update(); | 65 | update(); |
75 | } | 66 | } |
76 | 67 | ||
77 | void OTicker::setText( const QString& text ) { | 68 | void OTicker::setText( const QString& text ) { |
78 | pos = 0; // reset it everytime the text is changed | 69 | pos = 0; // reset it everytime the text is changed |
79 | scrollText = text; | 70 | scrollText = text; |
80 | qDebug(scrollText); | 71 | qDebug(scrollText); |
81 | 72 | ||
82 | int pixelLen = 0; | 73 | int pixelLen = 0; |
83 | bool bigger = false; | 74 | bool bigger = false; |
84 | int contWidth = contentsRect().width(); | 75 | int contWidth = contentsRect().width(); |
85 | int contHeight = contentsRect().height(); | 76 | int contHeight = contentsRect().height(); |
86 | int pixelTextLen = fontMetrics().width( text ); | 77 | int pixelTextLen = fontMetrics().width( text ); |
87 | printf("<<<<<<<height %d, width %d, text width %d %d\n", contHeight, contWidth, pixelTextLen, scrollText.length()); | 78 | printf("<<<<<<<height %d, width %d, text width %d %d\n", contHeight, contWidth, pixelTextLen, scrollText.length()); |
88 | if( pixelTextLen < contWidth) | 79 | if( pixelTextLen < contWidth) |
89 | { | 80 | { |
diff --git a/libopie/otimepicker.cpp b/libopie/otimepicker.cpp index 115d39b..1eca7c5 100644 --- a/libopie/otimepicker.cpp +++ b/libopie/otimepicker.cpp | |||
@@ -1,54 +1,51 @@ | |||
1 | #include "otimepicker.h" | 1 | #include "otimepicker.h" |
2 | 2 | ||
3 | #include <qbuttongroup.h> | ||
4 | #include <qtoolbutton.h> | ||
5 | #include <qlayout.h> | 3 | #include <qlayout.h> |
6 | #include <qstring.h> | ||
7 | #include <stdio.h> | 4 | #include <stdio.h> |
8 | #include <qlineedit.h> | 5 | #include <qlineedit.h> |
9 | 6 | ||
10 | 7 | ||
11 | /** | 8 | /** |
12 | * Constructs the widget | 9 | * Constructs the widget |
13 | * @param parent The parent of the OTimePicker | 10 | * @param parent The parent of the OTimePicker |
14 | * @param name The name of the object | 11 | * @param name The name of the object |
15 | * @param fl Window Flags | 12 | * @param fl Window Flags |
16 | */ | 13 | */ |
17 | OTimePicker::OTimePicker(QWidget* parent, const char* name, | 14 | OTimePicker::OTimePicker(QWidget* parent, const char* name, |
18 | WFlags fl) : | 15 | WFlags fl) : |
19 | QWidget(parent,name,fl) | 16 | QWidget(parent,name,fl) |
20 | { | 17 | { |
21 | 18 | ||
22 | QVBoxLayout *vbox=new QVBoxLayout(this); | 19 | QVBoxLayout *vbox=new QVBoxLayout(this); |
23 | 20 | ||
24 | OClickableLabel *r; | 21 | OClickableLabel *r; |
25 | QString s; | 22 | QString s; |
26 | 23 | ||
27 | // Hour Row | 24 | // Hour Row |
28 | QWidget *row=new QWidget(this); | 25 | QWidget *row=new QWidget(this); |
29 | QHBoxLayout *l=new QHBoxLayout(row); | 26 | QHBoxLayout *l=new QHBoxLayout(row); |
30 | vbox->addWidget(row); | 27 | vbox->addWidget(row); |
31 | 28 | ||
32 | 29 | ||
33 | for (int i=0; i<24; i++) { | 30 | for (int i=0; i<24; i++) { |
34 | r=new OClickableLabel(row); | 31 | r=new OClickableLabel(row); |
35 | hourLst.append(r); | 32 | hourLst.append(r); |
36 | s.sprintf("%.2d",i); | 33 | s.sprintf("%.2d",i); |
37 | r->setText(s); | 34 | r->setText(s); |
38 | r->setToggleButton(true); | 35 | r->setToggleButton(true); |
39 | r->setAlignment(AlignHCenter | AlignVCenter); | 36 | r->setAlignment(AlignHCenter | AlignVCenter); |
40 | l->addWidget(r); | 37 | l->addWidget(r); |
41 | connect(r, SIGNAL(toggled(bool)), | 38 | connect(r, SIGNAL(toggled(bool)), |
42 | this, SLOT(slotHour(bool))); | 39 | this, SLOT(slotHour(bool))); |
43 | 40 | ||
44 | if (i==11) { // Second row | 41 | if (i==11) { // Second row |
45 | row=new QWidget(this); | 42 | row=new QWidget(this); |
46 | l=new QHBoxLayout(row); | 43 | l=new QHBoxLayout(row); |
47 | vbox->addWidget(row); | 44 | vbox->addWidget(row); |
48 | } | 45 | } |
49 | } | 46 | } |
50 | 47 | ||
51 | // Minute Row | 48 | // Minute Row |
52 | row=new QWidget(this); | 49 | row=new QWidget(this); |
53 | l=new QHBoxLayout(row); | 50 | l=new QHBoxLayout(row); |
54 | vbox->addWidget(row); | 51 | vbox->addWidget(row); |
diff --git a/libopie/owait.cpp b/libopie/owait.cpp index 0fdf08d..a0f3834 100644 --- a/libopie/owait.cpp +++ b/libopie/owait.cpp | |||
@@ -1,70 +1,68 @@ | |||
1 | /* This file is part of the OPIE libraries | 1 | /* This file is part of the OPIE libraries |
2 | Copyright (C) 2003 Maximilian Reiss (harlekin@handhelds.org) | 2 | Copyright (C) 2003 Maximilian Reiss (harlekin@handhelds.org) |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qlabel.h> | ||
21 | #include <qlayout.h> | 20 | #include <qlayout.h> |
22 | #include <qtimer.h> | ||
23 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
24 | #include <qpainter.h> | 22 | #include <qpainter.h> |
25 | 23 | ||
26 | #include "owait.h" | 24 | #include "owait.h" |
27 | 25 | ||
28 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
29 | 27 | ||
30 | static int frame = 0; | 28 | static int frame = 0; |
31 | 29 | ||
32 | /** | 30 | /** |
33 | * This will construct a modal dialog. | 31 | * This will construct a modal dialog. |
34 | * | 32 | * |
35 | * The default timer length is 10. | 33 | * The default timer length is 10. |
36 | * | 34 | * |
37 | * @param parent The parent of the widget | 35 | * @param parent The parent of the widget |
38 | * @param msg The name of the object | 36 | * @param msg The name of the object |
39 | * @param dispIcon Display Icon? | 37 | * @param dispIcon Display Icon? |
40 | */ | 38 | */ |
41 | OWait::OWait(QWidget *parent, const char* msg, bool dispIcon ) | 39 | OWait::OWait(QWidget *parent, const char* msg, bool dispIcon ) |
42 | :QDialog(parent, msg, TRUE,WStyle_Customize) { | 40 | :QDialog(parent, msg, TRUE,WStyle_Customize) { |
43 | 41 | ||
44 | 42 | ||
45 | QHBoxLayout *hbox = new QHBoxLayout( this ); | 43 | QHBoxLayout *hbox = new QHBoxLayout( this ); |
46 | 44 | ||
47 | m_lb = new QLabel( this ); | 45 | m_lb = new QLabel( this ); |
48 | m_lb->setBackgroundMode ( NoBackground ); | 46 | m_lb->setBackgroundMode ( NoBackground ); |
49 | 47 | ||
50 | hbox->addWidget( m_lb ); | 48 | hbox->addWidget( m_lb ); |
51 | hbox->activate(); | 49 | hbox->activate(); |
52 | 50 | ||
53 | m_pix = Resource::loadPixmap( "BigBusy" ); | 51 | m_pix = Resource::loadPixmap( "BigBusy" ); |
54 | m_aniSize = m_pix.height(); | 52 | m_aniSize = m_pix.height(); |
55 | resize( m_aniSize, m_aniSize ); | 53 | resize( m_aniSize, m_aniSize ); |
56 | 54 | ||
57 | m_timerLength = 10; | 55 | m_timerLength = 10; |
58 | 56 | ||
59 | m_waitTimer = new QTimer( this ); | 57 | m_waitTimer = new QTimer( this ); |
60 | connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) ); | 58 | connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) ); |
61 | } | 59 | } |
62 | 60 | ||
63 | void OWait::timerEvent( QTimerEvent * ) { | 61 | void OWait::timerEvent( QTimerEvent * ) { |
64 | frame = (++frame) % 4; | 62 | frame = (++frame) % 4; |
65 | repaint(); | 63 | repaint(); |
66 | } | 64 | } |
67 | 65 | ||
68 | void OWait::paintEvent( QPaintEvent * ) { | 66 | void OWait::paintEvent( QPaintEvent * ) { |
69 | QPainter p( m_lb ); | 67 | QPainter p( m_lb ); |
70 | p.drawPixmap( 0, 0, m_pix, m_aniSize * frame, 0, m_aniSize, m_aniSize ); | 68 | p.drawPixmap( 0, 0, m_pix, m_aniSize * frame, 0, m_aniSize, m_aniSize ); |
diff --git a/libopie/pim/ocontactaccessbackend_xml.cpp b/libopie/pim/ocontactaccessbackend_xml.cpp index aae7fca..2373ad6 100644 --- a/libopie/pim/ocontactaccessbackend_xml.cpp +++ b/libopie/pim/ocontactaccessbackend_xml.cpp | |||
@@ -1,161 +1,162 @@ | |||
1 | /* | 1 | /* |
2 | * XML Backend for the OPIE-Contact Database. | 2 | * XML Backend for the OPIE-Contact Database. |
3 | * | 3 | * |
4 | * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) | 4 | * Copyright (c) 2002 by Stefan Eilers (Eilers.Stefan@epost.de) |
5 | * | 5 | * |
6 | * ===================================================================== | 6 | * ===================================================================== |
7 | *This program is free software; you can redistribute it and/or | 7 | *This program is free software; you can redistribute it and/or |
8 | *modify it under the terms of the GNU Library General Public | 8 | *modify it under the terms of the GNU Library General Public |
9 | * License as published by the Free Software Foundation; either | 9 | * License as published by the Free Software Foundation; either |
10 | * version 2 of the License, or (at your option) any later version. | 10 | * version 2 of the License, or (at your option) any later version. |
11 | * ===================================================================== | 11 | * ===================================================================== |
12 | * | 12 | * |
13 | * ===================================================================== | 13 | * ===================================================================== |
14 | * Version: $Id$ | 14 | * Version: $Id$ |
15 | * ===================================================================== | 15 | * ===================================================================== |
16 | * History: | 16 | * History: |
17 | * $Log$ | 17 | * $Log$ |
18 | * Revision 1.10 2004/03/01 15:44:36 chicken | ||
19 | * fix includes | ||
20 | * | ||
18 | * Revision 1.9 2003/09/22 14:31:16 eilers | 21 | * Revision 1.9 2003/09/22 14:31:16 eilers |
19 | * Added first experimental incarnation of sql-backend for addressbook. | 22 | * Added first experimental incarnation of sql-backend for addressbook. |
20 | * Some modifications to be able to compile the todo sql-backend. | 23 | * Some modifications to be able to compile the todo sql-backend. |
21 | * A lot of changes fill follow... | 24 | * A lot of changes fill follow... |
22 | * | 25 | * |
23 | * Revision 1.8 2003/08/30 15:28:26 eilers | 26 | * Revision 1.8 2003/08/30 15:28:26 eilers |
24 | * Removed some unimportant debug output which causes slow down.. | 27 | * Removed some unimportant debug output which causes slow down.. |
25 | * | 28 | * |
26 | * Revision 1.7 2003/08/01 12:30:16 eilers | 29 | * Revision 1.7 2003/08/01 12:30:16 eilers |
27 | * Merging changes from BRANCH_1_0 to HEAD | 30 | * Merging changes from BRANCH_1_0 to HEAD |
28 | * | 31 | * |
29 | * Revision 1.6 2003/07/07 16:19:47 eilers | 32 | * Revision 1.6 2003/07/07 16:19:47 eilers |
30 | * Fixing serious bug in hasQuerySettings() | 33 | * Fixing serious bug in hasQuerySettings() |
31 | * | 34 | * |
32 | * Revision 1.5 2003/04/13 18:07:10 zecke | 35 | * Revision 1.5 2003/04/13 18:07:10 zecke |
33 | * More API doc | 36 | * More API doc |
34 | * QString -> const QString& | 37 | * QString -> const QString& |
35 | * QString = 0l -> QString::null | 38 | * QString = 0l -> QString::null |
36 | * | 39 | * |
37 | * Revision 1.4 2003/03/21 14:32:54 mickeyl | 40 | * Revision 1.4 2003/03/21 14:32:54 mickeyl |
38 | * g++ compliance fix: default arguments belong into the declaration, but not the definition | 41 | * g++ compliance fix: default arguments belong into the declaration, but not the definition |
39 | * | 42 | * |
40 | * Revision 1.3 2003/03/21 12:26:28 eilers | 43 | * Revision 1.3 2003/03/21 12:26:28 eilers |
41 | * Fixing small bug: If we search a birthday from today to today, it returned | 44 | * Fixing small bug: If we search a birthday from today to today, it returned |
42 | * every contact .. | 45 | * every contact .. |
43 | * | 46 | * |
44 | * Revision 1.2 2003/03/21 10:33:09 eilers | 47 | * Revision 1.2 2003/03/21 10:33:09 eilers |
45 | * Merged speed optimized xml backend for contacts to main. | 48 | * Merged speed optimized xml backend for contacts to main. |
46 | * Added QDateTime to querybyexample. For instance, it is now possible to get | 49 | * Added QDateTime to querybyexample. For instance, it is now possible to get |
47 | * all Birthdays/Anniversaries between two dates. This should be used | 50 | * all Birthdays/Anniversaries between two dates. This should be used |
48 | * to show all birthdays in the datebook.. | 51 | * to show all birthdays in the datebook.. |
49 | * This change is sourcecode backward compatible but you have to upgrade | 52 | * This change is sourcecode backward compatible but you have to upgrade |
50 | * the binaries for today-addressbook. | 53 | * the binaries for today-addressbook. |
51 | * | 54 | * |
52 | * Revision 1.1.2.2 2003/02/11 12:17:28 eilers | 55 | * Revision 1.1.2.2 2003/02/11 12:17:28 eilers |
53 | * Speed optimization. Removed the sequential search loops. | 56 | * Speed optimization. Removed the sequential search loops. |
54 | * | 57 | * |
55 | * Revision 1.1.2.1 2003/02/10 15:31:38 eilers | 58 | * Revision 1.1.2.1 2003/02/10 15:31:38 eilers |
56 | * Writing offsets to debug output.. | 59 | * Writing offsets to debug output.. |
57 | * | 60 | * |
58 | * Revision 1.1 2003/02/09 15:05:01 eilers | 61 | * Revision 1.1 2003/02/09 15:05:01 eilers |
59 | * Nothing happened.. Just some cleanup before I will start.. | 62 | * Nothing happened.. Just some cleanup before I will start.. |
60 | * | 63 | * |
61 | * Revision 1.12 2003/01/03 16:58:03 eilers | 64 | * Revision 1.12 2003/01/03 16:58:03 eilers |
62 | * Reenable debug output | 65 | * Reenable debug output |
63 | * | 66 | * |
64 | * Revision 1.11 2003/01/03 12:31:28 eilers | 67 | * Revision 1.11 2003/01/03 12:31:28 eilers |
65 | * Bugfix for calculating data diffs.. | 68 | * Bugfix for calculating data diffs.. |
66 | * | 69 | * |
67 | * Revision 1.10 2003/01/02 14:27:12 eilers | 70 | * Revision 1.10 2003/01/02 14:27:12 eilers |
68 | * Improved query by example: Search by date is possible.. First step | 71 | * Improved query by example: Search by date is possible.. First step |
69 | * for a today plugin for birthdays.. | 72 | * for a today plugin for birthdays.. |
70 | * | 73 | * |
71 | * Revision 1.9 2002/12/08 12:48:57 eilers | 74 | * Revision 1.9 2002/12/08 12:48:57 eilers |
72 | * Moved journal-enum from ocontact into i the xml-backend.. | 75 | * Moved journal-enum from ocontact into i the xml-backend.. |
73 | * | 76 | * |
74 | * Revision 1.8 2002/11/14 17:04:24 eilers | 77 | * Revision 1.8 2002/11/14 17:04:24 eilers |
75 | * Sorting will now work if fullname is identical on some entries | 78 | * Sorting will now work if fullname is identical on some entries |
76 | * | 79 | * |
77 | * Revision 1.7 2002/11/13 15:02:46 eilers | 80 | * Revision 1.7 2002/11/13 15:02:46 eilers |
78 | * Small Bug in sorted fixed | 81 | * Small Bug in sorted fixed |
79 | * | 82 | * |
80 | * Revision 1.6 2002/11/13 14:14:51 eilers | 83 | * Revision 1.6 2002/11/13 14:14:51 eilers |
81 | * Added sorted for Contacts.. | 84 | * Added sorted for Contacts.. |
82 | * | 85 | * |
83 | * Revision 1.5 2002/11/01 15:10:42 eilers | 86 | * Revision 1.5 2002/11/01 15:10:42 eilers |
84 | * Added regExp-search in database for all fields in a contact. | 87 | * Added regExp-search in database for all fields in a contact. |
85 | * | 88 | * |
86 | * Revision 1.4 2002/10/16 10:52:40 eilers | 89 | * Revision 1.4 2002/10/16 10:52:40 eilers |
87 | * Added some docu to the interface and now using the cache infrastucture by zecke.. :) | 90 | * Added some docu to the interface and now using the cache infrastucture by zecke.. :) |
88 | * | 91 | * |
89 | * Revision 1.3 2002/10/14 16:21:54 eilers | 92 | * Revision 1.3 2002/10/14 16:21:54 eilers |
90 | * Some minor interface updates | 93 | * Some minor interface updates |
91 | * | 94 | * |
92 | * Revision 1.2 2002/10/07 17:34:24 eilers | 95 | * Revision 1.2 2002/10/07 17:34:24 eilers |
93 | * added OBackendFactory for advanced backend access | 96 | * added OBackendFactory for advanced backend access |
94 | * | 97 | * |
95 | * Revision 1.1 2002/09/27 17:11:44 eilers | 98 | * Revision 1.1 2002/09/27 17:11:44 eilers |
96 | * Added API for accessing the Contact-Database ! It is compiling, but | 99 | * Added API for accessing the Contact-Database ! It is compiling, but |
97 | * please do not expect that anything is working ! | 100 | * please do not expect that anything is working ! |
98 | * I will debug that stuff in the next time .. | 101 | * I will debug that stuff in the next time .. |
99 | * Please read README_COMPILE for compiling ! | 102 | * Please read README_COMPILE for compiling ! |
100 | * | 103 | * |
101 | * | 104 | * |
102 | */ | 105 | */ |
103 | 106 | ||
104 | #include "ocontactaccessbackend_xml.h" | 107 | #include "ocontactaccessbackend_xml.h" |
105 | 108 | ||
106 | #include <qasciidict.h> | 109 | #include <qasciidict.h> |
107 | #include <qdatetime.h> | ||
108 | #include <qfile.h> | 110 | #include <qfile.h> |
109 | #include <qfileinfo.h> | 111 | #include <qfileinfo.h> |
110 | #include <qregexp.h> | 112 | #include <qregexp.h> |
111 | #include <qarray.h> | 113 | #include <qarray.h> |
112 | #include <qmap.h> | 114 | #include <qmap.h> |
113 | #include <qdatetime.h> | ||
114 | 115 | ||
115 | #include <qpe/global.h> | 116 | #include <qpe/global.h> |
116 | 117 | ||
117 | #include <opie/xmltree.h> | 118 | #include <opie/xmltree.h> |
118 | #include "ocontactaccessbackend.h" | 119 | #include "ocontactaccessbackend.h" |
119 | #include "ocontactaccess.h" | 120 | #include "ocontactaccess.h" |
120 | 121 | ||
121 | #include <stdlib.h> | 122 | #include <stdlib.h> |
122 | #include <errno.h> | 123 | #include <errno.h> |
123 | 124 | ||
124 | using namespace Opie; | 125 | using namespace Opie; |
125 | 126 | ||
126 | 127 | ||
127 | OContactAccessBackend_XML::OContactAccessBackend_XML ( const QString& appname, const QString& filename ): | 128 | OContactAccessBackend_XML::OContactAccessBackend_XML ( const QString& appname, const QString& filename ): |
128 | m_changed( false ) | 129 | m_changed( false ) |
129 | { | 130 | { |
130 | // Just m_contactlist should call delete if an entry | 131 | // Just m_contactlist should call delete if an entry |
131 | // is removed. | 132 | // is removed. |
132 | m_contactList.setAutoDelete( true ); | 133 | m_contactList.setAutoDelete( true ); |
133 | m_uidToContact.setAutoDelete( false ); | 134 | m_uidToContact.setAutoDelete( false ); |
134 | 135 | ||
135 | m_appName = appname; | 136 | m_appName = appname; |
136 | 137 | ||
137 | /* Set journalfile name ... */ | 138 | /* Set journalfile name ... */ |
138 | m_journalName = getenv("HOME"); | 139 | m_journalName = getenv("HOME"); |
139 | m_journalName +="/.abjournal" + appname; | 140 | m_journalName +="/.abjournal" + appname; |
140 | 141 | ||
141 | /* Expecting to access the default filename if nothing else is set */ | 142 | /* Expecting to access the default filename if nothing else is set */ |
142 | if ( filename.isEmpty() ){ | 143 | if ( filename.isEmpty() ){ |
143 | m_fileName = Global::applicationFileName( "addressbook","addressbook.xml" ); | 144 | m_fileName = Global::applicationFileName( "addressbook","addressbook.xml" ); |
144 | } else | 145 | } else |
145 | m_fileName = filename; | 146 | m_fileName = filename; |
146 | 147 | ||
147 | /* Load Database now */ | 148 | /* Load Database now */ |
148 | load (); | 149 | load (); |
149 | } | 150 | } |
150 | 151 | ||
151 | bool OContactAccessBackend_XML::save() | 152 | bool OContactAccessBackend_XML::save() |
152 | { | 153 | { |
153 | 154 | ||
154 | if ( !m_changed ) | 155 | if ( !m_changed ) |
155 | return true; | 156 | return true; |
156 | 157 | ||
157 | QString strNewFile = m_fileName + ".new"; | 158 | QString strNewFile = m_fileName + ".new"; |
158 | QFile f( strNewFile ); | 159 | QFile f( strNewFile ); |
159 | if ( !f.open( IO_WriteOnly|IO_Raw ) ) | 160 | if ( !f.open( IO_WriteOnly|IO_Raw ) ) |
160 | return false; | 161 | return false; |
161 | 162 | ||
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp index 189bf94..b2c76f8 100644 --- a/libopie/pim/otodo.cpp +++ b/libopie/pim/otodo.cpp | |||
@@ -1,60 +1,59 @@ | |||
1 | 1 | ||
2 | #include <qobject.h> | 2 | #include <qobject.h> |
3 | #include <qshared.h> | 3 | #include <qshared.h> |
4 | 4 | ||
5 | 5 | ||
6 | 6 | ||
7 | #include <qpe/palmtopuidgen.h> | 7 | #include <qpe/palmtopuidgen.h> |
8 | #include <qpe/stringutil.h> | ||
9 | #include <qpe/palmtoprecord.h> | 8 | #include <qpe/palmtoprecord.h> |
10 | #include <qpe/stringutil.h> | ||
11 | #include <qpe/categories.h> | 9 | #include <qpe/categories.h> |
12 | #include <qpe/categoryselect.h> | 10 | #include <qpe/categoryselect.h> |
11 | #include <qpe/stringutil.h> | ||
13 | 12 | ||
14 | 13 | ||
15 | #include "opimstate.h" | 14 | #include "opimstate.h" |
16 | #include "orecur.h" | 15 | #include "orecur.h" |
17 | #include "opimmaintainer.h" | 16 | #include "opimmaintainer.h" |
18 | #include "opimnotifymanager.h" | 17 | #include "opimnotifymanager.h" |
19 | #include "opimresolver.h" | 18 | #include "opimresolver.h" |
20 | 19 | ||
21 | #include "otodo.h" | 20 | #include "otodo.h" |
22 | 21 | ||
23 | 22 | ||
24 | struct OTodo::OTodoData : public QShared { | 23 | struct OTodo::OTodoData : public QShared { |
25 | OTodoData() : QShared() { | 24 | OTodoData() : QShared() { |
26 | recur = 0; | 25 | recur = 0; |
27 | state = 0; | 26 | state = 0; |
28 | maintainer = 0; | 27 | maintainer = 0; |
29 | notifiers = 0; | 28 | notifiers = 0; |
30 | }; | 29 | }; |
31 | ~OTodoData() { | 30 | ~OTodoData() { |
32 | delete recur; | 31 | delete recur; |
33 | delete maintainer; | 32 | delete maintainer; |
34 | delete notifiers; | 33 | delete notifiers; |
35 | } | 34 | } |
36 | 35 | ||
37 | QDate date; | 36 | QDate date; |
38 | bool isCompleted:1; | 37 | bool isCompleted:1; |
39 | bool hasDate:1; | 38 | bool hasDate:1; |
40 | int priority; | 39 | int priority; |
41 | QString desc; | 40 | QString desc; |
42 | QString sum; | 41 | QString sum; |
43 | QMap<QString, QString> extra; | 42 | QMap<QString, QString> extra; |
44 | ushort prog; | 43 | ushort prog; |
45 | OPimState *state; | 44 | OPimState *state; |
46 | ORecur *recur; | 45 | ORecur *recur; |
47 | OPimMaintainer *maintainer; | 46 | OPimMaintainer *maintainer; |
48 | QDate start; | 47 | QDate start; |
49 | QDate completed; | 48 | QDate completed; |
50 | OPimNotifyManager *notifiers; | 49 | OPimNotifyManager *notifiers; |
51 | }; | 50 | }; |
52 | 51 | ||
53 | OTodo::OTodo(const OTodo &event ) | 52 | OTodo::OTodo(const OTodo &event ) |
54 | : OPimRecord( event ), data( event.data ) | 53 | : OPimRecord( event ), data( event.data ) |
55 | { | 54 | { |
56 | data->ref(); | 55 | data->ref(); |
57 | // qWarning("ref up"); | 56 | // qWarning("ref up"); |
58 | } | 57 | } |
59 | OTodo::~OTodo() { | 58 | OTodo::~OTodo() { |
60 | 59 | ||