summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opierdesktop/qtwin.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/noncore/net/opierdesktop/qtwin.cpp b/noncore/net/opierdesktop/qtwin.cpp
index 54a5a03..71ba5a5 100644
--- a/noncore/net/opierdesktop/qtwin.cpp
+++ b/noncore/net/opierdesktop/qtwin.cpp
@@ -67,162 +67,162 @@ int clipx;
67int clipy; 67int clipy;
68int clipcx; 68int clipcx;
69int clipcy; 69int clipcy;
70 70
71struct bitmap 71struct bitmap
72{ 72{
73 int w; 73 int w;
74 int h; 74 int h;
75 uint8* data; 75 uint8* data;
76}; 76};
77 77
78BOOL owncolmap = False; 78BOOL owncolmap = False;
79 79
80//***************************************************************************** 80//*****************************************************************************
81void CleanString(QString* Item) 81void CleanString(QString* Item)
82{ 82{
83 int i; 83 int i;
84 84
85 i = Item->length() - 1; 85 i = Item->length() - 1;
86 while (i >= 0) 86 while (i >= 0)
87 { 87 {
88 if (Item->at(i) == 10 || Item->at(i) == 13) 88 if (Item->at(i) == 10 || Item->at(i) == 13)
89 Item->remove(i, 1); 89 Item->remove(i, 1);
90 i--; 90 i--;
91 } 91 }
92} 92}
93 93
94//***************************************************************************** 94//*****************************************************************************
95QMyDialog::QMyDialog(QWidget* parent) : QDialog(parent, "Settings", true) 95QMyDialog::QMyDialog(QWidget* parent) : QDialog(parent, "Settings", true)
96{ 96{
97 setCaption( tr( "Configuration" ) ); 97 setCaption( tr( "Configuration" ) );
98 int i, j; 98 int i, j;
99 char* home; 99 char* home;
100 char Text[256]; 100 char Text[256];
101 QString Line; 101 QString Line;
102 QString ItemName; 102 QString ItemName;
103 QString ItemValue; 103 QString ItemValue;
104 104
105 // resize dialog 105 // resize dialog
106 resize(230, 270); 106 resize(230, 270);
107 // main list box 107 // main list box
108 ListBox = new QListBox(this); 108 ListBox = new QListBox(this);
109 ListBox->move(10, 10); 109 ListBox->move(10, 10);
110 ListBox->resize(200, 100); 110 ListBox->resize(200, 100);
111 connect(ListBox, SIGNAL(selectionChanged()), this, SLOT(ListBoxChanged())); 111 connect(ListBox, SIGNAL(selectionChanged()), this, SLOT(ListBoxChanged()));
112 connect(ListBox, SIGNAL(selected(int)), this, SLOT(ListBoxSelected(int))); 112 connect(ListBox, SIGNAL(selected(int)), this, SLOT(ListBoxSelected(int)));
113 // server 113 // server
114 Label1 = new QLabel(this); 114 Label1 = new QLabel(this);
115 Label1->setText("Server Desc"); 115 Label1->setText( tr("Server Desc") );
116 Label1->move(10, 120); 116 Label1->move(10, 120);
117 Label1->resize(100, 20); 117 Label1->resize(100, 20);
118 ServerNameEdit = new QLineEdit(this); 118 ServerNameEdit = new QLineEdit(this);
119 ServerNameEdit->move(75, 120); 119 ServerNameEdit->move(75, 120);
120 ServerNameEdit->resize(100, 20); 120 ServerNameEdit->resize(100, 20);
121 // username 121 // username
122 Label2 = new QLabel(this); 122 Label2 = new QLabel(this);
123 Label2->setText("User Name"); 123 Label2->setText( tr("User Name") );
124 Label2->move(10, 150); 124 Label2->move(10, 150);
125 Label2->resize(100, 20); 125 Label2->resize(100, 20);
126 UserNameEdit = new QLineEdit(this); 126 UserNameEdit = new QLineEdit(this);
127 UserNameEdit->move(75, 150); 127 UserNameEdit->move(75, 150);
128 UserNameEdit->resize(100, 20); 128 UserNameEdit->resize(100, 20);
129 // ip 129 // ip
130 Label3 = new QLabel(this); 130 Label3 = new QLabel(this);
131 Label3->setText("Server IP"); 131 Label3->setText( tr("Server Address") );
132 Label3->move(10, 180); 132 Label3->move(10, 180);
133 Label3->resize(100, 20); 133 Label3->resize(100, 20);
134 IPEdit = new QLineEdit(this); 134 IPEdit = new QLineEdit(this);
135 IPEdit->move(75, 180); 135 IPEdit->move(75, 180);
136 IPEdit->resize(100, 20); 136 IPEdit->resize(100, 20);
137 // width and height 137 // width and height
138 WidthHeightBox = new QComboBox(this); 138 WidthHeightBox = new QComboBox(this);
139 WidthHeightBox->move(10, 210); 139 WidthHeightBox->move(10, 210);
140 WidthHeightBox->resize(100, 20); 140 WidthHeightBox->resize(100, 20);
141 WidthHeightBox->insertItem("240x320"); 141 WidthHeightBox->insertItem("240x320");
142 WidthHeightBox->insertItem("640x480"); 142 WidthHeightBox->insertItem("640x480");
143 WidthHeightBox->insertItem("800x600"); 143 WidthHeightBox->insertItem("800x600");
144 connect(WidthHeightBox, SIGNAL(activated(int)), this, SLOT(ComboChanged(int))); 144 connect(WidthHeightBox, SIGNAL(activated(int)), this, SLOT(ComboChanged(int)));
145 WidthHeightBox->setCurrentItem(1); 145 WidthHeightBox->setCurrentItem(1);
146 WidthEdit = new QLineEdit(this); 146 WidthEdit = new QLineEdit(this);
147 WidthEdit->move(110, 210); 147 WidthEdit->move(110, 210);
148 WidthEdit->resize(30, 20); 148 WidthEdit->resize(30, 20);
149 WidthEdit->setText("800"); 149 WidthEdit->setText("800");
150 HeightEdit = new QLineEdit(this); 150 HeightEdit = new QLineEdit(this);
151 HeightEdit->move(140, 210); 151 HeightEdit->move(140, 210);
152 HeightEdit->resize(30, 20); 152 HeightEdit->resize(30, 20);
153 HeightEdit->setText("600"); 153 HeightEdit->setText("600");
154 // add to list button 154 // add to list button
155 AddButton = new QPushButton(this); 155 AddButton = new QPushButton(this);
156 AddButton->move(180, 120); 156 AddButton->move(180, 120);
157 AddButton->resize(50, 20); 157 AddButton->resize(50, 20);
158 AddButton->setText("Add"); 158 AddButton->setText(tr("Add", "Add Connection"));
159 connect(AddButton, SIGNAL(clicked()), this, SLOT(AddClicked())); 159 connect(AddButton, SIGNAL(clicked()), this, SLOT(AddClicked()));
160 // change list item button 160 // change list item button
161 EditButton = new QPushButton(this); 161 EditButton = new QPushButton(this);
162 EditButton->move(180, 140); 162 EditButton->move(180, 140);
163 EditButton->resize(50, 20); 163 EditButton->resize(50, 20);
164 EditButton->setText("Edit"); 164 EditButton->setText(tr("Edit"));
165 connect(EditButton, SIGNAL(clicked()), this, SLOT(EditClicked())); 165 connect(EditButton, SIGNAL(clicked()), this, SLOT(EditClicked()));
166 // save to file button 166 // save to file button
167 SaveButton = new QPushButton(this); 167 SaveButton = new QPushButton(this);
168 SaveButton->move(180, 160); 168 SaveButton->move(180, 160);
169 SaveButton->resize(50, 20); 169 SaveButton->resize(50, 20);
170 SaveButton->setText("Save"); 170 SaveButton->setText(tr("Save"));
171 connect(SaveButton, SIGNAL(clicked()), this, SLOT(SaveClicked())); 171 connect(SaveButton, SIGNAL(clicked()), this, SLOT(SaveClicked()));
172 // remove an item button 172 // remove an item button
173 RemoveButton = new QPushButton(this); 173 RemoveButton = new QPushButton(this);
174 RemoveButton->move(180, 180); 174 RemoveButton->move(180, 180);
175 RemoveButton->resize(50, 20); 175 RemoveButton->resize(50, 20);
176 RemoveButton->setText("Remove"); 176 RemoveButton->setText(tr("Remove"));
177 connect(RemoveButton, SIGNAL(clicked()), this, SLOT(RemoveClicked())); 177 connect(RemoveButton, SIGNAL(clicked()), this, SLOT(RemoveClicked()));
178 // full screen check box 178 // full screen check box
179 FullScreenCheckBox = new QCheckBox(this, "Full Screen"); 179 FullScreenCheckBox = new QCheckBox(this, "Full Screen");
180 FullScreenCheckBox->setText("Full Screen"); 180 FullScreenCheckBox->setText(tr("Full Screen"));
181 FullScreenCheckBox->move(10, 230); 181 FullScreenCheckBox->move(10, 230);
182 // ok button 182 // ok button
183 183
184 for (i = 0; i < 10; i++) 184 for (i = 0; i < 10; i++)
185 { 185 {
186 ConnectionList[i] = new QMyConnectionItem; 186 ConnectionList[i] = new QMyConnectionItem;
187 ConnectionList[i]->ServerName = ""; 187 ConnectionList[i]->ServerName = "";
188 ConnectionList[i]->UserName = ""; 188 ConnectionList[i]->UserName = "";
189 ConnectionList[i]->ServerIP = ""; 189 ConnectionList[i]->ServerIP = "";
190 ConnectionList[i]->Width = 0; 190 ConnectionList[i]->Width = 0;
191 ConnectionList[i]->Height = 0; 191 ConnectionList[i]->Height = 0;
192 ConnectionList[i]->FullScreen = 0; 192 ConnectionList[i]->FullScreen = 0;
193 } 193 }
194 home = getenv("HOME"); 194 home = getenv("HOME");
195 if (home != NULL) 195 if (home != NULL)
196 { 196 {
197 sprintf(Text, "%s/rdesktop.ini", home); 197 sprintf(Text, "%s/rdesktop.ini", home);
198 QFile* File = new QFile(Text); 198 QFile* File = new QFile(Text);
199 if (File->open(IO_ReadOnly)) 199 if (File->open(IO_ReadOnly))
200 { 200 {
201 i = -1; 201 i = -1;
202 while (!File->atEnd()) 202 while (!File->atEnd())
203 { 203 {
204 File->readLine(Line, 255); 204 File->readLine(Line, 255);
205 j = Line.find("="); 205 j = Line.find("=");
206 if (j > 0) 206 if (j > 0)
207 { 207 {
208 ItemName = Line.mid(0, j); 208 ItemName = Line.mid(0, j);
209 CleanString(&ItemName); 209 CleanString(&ItemName);
210 ItemValue = Line.mid(j + 1); 210 ItemValue = Line.mid(j + 1);
211 CleanString(&ItemValue); 211 CleanString(&ItemValue);
212 if (ItemName == "Server") 212 if (ItemName == "Server")
213 { 213 {
214 i++; 214 i++;
215 ConnectionList[i]->ServerName = ItemValue; 215 ConnectionList[i]->ServerName = ItemValue;
216 ListBox->insertItem(ItemValue); 216 ListBox->insertItem(ItemValue);
217 } 217 }
218 else if (ItemName == "UserName") 218 else if (ItemName == "UserName")
219 ConnectionList[i]->UserName = ItemValue; 219 ConnectionList[i]->UserName = ItemValue;
220 else if (ItemName == "Width") 220 else if (ItemName == "Width")
221 ConnectionList[i]->Width = ItemValue.toInt(); 221 ConnectionList[i]->Width = ItemValue.toInt();
222 else if (ItemName == "Height") 222 else if (ItemName == "Height")
223 ConnectionList[i]->Height = ItemValue.toInt(); 223 ConnectionList[i]->Height = ItemValue.toInt();
224 else if (ItemName == "IP") 224 else if (ItemName == "IP")
225 ConnectionList[i]->ServerIP = ItemValue; 225 ConnectionList[i]->ServerIP = ItemValue;
226 else if (ItemName == "FullScreen") 226 else if (ItemName == "FullScreen")
227 ConnectionList[i]->FullScreen = (ItemValue != "0"); 227 ConnectionList[i]->FullScreen = (ItemValue != "0");
228 } 228 }