summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/calendar.cpp6
-rw-r--r--library/qpemessagebox.cpp9
2 files changed, 14 insertions, 1 deletions
diff --git a/library/calendar.cpp b/library/calendar.cpp
index 5199413..70e764c 100644
--- a/library/calendar.cpp
+++ b/library/calendar.cpp
@@ -1,111 +1,117 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of 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#include "calendar.h" 20#include "calendar.h"
21 21
22#include <qdatetime.h> 22#include <qdatetime.h>
23#include <qobject.h> 23#include <qobject.h>
24 24
25/*! \class Calendar calendar.html 25/*! \class Calendar calendar.html
26 26
27 \brief The Calendar class provides programmers with an easy to calculate 27 \brief The Calendar class provides programmers with an easy to calculate
28 and get information about dates, months and years. 28 and get information about dates, months and years.
29 29
30 \ingroup qtopiaemb 30 \ingroup qtopiaemb
31*/ 31*/
32 32
33#ifdef Q_OS_MACX
34 #define ATTRIBUTE_UNUSED
35#else
36 #define ATTRIBUTE_UNUSED __attribute__((unused))
37#endif
33 38
34 39
40static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() ATTRIBUTE_UNUSED;
35static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() { 41static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() {
36 (void)QObject::tr("Jan"); 42 (void)QObject::tr("Jan");
37 (void)QObject::tr("Feb"); 43 (void)QObject::tr("Feb");
38 (void)QObject::tr("Mar"); 44 (void)QObject::tr("Mar");
39 (void)QObject::tr("Apr"); 45 (void)QObject::tr("Apr");
40 (void)QObject::tr("May"); 46 (void)QObject::tr("May");
41 (void)QObject::tr("Jun"); 47 (void)QObject::tr("Jun");
42 (void)QObject::tr("Jul"); 48 (void)QObject::tr("Jul");
43 (void)QObject::tr("Aug"); 49 (void)QObject::tr("Aug");
44 (void)QObject::tr("Sep"); 50 (void)QObject::tr("Sep");
45 (void)QObject::tr("Oct"); 51 (void)QObject::tr("Oct");
46 (void)QObject::tr("Nov"); 52 (void)QObject::tr("Nov");
47 (void)QObject::tr("Dec"); 53 (void)QObject::tr("Dec");
48 (void)QObject::tr("Mon"); 54 (void)QObject::tr("Mon");
49 (void)QObject::tr("Tue"); 55 (void)QObject::tr("Tue");
50 (void)QObject::tr("Wed"); 56 (void)QObject::tr("Wed");
51 (void)QObject::tr("Thu"); 57 (void)QObject::tr("Thu");
52 (void)QObject::tr("Fri"); 58 (void)QObject::tr("Fri");
53 (void)QObject::tr("Sat"); 59 (void)QObject::tr("Sat");
54 (void)QObject::tr("Sun"); 60 (void)QObject::tr("Sun");
55} 61}
56 62
57 63
58 64
59/*! 65/*!
60 Returns the name of the month for \a m. 66 Returns the name of the month for \a m.
61 Equivalent to QDate::monthName(). 67 Equivalent to QDate::monthName().
62*/ 68*/
63 69
64QString Calendar::nameOfMonth( int m ) 70QString Calendar::nameOfMonth( int m )
65{ 71{
66 QDate d; 72 QDate d;
67 return QObject::tr( d.monthName( m ) ); 73 return QObject::tr( d.monthName( m ) );
68} 74}
69 75
70/*! 76/*!
71 Returns the name of the day for \a d. 77 Returns the name of the day for \a d.
72 Equivalent to QDate::dayName(). 78 Equivalent to QDate::dayName().
73*/ 79*/
74QString Calendar::nameOfDay( int d ) 80QString Calendar::nameOfDay( int d )
75{ 81{
76 QDate dt; 82 QDate dt;
77 return QObject::tr( dt.dayName( d ) ); 83 return QObject::tr( dt.dayName( d ) );
78} 84}
79 85
80/*! \obsolete */ 86/*! \obsolete */
81QValueList<Calendar::Day> Calendar::daysOfMonth( int year, int month, 87QValueList<Calendar::Day> Calendar::daysOfMonth( int year, int month,
82 bool startWithMonday ) 88 bool startWithMonday )
83{ 89{
84 QDate temp; 90 QDate temp;
85 temp.setYMD( year, month, 1 ); 91 temp.setYMD( year, month, 1 );
86 int firstDay = temp.dayOfWeek(); 92 int firstDay = temp.dayOfWeek();
87 int i; 93 int i;
88 QDate prev; 94 QDate prev;
89 QValueList<Day> days; 95 QValueList<Day> days;
90 96
91 if ( startWithMonday ) 97 if ( startWithMonday )
92 i = 1; 98 i = 1;
93 else 99 else
94 i = 0; 100 i = 0;
95 101
96 if ( month > 1 ) 102 if ( month > 1 )
97 prev.setYMD( year, month - 1, 1 ); 103 prev.setYMD( year, month - 1, 1 );
98 else 104 else
99 prev.setYMD( year - 1, 12, 1 ); 105 prev.setYMD( year - 1, 12, 1 );
100 for ( ; i < firstDay; i++ ) { 106 for ( ; i < firstDay; i++ ) {
101 days.append( Day( prev.daysInMonth() - ( firstDay - i - 1 ), 107 days.append( Day( prev.daysInMonth() - ( firstDay - i - 1 ),
102 Day::PrevMonth, FALSE ) ); 108 Day::PrevMonth, FALSE ) );
103 } 109 }
104 for ( i = 1; i <= temp.daysInMonth(); i++ ) 110 for ( i = 1; i <= temp.daysInMonth(); i++ )
105 days.append( Day( i, Day::ThisMonth, FALSE ) ); 111 days.append( Day( i, Day::ThisMonth, FALSE ) );
106 i = 0; 112 i = 0;
107 while ( days.count() < 6 * 7 ) 113 while ( days.count() < 6 * 7 )
108 days.append( Day( ++i, Day::NextMonth, FALSE ) ); 114 days.append( Day( ++i, Day::NextMonth, FALSE ) );
109 115
110 return days; 116 return days;
111} 117}
diff --git a/library/qpemessagebox.cpp b/library/qpemessagebox.cpp
index bf03d31..c38828a 100644
--- a/library/qpemessagebox.cpp
+++ b/library/qpemessagebox.cpp
@@ -1,53 +1,60 @@
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 "qpemessagebox.h" 21#include "qpemessagebox.h"
22#include <qtopia/stringutil.h> 22#include <qtopia/stringutil.h>
23 23
24#include <qmessagebox.h> 24#include <qmessagebox.h>
25 25
26static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() { 26#ifdef Q_OS_MACX
27 #define ATTRIBUTE_UNUSED
28#else
29 #define ATTRIBUTE_UNUSED __attribute__((unused))
30#endif
31
32static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() ATTRIBUTE_UNUSED;
33static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() {
27(void)QMessageBox::tr("Yes"); 34(void)QMessageBox::tr("Yes");
28(void)QMessageBox::tr("No"); 35(void)QMessageBox::tr("No");
29} 36}
30 37
31 38
32/*! 39/*!
33 \class QPEMessageBox qpemessagebox.h 40 \class QPEMessageBox qpemessagebox.h
34 \brief A message box that provides yes, no and cancel options. 41 \brief A message box that provides yes, no and cancel options.
35 42
36 \ingroup qtopiaemb 43 \ingroup qtopiaemb
37 */ 44 */
38 45
39/*! 46/*!
40 Displays a QMessageBox with parent \a parent and caption \a caption. 47 Displays a QMessageBox with parent \a parent and caption \a caption.
41 The message displayed is "Are you sure you want to delete: ", 48 The message displayed is "Are you sure you want to delete: ",
42 followed by \a object. 49 followed by \a object.
43 */ 50 */
44bool QPEMessageBox::confirmDelete( QWidget *parent, const QString & caption, 51bool QPEMessageBox::confirmDelete( QWidget *parent, const QString & caption,
45 const QString & object ) 52 const QString & object )
46{ 53{
47 QString msg = QObject::tr("<qt>Are you sure you want to delete\n %1?</qt>").arg( Qtopia::escapeString( object ) ); // use <qt> an esacpe String.... 54 QString msg = QObject::tr("<qt>Are you sure you want to delete\n %1?</qt>").arg( Qtopia::escapeString( object ) ); // use <qt> an esacpe String....
48 int r = QMessageBox::warning( parent, caption, msg, QMessageBox::Yes, 55 int r = QMessageBox::warning( parent, caption, msg, QMessageBox::Yes,
49 QMessageBox::No|QMessageBox::Default| 56 QMessageBox::No|QMessageBox::Default|
50 QMessageBox::Escape, 0 ); 57 QMessageBox::Escape, 0 );
51 58
52 return r == QMessageBox::Yes; 59 return r == QMessageBox::Yes;
53} 60}