summaryrefslogtreecommitdiff
authorzecke <zecke>2002-06-26 20:41:06 (UTC)
committer zecke <zecke>2002-06-26 20:41:06 (UTC)
commita078163b38383870dd5a659c1f0964e1238867b3 (patch) (side-by-side diff)
tree68a517f1adc23cc0fa70b979fe772bcaa53790ab
parentc229565c40d478555a9ed0aa4910b9ab8181884c (diff)
downloadopie-a078163b38383870dd5a659c1f0964e1238867b3.zip
opie-a078163b38383870dd5a659c1f0964e1238867b3.tar.gz
opie-a078163b38383870dd5a659c1f0964e1238867b3.tar.bz2
OFileSelector is now a complete drop in replacement
of the QPE fileselector
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie/ofileselector.cc36
1 files changed, 30 insertions, 6 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index 98290e0..824acf2 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -126,5 +126,5 @@ OFileSelector::OFileSelector(const QString &mimeFilter, QWidget *parent,
initVars();
m_currentDir = QPEApplication::documentDir();
- m_mode = OPEN;
+ m_mode = FILESELECTOR;
m_selector = NORMAL;
m_shClose = closeVisible;
@@ -156,4 +156,6 @@ void OFileSelector::setNewVisible( bool visible )
connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ),
this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
+ connect(m_select, SIGNAL(closeMe() ),
+ this, SIGNAL(closeMe() ) );
//connect to close me and other signals as well
m_stack->addWidget( m_select, NORMAL );
@@ -436,7 +438,9 @@ void OFileSelector::slotViewCheck(const QString &sel)
m_select = new FileSelector(mime,
m_stack, "fileselector",
- FALSE, FALSE);
+ m_shNew, m_shClose);
connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ),
this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
+ connect(m_select, SIGNAL(closeMe() ),
+ this, SIGNAL(closeMe() ) );
//connect to close me and other signals as well
@@ -495,8 +499,10 @@ void OFileSelector::slotMimeCheck(const QString &mime)
m_select = new FileSelector( newMimeType,
m_stack, "fileselector",
- FALSE, FALSE);
+ m_shNew, m_shClose);
connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ),
this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
+ connect(m_select, SIGNAL(closeMe() ),
+ this, SIGNAL(closeMe() ) );
//connect to close me and other signals as well
m_stack->addWidget( m_select, NORMAL );
@@ -561,8 +567,10 @@ void OFileSelector::init()
m_select = new FileSelector(mime,
m_stack, "fileselector",
- FALSE, FALSE);
+ m_shNew, m_shClose);
connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ),
this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
+ connect(m_select, SIGNAL(closeMe() ),
+ this, SIGNAL( closeMe() ) );
//connect to close me and other signals as well
@@ -875,6 +883,6 @@ void OFileSelector::initializeListView()
if(!m_shClose )
m_close->hide();
- if(!m_shNew)
- m_close->hide();
+ //if(!m_shNew)
+ //m_close->hide();
} // off toolbar
@@ -1023,7 +1031,16 @@ void OFileSelector::slotCurrentChanged(QListViewItem* item )
if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ) {
OFileSelectorItem *sel = (OFileSelectorItem*) item; // start to use the C++ casts ;)
+ qWarning("current changed");
if(!sel->isDir() ){
if( m_shLne )
m_edit->setText( sel->text(1) );
+
+ if (m_mode == FILESELECTOR ) {
+ QStringList str = QStringList::split("->", sel->text(1) );
+ QString path =sel->directory() + "/" + str[0].stripWhiteSpace();
+ emit fileSelected(path );
+ DocLnk lnk( path );
+ emit fileSelected(lnk );
+ }
}
}
@@ -1051,5 +1068,9 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &
if( m_shLne )
m_edit->setText( str[0].stripWhiteSpace() );
+ qWarning("selected here in slot clicked");
emit fileSelected( sel->directory() + "/" + str[0].stripWhiteSpace() );
+ DocLnk lnk( sel->directory() + "/" + str[0].stripWhiteSpace() );
+ qWarning("file selected");
+ emit fileSelected( lnk );
}
}
@@ -1085,4 +1106,7 @@ void OFileSelector::slotOpen()
QStringList str = QStringList::split("->", sel->text(1) );
slotFileSelected( sel->directory() +"/" +str[0].stripWhiteSpace() );
+ qWarning("slot open");
+ // DocLnk lnk( sel->directory() + "/" + str[0].stripWhiteSpace() );
+ //emit fileSelected( lnk );
}
}