author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/koeventeditor.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'korganizer/koeventeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventeditor.cpp | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp index 3e87197..62ad250 100644 --- a/korganizer/koeventeditor.cpp +++ b/korganizer/koeventeditor.cpp @@ -9,40 +9,45 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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 <qhbox.h> +#include <q3hbox.h> #include <qtimer.h> #include <qdir.h> #include <qlayout.h> -#include <qwidgetstack.h> +#include <q3widgetstack.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3PtrList> +#include <Q3VBoxLayout> #include <kiconloader.h> #include <kstandarddirs.h> #include <kdebug.h> #include <klocale.h> #include <kfiledialog.h> #include <kmessagebox.h> #include <libkcal/calendarresources.h> #include <libkcal/resourcecalendar.h> #include <kresources/resourceselectdialog.h> #include <libkdepim/categoryselectdialog.h> #include <libkcal/calendarlocal.h> #include <libkcal/icalformat.h> #include "koprefs.h" @@ -92,111 +97,111 @@ void KOEventEditor::reload() void KOEventEditor::setSecrecy( int sec ) { mGeneral->setSecrecy( sec ); } void KOEventEditor::setCategories( QString s ) { mGeneral->setCategories(s); } void KOEventEditor::setupGeneral() { mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" ); connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); if( KOPrefs::instance()->mCompactDialogs ) { - QFrame *topFrame = addPage(i18n("General")); - QBoxLayout *topLayout = new QVBoxLayout(topFrame); + Q3Frame *topFrame = addPage(i18n("General")); + Q3BoxLayout *topLayout = new Q3VBoxLayout(topFrame); topLayout->setSpacing(spacingHint()-1); topLayout->setMargin(marginHint()-1); topLayout->addStretch ( 1 ); mGeneral->initHeader(topFrame,topLayout); topLayout->addStretch ( 1 ); mGeneral->initTime(topFrame,topLayout); topLayout->addStretch ( 1 ); // QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); mGeneral->initAlarm(topFrame,topLayout); topLayout->addStretch ( 1 ); mGeneral->enableAlarm( false ); - QBoxLayout *buttonLayout; + Q3BoxLayout *buttonLayout; if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 ) - buttonLayout = new QVBoxLayout( topLayout ); + buttonLayout = new Q3VBoxLayout( topLayout ); else - buttonLayout = new QHBoxLayout( topLayout ); - QHBox* buttonWidget = new QHBox (topFrame); - QIconSet icon; + buttonLayout = new Q3HBoxLayout( topLayout ); + Q3HBox* buttonWidget = new Q3HBox (topFrame); + QIcon icon; if ( QApplication::desktop()->width() < 321 ) icon = SmallIcon("fileexport16"); else icon = SmallIcon("fileexport"); QPushButton * loadTemplate = new QPushButton( buttonWidget); QPushButton * saveTemplate = new QPushButton( buttonWidget); saveTemplate->setIconSet (icon ) ; int size = saveTemplate->sizeHint().height(); saveTemplate->setFixedSize( size, size ); if ( QApplication::desktop()->width() < 321 ) icon = SmallIcon("fileimport16"); else icon = SmallIcon("fileimport"); loadTemplate->setIconSet (icon ) ; loadTemplate->setFixedSize( size, size ); buttonLayout->addWidget( buttonWidget ); mGeneral->initCategories( topFrame, buttonLayout ); topLayout->addStretch( 1 ); - QFrame *topFrame2 = addPage(i18n("Details")); + Q3Frame *topFrame2 = addPage(i18n("Details")); - QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); + Q3BoxLayout *topLayout2 = new Q3VBoxLayout(topFrame2); topLayout2->setSpacing(spacingHint()-1); topLayout2->setMargin(marginHint()-1); topLayout2->setSpacing(spacingHint()); mGeneral->initClass(topFrame2,topLayout2); mGeneral->initSecrecy( topFrame2, topLayout2 ); mGeneral->initDescription(topFrame2,topLayout2); 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); - QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); + Q3BoxLayout *alarmLineLayout = new Q3HBoxLayout(topLayout); mGeneral->initAlarm(topFrame,alarmLineLayout); mGeneral->initClass(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 KOEventEditor::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 KOEventEditor::editEvent(Event *event, bool showDescription) { // init(); mEvent = event; readEvent(mEvent); if ( showDescription ) { showPage( 1 ); mGeneral->setFocusOn( 1 ); } else { showPage( 0 ); @@ -343,33 +348,33 @@ void KOEventEditor::slotLoadTemplate() QString fileName =locateLocal( "templates", "events" ); QDir t_dir; if ( !t_dir.exists(fileName) ) t_dir.mkdir ( fileName ); fileName += "/event"; fileName = KFileDialog::getOpenFileName( fileName , i18n("Load Event 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<Event> events = cal.events(); + Q3PtrList<Event> events = cal.events(); Event* event = events.first(); if ( !event ) { KMessageBox::error( this, i18n("Template does not contain\na valid Event.")); } else { kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl; readEvent( event, true ); } } void KOEventEditor::slotSaveTemplate() { QString fileName =locateLocal( "templates", "events" ); QDir t_dir; if ( !t_dir.exists(fileName) ) |