Diffstat (limited to 'noncore/apps/opie-console/metafactory.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/metafactory.cpp | 74 |
1 files changed, 56 insertions, 18 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); |
71 | } | 88 | } |
72 | 89 | return wid; | |
73 | QString MetaFactory::name( const QString& str ) { | ||
74 | return m_namemap[str]; | ||
75 | } | 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 ); | ||
76 | 96 | ||
97 | QMap<QString, configWidget>::Iterator it; | ||
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; | ||
114 | } | ||