Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 0045b7f..bfe0aec 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -48,108 +48,118 @@ | |||
48 | 48 | ||
49 | #include "koprefs.h" | 49 | #include "koprefs.h" |
50 | #include "koglobals.h" | 50 | #include "koglobals.h" |
51 | 51 | ||
52 | #include "koeditorgeneral.h" | 52 | #include "koeditorgeneral.h" |
53 | #include "kolocationbox.h" | 53 | #include "kolocationbox.h" |
54 | #ifndef DESKTOP_VERSION | 54 | #ifndef DESKTOP_VERSION |
55 | #include <qpe/qpeapplication.h> | 55 | #include <qpe/qpeapplication.h> |
56 | #else | 56 | #else |
57 | #include <qapplication.h> | 57 | #include <qapplication.h> |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : | 60 | KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : |
61 | QObject( parent, name) | 61 | QObject( parent, name) |
62 | { | 62 | { |
63 | mNextFocus = 0; | 63 | mNextFocus = 0; |
64 | } | 64 | } |
65 | 65 | ||
66 | KOEditorGeneral::~KOEditorGeneral() | 66 | KOEditorGeneral::~KOEditorGeneral() |
67 | { | 67 | { |
68 | } | 68 | } |
69 | 69 | ||
70 | void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) | 70 | void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) |
71 | { | 71 | { |
72 | QGridLayout *headerLayout = new QGridLayout(topLayout); | 72 | QGridLayout *headerLayout = new QGridLayout(topLayout); |
73 | 73 | ||
74 | #if 0 | 74 | #if 0 |
75 | mOwnerLabel = new QLabel(i18n("Owner:"),parent); | 75 | mOwnerLabel = new QLabel(i18n("Owner:"),parent); |
76 | headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); | 76 | headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); | 79 | QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); |
80 | headerLayout->addWidget(summaryLabel,1,0); | 80 | headerLayout->addWidget(summaryLabel,1,0); |
81 | 81 | ||
82 | mSummaryEdit = new KOLocationBox(TRUE,parent, 10); | 82 | mSummaryEdit = new KOLocationBox(TRUE,parent, 10); |
83 | mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); | 83 | mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); |
84 | //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); | 84 | //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); |
85 | //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() ); | 85 | //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() ); |
86 | int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2; | 86 | int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2; |
87 | if ( QApplication::desktop()->width() > 320 ) | 87 | if ( QApplication::desktop()->width() > 320 ) |
88 | mSummaryEdit->setMaximumHeight( hei +6 ); | 88 | mSummaryEdit->setMaximumHeight( hei +6 ); |
89 | //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding ); | 89 | //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding ); |
90 | // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink } | 90 | // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink } |
91 | // mSummaryEdit = new QLineEdit(parent); | 91 | // mSummaryEdit = new QLineEdit(parent); |
92 | headerLayout->addWidget(mSummaryEdit,1,1); | 92 | headerLayout->addWidget(mSummaryEdit,1,1); |
93 | connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); | 93 | connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); |
94 | 94 | ||
95 | QLabel *locationLabel = new QLabel(i18n("Location:"),parent); | 95 | QLabel *locationLabel = new QLabel(i18n("Location:"),parent); |
96 | if ( QApplication::desktop()->height() < 320 ) | ||
97 | headerLayout->addWidget(locationLabel,1,2); | ||
98 | else | ||
96 | headerLayout->addWidget(locationLabel,2,0); | 99 | headerLayout->addWidget(locationLabel,2,0); |
97 | 100 | ||
98 | mLocationEdit = new KOLocationBox(TRUE,parent,10); | 101 | mLocationEdit = new KOLocationBox(TRUE,parent,10); |
99 | mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); | 102 | mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); |
100 | if ( QApplication::desktop()->width() > 320 ) | 103 | if ( QApplication::desktop()->width() > 320 ) |
101 | mLocationEdit->setMaximumHeight( hei + 6); | 104 | mLocationEdit->setMaximumHeight( hei + 6); |
102 | 105 | ||
103 | // mLocationEdit = new QLineEdit(parent); | 106 | // mLocationEdit = new QLineEdit(parent); |
104 | connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); | 107 | connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); |
108 | if ( QApplication::desktop()->height() < 320 ) { | ||
109 | headerLayout->addWidget(mLocationEdit,1,3); | ||
110 | headerLayout->setColStretch( 1, 10); | ||
111 | headerLayout->setColStretch( 3, 10); | ||
112 | } | ||
113 | else { | ||
105 | headerLayout->addWidget(mLocationEdit,2,1); | 114 | headerLayout->addWidget(mLocationEdit,2,1); |
106 | headerLayout->setColStretch( 1, 10); | 115 | headerLayout->setColStretch( 1, 10); |
107 | } | 116 | } |
117 | } | ||
108 | void KOEditorGeneral::setFocusOn( int i ) | 118 | void KOEditorGeneral::setFocusOn( int i ) |
109 | { | 119 | { |
110 | mNextFocus = i; | 120 | mNextFocus = i; |
111 | QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); | 121 | QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); |
112 | } | 122 | } |
113 | void KOEditorGeneral::slotSetFocusOn() | 123 | void KOEditorGeneral::slotSetFocusOn() |
114 | { | 124 | { |
115 | mNextFocus; | 125 | mNextFocus; |
116 | if ( mNextFocus == 1 ) { | 126 | if ( mNextFocus == 1 ) { |
117 | mDescriptionEdit->setFocus(); | 127 | mDescriptionEdit->setFocus(); |
118 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); | 128 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); |
119 | } | 129 | } |
120 | if ( mNextFocus == 2 ) { | 130 | if ( mNextFocus == 2 ) { |
121 | mSummaryEdit->setFocus(); | 131 | mSummaryEdit->setFocus(); |
122 | } | 132 | } |
123 | } | 133 | } |
124 | void KOEditorGeneral::editCategories() | 134 | void KOEditorGeneral::editCategories() |
125 | { | 135 | { |
126 | // qDebug("KOEditorGeneral::editCategories() "); | 136 | // qDebug("KOEditorGeneral::editCategories() "); |
127 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); | 137 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); |
128 | connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); | 138 | connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); |
129 | //KOGlobals::fitDialogToScreen( csd ); | 139 | //KOGlobals::fitDialogToScreen( csd ); |
130 | csd->setColorEnabled(); | 140 | csd->setColorEnabled(); |
131 | csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); | 141 | csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); |
132 | csd->exec(); | 142 | csd->exec(); |
133 | delete csd; | 143 | delete csd; |
134 | } | 144 | } |
135 | void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) | 145 | void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) |
136 | { | 146 | { |
137 | QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); | 147 | QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); |
138 | 148 | ||
139 | mCategoriesButton = new QPushButton(parent); | 149 | mCategoriesButton = new QPushButton(parent); |
140 | mCategoriesButton->setText(i18n("Categories...")); | 150 | mCategoriesButton->setText(i18n("Categories...")); |
141 | connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); | 151 | connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); |
142 | categoriesLayout->addWidget(mCategoriesButton); | 152 | categoriesLayout->addWidget(mCategoriesButton); |
143 | 153 | ||
144 | mCategoriesLabel = new QLabel(parent); | 154 | mCategoriesLabel = new QLabel(parent); |
145 | mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); | 155 | mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); |
146 | categoriesLayout->addWidget(mCategoriesLabel,1); | 156 | categoriesLayout->addWidget(mCategoriesLabel,1); |
147 | } | 157 | } |
148 | 158 | ||
149 | void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) | 159 | void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) |
150 | { | 160 | { |
151 | QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); | 161 | QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); |
152 | 162 | ||
153 | QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); | 163 | QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); |
154 | mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); | 164 | mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); |
155 | secrecyLayout->addWidget(mCancelBox); | 165 | secrecyLayout->addWidget(mCancelBox); |