29 #include "folderrequester.h"
31 #include "kmfoldertree.h"
32 #include "kmfolderseldlg.h"
35 #include <klineedit.h>
36 #include <kiconloader.h>
40 #include <tqtoolbutton.h>
45 : TQWidget( parent ), mFolder( 0 ), mFolderTree( tree ),
46 mMustBeReadWrite( true ), mShowOutbox( true ), mShowImapFolders( true )
48 TQHBoxLayout * hlay =
new TQHBoxLayout(
this, 0, KDialog::spacingHint() );
49 hlay->setAutoAdd(
true );
51 edit =
new KLineEdit(
this );
52 edit->setReadOnly(
true );
54 TQToolButton* button =
new TQToolButton(
this );
55 button->setIconSet( TDEGlobal::iconLoader()->loadIconSet(
"folder", TDEIcon::Small, 0 ) );
56 connect( button, TQ_SIGNAL(clicked()),
this, TQ_SLOT(
slotOpenDialog()) );
58 setSizePolicy( TQSizePolicy( TQSizePolicy::MinimumExpanding,
59 TQSizePolicy::Fixed ) );
60 setFocusPolicy( TQWidget::StrongFocus );
66 KMFolderSelDlg dlg(
this, mFolderTree, i18n(
"Select Folder"),
67 mMustBeReadWrite,
false );
68 dlg.setFlags( mMustBeReadWrite, mShowOutbox, mShowImapFolders );
69 dlg.setFolder( mFolder );
71 if (!dlg.exec())
return;
76 FolderRequester::~FolderRequester()
94 else if ( !mMustBeReadWrite )
95 edit->setText( i18n(
"Local Folders") );
106 if ( !idString.isEmpty() ) {
107 edit->setText( i18n(
"Unknown folder '%1'" ).arg( idString ) );
109 edit->setText( i18n(
"Please select a folder" ) );
113 mFolderId = idString;
119 if ( e->key() == TQt::Key_Space )
127 #include "folderrequester.moc"
TQString idString() const
Returns a string that can be used to identify this folder.
virtual TQString prettyURL() const
URL of the node for visualization purposes.
FolderRequester(TQWidget *parent, KMFolderTree *tree)
Constructor.
KMFolder * folder(void) const
Returns selected folder.
virtual void keyPressEvent(TQKeyEvent *e)
Capture space key to open the dialog.
void setFolder(KMFolder *)
Preset the folder.
void slotOpenDialog()
Open the folder dialog.
void folderChanged(KMFolder *)
Emitted when the folder changed.