author | zautrix <zautrix> | 2005-02-05 12:03:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-05 12:03:42 (UTC) |
commit | f5902d0e08e0b10321c555e8846a8a8ce2087d30 (patch) (side-by-side diff) | |
tree | 5aeaa9689b3161867fb0c8707adc5908b5072f06 /microkde | |
parent | 86c0d35262454a31ed7d50d3e20cbdace954ebdf (diff) | |
download | kdepimpi-f5902d0e08e0b10321c555e8846a8a8ce2087d30.zip kdepimpi-f5902d0e08e0b10321c555e8846a8a8ce2087d30.tar.gz kdepimpi-f5902d0e08e0b10321c555e8846a8a8ce2087d30.tar.bz2 |
file selector fix
-rw-r--r-- | microkde/kfiledialog.cpp | 2 | ||||
-rw-r--r-- | microkde/ofileselector_p.cpp | 28 | ||||
-rw-r--r-- | microkde/ofileselector_p.h | 1 |
3 files changed, 30 insertions, 1 deletions
diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp index 977499e..309f8dc 100644 --- a/microkde/kfiledialog.cpp +++ b/microkde/kfiledialog.cpp @@ -24,2 +24,3 @@ QString KFileDialog::getSaveFileName( const QString & fn, OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); + QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); lay.addWidget( &o); @@ -49,2 +50,3 @@ QString KFileDialog::getOpenFileName( const QString & fn, OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); + QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); lay.addWidget( &o); diff --git a/microkde/ofileselector_p.cpp b/microkde/ofileselector_p.cpp index fd5f965..f85f8f4 100644 --- a/microkde/ofileselector_p.cpp +++ b/microkde/ofileselector_p.cpp @@ -387,2 +387,3 @@ OFileSelector* OFileViewFileListView::selector() { bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) { +#if 0 if ( e->type() == QEvent::KeyPress ) { @@ -394,2 +395,3 @@ bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) { } +#endif return false; @@ -403,2 +405,6 @@ void OFileViewFileListView::connectSlots() { this, SLOT(slotClicked(int, QListViewItem*, const QPoint&, int ) ) ); + connect(m_view, SIGNAL(doubleClicked( QListViewItem* )), + this, SLOT(slotDoubleClicked(QListViewItem* ) ) ); + connect(m_view, SIGNAL(returnPressed( QListViewItem* )), + this, SLOT(slotDoubleClicked(QListViewItem* ) ) ); } @@ -425,2 +431,22 @@ void OFileViewFileListView::slotCurrentChanged( QListViewItem* item) { } +void OFileViewFileListView::slotDoubleClicked(QListViewItem* item ) { + if (!item ) return; + OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); + if (!sel->isLocked() ) { + QStringList str = QStringList::split("->", sel->text(1) ); + if (sel->isDir() ) { + m_currentDir = sel->directory() + "/" + str[0].stripWhiteSpace(); + emit selector()->dirSelected( m_currentDir ); + reread( m_all ); + }else { // file + //qWarning("slot Clicked"); + selector()->m_lneEdit->setText( str[0].stripWhiteSpace() ); + QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); + emit selector()->fileSelected( path ); + DocLnk lnk( path ); + emit selector()->fileSelected( lnk ); + emit selector()->ok(); + } + } // not locked +} void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const QPoint&, int ) { @@ -437,3 +463,3 @@ void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const }else { // file - qWarning("slot Clicked"); + //qWarning("slot Clicked"); selector()->m_lneEdit->setText( str[0].stripWhiteSpace() ); diff --git a/microkde/ofileselector_p.h b/microkde/ofileselector_p.h index b371806..834fd70 100644 --- a/microkde/ofileselector_p.h +++ b/microkde/ofileselector_p.h @@ -128,2 +128,3 @@ private slots: void slotClicked(int, QListViewItem*, const QPoint&, int ); + void slotDoubleClicked(QListViewItem*); void slotFSActivated(int); |