Diffstat (limited to 'korganizer/filtereditdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/filtereditdialog.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/korganizer/filtereditdialog.cpp b/korganizer/filtereditdialog.cpp index df84911..a3cff49 100644 --- a/korganizer/filtereditdialog.cpp +++ b/korganizer/filtereditdialog.cpp @@ -1,115 +1,120 @@ /* This file is part of KOrganizer. Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 <qlayout.h> #include <qpushbutton.h> #include <qcombobox.h> #include <qcheckbox.h> #include <qradiobutton.h> -#include <qlistbox.h> +#include <q3listbox.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3PtrList> + +#include <QDesktopWidget> #include <kdebug.h> #include <klocale.h> #include <klineeditdlg.h> #include <kmessagebox.h> #include <libkdepim/categoryselectdialog.h> #include "koprefs.h" #include "filteredit_base.h" #include "filtereditdialog.h" //#include "filtereditdialog.moc" // TODO: Make dialog work on a copy of the filters objects. class ComboFilterBox: public QComboBox { public: ComboFilterBox( QWidget *parent=0, const char *name=0) : QComboBox( parent,name ) { } void popupBox() { popup(); } }; -FilterEditDialog::FilterEditDialog(QPtrList<CalFilter> *filters,QWidget *parent, +FilterEditDialog::FilterEditDialog(Q3PtrList<CalFilter> *filters,QWidget *parent, const char *name) : KDialogBase(parent,name,true,i18n("Edit Calendar Filters"), Ok|Apply|Cancel) { mFilters = filters; QWidget *mainWidget = new QWidget(this); setMainWidget(mainWidget); mSelectionCombo = new ComboFilterBox(mainWidget); connect(mSelectionCombo,SIGNAL(activated(int)),SLOT(filterSelected())); // mSelectionCombo->setEditable ( true ); QPushButton *addButton = new QPushButton(i18n("Add Filter"),mainWidget); connect(addButton,SIGNAL(clicked()),SLOT(slotAdd())); addButton->setMaximumSize( addButton->sizeHint()); mRemoveButton = new QPushButton( i18n("Remove"), mainWidget ); connect( mRemoveButton, SIGNAL( clicked() ), SLOT( slotRemove() ) ); mRemoveButton->setMaximumSize( mRemoveButton->sizeHint()); QPushButton *upButton = new QPushButton(i18n("Up"),mainWidget); upButton->setMaximumSize( upButton->sizeHint()); connect(upButton,SIGNAL(clicked()),SLOT(slotUp())); mEditor = new FilterEdit_base(mainWidget); - QGridLayout *topLayout = new QGridLayout(mainWidget,2,2); + Q3GridLayout *topLayout = new Q3GridLayout(mainWidget,2,2); topLayout->setSpacing(spacingHint()); topLayout->addWidget(mSelectionCombo,0,0); topLayout->addWidget(upButton,0,1); topLayout->addWidget(addButton,0,2); topLayout->addWidget(mRemoveButton,0,3); topLayout->addMultiCellWidget(mEditor,1,1,0,3); mSelectionCombo->setMaximumWidth ( QApplication::desktop()->width() - addButton->maximumWidth() - mRemoveButton->maximumWidth() - upButton->maximumWidth() - spacingHint() * 5 ); connect(mEditor->mCatEditButton,SIGNAL(clicked()), SLOT(editCategorySelection())); // Clicking cancel exits the dialog without saving connect(this,SIGNAL(cancelClicked()),SLOT(reject())); updateFilterList(); } FilterEditDialog::~FilterEditDialog() { } void FilterEditDialog::slotUp() { if ( mFilters->count() <= 1 ) return; if ( mSelectionCombo->currentItem() == 0 ) return; int num = mSelectionCombo->currentItem(); CalFilter* f = new CalFilter( ); *f = *(mFilters->at( num )); mFilters->remove( num ); mFilters->insert( num-1, f ); |