summaryrefslogtreecommitdiff
path: root/libopie/ofileselector/ofileselector.cpp
authorzecke <zecke>2002-10-05 22:20:57 (UTC)
committer zecke <zecke>2002-10-05 22:20:57 (UTC)
commit99425255c4afcd75ee6b2f903487cb958d3acdee (patch) (side-by-side diff)
tree8cce0b096ce9a000291044def444f30934c79888 /libopie/ofileselector/ofileselector.cpp
parent94180a2019a945e6a492405dc6a30420c760529f (diff)
downloadopie-99425255c4afcd75ee6b2f903487cb958d3acdee.zip
opie-99425255c4afcd75ee6b2f903487cb958d3acdee.tar.gz
opie-99425255c4afcd75ee6b2f903487cb958d3acdee.tar.bz2
So now switching is about to be implemented the next commit will have a completed OListe/OFileView switch
Diffstat (limited to 'libopie/ofileselector/ofileselector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector/ofileselector.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/libopie/ofileselector/ofileselector.cpp b/libopie/ofileselector/ofileselector.cpp
index 458d432..91a510f 100644
--- a/libopie/ofileselector/ofileselector.cpp
+++ b/libopie/ofileselector/ofileselector.cpp
@@ -31,12 +31,13 @@
#include "ofileview.h"
#include "ofileselectormain.h"
#include "ofileselector.h"
#include "olocallister.h"
#include "olister.h"
+#include "odefaultfactories.h"
QMap<QString,QPixmap> *OFileSelector::m_pixmaps = 0;
namespace {
/* let's find the index for a specified string */
int indexByString( const QComboBox *box, const QString &str ){
@@ -294,15 +295,13 @@ QStringList OFileSelector::selectedNames()const
*/
QString OFileSelector::selectedPath()const
{
QString path;
if( m_selector == Normal ){
path = QPEApplication::documentDir();
- } /*else if( m_selector == Extended || m_selector == ExtendedAll ){
- ;
- }*/
+ } /* normal case to do */
return path;
}
QStringList OFileSelector::selectedPaths() const
{
QStringList list;
list << selectedPath();
@@ -369,21 +368,14 @@ void OFileSelector::slotCancel()
void OFileSelector::slotViewCheck(const QString &sel)
{
if( sel == tr("Documents" ) ){
initializeOldSelector();
m_selector = Normal;
- }else if( sel == tr("Files") ){
- m_selector = Extended;
-
- // FIXME call the factory
- //reparse();
- }else if( sel == tr("All Files") ){
- m_selector = ExtendedAll;
-/* see above
- reparse(); */
+ }else {
+;
}
}
QString OFileSelector::currentMimeType() const{
QString mime;
QString currentText;
@@ -471,12 +463,13 @@ void OFileSelector::locationComboChanged()
cd( m_location->lineEdit()->text() );
reparse();
}
void OFileSelector::init()
{
+ initFactory();
m_lay = new QVBoxLayout( this );
m_lay->setSpacing(0 );
/* take care of the main view... */
initToolbar();
@@ -650,16 +643,12 @@ void OFileSelector::initializeChooser()
m_boxView = new QHBox( this );
m_viewCheck = new QComboBox( m_boxView, "view check");
m_mimeCheck = new QComboBox( m_boxView, "mime check");
m_boxView->setSpacing( 8 );
m_lay->addWidget(m_boxView, 0 );
- m_viewCheck->insertItem( tr("Documents") );
- m_viewCheck->insertItem( tr("Files") );
- m_viewCheck->insertItem( tr("All Files") );
- /* update to custom views */
updateMimeCheck();
connect( m_viewCheck, SIGNAL( activated(const QString & ) ),
this, SLOT( slotViewCheck(const QString & ) ) );
connect( m_mimeCheck, SIGNAL( activated(const QString & ) ),
@@ -948,12 +937,23 @@ void OFileSelector::reparse()
m_location->insertItem( m_currentDir );
}
// reenable painting and updates
}
+/*
+ * the factory
+ */
+void OFileSelector::initFactory() {
+ m_fileFactory = new OFileFactory();
+ m_fileFactory->addLister(tr("Files"), newLocalLister );
+ m_fileFactory->addView(tr("List View"), newFileListView );
+ /* the factory is just a dummy */
+ m_fileFactory->addView(tr("Documents"), newFileListView );
+}
+
OFileView* OFileSelector::currentView() {
return m_fileView;
}
OFileView* OFileSelector::currentView() const{
return m_fileView;
@@ -1010,13 +1010,13 @@ void OFileSelector::initializeOldSelector() {
QString mime = currentMimeType();
qWarning("MimeType " + mime );
m_select = new FileSelector( mime ,
m_mainView, "fileselector",
FALSE, FALSE);
m_select->setCategorySelectVisible( FALSE );
- m_select->setTypeComboVisible( FALSE );
+ m_select->setTypeComboVisible( FALSE );
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