summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditorgeneraltodo.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koeditorgeneraltodo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneraltodo.cpp39
1 files changed, 23 insertions, 16 deletions
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp
index d32d5a5..baee9fc 100644
--- a/korganizer/koeditorgeneraltodo.cpp
+++ b/korganizer/koeditorgeneraltodo.cpp
@@ -13,32 +13,39 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qtooltip.h>
-#include <qfiledialog.h>
+#include <q3filedialog.h>
#include <qlayout.h>
-#include <qvbox.h>
-#include <qbuttongroup.h>
-#include <qvgroupbox.h>
-#include <qwidgetstack.h>
+#include <q3vbox.h>
+#include <q3buttongroup.h>
+#include <q3vgroupbox.h>
+#include <q3widgetstack.h>
#include <qdatetime.h>
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <Q3GridLayout>
+#include <Q3Frame>
+#include <QLabel>
+#include <Q3VBoxLayout>
#include <kglobal.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <krestrictedline.h>
#include <kstandarddirs.h>
#include <kfiledialog.h>
#include <kdialog.h>
#include <libkcal/todo.h>
@@ -73,36 +80,36 @@ void KOEditorGeneralTodo::finishSetup()
// QWidget::setTabOrder(mStartDateEdit, mStartTimeEdit);
// QWidget::setTabOrder(mStartTimeEdit, mTimeButton);
// QWidget::setTabOrder(mTimeButton, mCompletedCombo);
// QWidget::setTabOrder(mCompletedCombo, mPriorityCombo);
// QWidget::setTabOrder(mPriorityCombo, mAlarmButton);
// QWidget::setTabOrder(mAlarmButton, mCategoriesButton);
// QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo);
// QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit);
mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
mSummaryEdit->setFocus();
}
-void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout)
+void KOEditorGeneralTodo::initTime(QWidget *parent,Q3BoxLayout *topLayout)
{
- QBoxLayout *timeLayout = new QVBoxLayout(topLayout);
+ Q3BoxLayout *timeLayout = new Q3VBoxLayout(topLayout);
- QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal,
+ Q3GroupBox *timeGroupBox = new Q3GroupBox(1,Qt::Horizontal,
i18n("Date && Time"),parent);
timeLayout->addWidget(timeGroupBox);
timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 );
timeGroupBox->layout()->setMargin( KDialog::marginHint() );
- QFrame *timeBoxFrame = new QFrame(timeGroupBox);
+ Q3Frame *timeBoxFrame = new Q3Frame(timeGroupBox);
- QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3);
+ Q3GridLayout *layoutTimeBox = new Q3GridLayout(timeBoxFrame,3,3);
layoutTimeBox->setSpacing(KDialog::spacingHintSmall());
layoutTimeBox->setColStretch( 1, 1 );
mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame);
layoutTimeBox->addWidget(mStartCheck,0,0);
connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool)));
mStartDateEdit = new KDateEdit(timeBoxFrame);
layoutTimeBox->addWidget(mStartDateEdit,0,1);
mStartTimeEdit = new KOTimeEdit(timeBoxFrame);
layoutTimeBox->addWidget(mStartTimeEdit,0,2);
@@ -124,25 +131,25 @@ void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout)
layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1);
connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool)));
connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime)));
connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime)));
connect(mStartDateEdit, SIGNAL(dateChanged(QDate)),
this, SLOT(startDateChanged(QDate)));
// some more layouting
//layoutTimeBox->setColStretch(3,1);
}
-void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout)
+void KOEditorGeneralTodo::initCompletion(QWidget *parent, Q3BoxLayout *topLayout)
{
mCompletedCombo = new QComboBox(parent);
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 0 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 20 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 40 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 60 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 80 %"));
@@ -164,43 +171,43 @@ void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout)
mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) );
connect(mCompleteDateEdit,SIGNAL(setTimeTo(QTime)),mCompleteTimeEdit,SLOT(setTime(QTime)));
if ( QApplication::desktop()->width() <= 480 ) {
if ( QApplication::desktop()->width() < 320 )
mCompleteDateEdit->setMaximumWidth( 85 );
else
mCompleteDateEdit->setMaximumWidth( 140 );
topLayout->setSpacing( 0 );
}
}
-void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout)
+void KOEditorGeneralTodo::initPriority(QWidget *parent, Q3BoxLayout *topLayout)
{
- QHBox* h = new QHBox ( parent );
+ Q3HBox* h = new Q3HBox ( parent );
topLayout->addWidget( h );
QLabel *priorityLabel = new QLabel(i18n("Priority:"), h);
// topLayout->addWidget(priorityLabel);
mPriorityCombo = new QComboBox( h );
mPriorityCombo->insertItem(i18n("1 (high)"));
mPriorityCombo->insertItem(i18n("2"));
mPriorityCombo->insertItem(i18n("3"));
mPriorityCombo->insertItem(i18n("4"));
mPriorityCombo->insertItem(i18n("5 (low)"));
//topLayout->addWidget(mPriorityCombo);
}
-void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout)
+void KOEditorGeneralTodo::initStatus(QWidget *parent,Q3BoxLayout *topLayout)
{
- QBoxLayout *statusLayout = new QHBoxLayout(topLayout);
+ Q3BoxLayout *statusLayout = new Q3HBoxLayout(topLayout);
initCompletion( parent, statusLayout );
statusLayout->addStretch( 1 );
initPriority( parent, statusLayout );
}
void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay)
{
mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
@@ -387,25 +394,25 @@ void KOEditorGeneralTodo::enableStartEdit( bool enable )
}
if (enable) {
mStartTimeEdit->setEnabled( mTimeButton->isChecked() );
} else {
mStartTimeEdit->setEnabled( false );
}
emit datesChecked();
}
void KOEditorGeneralTodo::startDateChanged(QDate newdate)
{
if ( mDueCheck->isChecked() )
- emit dateTimesChanged(newdate,mDueDateEdit->date());
+ emit dateTimesChanged((QDateTime)newdate,(QDateTime)mDueDateEdit->date());
}
void KOEditorGeneralTodo::enableTimeEdits(bool enable)
{
if(mStartCheck->isChecked()) {
mStartTimeEdit->setEnabled( enable );
}
if(mDueCheck->isChecked()) {
mDueTimeEdit->setEnabled( enable );
}
}
void KOEditorGeneralTodo::showAlarm()