author | llornkcor <llornkcor> | 2002-08-26 23:42:26 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-26 23:42:26 (UTC) |
commit | fd60f8aac384983daf7999c20bf827a8bacf8f8f (patch) (unidiff) | |
tree | 0a29acacdc405c965027c28dfd57c33a37d1a8af /noncore/settings | |
parent | 2182c3985c78662c0ce422508d23d3b10399583d (diff) | |
download | opie-fd60f8aac384983daf7999c20bf827a8bacf8f8f.zip opie-fd60f8aac384983daf7999c20bf827a8bacf8f8f.tar.gz opie-fd60f8aac384983daf7999c20bf827a8bacf8f8f.tar.bz2 |
added user message to restart opie or not on key switch change and changed control name
-rw-r--r-- | noncore/settings/sound/opie-vmemo-settings.control | 10 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 113 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.cpp | 5 |
3 files changed, 73 insertions, 55 deletions
diff --git a/noncore/settings/sound/opie-vmemo-settings.control b/noncore/settings/sound/opie-vmemo-settings.control new file mode 100644 index 0000000..3d42ca0 --- a/dev/null +++ b/noncore/settings/sound/opie-vmemo-settings.control | |||
@@ -0,0 +1,10 @@ | |||
1 | Files: bin/sound apps/Settings/Sound.desktop | ||
2 | Priority: optional | ||
3 | Section: opie/settings | ||
4 | Maintainer: L.J. Potter | ||
5 | Architecture: arm | ||
6 | Arch: iPAQ | ||
7 | Version: $QPE_VERSION-$SUB_VERSION.2 | ||
8 | Depends: opie-base ($QPE_VERSION) | ||
9 | Description: Sound settings dialog | ||
10 | For the Opie environment. | ||
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index cddb478..8b97e4d 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp | |||
@@ -1,25 +1,26 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | // parts copyright 2002 L.J. Potter | ||
20 | 21 | ||
21 | #include "soundsettings.h" | 22 | #include "soundsettings.h" |
22 | 23 | ||
23 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/config.h> | 25 | #include <qpe/config.h> |
25 | #include <qpe/qcopenvelope_qws.h> | 26 | #include <qpe/qcopenvelope_qws.h> |
@@ -36,13 +37,13 @@ | |||
36 | #include <sys/types.h> | 37 | #include <sys/types.h> |
37 | #include <unistd.h> | 38 | #include <unistd.h> |
38 | #include <stdio.h> | 39 | #include <stdio.h> |
39 | #include <sys/stat.h> | 40 | #include <sys/stat.h> |
40 | 41 | ||
41 | SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) | 42 | SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) |
42 | : SoundSettingsBase( parent, objname, TRUE, fl ) | 43 | : SoundSettingsBase( parent, objname, TRUE, fl ) |
43 | { | 44 | { |
44 | keyReset=FALSE; | 45 | keyReset=FALSE; |
45 | 46 | ||
46 | Config config( "qpe"); | 47 | Config config( "qpe"); |
47 | config.setGroup( "Volume" ); | 48 | config.setGroup( "Volume" ); |
48 | Config cfg("Vmemo"); | 49 | Config cfg("Vmemo"); |
@@ -106,62 +107,70 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) | |||
106 | updateStorageCombo(); | 107 | updateStorageCombo(); |
107 | connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); | 108 | connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); |
108 | connect( keyComboBox,SIGNAL(activated(const QString &)),this,SLOT( setKeyButton(const QString &))); | 109 | connect( keyComboBox,SIGNAL(activated(const QString &)),this,SLOT( setKeyButton(const QString &))); |
109 | connect( timeLimitComboBox,SIGNAL(activated( const QString &)),this,SLOT( setSizeLimitButton(const QString &))); | 110 | connect( timeLimitComboBox,SIGNAL(activated( const QString &)),this,SLOT( setSizeLimitButton(const QString &))); |
110 | // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 111 | // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
111 | } | 112 | } |
113 | |||
112 | void SoundSettings::updateStorageCombo() { | 114 | void SoundSettings::updateStorageCombo() { |
113 | 115 | ||
114 | Config config( "Vmemo" ); | 116 | Config config( "Vmemo" ); |
115 | config.setGroup( "System" ); | 117 | config.setGroup( "System" ); |
116 | QString loc = config.readEntry("RecLocation","/"); | 118 | QString loc = config.readEntry("RecLocation","/"); |
117 | int i=0; | 119 | int i=0; |
118 | int set=0; | 120 | int set=0; |
119 | StorageInfo storageInfo; | 121 | StorageInfo storageInfo; |
120 | QString sName, sPath; | 122 | QString sName, sPath; |
121 | QStringList list; | 123 | QStringList list; |
122 | list << "Documents : "+QPEApplication::documentDir(); | 124 | list << "Documents : "+QPEApplication::documentDir(); |
123 | list << "tmp : /tmp"; | 125 | list << "tmp : /tmp"; |
124 | 126 | ||
125 | const QList<FileSystem> &fs = storageInfo.fileSystems(); | 127 | const QList<FileSystem> &fs = storageInfo.fileSystems(); |
126 | QListIterator<FileSystem> it ( fs ); | 128 | QListIterator<FileSystem> it ( fs ); |
127 | for( ; it.current(); ++it ){ | 129 | for( ; it.current(); ++it ){ |
128 | const QString name = (*it)->name(); | 130 | const QString name = (*it)->name(); |
129 | const QString path = (*it)->path(); | 131 | const QString path = (*it)->path(); |
130 | qDebug("storage name "+name +" storage path is "+path); | 132 | qDebug("storage name "+name +" storage path is "+path); |
131 | list << name + ": " +path; | 133 | list << name + ": " +path; |
132 | if( loc.find( path,0,TRUE) != -1) | 134 | if( loc.find( path,0,TRUE) != -1) |
133 | set = i; | 135 | set = i; |
134 | // if(dit.current()->file().find(path) != -1 ) storage=name; | 136 | // if(dit.current()->file().find(path) != -1 ) storage=name; |
135 | i++; | 137 | i++; |
136 | } | 138 | } |
137 | 139 | ||
138 | LocationComboBox->insertStringList(list); | 140 | LocationComboBox->insertStringList(list); |
139 | qDebug("set item %d", set); | 141 | qDebug("set item %d", set); |
140 | LocationComboBox->setCurrentItem(set); | 142 | LocationComboBox->setCurrentItem(set); |
141 | } | 143 | } |
142 | 144 | ||
143 | void SoundSettings::setLocation(const QString & string) { | 145 | void SoundSettings::setLocation(const QString & string) { |
144 | Config config( "Vmemo" ); | 146 | Config config( "Vmemo" ); |
145 | config.setGroup( "System" ); | 147 | config.setGroup( "System" ); |
146 | config.writeEntry("RecLocation",string); | 148 | config.writeEntry("RecLocation",string); |
147 | qDebug("set location "+string); | 149 | qDebug("set location "+string); |
148 | config.write(); | 150 | config.write(); |
149 | } | 151 | } |
150 | 152 | ||
151 | void SoundSettings::cleanUp() { | 153 | void SoundSettings::cleanUp() { |
152 | Config cfg("Vmemo"); | 154 | Config cfg("Vmemo"); |
153 | cfg.writeEntry("Alert",AlertCheckBox->isChecked()); | 155 | cfg.writeEntry("Alert",AlertCheckBox->isChecked()); |
154 | 156 | ||
155 | cfg.setGroup("Record"); | 157 | cfg.setGroup("Record"); |
156 | cfg.writeEntry("SampleRate",sampleRate->currentText()); | 158 | cfg.writeEntry("SampleRate",sampleRate->currentText()); |
157 | cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); | 159 | cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); |
158 | cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); | 160 | cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); |
159 | 161 | ||
160 | if(keyReset) QCopEnvelope ("QPE/System", "restart()"); | 162 | if(keyReset) { |
161 | 163 | switch ( QMessageBox::warning(this,tr("Restart"), | |
164 | tr("To implement a new key switch\nOpie will have to be restarted./n<B>Restart</B> Opie now?"), | ||
165 | tr("Yes"),tr("No"),0,1,1) ) { | ||
166 | case 0: | ||
167 | QCopEnvelope ("QPE/System", "restart()"); | ||
168 | break; | ||
169 | }; | ||
170 | } | ||
162 | } | 171 | } |
163 | 172 | ||
164 | void SoundSettings::setKeyButton(const QString &name) { | 173 | void SoundSettings::setKeyButton(const QString &name) { |
165 | Config cfg("Vmemo"); | 174 | Config cfg("Vmemo"); |
166 | cfg.setGroup("Defaults"); | 175 | cfg.setGroup("Defaults"); |
167 | cfg.writeEntry( "toggleKey", keyComboBox->currentItem() ); | 176 | cfg.writeEntry( "toggleKey", keyComboBox->currentItem() ); |
@@ -181,11 +190,11 @@ void SoundSettings::updateLocationCombo() { | |||
181 | 190 | ||
182 | void SoundSettings::setSizeLimitButton(const QString &index) { | 191 | void SoundSettings::setSizeLimitButton(const QString &index) { |
183 | 192 | ||
184 | Config cfg("Vmemo"); | 193 | Config cfg("Vmemo"); |
185 | cfg.setGroup("Record"); | 194 | cfg.setGroup("Record"); |
186 | if(index.find("Unlimited",0,TRUE) != -1) | 195 | if(index.find("Unlimited",0,TRUE) != -1) |
187 | cfg.writeEntry("SizeLimit", -1); | 196 | cfg.writeEntry("SizeLimit", -1); |
188 | else | 197 | else |
189 | cfg.writeEntry("SizeLimit", index); | 198 | cfg.writeEntry("SizeLimit", index); |
190 | cfg.write(); | 199 | cfg.write(); |
191 | } | 200 | } |
diff --git a/noncore/settings/sound/soundsettingsbase.cpp b/noncore/settings/sound/soundsettingsbase.cpp index 3c98362..05b4b7e 100644 --- a/noncore/settings/sound/soundsettingsbase.cpp +++ b/noncore/settings/sound/soundsettingsbase.cpp | |||
@@ -159,15 +159,14 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m | |||
159 | timeLimitComboBox->insertItem( tr( "10" ) ); | 159 | timeLimitComboBox->insertItem( tr( "10" ) ); |
160 | timeLimitComboBox->insertItem( tr( "5" ) ); | 160 | timeLimitComboBox->insertItem( tr( "5" ) ); |
161 | timeLimitComboBox->insertItem( tr( "Unlimited" ) ); | 161 | timeLimitComboBox->insertItem( tr( "Unlimited" ) ); |
162 | 162 | ||
163 | SoundSettingsBaseLayout->addMultiCellWidget(timeLimitComboBox , 8, 8, 0, 0, 1); | 163 | SoundSettingsBaseLayout->addMultiCellWidget(timeLimitComboBox , 8, 8, 0, 0, 1); |
164 | 164 | ||
165 | 165 | QSpacerItem* spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); | |
166 | QSpacerItem* spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); | 166 | SoundSettingsBaseLayout->addItem( spacer4, 9, 0 ); |
167 | SoundSettingsBaseLayout->addItem( spacer4, 9, 0 ); | ||
168 | } | 167 | } |
169 | 168 | ||
170 | /* | 169 | /* |
171 | * Destroys the object and frees any allocated resources | 170 | * Destroys the object and frees any allocated resources |
172 | */ | 171 | */ |
173 | SoundSettingsBase::~SoundSettingsBase() | 172 | SoundSettingsBase::~SoundSettingsBase() |