summaryrefslogtreecommitdiff
path: root/libopie/ofileselector
authorharlekin <harlekin>2002-10-31 13:09:13 (UTC)
committer harlekin <harlekin>2002-10-31 13:09:13 (UTC)
commitae467a89591b45a8a190174a0cae0b330de8d89e (patch) (side-by-side diff)
tree2a4799378bdf4ce450955492b66b418214b9fbf4 /libopie/ofileselector
parentf6ca21ad98c7af99c0ae4c04afe3c2126317d6de (diff)
downloadopie-ae467a89591b45a8a190174a0cae0b330de8d89e.zip
opie-ae467a89591b45a8a190174a0cae0b330de8d89e.tar.gz
opie-ae467a89591b45a8a190174a0cae0b330de8d89e.tar.bz2
excludeFromRefresh() added
Diffstat (limited to 'libopie/ofileselector') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector/odefaultfactories.cpp8
-rw-r--r--libopie/ofileselector/odefaultfactories.h3
-rw-r--r--libopie/ofileselector/ofiledialog.cpp2
-rw-r--r--libopie/ofileselector/ofiledialog.h3
-rw-r--r--libopie/ofileselector/ofileselector.cpp8
5 files changed, 19 insertions, 5 deletions
diff --git a/libopie/ofileselector/odefaultfactories.cpp b/libopie/ofileselector/odefaultfactories.cpp
index c41fbca..c8efffb 100644
--- a/libopie/ofileselector/odefaultfactories.cpp
+++ b/libopie/ofileselector/odefaultfactories.cpp
@@ -1,15 +1,23 @@
#include "ofilelistview.h"
+#include "ofileiconview.h"
#include "olocallister.h"
+
#include "odefaultfactories.h"
extern "C" {
+
+ OFileView* newFileIconView( OFileSelector* sel, QWidget* parent ) {
+ return new OFileIconView( parent, sel );
+ }
+
OFileView* newFileListView( OFileSelector* sel, QWidget* par ) {
return new OFileListView(par, sel );
}
+
OLister* newLocalLister( OFileSelector* sel) {
return new OLocalLister( sel );
}
};
diff --git a/libopie/ofileselector/odefaultfactories.h b/libopie/ofileselector/odefaultfactories.h
index eb698d3..b4c35af 100644
--- a/libopie/ofileselector/odefaultfactories.h
+++ b/libopie/ofileselector/odefaultfactories.h
@@ -1,14 +1,17 @@
#ifndef OPIE_DEFAULT_FACTORIES_H
#define OPIE_DEFAULT_FACTORIES_H
#include "ofilefactory.h"
extern "C" {
+ OFileView* newFileIconView( OFileSelector*, QWidget* parent );
OFileView* newFileListView( OFileSelector*, QWidget* parent );
+
OLister* newLocalLister(OFileSelector* );
+
};
#endif
diff --git a/libopie/ofileselector/ofiledialog.cpp b/libopie/ofileselector/ofiledialog.cpp
index 430def2..d137c66 100644
--- a/libopie/ofileselector/ofiledialog.cpp
+++ b/libopie/ofileselector/ofiledialog.cpp
@@ -75,25 +75,25 @@ DocLnk OFileDialog::selectedDocument()const
QString OFileDialog::getOpenFileName(int selector,
const QString &startDir,
const QString &file,
const MimeTypes &mimes,
QWidget *wid,
const QString &caption )
{
QString ret;
OFileDialog dlg( caption.isEmpty() ? tr("Open") : caption,
wid, OFileSelector::Open, selector, startDir, file, mimes);
dlg.showMaximized();
if( dlg.exec() )
- ret = dlg.fileName();
+ ret = dlg.fileName();
return ret;
}
QString OFileDialog::getSaveFileName(int selector,
const QString &startDir,
const QString &file,
const MimeTypes &mimes,
QWidget *wid,
const QString &caption )
{
QString ret;
OFileDialog dlg( caption.isEmpty() ? tr("Save") : caption,
diff --git a/libopie/ofileselector/ofiledialog.h b/libopie/ofileselector/ofiledialog.h
index e14253c..e368e96 100644
--- a/libopie/ofileselector/ofiledialog.h
+++ b/libopie/ofileselector/ofiledialog.h
@@ -23,25 +23,26 @@
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef OpieFileDialog_h
#define OpieFileDialog_h
#include <qdialog.h>
-#include <opie/ofileselector.h>
+//#include <opie/ofileselector.h>
+#include "ofileselector.h"
class OFileDialog : public QDialog {
Q_OBJECT
public:
OFileDialog(const QString &caption,
QWidget *, int mode, int selector,
const QString &dirName,
const QString &fileName = QString::null,
const MimeTypes &mimetypes = MimeTypes() );
QString mimetype() const;
QString fileName() const;
DocLnk selectedDocument()const;
diff --git a/libopie/ofileselector/ofileselector.cpp b/libopie/ofileselector/ofileselector.cpp
index 9ce07dd..c6e923f 100644
--- a/libopie/ofileselector/ofileselector.cpp
+++ b/libopie/ofileselector/ofileselector.cpp
@@ -476,24 +476,26 @@ void OFileSelector::init()
if( m_shLne ) // the LineEdit with the current FileName
initializeName();
if( m_shPerm ) // the Permission QCheckBox
initializePerm();
if( m_shYesNo ) // the Yes No button row
initializeYes( );
if (m_selector != Normal )
reparse();
+
+ showMaximized();
}
void OFileSelector::updateMimes()
{
if( m_autoMime ){
m_mimetypes.clear();
m_mimetypes.insert( tr("All"), QString::null );
if( m_selector == Normal ){
DocLnkSet set;
Global::findDocuments(&set, QString::null );
QListIterator<DocLnk> dit( set.children() );
for( ; dit.current(); ++dit ){
if( !m_mimetypes.contains( (*dit)->type() ) )
@@ -642,25 +644,25 @@ void OFileSelector::initializeChooser()
void OFileSelector::initToolbar() {
m_mainView = new OFileSelectorMain( this );
/* now generate the tool bar */
qWarning( "toolbar" );
m_pseudo = new QWidget( m_mainView, "Pseudo Widget" );
m_pseudoLayout = new QVBoxLayout( m_pseudo );
m_boxToolbar = new QHBox( m_pseudo );
m_boxToolbar->setSpacing( 0 );
// tool bar members now
- m_location = new QComboBox( m_boxToolbar );
+ m_location = new QComboBox( m_boxToolbar );
m_location->setEditable( TRUE );
m_location->setDuplicatesEnabled( FALSE );
connect( m_location, SIGNAL(activated(const QString& ) ),
this, SLOT(slotLocationActivated(const QString& )) );
connect( m_location->lineEdit(), SIGNAL(returnPressed() ) ,
this, SLOT(locationComboChanged() ) );
// UP Button
m_up = new QPushButton( Resource::loadIconSet("up"), QString::null,
m_boxToolbar, "cdUpButton" );
m_up->setFixedSize( QSize(20, 20 ) );
connect( m_up, SIGNAL( clicked() ), this, SLOT(cdUP() ) );
@@ -965,27 +967,27 @@ void OFileSelector::setView( const QString& lis ) {
m_fileView = factory()->view( list, this, m_mainView );
m_mainView->setWidget( m_fileView->widget() );
reparse();
}
}
/*
* 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 );
+ m_fileFactory->addView(tr("Documents"), newFileIconView );
}
+
void OFileSelector::fillList() {
qWarning("fill list");
if (!m_viewCheck )
return;
m_viewCheck->clear();
QStringList list = factory()->views();
qWarning("views: " + list.join(";") );
for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
qWarning( (*it) );
if ( (*it) == tr("Documents") ) {
m_viewCheck->insertItem( (*it) );