summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventeditor.cpp
Unidiff
Diffstat (limited to 'korganizer/koeventeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventeditor.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp
index b3edec6..0ff99a4 100644
--- a/korganizer/koeventeditor.cpp
+++ b/korganizer/koeventeditor.cpp
@@ -1,146 +1,145 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001,2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001,2002 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qtooltip.h> 24#include <qtooltip.h>
25#include <qframe.h> 25#include <qframe.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qhbox.h> 27#include <qhbox.h>
28#include <qdir.h> 28#include <qdir.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qapplication.h> 31#include <qapplication.h>
32 32
33#include <kiconloader.h> 33#include <kiconloader.h>
34#include <kstandarddirs.h> 34#include <kstandarddirs.h>
35#include <kdebug.h> 35#include <kdebug.h>
36#include <klocale.h> 36#include <klocale.h>
37#include <kfiledialog.h> 37#include <kfiledialog.h>
38#include <kmessagebox.h> 38#include <kmessagebox.h>
39#include <libkcal/calendarresources.h> 39#include <libkcal/calendarresources.h>
40#include <libkcal/resourcecalendar.h> 40#include <libkcal/resourcecalendar.h>
41#include <kresources/resourceselectdialog.h> 41#include <kresources/resourceselectdialog.h>
42 42
43#include <libkdepim/categoryselectdialog.h> 43#include <libkdepim/categoryselectdialog.h>
44#include <libkcal/calendarlocal.h> 44#include <libkcal/calendarlocal.h>
45#include <libkcal/icalformat.h> 45#include <libkcal/icalformat.h>
46 46
47#include "koprefs.h" 47#include "koprefs.h"
48 48
49#include "koeventeditor.h" 49#include "koeventeditor.h"
50#include "koeventeditor.moc"
51extern int globalFlagBlockAgenda; 50extern int globalFlagBlockAgenda;
52 51
53KOEventEditor::KOEventEditor( Calendar *calendar, QWidget *parent ) : 52KOEventEditor::KOEventEditor( Calendar *calendar, QWidget *parent ) :
54 KOIncidenceEditor( i18n("Edit Event"), calendar, parent ) 53 KOIncidenceEditor( i18n("Edit Event"), calendar, parent )
55{ 54{
56 mEvent = 0; 55 mEvent = 0;
57 init(); 56 init();
58} 57}
59 58
60KOEventEditor::~KOEventEditor() 59KOEventEditor::~KOEventEditor()
61{ 60{
62 //emit dialogClose( mEvent ); 61 //emit dialogClose( mEvent );
63} 62}
64 63
65void KOEventEditor::init() 64void KOEventEditor::init()
66{ 65{
67 66
68 setupGeneral(); 67 setupGeneral();
69 setupAttendeesTab(); 68 setupAttendeesTab();
70 setupRecurrence(); 69 setupRecurrence();
71 70
72 // Propagate date time settings to recurrence tab 71 // Propagate date time settings to recurrence tab
73 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), 72 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)),
74 mRecurrence,SLOT(setDateTimes(QDateTime,QDateTime))); 73 mRecurrence,SLOT(setDateTimes(QDateTime,QDateTime)));
75 connect(mGeneral,SIGNAL(dateTimeStrChanged(const QString &)), 74 connect(mGeneral,SIGNAL(dateTimeStrChanged(const QString &)),
76 mRecurrence,SLOT(setDateTimeStr(const QString &))); 75 mRecurrence,SLOT(setDateTimeStr(const QString &)));
77 76
78 // Category dialog 77 // Category dialog
79 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); 78 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show()));
80 //connect(mCategoryDialog,SIGNAL(categoriesSelected(const QString &)), 79 //connect(mCategoryDialog,SIGNAL(categoriesSelected(const QString &)),
81 // mGeneral,SLOT(setCategories(const QString &))); 80 // mGeneral,SLOT(setCategories(const QString &)));
82 81
83 82
84} 83}
85 84
86void KOEventEditor::reload() 85void KOEventEditor::reload()
87{ 86{
88 if ( mEvent ) readEvent( mEvent ); 87 if ( mEvent ) readEvent( mEvent );
89} 88}
90 89
91void KOEventEditor::setSecrecy( int sec ) 90void KOEventEditor::setSecrecy( int sec )
92{ 91{
93 mGeneral->setSecrecy( sec ); 92 mGeneral->setSecrecy( sec );
94} 93}
95void KOEventEditor::setCategories( QString s ) 94void KOEventEditor::setCategories( QString s )
96{ 95{
97 mGeneral->setCategories(s); 96 mGeneral->setCategories(s);
98 97
99} 98}
100void KOEventEditor::setupGeneral() 99void KOEventEditor::setupGeneral()
101{ 100{
102 mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" ); 101 mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" );
103 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); 102 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
104 103
105 if( KOPrefs::instance()->mCompactDialogs ) { 104 if( KOPrefs::instance()->mCompactDialogs ) {
106 QFrame *topFrame = addPage(i18n("General")); 105 QFrame *topFrame = addPage(i18n("General"));
107 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 106 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
108 topLayout->setSpacing(spacingHint()-1); 107 topLayout->setSpacing(spacingHint()-1);
109 topLayout->setMargin(marginHint()-1); 108 topLayout->setMargin(marginHint()-1);
110 mGeneral->initHeader(topFrame,topLayout); 109 mGeneral->initHeader(topFrame,topLayout);
111 mGeneral->initTime(topFrame,topLayout); 110 mGeneral->initTime(topFrame,topLayout);
112// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 111// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
113 mGeneral->initAlarm(topFrame,topLayout); 112 mGeneral->initAlarm(topFrame,topLayout);
114 mGeneral->enableAlarm( false ); 113 mGeneral->enableAlarm( false );
115 114
116 QBoxLayout *buttonLayout; 115 QBoxLayout *buttonLayout;
117 if ( QApplication::desktop()->width() < 500 ) 116 if ( QApplication::desktop()->width() < 500 )
118 buttonLayout = new QVBoxLayout( topLayout ); 117 buttonLayout = new QVBoxLayout( topLayout );
119 else 118 else
120 buttonLayout = new QHBoxLayout( topLayout ); 119 buttonLayout = new QHBoxLayout( topLayout );
121 QHBox* buttonWidget = new QHBox (topFrame); 120 QHBox* buttonWidget = new QHBox (topFrame);
122 QIconSet icon; 121 QIconSet icon;
123 if ( QApplication::desktop()->width() < 321 ) 122 if ( QApplication::desktop()->width() < 321 )
124 icon = SmallIcon("fileexport16"); 123 icon = SmallIcon("fileexport16");
125 else 124 else
126 icon = SmallIcon("fileexport"); 125 icon = SmallIcon("fileexport");
127 QPushButton * loadTemplate = new QPushButton( buttonWidget); 126 QPushButton * loadTemplate = new QPushButton( buttonWidget);
128 QPushButton * saveTemplate = new QPushButton( buttonWidget); 127 QPushButton * saveTemplate = new QPushButton( buttonWidget);
129 saveTemplate->setIconSet (icon ) ; 128 saveTemplate->setIconSet (icon ) ;
130 int size = saveTemplate->sizeHint().height(); 129 int size = saveTemplate->sizeHint().height();
131 saveTemplate->setFixedSize( size, size ); 130 saveTemplate->setFixedSize( size, size );
132 if ( QApplication::desktop()->width() < 321 ) 131 if ( QApplication::desktop()->width() < 321 )
133 icon = SmallIcon("fileimport16"); 132 icon = SmallIcon("fileimport16");
134 else 133 else
135 icon = SmallIcon("fileimport"); 134 icon = SmallIcon("fileimport");
136 loadTemplate->setIconSet (icon ) ; 135 loadTemplate->setIconSet (icon ) ;
137 loadTemplate->setFixedSize( size, size ); 136 loadTemplate->setFixedSize( size, size );
138 buttonLayout->addWidget( buttonWidget ); 137 buttonLayout->addWidget( buttonWidget );
139 mGeneral->initCategories( topFrame, buttonLayout ); 138 mGeneral->initCategories( topFrame, buttonLayout );
140 139
141 topLayout->addStretch( 1 ); 140 topLayout->addStretch( 1 );
142 141
143 QFrame *topFrame2 = addPage(i18n("Details")); 142 QFrame *topFrame2 = addPage(i18n("Details"));
144 143
145 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); 144 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2);
146 topLayout2->setSpacing(spacingHint()); 145 topLayout2->setSpacing(spacingHint());