author | zecke <zecke> | 2002-10-08 16:37:37 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-08 16:37:37 (UTC) |
commit | 76fb8a57bf9fbae3a7073c8b0be1216f34adf99c (patch) (unidiff) | |
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 | |||
@@ -7,16 +7,26 @@ MetaFactory::~MetaFactory() { | |||
7 | 7 | ||
8 | } | 8 | } |
9 | void MetaFactory::addConfigWidgetFactory( const QString& str, | 9 | void MetaFactory::addConnectionWidgetFactory( const QCString& name, |
10 | const QString& name, | 10 | const QString& str, |
11 | configWidget wid) { | 11 | configWidget wid) { |
12 | m_namemap.insert ( str, name ); | 12 | m_strings.insert( str, name ); |
13 | m_confFact.insert( str, wid ); | 13 | m_conFact.insert( str, wid ); |
14 | } | 14 | } |
15 | void MetaFactory::addIOLayerFactory( const QString& str, | 15 | void MetaFactory::addTerminalWidgetFactory( const QCString& name, |
16 | const QString& str, | ||
17 | configWidget wid ) { | ||
18 | m_strings.insert( str, name ); | ||
19 | m_termFact.insert( str, wid ); | ||
20 | } | ||
21 | void MetaFactory::addIOLayerFactory( const QCString& name, | ||
22 | const QString& str, | ||
16 | iolayer lay) { | 23 | iolayer lay) { |
24 | m_strings.insert( str, name ); | ||
17 | m_layerFact.insert( str, lay ); | 25 | m_layerFact.insert( str, lay ); |
18 | } | 26 | } |
19 | void MetaFactory::addFileTransferLayer( const QString& str, | 27 | void MetaFactory::addFileTransferLayer( const QCString& name, |
28 | const QString& str, | ||
20 | filelayer lay) { | 29 | filelayer lay) { |
30 | m_strings.insert(str, name ); | ||
21 | m_fileFact.insert( str, lay ); | 31 | m_fileFact.insert( str, lay ); |
22 | } | 32 | } |
@@ -29,8 +39,16 @@ QStringList MetaFactory::ioLayers()const { | |||
29 | return list; | 39 | return list; |
30 | } | 40 | } |
31 | QStringList MetaFactory::configWidgets()const { | 41 | QStringList MetaFactory::connectionWidgets()const { |
42 | QStringList list; | ||
43 | QMap<QString, configWidget>::ConstIterator it; | ||
44 | for ( it = m_conFact.begin(); it != m_conFact.end(); ++it ) { | ||
45 | list << it.key(); | ||
46 | } | ||
47 | return list; | ||
48 | } | ||
49 | QStringList MetaFactory::terminalWidgets()const { | ||
32 | QStringList list; | 50 | QStringList list; |
33 | QMap<QString, configWidget>::ConstIterator it; | 51 | QMap<QString, configWidget>::ConstIterator it; |
34 | for ( it = m_confFact.begin(); it != m_confFact.end(); ++it ) { | 52 | for ( it = m_termFact.begin(); it != m_termFact.end(); ++it ) { |
35 | list << it.key(); | 53 | list << it.key(); |
36 | } | 54 | } |
@@ -61,16 +79,36 @@ IOLayer* MetaFactory::newIOLayer( const QString& str,const Profile& prof ) { | |||
61 | } | 79 | } |
62 | 80 | ||
63 | ProfileEditorPlugin *MetaFactory::newConfigPlugin ( const QString& str, QWidget *parent, Profile *prof) { | 81 | ProfileDialogWidget *MetaFactory::newConnectionPlugin ( const QString& str, QWidget *parent) { |
64 | ProfileEditorPlugin *p = NULL; | 82 | ProfileDialogWidget* wid = 0l; |
65 | configWidget c; | ||
66 | 83 | ||
67 | c = m_confFact[str]; | 84 | QMap<QString, configWidget>::Iterator it; |
68 | if(c) p = c(parent, prof); | 85 | it = m_conFact.find( str ); |
69 | 86 | if ( it != m_conFact.end() ) { | |
70 | return p; | 87 | wid = (*(it.data() ) )(str,parent); |
88 | } | ||
89 | return wid; | ||
71 | } | 90 | } |
91 | ProfileDialogWidget *MetaFactory::newTerminalPlugin( const QString& str, QWidget *parent) { | ||
92 | if (str.isEmpty() ) | ||
93 | return 0l; | ||
94 | ProfileDialogWidget* wid = 0l; | ||
95 | qWarning("new terminalPlugin %s %l", str.latin1(), parent ); | ||
72 | 96 | ||
73 | QString MetaFactory::name( const QString& str ) { | 97 | QMap<QString, configWidget>::Iterator it; |
74 | return m_namemap[str]; | 98 | it = m_termFact.find( str ); |
99 | if ( it != m_conFact.end() ) { | ||
100 | wid = (*(it.data() ) )(str,parent); | ||
101 | } | ||
102 | return wid; | ||
103 | } | ||
104 | QCString MetaFactory::internal( const QString& str )const { | ||
105 | return m_strings[str]; | ||
106 | } | ||
107 | QString MetaFactory::external( const QCString& str )const { | ||
108 | QMap<QString, QCString>::ConstIterator it; | ||
109 | for ( it = m_strings.begin(); it != m_strings.end(); ++it ) { | ||
110 | if ( it.data() == str ) | ||
111 | return it.key(); | ||
112 | } | ||
113 | return QString::null; | ||
75 | } | 114 | } |
76 | |||