-rw-r--r-- | noncore/settings/netsystemtime/formattabwidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/netsystemtime/formattabwidget.cpp b/noncore/settings/netsystemtime/formattabwidget.cpp index a037881..7d01bff 100644 --- a/noncore/settings/netsystemtime/formattabwidget.cpp +++ b/noncore/settings/netsystemtime/formattabwidget.cpp | |||
@@ -25,103 +25,103 @@ | |||
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include "formattabwidget.h" | 31 | #include "formattabwidget.h" |
32 | 32 | ||
33 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
34 | 34 | ||
35 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | 35 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) |
36 | #include <qpe/qcopenvelope_qws.h> | 36 | #include <qpe/qcopenvelope_qws.h> |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
40 | #include <qlabel.h> | 40 | #include <qlabel.h> |
41 | #include <qlayout.h> | 41 | #include <qlayout.h> |
42 | #include <qscrollview.h> | 42 | #include <qscrollview.h> |
43 | #include <qtimer.h> | 43 | #include <qtimer.h> |
44 | 44 | ||
45 | FormatTabWidget::FormatTabWidget( QWidget *parent ) | 45 | FormatTabWidget::FormatTabWidget( QWidget *parent ) |
46 | : QWidget( parent, 0x0, 0 ) | 46 | : QWidget( parent, 0x0, 0 ) |
47 | { | 47 | { |
48 | QVBoxLayout *tmpvb = new QVBoxLayout( this ); | 48 | QVBoxLayout *tmpvb = new QVBoxLayout( this ); |
49 | QScrollView *sv = new QScrollView( this ); | 49 | QScrollView *sv = new QScrollView( this ); |
50 | tmpvb->addWidget( sv, 0, 0 ); | 50 | tmpvb->addWidget( sv, 0, 0 ); |
51 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 51 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
52 | sv->setFrameStyle( QFrame::NoFrame ); | 52 | sv->setFrameStyle( QFrame::NoFrame ); |
53 | QWidget *container = new QWidget( sv->viewport() ); | 53 | QWidget *container = new QWidget( sv->viewport() ); |
54 | sv->addChild( container ); | 54 | sv->addChild( container ); |
55 | 55 | ||
56 | QGridLayout *layout = new QGridLayout( container ); | 56 | QGridLayout *layout = new QGridLayout( container ); |
57 | layout->setMargin( 2 ); | 57 | layout->setMargin( 2 ); |
58 | layout->setSpacing( 4 ); | 58 | layout->setSpacing( 4 ); |
59 | 59 | ||
60 | // Time format selector | 60 | // Time format selector |
61 | layout->addWidget( new QLabel( tr( "Time format" ), container ), 0, 0 ); | 61 | layout->addWidget( new QLabel( tr( "Time format" ), container ), 0, 0 ); |
62 | cbAppletFormat = new QComboBox( container ); | 62 | cbAppletFormat = new QComboBox( container ); |
63 | cbAppletFormat->insertItem( tr( "hh:mm" ), 0 ); | 63 | cbAppletFormat->insertItem( tr( "hh:mm" ), 0 ); |
64 | cbAppletFormat->insertItem( tr( "D/M hh:mm" ), 1 ); | 64 | cbAppletFormat->insertItem( tr( "D/M hh:mm" ), 1 ); |
65 | cbAppletFormat->insertItem( tr( "M/D hh:mm" ), 2 ); | 65 | cbAppletFormat->insertItem( tr( "M/D hh:mm" ), 2 ); |
66 | layout->addWidget( cbAppletFormat, 0, 1 ); | 66 | layout->addWidget( cbAppletFormat, 0, 1 ); |
67 | 67 | ||
68 | // 12/24 hour selector | 68 | // 12/24 hour selector |
69 | layout->addWidget( new QLabel( tr( "12/24 hour" ), container ), 1, 0 ); | 69 | layout->addWidget( new QLabel( tr( "12/24 hour" ), container ), 1, 0 ); |
70 | cbAmpm = new QComboBox( container ); | 70 | cbAmpm = new QComboBox( container ); |
71 | cbAmpm->insertItem( tr( "24 hour" ), 0 ); | 71 | cbAmpm->insertItem( tr( "24 hour" ), 0 ); |
72 | cbAmpm->insertItem( tr( "12 hour" ), 1 ); | 72 | cbAmpm->insertItem( tr( "12 hour" ), 1 ); |
73 | connect( cbAmpm, SIGNAL(activated( int)), this, SIGNAL(show12HourTime( int)) ); | 73 | connect( cbAmpm, SIGNAL(activated(int)), this, SIGNAL(show12HourTime(int)) ); |
74 | layout->addWidget( cbAmpm, 1, 1 ); | 74 | layout->addWidget( cbAmpm, 1, 1 ); |
75 | 75 | ||
76 | // Date format selector | 76 | // Date format selector |
77 | layout->addWidget( new QLabel( tr( "Date format" ), container ), 2, 0 ); | 77 | layout->addWidget( new QLabel( tr( "Date format" ), container ), 2, 0 ); |
78 | cbDateFormat = new QComboBox( container ); | 78 | cbDateFormat = new QComboBox( container ); |
79 | connect( cbDateFormat, SIGNAL(activated( int)), this, SLOT(slotDateFormatChanged( int)) ); | 79 | connect( cbDateFormat, SIGNAL(activated(int)), this, SLOT(slotDateFormatChanged(int)) ); |
80 | layout->addWidget( cbDateFormat, 2, 1 ); | 80 | layout->addWidget( cbDateFormat, 2, 1 ); |
81 | 81 | ||
82 | // Week starts on selector | 82 | // Week starts on selector |
83 | layout->addWidget( new QLabel( tr( "Weeks start on" ), container ), 3, 0 ); | 83 | layout->addWidget( new QLabel( tr( "Weeks start on" ), container ), 3, 0 ); |
84 | cbWeekStart = new QComboBox( container ); | 84 | cbWeekStart = new QComboBox( container ); |
85 | cbWeekStart->insertItem( tr( "Sunday" ), 0 ); | 85 | cbWeekStart->insertItem( tr( "Sunday" ), 0 ); |
86 | cbWeekStart->insertItem( tr( "Monday" ), 1 ); | 86 | cbWeekStart->insertItem( tr( "Monday" ), 1 ); |
87 | connect( cbWeekStart, SIGNAL(activated(int)), this, SIGNAL(weekStartChanged(int)) ); | 87 | connect( cbWeekStart, SIGNAL(activated(int)), this, SIGNAL(weekStartChanged(int)) ); |
88 | layout->addWidget( cbWeekStart, 3, 1 ); | 88 | layout->addWidget( cbWeekStart, 3, 1 ); |
89 | 89 | ||
90 | // Initialize values | 90 | // Initialize values |
91 | Config config( "qpe" ); | 91 | Config config( "qpe" ); |
92 | config.setGroup( "Date" ); | 92 | config.setGroup( "Date" ); |
93 | cbAppletFormat->setCurrentItem( config.readNumEntry( "ClockApplet", 0 ) ); | 93 | cbAppletFormat->setCurrentItem( config.readNumEntry( "ClockApplet", 0 ) ); |
94 | 94 | ||
95 | DateFormat df(QChar(config.readEntry("Separator", "/")[0]), | 95 | DateFormat df(QChar(config.readEntry("Separator", "/")[0]), |
96 | (DateFormat::Order)config .readNumEntry("ShortOrder", DateFormat::DayMonthYear), | 96 | (DateFormat::Order)config .readNumEntry("ShortOrder", DateFormat::DayMonthYear), |
97 | (DateFormat::Order)config.readNumEntry("LongOrder", DateFormat::DayMonthYear)); | 97 | (DateFormat::Order)config.readNumEntry("LongOrder", DateFormat::DayMonthYear)); |
98 | 98 | ||
99 | int currentdf = 0; | 99 | int currentdf = 0; |
100 | date_formats[0] = DateFormat( '/', DateFormat::MonthDayYear ); | 100 | date_formats[0] = DateFormat( '/', DateFormat::MonthDayYear ); |
101 | cbDateFormat->insertItem( tr( date_formats[0].toNumberString() ) ); | 101 | cbDateFormat->insertItem( tr( date_formats[0].toNumberString() ) ); |
102 | date_formats[1] = DateFormat( '.', DateFormat::DayMonthYear ); | 102 | date_formats[1] = DateFormat( '.', DateFormat::DayMonthYear ); |
103 | if ( df == date_formats[1] ) | 103 | if ( df == date_formats[1] ) |
104 | currentdf = 1; | 104 | currentdf = 1; |
105 | cbDateFormat->insertItem( tr( date_formats[1].toNumberString() ) ); | 105 | cbDateFormat->insertItem( tr( date_formats[1].toNumberString() ) ); |
106 | date_formats[2] = DateFormat( '-', DateFormat::YearMonthDay, DateFormat::DayMonthYear ); | 106 | date_formats[2] = DateFormat( '-', DateFormat::YearMonthDay, DateFormat::DayMonthYear ); |
107 | if ( df == date_formats[2] ) | 107 | if ( df == date_formats[2] ) |
108 | currentdf = 2; | 108 | currentdf = 2; |
109 | cbDateFormat->insertItem( tr( date_formats[2].toNumberString() ) ); //ISO8601 | 109 | cbDateFormat->insertItem( tr( date_formats[2].toNumberString() ) ); //ISO8601 |
110 | date_formats[3] = DateFormat( '/', DateFormat::DayMonthYear ); | 110 | date_formats[3] = DateFormat( '/', DateFormat::DayMonthYear ); |
111 | if ( df == date_formats[3] ) | 111 | if ( df == date_formats[3] ) |
112 | currentdf = 3; | 112 | currentdf = 3; |
113 | cbDateFormat->insertItem( tr( date_formats[3].toNumberString() ) ); | 113 | cbDateFormat->insertItem( tr( date_formats[3].toNumberString() ) ); |
114 | 114 | ||
115 | cbDateFormat->setCurrentItem( currentdf ); | 115 | cbDateFormat->setCurrentItem( currentdf ); |
116 | //dateButton->setDateFormat( df ); | 116 | //dateButton->setDateFormat( df ); |
117 | 117 | ||
118 | config.setGroup( "Time" ); | 118 | config.setGroup( "Time" ); |
119 | cbAmpm->setCurrentItem( config.readBoolEntry( "AMPM", FALSE ) ? 1 : 0 ); | 119 | cbAmpm->setCurrentItem( config.readBoolEntry( "AMPM", FALSE ) ? 1 : 0 ); |
120 | cbWeekStart->setCurrentItem( config.readBoolEntry( "MONDAY", TRUE ) ? 1 : 0 ); | 120 | cbWeekStart->setCurrentItem( config.readBoolEntry( "MONDAY", TRUE ) ? 1 : 0 ); |
121 | 121 | ||
122 | // Send initial configuration options | 122 | // Send initial configuration options |
123 | QTimer::singleShot( 1200, this, SLOT(sendOptions()) ); | 123 | QTimer::singleShot( 1200, this, SLOT(sendOptions()) ); |
124 | } | 124 | } |
125 | 125 | ||
126 | FormatTabWidget::~FormatTabWidget() | 126 | FormatTabWidget::~FormatTabWidget() |
127 | { | 127 | { |