summaryrefslogtreecommitdiff
path: root/libopie
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 /libopie
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 (limited to 'libopie') (more/less context) (ignore 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
@@ -127,3 +127,3 @@ OFileSelector::OFileSelector(const QString &mimeFilter, QWidget *parent,
m_currentDir = QPEApplication::documentDir();
- m_mode = OPEN;
+ m_mode = FILESELECTOR;
m_selector = NORMAL;
@@ -157,2 +157,4 @@ void OFileSelector::setNewVisible( bool visible )
this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
+ connect(m_select, SIGNAL(closeMe() ),
+ this, SIGNAL(closeMe() ) );
//connect to close me and other signals as well
@@ -437,5 +439,7 @@ void OFileSelector::slotViewCheck(const QString &sel)
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
@@ -496,3 +500,3 @@ void OFileSelector::slotMimeCheck(const QString &mime)
m_stack, "fileselector",
- FALSE, FALSE);
+ m_shNew, m_shClose);
@@ -500,2 +504,4 @@ void OFileSelector::slotMimeCheck(const QString &mime)
this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
+ connect(m_select, SIGNAL(closeMe() ),
+ this, SIGNAL(closeMe() ) );
//connect to close me and other signals as well
@@ -562,3 +568,3 @@ void OFileSelector::init()
m_stack, "fileselector",
- FALSE, FALSE);
+ m_shNew, m_shClose);
@@ -566,2 +572,4 @@ void OFileSelector::init()
this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
+ connect(m_select, SIGNAL(closeMe() ),
+ this, SIGNAL( closeMe() ) );
//connect to close me and other signals as well
@@ -876,4 +884,4 @@ void OFileSelector::initializeListView()
m_close->hide();
- if(!m_shNew)
- m_close->hide();
+ //if(!m_shNew)
+ //m_close->hide();
@@ -1024,2 +1032,3 @@ void OFileSelector::slotCurrentChanged(QListViewItem* item )
OFileSelectorItem *sel = (OFileSelectorItem*) item; // start to use the C++ casts ;)
+ qWarning("current changed");
if(!sel->isDir() ){
@@ -1027,2 +1036,10 @@ void OFileSelector::slotCurrentChanged(QListViewItem* item )
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 );
+ }
}
@@ -1052,3 +1069,7 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &
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 );
}
@@ -1086,2 +1107,5 @@ void OFileSelector::slotOpen()
slotFileSelected( sel->directory() +"/" +str[0].stripWhiteSpace() );
+ qWarning("slot open");
+ // DocLnk lnk( sel->directory() + "/" + str[0].stripWhiteSpace() );
+ //emit fileSelected( lnk );
}