Diffstat (limited to 'noncore/unsupported/oipkg/pksettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pksettings.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp index 063b018..aac011e 100644 --- a/noncore/unsupported/oipkg/pksettings.cpp +++ b/noncore/unsupported/oipkg/pksettings.cpp | |||
@@ -1,145 +1,145 @@ | |||
1 | #include "pksettings.h" | 1 | #include "pksettings.h" |
2 | 2 | ||
3 | #include <qpe/process.h> | 3 | #include <qpe/process.h> |
4 | #include <qpe/resource.h> | 4 | #include <qpe/resource.h> |
5 | #include <qpe/stringutil.h> | 5 | #include <qpe/stringutil.h> |
6 | #include <qpe/qpeapplication.h> | 6 | #include <qpe/qpeapplication.h> |
7 | #include <qpe/qcopenvelope_qws.h> | 7 | #include <qpe/qcopenvelope_qws.h> |
8 | #include <qpe/applnk.h> | 8 | #include <qpe/applnk.h> |
9 | #include <qpe/config.h> | 9 | #include <qpe/config.h> |
10 | 10 | ||
11 | #include <qprogressbar.h> | 11 | #include <qprogressbar.h> |
12 | #include <qcombobox.h> | 12 | #include <qcombobox.h> |
13 | #include <qdict.h> | 13 | #include <qdict.h> |
14 | #include <qfile.h> | 14 | #include <qfile.h> |
15 | #include <qlineedit.h> | 15 | #include <qlineedit.h> |
16 | #include <qpushbutton.h> | 16 | #include <qpushbutton.h> |
17 | #include <qlistview.h> | 17 | #include <qlistview.h> |
18 | #include <qlistbox.h> | 18 | #include <qlistbox.h> |
19 | #include <qcheckbox.h> | 19 | #include <qcheckbox.h> |
20 | #include <qmessagebox.h> | 20 | #include <qmessagebox.h> |
21 | #include <qpainter.h> | 21 | #include <qpainter.h> |
22 | #include <qpixmap.h> | 22 | #include <qpixmap.h> |
23 | #include <qregexp.h> | 23 | #include <qregexp.h> |
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qobject.h> | 25 | #include <qobject.h> |
26 | #include <qtextstream.h> | 26 | #include <qtextstream.h> |
27 | #include <qtextview.h> | 27 | #include <qtextview.h> |
28 | #include <qtoolbutton.h> | 28 | #include <qtoolbutton.h> |
29 | #include <qtabwidget.h> | 29 | #include <qtabwidget.h> |
30 | 30 | ||
31 | #include <stdlib.h> | 31 | #include <stdlib.h> |
32 | #include <unistd.h> | 32 | #include <unistd.h> |
33 | #include "debug.h" | 33 | #include "debug.h" |
34 | //#include "utils.h" | 34 | //#include "utils.h" |
35 | 35 | ||
36 | PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl ) | 36 | PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* name, WFlags fl ) |
37 | : PackageManagerSettingsBase( parent, name, fl ) | 37 | : PackageManagerSettingsBase( parent, name, fl ) |
38 | { | 38 | { |
39 | connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) ); | 39 | connect( newserver, SIGNAL(clicked()), this, SLOT(newServer()) ); |
40 | connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) ); | 40 | connect( removeserver, SIGNAL(clicked()), this, SLOT(removeServer()) ); |
41 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); | 41 | connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); |
42 | connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) ); | 42 | connect( newdestination, SIGNAL(clicked()), this, SLOT(newDestination()) ); |
43 | connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) ); | 43 | connect( removedestination, SIGNAL(clicked()), this, SLOT(removeDestination()) ); |
44 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); | 44 | connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); |
45 | // connect( CheckBoxLink, SIGNAL(toggled(bool)), | 45 | // connect( CheckBoxLink, SIGNAL(toggled(bool)), |
46 | // activeLinkDestination, SLOT(setEnabled(bool)) ); | 46 | // activeLinkDestination, SLOT(setEnabled(bool)) ); |
47 | 47 | ||
48 | // connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) ); | 48 | // connect( settingName, SIGNAL(activated(int)), this, SLOT(installationSettingChange(int)) ); |
49 | // connect( settingName, SIGNAL(textChanged(const QString &)), this, SLOT(installationSettingSetName(const QString &)) ); | 49 | // connect( settingName, SIGNAL(textChanged(const QString&)), this, SLOT(installationSettingSetName(const QString&)) ); |
50 | // connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) ); | 50 | // connect( newsetting, SIGNAL(clicked()), this, SLOT(newInstallationSetting()) ); |
51 | // connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) ); | 51 | // connect( renamesetting, SIGNAL(clicked()), this, SLOT(renameInstallationSetting()) ); |
52 | // connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) ); | 52 | // connect( removesetting, SIGNAL(clicked()), this, SLOT(removeInstallationSetting()) ); |
53 | servername->setEnabled(FALSE); | 53 | servername->setEnabled(FALSE); |
54 | serverurl->setEnabled(FALSE); | 54 | serverurl->setEnabled(FALSE); |
55 | serverurlDic.setAutoDelete(TRUE); | 55 | serverurlDic.setAutoDelete(TRUE); |
56 | destinationname->setEnabled(FALSE); | 56 | destinationname->setEnabled(FALSE); |
57 | destinationurl->setEnabled(FALSE); | 57 | destinationurl->setEnabled(FALSE); |
58 | destinationurlDic.setAutoDelete(TRUE); | 58 | destinationurlDic.setAutoDelete(TRUE); |
59 | readSettings(); | 59 | readSettings(); |
60 | activeLinkDestination->hide(); | 60 | activeLinkDestination->hide(); |
61 | serverChanged = false; | 61 | serverChanged = false; |
62 | 62 | ||
63 | // get rid of setups | 63 | // get rid of setups |
64 | // Settings->hide(); | 64 | // Settings->hide(); |
65 | // settingName->hide(); | 65 | // settingName->hide(); |
66 | // newsetting->hide(); | 66 | // newsetting->hide(); |
67 | // renamesetting->hide(); | 67 | // renamesetting->hide(); |
68 | // removesetting->hide(); | 68 | // removesetting->hide(); |
69 | } | 69 | } |
70 | 70 | ||
71 | PackageManagerSettings::~PackageManagerSettings() | 71 | PackageManagerSettings::~PackageManagerSettings() |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | void PackageManagerSettings::newServer() | 76 | void PackageManagerSettings::newServer() |
77 | { | 77 | { |
78 | int i = servers->count(); | 78 | int i = servers->count(); |
79 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { | 79 | if ( servername->isEnabled() || serverurl->text().isEmpty() ) { |
80 | serverurlDic.insert(i,new QString("http://")); | 80 | serverurlDic.insert(i,new QString("http://")); |
81 | servers->insertItem(tr("New")); | 81 | servers->insertItem(tr("New")); |
82 | activeServers->insertItem(tr("New")); | 82 | activeServers->insertItem(tr("New")); |
83 | } else { | 83 | } else { |
84 | // allows one-level undo | 84 | // allows one-level undo |
85 | serverurlDic.insert(i,new QString(serverurl->text())); | 85 | serverurlDic.insert(i,new QString(serverurl->text())); |
86 | servers->insertItem(servername->text()); | 86 | servers->insertItem(servername->text()); |
87 | activeServers->insertItem(servername->text()); | 87 | activeServers->insertItem(servername->text()); |
88 | } | 88 | } |
89 | changed = true; | 89 | changed = true; |
90 | servers->setSelected(i,TRUE); | 90 | servers->setSelected(i,TRUE); |
91 | editServer(i); | 91 | editServer(i); |
92 | changed = true; | 92 | changed = true; |
93 | } | 93 | } |
94 | 94 | ||
95 | void PackageManagerSettings::newDestination() | 95 | void PackageManagerSettings::newDestination() |
96 | { | 96 | { |
97 | int i = destinations->count(); | 97 | int i = destinations->count(); |
98 | if ( destinationname->isEnabled() || destinationurl->text().isEmpty() ) { | 98 | if ( destinationname->isEnabled() || destinationurl->text().isEmpty() ) { |
99 | destinationurlDic.insert(i,new QString("/")); | 99 | destinationurlDic.insert(i,new QString("/")); |
100 | destinations->insertItem(tr("New")); | 100 | destinations->insertItem(tr("New")); |
101 | activeDestination->insertItem(tr("New")); | 101 | activeDestination->insertItem(tr("New")); |
102 | activeLinkDestination->insertItem(tr("New")); | 102 | activeLinkDestination->insertItem(tr("New")); |
103 | } else { | 103 | } else { |
104 | // allows one-level undo | 104 | // allows one-level undo |
105 | destinationurlDic.insert(i,new QString(destinationurl->text())); | 105 | destinationurlDic.insert(i,new QString(destinationurl->text())); |
106 | destinations->insertItem(destinationname->text()); | 106 | destinations->insertItem(destinationname->text()); |
107 | activeDestination->insertItem(destinationname->text()); | 107 | activeDestination->insertItem(destinationname->text()); |
108 | activeLinkDestination->insertItem(destinationname->text()); | 108 | activeLinkDestination->insertItem(destinationname->text()); |
109 | } | 109 | } |
110 | destinations->setSelected(i,TRUE); | 110 | destinations->setSelected(i,TRUE); |
111 | editDestination(i); | 111 | editDestination(i); |
112 | changed = true; | 112 | changed = true; |
113 | } | 113 | } |
114 | 114 | ||
115 | 115 | ||
116 | void PackageManagerSettings::editServer(int i) | 116 | void PackageManagerSettings::editServer(int i) |
117 | { | 117 | { |
118 | if ( servername->isEnabled() ) { | 118 | if ( servername->isEnabled() ) { |
119 | disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); | 119 | disconnect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); |
120 | disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); | 120 | disconnect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); |
121 | } else { | 121 | } else { |
122 | servername->setEnabled(TRUE); | 122 | servername->setEnabled(TRUE); |
123 | serverurl->setEnabled(TRUE); | 123 | serverurl->setEnabled(TRUE); |
124 | } | 124 | } |
125 | 125 | ||
126 | servername->setText( servers->text(i) ); | 126 | servername->setText( servers->text(i) ); |
127 | serverurl->setText( *serverurlDic[i] ); | 127 | serverurl->setText( *serverurlDic[i] ); |
128 | 128 | ||
129 | editedserver = i; | 129 | editedserver = i; |
130 | serverChanged = true; | 130 | serverChanged = true; |
131 | connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); | 131 | connect( servername, SIGNAL(textChanged(const QString&)), this, SLOT(serverNameChanged(const QString&)) ); |
132 | connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); | 132 | connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); |
133 | changed = true; | 133 | changed = true; |
134 | } | 134 | } |
135 | 135 | ||
136 | 136 | ||
137 | void PackageManagerSettings::editDestination(int i) | 137 | void PackageManagerSettings::editDestination(int i) |
138 | { | 138 | { |
139 | if ( destinationname->isEnabled() ) { | 139 | if ( destinationname->isEnabled() ) { |
140 | disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); | 140 | disconnect( destinationname, SIGNAL(textChanged(const QString&)), this, SLOT(destNameChanged(const QString&)) ); |
141 | disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); | 141 | disconnect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); |
142 | } else { | 142 | } else { |
143 | destinationname->setEnabled(TRUE); | 143 | destinationname->setEnabled(TRUE); |
144 | destinationurl->setEnabled(TRUE); | 144 | destinationurl->setEnabled(TRUE); |
145 | //since it does not work anyway | 145 | //since it does not work anyway |