summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventeditor.cpp
Unidiff
Diffstat (limited to 'korganizer/koeventeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventeditor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp
index e23e680..02d4a78 100644
--- a/korganizer/koeventeditor.cpp
+++ b/korganizer/koeventeditor.cpp
@@ -9,156 +9,158 @@
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"
50extern int globalFlagBlockAgenda; 50extern int globalFlagBlockAgenda;
51 51
52KOEventEditor::KOEventEditor( Calendar *calendar, QWidget *parent ) : 52KOEventEditor::KOEventEditor( Calendar *calendar, QWidget *parent ) :
53 KOIncidenceEditor( i18n("Edit Event"), calendar, parent ) 53 KOIncidenceEditor( i18n("Edit Event"), calendar, parent )
54{ 54{
55 mEvent = 0; 55 mEvent = 0;
56 init(); 56 init();
57 if ( QApplication::desktop()->height() <= 240 )
58 hideButtons();
57} 59}
58 60
59KOEventEditor::~KOEventEditor() 61KOEventEditor::~KOEventEditor()
60{ 62{
61 //emit dialogClose( mEvent ); 63 //emit dialogClose( mEvent );
62} 64}
63 65
64void KOEventEditor::init() 66void KOEventEditor::init()
65{ 67{
66 68
67 setupGeneral(); 69 setupGeneral();
68 setupAttendeesTab(); 70 setupAttendeesTab();
69 setupRecurrence(); 71 setupRecurrence();
70 72
71 // Propagate date time settings to recurrence tab 73 // Propagate date time settings to recurrence tab
72 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), 74 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)),
73 mRecurrence,SLOT(setDateTimes(QDateTime,QDateTime))); 75 mRecurrence,SLOT(setDateTimes(QDateTime,QDateTime)));
74 connect(mGeneral,SIGNAL(dateTimeStrChanged(const QString &)), 76 connect(mGeneral,SIGNAL(dateTimeStrChanged(const QString &)),
75 mRecurrence,SLOT(setDateTimeStr(const QString &))); 77 mRecurrence,SLOT(setDateTimeStr(const QString &)));
76 78
77 // Category dialog 79 // Category dialog
78 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); 80 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show()));
79 //connect(mCategoryDialog,SIGNAL(categoriesSelected(const QString &)), 81 //connect(mCategoryDialog,SIGNAL(categoriesSelected(const QString &)),
80 // mGeneral,SLOT(setCategories(const QString &))); 82 // mGeneral,SLOT(setCategories(const QString &)));
81 83
82 84
83} 85}
84 86
85void KOEventEditor::reload() 87void KOEventEditor::reload()
86{ 88{
87 if ( mEvent ) readEvent( mEvent ); 89 if ( mEvent ) readEvent( mEvent );
88} 90}
89 91
90void KOEventEditor::setSecrecy( int sec ) 92void KOEventEditor::setSecrecy( int sec )
91{ 93{
92 mGeneral->setSecrecy( sec ); 94 mGeneral->setSecrecy( sec );
93} 95}
94void KOEventEditor::setCategories( QString s ) 96void KOEventEditor::setCategories( QString s )
95{ 97{
96 mGeneral->setCategories(s); 98 mGeneral->setCategories(s);
97 99
98} 100}
99void KOEventEditor::setupGeneral() 101void KOEventEditor::setupGeneral()
100{ 102{
101 mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" ); 103 mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" );
102 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); 104 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
103 105
104 if( KOPrefs::instance()->mCompactDialogs ) { 106 if( KOPrefs::instance()->mCompactDialogs ) {
105 QFrame *topFrame = addPage(i18n("General")); 107 QFrame *topFrame = addPage(i18n("General"));
106 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 108 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
107 topLayout->setSpacing(spacingHint()-1); 109 topLayout->setSpacing(spacingHint()-1);
108 topLayout->setMargin(marginHint()-1); 110 topLayout->setMargin(marginHint()-1);
109 mGeneral->initHeader(topFrame,topLayout); 111 mGeneral->initHeader(topFrame,topLayout);
110 mGeneral->initTime(topFrame,topLayout); 112 mGeneral->initTime(topFrame,topLayout);
111// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 113// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
112 mGeneral->initAlarm(topFrame,topLayout); 114 mGeneral->initAlarm(topFrame,topLayout);
113 mGeneral->enableAlarm( false ); 115 mGeneral->enableAlarm( false );
114 116
115 QBoxLayout *buttonLayout; 117 QBoxLayout *buttonLayout;
116 if ( QApplication::desktop()->width() < 500 ) 118 if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 )
117 buttonLayout = new QVBoxLayout( topLayout ); 119 buttonLayout = new QVBoxLayout( topLayout );
118 else 120 else
119 buttonLayout = new QHBoxLayout( topLayout ); 121 buttonLayout = new QHBoxLayout( topLayout );
120 QHBox* buttonWidget = new QHBox (topFrame); 122 QHBox* buttonWidget = new QHBox (topFrame);
121 QIconSet icon; 123 QIconSet icon;
122 if ( QApplication::desktop()->width() < 321 ) 124 if ( QApplication::desktop()->width() < 321 )
123 icon = SmallIcon("fileexport16"); 125 icon = SmallIcon("fileexport16");
124 else 126 else
125 icon = SmallIcon("fileexport"); 127 icon = SmallIcon("fileexport");
126 QPushButton * loadTemplate = new QPushButton( buttonWidget); 128 QPushButton * loadTemplate = new QPushButton( buttonWidget);
127 QPushButton * saveTemplate = new QPushButton( buttonWidget); 129 QPushButton * saveTemplate = new QPushButton( buttonWidget);
128 saveTemplate->setIconSet (icon ) ; 130 saveTemplate->setIconSet (icon ) ;
129 int size = saveTemplate->sizeHint().height(); 131 int size = saveTemplate->sizeHint().height();
130 saveTemplate->setFixedSize( size, size ); 132 saveTemplate->setFixedSize( size, size );
131 if ( QApplication::desktop()->width() < 321 ) 133 if ( QApplication::desktop()->width() < 321 )
132 icon = SmallIcon("fileimport16"); 134 icon = SmallIcon("fileimport16");
133 else 135 else
134 icon = SmallIcon("fileimport"); 136 icon = SmallIcon("fileimport");
135 loadTemplate->setIconSet (icon ) ; 137 loadTemplate->setIconSet (icon ) ;
136 loadTemplate->setFixedSize( size, size ); 138 loadTemplate->setFixedSize( size, size );
137 buttonLayout->addWidget( buttonWidget ); 139 buttonLayout->addWidget( buttonWidget );
138 mGeneral->initCategories( topFrame, buttonLayout ); 140 mGeneral->initCategories( topFrame, buttonLayout );
139 141
140 topLayout->addStretch( 1 ); 142 topLayout->addStretch( 1 );
141 143
142 QFrame *topFrame2 = addPage(i18n("Details")); 144 QFrame *topFrame2 = addPage(i18n("Details"));
143 145
144 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); 146 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2);
145 topLayout2->setSpacing(spacingHint()); 147 topLayout2->setSpacing(spacingHint());
146 148
147 mGeneral->initClass(topFrame2,topLayout2); 149 mGeneral->initClass(topFrame2,topLayout2);
148 mGeneral->initSecrecy( topFrame2, topLayout2 ); 150 mGeneral->initSecrecy( topFrame2, topLayout2 );
149 mGeneral->initDescription(topFrame2,topLayout2); 151 mGeneral->initDescription(topFrame2,topLayout2);
150 152
151 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 153 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
152 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); 154 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
153 } else { 155 } else {
154 QFrame *topFrame = addPage(i18n("General")); 156 QFrame *topFrame = addPage(i18n("General"));
155 157
156 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 158 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
157 topLayout->setSpacing(spacingHint()); 159 topLayout->setSpacing(spacingHint());
158 160
159 mGeneral->initHeader(topFrame,topLayout); 161 mGeneral->initHeader(topFrame,topLayout);
160 mGeneral->initTime(topFrame,topLayout); 162 mGeneral->initTime(topFrame,topLayout);
161 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 163 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
162 mGeneral->initAlarm(topFrame,alarmLineLayout); 164 mGeneral->initAlarm(topFrame,alarmLineLayout);
163 mGeneral->initClass(topFrame,alarmLineLayout); 165 mGeneral->initClass(topFrame,alarmLineLayout);
164 mGeneral->initDescription(topFrame,topLayout); 166 mGeneral->initDescription(topFrame,topLayout);