summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-07 18:10:10 (UTC)
committer harlekin <harlekin>2002-10-07 18:10:10 (UTC)
commit3d7d26f3c6ec040d883f1a1f7137c1ded6d9d76d (patch) (unidiff)
tree7fdc70be408f3c4ac5160ccf1cbc2e3584630ef9
parentd55aa591770675008da9e3290617e463a77e4c98 (diff)
downloadopie-3d7d26f3c6ec040d883f1a1f7137c1ded6d9d76d.zip
opie-3d7d26f3c6ec040d883f1a1f7137c1ded6d9d76d.tar.gz
opie-3d7d26f3c6ec040d883f1a1f7137c1ded6d9d76d.tar.bz2
forgot about a otabwidget speciality
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index be23eff..3843943 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -70,96 +70,97 @@ void ProfileEditorDialog::initUI()
70 QLabel *device = new QLabel(QObject::tr("Device"), tabconn); 70 QLabel *device = new QLabel(QObject::tr("Device"), tabconn);
71 71
72 device_box = new QComboBox(tabconn); 72 device_box = new QComboBox(tabconn);
73 73
74 QStringList w = m_fact->configWidgets(); 74 QStringList w = m_fact->configWidgets();
75 for(QStringList::Iterator it = w.begin(); it != w.end(); it++) 75 for(QStringList::Iterator it = w.begin(); it != w.end(); it++)
76 device_box->insertItem(m_fact->name((*it))); 76 device_box->insertItem(m_fact->name((*it)));
77 77
78 // connection tab, factory part 78 // connection tab, factory part
79 plugin_base = new QWidget(tabconn); 79 plugin_base = new QWidget(tabconn);
80 plugin_layout = new QHBoxLayout(plugin_base, 0); 80 plugin_layout = new QHBoxLayout(plugin_base, 0);
81 81
82 plugin_plugin = m_fact->newConfigPlugin("serial", plugin_base, &m_prof); 82 plugin_plugin = m_fact->newConfigPlugin("serial", plugin_base, &m_prof);
83 plugin_layout->add(plugin_plugin->widget()); 83 plugin_layout->add(plugin_plugin->widget());
84 84
85 // connection tab, general part 85 // connection tab, general part
86 86
87 QWidget *conn_widget = plugin_plugin->connection_widget(); 87 QWidget *conn_widget = plugin_plugin->connection_widget();
88 conn_widget->reparent(tabconn, 0, QPoint(), true); 88 conn_widget->reparent(tabconn, 0, QPoint(), true);
89 89
90 // terminal tab 90 // terminal tab
91 91
92 QWidget *term_widget = plugin_plugin->terminal_widget(); 92 QWidget *term_widget = plugin_plugin->terminal_widget();
93 term_widget->reparent(tabterm, 0, QPoint(), true); 93 term_widget->reparent(tabterm, 0, QPoint(), true);
94 94
95 // layouting 95 // layouting
96 96
97 QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2); 97 QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2);
98 vbox3->add(name); 98 vbox3->add(name);
99 vbox3->add(name_line); 99 vbox3->add(name_line);
100 vbox3->addStretch(1); 100 vbox3->addStretch(1);
101 101
102 QVBoxLayout *vbox = new QVBoxLayout(tabconn, 2); 102 QVBoxLayout *vbox = new QVBoxLayout(tabconn, 2);
103 vbox->add(device); 103 vbox->add(device);
104 vbox->add(device_box); 104 vbox->add(device_box);
105 vbox->add(plugin_base); 105 vbox->add(plugin_base);
106 vbox->add(conn_widget); 106 vbox->add(conn_widget);
107 vbox->setStretchFactor(device, 1); 107 vbox->setStretchFactor(device, 1);
108 vbox->setStretchFactor(device_box, 1); 108 vbox->setStretchFactor(device_box, 1);
109 vbox->setStretchFactor(plugin_base, 1); 109 vbox->setStretchFactor(plugin_base, 1);
110 vbox->setStretchFactor(conn_widget, 7); 110 vbox->setStretchFactor(conn_widget, 7);
111 111
112 QVBoxLayout *vbox2 = new QVBoxLayout(tabterm, 2); 112 QVBoxLayout *vbox2 = new QVBoxLayout(tabterm, 2);
113 vbox2->add(term_widget); 113 vbox2->add(term_widget);
114 114
115 tabWidget->addTab(tabprof, "", QObject::tr("Profile")); 115 tabWidget->addTab(tabprof, "", QObject::tr("Profile"));
116 tabWidget->addTab(tabconn, "", QObject::tr("Connection")); 116 tabWidget->addTab(tabconn, "", QObject::tr("Connection"));
117 tabWidget->addTab(tabterm, "", QObject::tr("Terminal")); 117 tabWidget->addTab(tabterm, "", QObject::tr("Terminal"));
118 tabWidget->setCurrentTab( tabprof );
118 119
119 // load profile values 120 // load profile values
120 name_line->setText(m_prof.name()); 121 name_line->setText(m_prof.name());
121 for(int i = 0; i < device_box->count(); i++) 122 for(int i = 0; i < device_box->count(); i++)
122 { 123 {
123 device_box->setCurrentItem(i); 124 device_box->setCurrentItem(i);
124 if(prof_type() == m_prof.ioLayerName()) 125 if(prof_type() == m_prof.ioLayerName())
125 { 126 {
126 slotDevice(i); 127 slotDevice(i);
127 break; 128 break;
128 } 129 }
129 } 130 }
130 131
131 // signals 132 // signals
132 connect(device_box, SIGNAL(activated(int)), SLOT(slotDevice(int))); 133 connect(device_box, SIGNAL(activated(int)), SLOT(slotDevice(int)));
133} 134}
134 135
135ProfileEditorDialog::~ProfileEditorDialog() { 136ProfileEditorDialog::~ProfileEditorDialog() {
136 137
137} 138}
138 139
139void ProfileEditorDialog::slotDevice(int id) 140void ProfileEditorDialog::slotDevice(int id)
140{ 141{
141 delete plugin_plugin; 142 delete plugin_plugin;
142 143
143 plugin_plugin = m_fact->newConfigPlugin(prof_type(), plugin_base, &m_prof); 144 plugin_plugin = m_fact->newConfigPlugin(prof_type(), plugin_base, &m_prof);
144 plugin_layout->add(plugin_plugin->widget()); 145 plugin_layout->add(plugin_plugin->widget());
145 146
146 // Reload profile associated to device, including e.g. conn_device() 147 // Reload profile associated to device, including e.g. conn_device()
147 // m_prof = plugin_plugin->profile() 148 // m_prof = plugin_plugin->profile()
148 // or, keeping the profile name: m_prof->reload(plugin_plugin->profile()) 149 // or, keeping the profile name: m_prof->reload(plugin_plugin->profile())
149 150
150 //plugin_plugin->show(); 151 //plugin_plugin->show();
151 plugin_plugin->widget()->show(); 152 plugin_plugin->widget()->show();
152} 153}
153 154
154void ProfileEditorDialog::accept() 155void ProfileEditorDialog::accept()
155{ 156{
156 if(prof_name().isEmpty()) 157 if(prof_name().isEmpty())
157 { 158 {
158 QMessageBox::information(this, 159 QMessageBox::information(this,
159 QObject::tr("Invalid profile"), 160 QObject::tr("Invalid profile"),
160 QObject::tr("Please enter a profile name.")); 161 QObject::tr("Please enter a profile name."));
161 return; 162 return;
162 } 163 }
163 // Save profile and plugin profile 164 // Save profile and plugin profile
164 if(plugin_plugin) plugin_plugin->save(); 165 if(plugin_plugin) plugin_plugin->save();
165 166