26 #include "importdialog.h"
29 #include "stdcalendar.h"
31 #include <tdelocale.h>
35 #include <tqradiobutton.h>
36 #include <tqbuttongroup.h>
40 ImportDialog::ImportDialog( const KURL &url, TQWidget *parent, bool isPart )
41 : KDialogBase( Plain, i18n( "Import Calendar/Event"), Ok | Cancel, Ok, parent,
45 TQFrame *topFrame = plainPage();
46 TQVBoxLayout *topLayout = new TQVBoxLayout( topFrame, 0, spacingHint() );
48 TQString txt = i18n( "Import calendar/event at '%1' into KOrganizer.")
49 .arg( mUrl.prettyURL() );
51 topLayout->addWidget( new TQLabel( txt, topFrame ) );
53 TQButtonGroup *radioBox = new TQButtonGroup( 1, TQt::Horizontal, topFrame );
54 radioBox->setFlat( true );
55 topLayout->addWidget( radioBox );
57 mAddButton = new TQRadioButton( i18n( "Add as new calendar"), radioBox );
59 mMergeButton = new TQRadioButton( i18n( "Merge into existing calendar"),
62 mOpenButton = isPart ? 0 : new TQRadioButton( i18n( "Open in separate window"), radioBox );
64 mAddButton->setChecked( true );
67 ImportDialog::~ImportDialog()
71 void ImportDialog::slotOk()
73 kdDebug(5850) << "Adding resource for url '" << mUrl << "'" << endl;
75 if ( mAddButton->isChecked() ) {
76 emit addResource( mUrl );
77 } else if ( mMergeButton->isChecked() ) {
79 emit openURL( mUrl, true );
80 } else if ( mOpenButton && mOpenButton->isChecked() ) {
82 emit newWindow( mUrl );
84 kdError() << "ImportDialog: internal error." << endl;
87 emit dialogFinished( this );
92 #include "importdialog.moc"
|