author | zecke <zecke> | 2002-10-08 16:37:37 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-08 16:37:37 (UTC) |
commit | 76fb8a57bf9fbae3a7073c8b0be1216f34adf99c (patch) (side-by-side diff) | |
tree | 3f486d66ce474039b1a0fc4ade770e6e8a7c32b3 /noncore/apps/opie-console/metafactory.cpp | |
parent | faeb94a4000dc539577af465107b5d10903f92d6 (diff) | |
download | opie-76fb8a57bf9fbae3a7073c8b0be1216f34adf99c.zip opie-76fb8a57bf9fbae3a7073c8b0be1216f34adf99c.tar.gz opie-76fb8a57bf9fbae3a7073c8b0be1216f34adf99c.tar.bz2 |
SzModem:
Make it compile remove = 0 from sendFile
Add a Type to Sz
so it could cover SX,SY too
MetaFactory:
take QCString name
QString uiString
so Carsten will be able to translate
and users can switch Language without losing profiles
Default
It's aware of all Default/BuiltIn Plugins and adds them to the factory
Common
typedef bool BOOL TT is not using bool because it wasn't available at that time
they use uint : 1...
maybe we should change UINT_8 to Q_UINT8...
MainWindow:
give the factory to the config widget
use Default
IOLayer
reload should take Profile not Config
ConfigDialog:
make use of Factory and do not do new MetaFactory.. i should
make the c'tor private and add MainWindow as friend
ProfileEditorDialog:
Huge clean ups to the architecture. I still need to convert
the widgets.
Use the factory right
Diffstat (limited to 'noncore/apps/opie-console/metafactory.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/metafactory.cpp | 76 |
1 files changed, 57 insertions, 19 deletions
diff --git a/noncore/apps/opie-console/metafactory.cpp b/noncore/apps/opie-console/metafactory.cpp index b69d6da..077b418 100644 --- a/noncore/apps/opie-console/metafactory.cpp +++ b/noncore/apps/opie-console/metafactory.cpp @@ -1,46 +1,64 @@ #include <qpe/config.h> #include "metafactory.h" MetaFactory::MetaFactory() { } MetaFactory::~MetaFactory() { } -void MetaFactory::addConfigWidgetFactory( const QString& str, - const QString& name, - configWidget wid) { - m_namemap.insert ( str, name ); - m_confFact.insert( str, wid ); +void MetaFactory::addConnectionWidgetFactory( const QCString& name, + const QString& str, + configWidget wid) { + m_strings.insert( str, name ); + m_conFact.insert( str, wid ); } -void MetaFactory::addIOLayerFactory( const QString& str, +void MetaFactory::addTerminalWidgetFactory( const QCString& name, + const QString& str, + configWidget wid ) { + m_strings.insert( str, name ); + m_termFact.insert( str, wid ); +} +void MetaFactory::addIOLayerFactory( const QCString& name, + const QString& str, iolayer lay) { + m_strings.insert( str, name ); m_layerFact.insert( str, lay ); } -void MetaFactory::addFileTransferLayer( const QString& str, +void MetaFactory::addFileTransferLayer( const QCString& name, + const QString& str, filelayer lay) { + m_strings.insert(str, name ); m_fileFact.insert( str, lay ); } QStringList MetaFactory::ioLayers()const { QStringList list; QMap<QString, iolayer>::ConstIterator it; for (it = m_layerFact.begin(); it != m_layerFact.end(); ++it ) { list << it.key(); } return list; } -QStringList MetaFactory::configWidgets()const { +QStringList MetaFactory::connectionWidgets()const { + QStringList list; + QMap<QString, configWidget>::ConstIterator it; + for ( it = m_conFact.begin(); it != m_conFact.end(); ++it ) { + list << it.key(); + } + return list; +} +QStringList MetaFactory::terminalWidgets()const { QStringList list; QMap<QString, configWidget>::ConstIterator it; - for ( it = m_confFact.begin(); it != m_confFact.end(); ++it ) { + for ( it = m_termFact.begin(); it != m_termFact.end(); ++it ) { list << it.key(); } return list; } QStringList MetaFactory::fileTransferLayers()const { QStringList list; QMap<QString, filelayer>::ConstIterator it; for ( it = m_fileFact.begin(); it != m_fileFact.end(); ++it ) { list << it.key(); } return list; } @@ -51,26 +69,46 @@ IOLayer* MetaFactory::newIOLayer( const QString& str,const Profile& prof ) { QMap<QString, iolayer>::Iterator it; it = m_layerFact.find( str ); if ( it != m_layerFact.end() ) { lay = (*(it.data()))(prof); /* iolayer laye = it.data(); lay = (*laye )(conf);*/ } return lay; } -ProfileEditorPlugin *MetaFactory::newConfigPlugin ( const QString& str, QWidget *parent, Profile *prof) { - ProfileEditorPlugin *p = NULL; - configWidget c; +ProfileDialogWidget *MetaFactory::newConnectionPlugin ( const QString& str, QWidget *parent) { + ProfileDialogWidget* wid = 0l; - c = m_confFact[str]; - if(c) p = c(parent, prof); - - return p; + QMap<QString, configWidget>::Iterator it; + it = m_conFact.find( str ); + if ( it != m_conFact.end() ) { + wid = (*(it.data() ) )(str,parent); + } + return wid; } +ProfileDialogWidget *MetaFactory::newTerminalPlugin( const QString& str, QWidget *parent) { + if (str.isEmpty() ) + return 0l; + ProfileDialogWidget* wid = 0l; + qWarning("new terminalPlugin %s %l", str.latin1(), parent ); -QString MetaFactory::name( const QString& str ) { - return m_namemap[str]; + QMap<QString, configWidget>::Iterator it; + it = m_termFact.find( str ); + if ( it != m_conFact.end() ) { + wid = (*(it.data() ) )(str,parent); + } + return wid; +} +QCString MetaFactory::internal( const QString& str )const { + return m_strings[str]; +} +QString MetaFactory::external( const QCString& str )const { + QMap<QString, QCString>::ConstIterator it; + for ( it = m_strings.begin(); it != m_strings.end(); ++it ) { + if ( it.data() == str ) + return it.key(); + } + return QString::null; } - |