-rw-r--r-- | korganizer/ktimeedit.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp index 5222ac9..61a0931 100644 --- a/korganizer/ktimeedit.cpp +++ b/korganizer/ktimeedit.cpp | |||
@@ -40,28 +40,30 @@ | |||
40 | 40 | ||
41 | // Validator for a time value with only hours and minutes (no seconds) | 41 | // Validator for a time value with only hours and minutes (no seconds) |
42 | // Mostly locale aware. Author: David Faure <faure@kde.org> | 42 | // Mostly locale aware. Author: David Faure <faure@kde.org> |
43 | 43 | ||
44 | // KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox. | 44 | // KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox. |
45 | // Difficult to get all in one... | 45 | // Difficult to get all in one... |
46 | // But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help. | 46 | // But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help. |
47 | KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) | 47 | KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name) |
48 | : QComboBox(TRUE, parent, name) | 48 | : QComboBox(TRUE, parent, name) |
49 | { | 49 | { |
50 | setInsertionPolicy(NoInsertion); | 50 | setInsertionPolicy(NoInsertion); |
51 | mFlagKeyPressed = false; | 51 | mFlagKeyPressed = false; |
52 | 52 | if ( QApplication::desktop()->height() <= 480 ) { | |
53 | if ( QApplication::desktop()->width() < 650 ) | ||
54 | setSizeLimit ( 6 ); | 53 | setSizeLimit ( 6 ); |
55 | mTime = qt; | 54 | } else { |
55 | setSizeLimit ( 12 ); | ||
56 | } | ||
57 | mTime = qt; | ||
56 | 58 | ||
57 | // mNoTimeString = i18n("No Time"); | 59 | // mNoTimeString = i18n("No Time"); |
58 | // insertItem( mNoTimeString ); | 60 | // insertItem( mNoTimeString ); |
59 | 61 | ||
60 | // Fill combo box with selection of times in localized format. | 62 | // Fill combo box with selection of times in localized format. |
61 | QTime timeEntry(0,0,0); | 63 | QTime timeEntry(0,0,0); |
62 | do { | 64 | do { |
63 | insertItem(KGlobal::locale()->formatTime(timeEntry)); | 65 | insertItem(KGlobal::locale()->formatTime(timeEntry)); |
64 | timeEntry = timeEntry.addSecs(60*15); | 66 | timeEntry = timeEntry.addSecs(60*15); |
65 | } while (!timeEntry.isNull()); | 67 | } while (!timeEntry.isNull()); |
66 | // Add end of day. | 68 | // Add end of day. |
67 | insertItem( KGlobal::locale()->formatTime( QTime( 23, 59, 59 ) ) ); | 69 | insertItem( KGlobal::locale()->formatTime( QTime( 23, 59, 59 ) ) ); |