summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoeditor.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/kotodoeditor.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'korganizer/kotodoeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoeditor.cpp43
1 files changed, 24 insertions, 19 deletions
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index 20a35d2..aeab92a 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -14,33 +14,38 @@
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 <qframe.h>
+#include <q3frame.h>
#include <qpixmap.h>
#include <qlayout.h>
-#include <qhbox.h>
+#include <q3hbox.h>
#include <qtimer.h>
#include <qdir.h>
#include <qdatetime.h>
#include <qapplication.h>
+#include <QDesktopWidget>
#include <qtabwidget.h>
+//Added by qt3to4:
+#include <Q3HBoxLayout>
+#include <Q3PtrList>
+#include <Q3VBoxLayout>
#include <kiconloader.h>
#include <klocale.h>
#include <kfiledialog.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <libkdepim/categoryselectdialog.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <libkcal/icalformat.h>
@@ -72,26 +77,26 @@ KOTodoEditor::~KOTodoEditor()
void KOTodoEditor::init()
{
setupGeneral();
setupAttendeesTab();
setupRecurrence();
connect(mGeneral,SIGNAL(datesChecked()),this ,SLOT(checkRecurrence()));
mRecurrence->setDateTimeStr( i18n("<i>The recurrence is computed from the start datetime!</i>") );
connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)),
mRecurrence,SLOT(setDefaultsDates(QDateTime,QDateTime)));
}
void KOTodoEditor::setupRecurrence()
{
- QFrame *topFrame = addPage( i18n("Recurrence") );
- QBoxLayout *topLayout = new QVBoxLayout( topFrame );
+ Q3Frame *topFrame = addPage( i18n("Recurrence") );
+ Q3BoxLayout *topLayout = new Q3VBoxLayout( topFrame );
mRecurrence = new KOEditorRecurrence( topFrame );
topLayout->addWidget( mRecurrence );
}
void KOTodoEditor::setCategories( QString s )
{
mGeneral->setCategories(s);
}
void KOTodoEditor::setSecrecy( int sec )
{
mGeneral->setSecrecy( sec );
@@ -102,110 +107,110 @@ void KOTodoEditor::reload()
}
void KOTodoEditor::setupGeneral()
{
mGeneral = new KOEditorGeneralTodo(this);
connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
// connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show()));
//connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)),
// mGeneral,SLOT(setCategories(const QString &)));
if (KOPrefs::instance()->mCompactDialogs) {
- QFrame *topFrame = addPage(i18n("General"));
+ Q3Frame *topFrame = addPage(i18n("General"));
- QBoxLayout *topLayout = new QVBoxLayout(topFrame);
+ Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
if ( QApplication::desktop()->width() < 480 ) {
topLayout->setMargin(marginHintSmall());
topLayout->setSpacing(spacingHintSmall());
} else {
topLayout->setMargin(marginHint());
topLayout->setSpacing(spacingHint());
}
topLayout->addStretch( 1 );
mGeneral->initHeader(topFrame,topLayout);
topLayout->addStretch( 1 );
mGeneral->initTime(topFrame,topLayout);
topLayout->addStretch( 1 );
mGeneral->initAlarm(topFrame,topLayout);
topLayout->addStretch( 1 );
mGeneral->enableAlarm( false );
- QBoxLayout *priorityLayout;
+ Q3BoxLayout *priorityLayout;
if ( QApplication::desktop()->width() < 500 )
- priorityLayout = new QVBoxLayout( topLayout );
+ priorityLayout = new Q3VBoxLayout( topLayout );
else
- priorityLayout = new QHBoxLayout( topLayout );
+ priorityLayout = new Q3HBoxLayout( topLayout );
QWidget* prioWidget = new QWidget (topFrame);
priorityLayout->addWidget( prioWidget );
- QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget);
+ Q3HBoxLayout* priorityLayout2 = new Q3HBoxLayout( prioWidget);
- QIconSet icon;
+ QIcon icon;
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("fileimport16");
else
icon = SmallIcon("fileimport");
QPushButton * loadTemplate = new QPushButton( prioWidget);
loadTemplate->setIconSet (icon ) ;
int size = loadTemplate->sizeHint().height();
loadTemplate->setFixedSize( size, size );
if ( QApplication::desktop()->width() < 321 )
icon = SmallIcon("fileexport16");
else
icon = SmallIcon("fileexport");
QPushButton * saveTemplate = new QPushButton( prioWidget);
saveTemplate->setIconSet (icon ) ;
saveTemplate->setFixedSize( size, size );
priorityLayout2->addWidget(loadTemplate);
priorityLayout2->addWidget(saveTemplate);
mGeneral->initPriority(prioWidget,priorityLayout2);
mGeneral->initCategories( topFrame, priorityLayout );
topLayout->addStretch(1);
- QFrame *topFrame2 = addPage(i18n("Details"));
+ Q3Frame *topFrame2 = addPage(i18n("Details"));
- QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2);
+ Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2);
topLayout2->setMargin(marginHint());
topLayout2->setSpacing(spacingHint());
- QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 );
+ Q3HBoxLayout *completionLayout = new Q3HBoxLayout( topLayout2 );
mGeneral->initCompletion(topFrame2,completionLayout);
mGeneral->initSecrecy( topFrame2, topLayout2 );
mGeneral->initDescription(topFrame2,topLayout2);
// QHBox * hb = new QHBox ( topFrame2 );
// topLayout2->addWidget(hb);
// hb->setSpacing( 3 );
connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
} else {
- QFrame *topFrame = addPage(i18n("General"));
+ Q3Frame *topFrame = addPage(i18n("General"));
- QBoxLayout *topLayout = new QVBoxLayout(topFrame);
+ Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame);
topLayout->setSpacing(spacingHint());
mGeneral->initHeader(topFrame,topLayout);
mGeneral->initTime(topFrame,topLayout);
mGeneral->initStatus(topFrame,topLayout);
- QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
+ Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout);
mGeneral->initAlarm(topFrame,alarmLineLayout);
mGeneral->initDescription(topFrame,topLayout);
- QBoxLayout *detailsLayout = new QHBoxLayout(topLayout);
+ Q3BoxLayout *detailsLayout = new Q3HBoxLayout(topLayout);
mGeneral->initCategories( topFrame, detailsLayout );
mGeneral->initSecrecy( topFrame, detailsLayout );
}
mGeneral->finishSetup();
}
void KOTodoEditor::editTodo(Todo *todo, bool editDescription)
{
//init();
mTodo = todo;
@@ -418,25 +423,25 @@ void KOTodoEditor::slotLoadTemplate()
t_dir.mkdir ( fileName );
fileName += "/todo";
fileName = KFileDialog::getSaveFileName( fileName , "Load Todo template", this );
if ( fileName.length() == 0 )
return;
CalendarLocal cal;
ICalFormat format;
if ( !format.load( &cal, fileName ) ) {
KMessageBox::error( this, i18n("Error loading template file\n '%1'.")
.arg( fileName ) );
return ;
}
- QPtrList<Todo> todos = cal.todos();
+ Q3PtrList<Todo> todos = cal.todos();
Todo * todo = todos.first();
if ( !todo ) {
KMessageBox::error( this,
i18n("Template does not\ncontain a valid Todo."));
} else {
readTodo( todo );
}
}
void KOTodoEditor::slotSaveTemplate()
{