Changeset 28
- Timestamp:
- 01/05/08 16:32:32 (4 years ago)
- Files:
-
- 4 edited
-
gui/main_window.cpp (modified) (3 diffs)
-
gui/main_window.h (modified) (1 diff)
-
gui/main_window.ui (modified) (4 diffs)
-
lib/mpdparseutils.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gui/main_window.cpp
r26 r28 50 50 connect(playPauseTrackButton, SIGNAL(clicked(bool)), this, SLOT(playPauseTrack())); 51 51 connect(nextTrackButton, SIGNAL(clicked(bool)), this, SLOT(nextTrack())); 52 connect(randomCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setRandom(int))); 53 connect(repeatCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setRepeat(int))); 52 54 connect(playlistTableView, SIGNAL(activated(const QModelIndex &)), this, SLOT(playlistItemActivated(const QModelIndex &))); 53 55 connect(removeFromPlaylistPushButton, SIGNAL(clicked(bool)), this, SLOT(removeFromPlaylist())); … … 116 118 } 117 119 120 void MainWindow::setRandom(int state) 121 { 122 if(state == Qt::Checked) 123 mpd.setRandom(true); 124 else 125 mpd.setRandom(false); 126 } 127 128 void MainWindow::setRepeat(int state) 129 { 130 if(state == Qt::Checked) 131 mpd.setRepeat(true); 132 else 133 mpd.setRepeat(false); 134 } 135 118 136 void MainWindow::updateCurrentSong(Song *song) 119 137 { … … 136 154 if(!slidingVolume) 137 155 volumeSlider->setValue(status.volume); 156 157 if(status.random) { 158 randomCheckBox->setCheckState(Qt::Checked); 159 } else { 160 randomCheckBox->setCheckState(Qt::Unchecked); 161 } 162 163 if(status.repeat) { 164 repeatCheckBox->setCheckState(Qt::Checked); 165 } else { 166 repeatCheckBox->setCheckState(Qt::Unchecked); 167 } 138 168 139 169 if(status.time_total == -1) { -
gui/main_window.h
r26 r28 38 38 void previousTrack(); 39 39 void setVolume(); 40 void setRandom(int); 41 void setRepeat(int); 40 42 void updateCurrentSong(Song *song); 41 43 void updateStatus(const MPDStatus &status); -
gui/main_window.ui
r26 r28 6 6 <x>0</x> 7 7 <y>0</y> 8 <width> 649</width>8 <width>918</width> 9 9 <height>600</height> 10 10 </rect> … … 173 173 <layout class="QHBoxLayout" > 174 174 <item> 175 <widget class="QPushButton" name="prevTrackButton" > 176 <property name="sizePolicy" > 177 <sizepolicy vsizetype="Fixed" hsizetype="Maximum" > 178 <horstretch>0</horstretch> 179 <verstretch>0</verstretch> 180 </sizepolicy> 181 </property> 182 <property name="text" > 183 <string>Previous</string> 184 </property> 185 </widget> 186 </item> 187 <item> 188 <widget class="QPushButton" name="stopTrackButton" > 189 <property name="sizePolicy" > 190 <sizepolicy vsizetype="Fixed" hsizetype="Maximum" > 191 <horstretch>0</horstretch> 192 <verstretch>0</verstretch> 193 </sizepolicy> 194 </property> 195 <property name="text" > 196 <string>Stop</string> 197 </property> 198 </widget> 199 </item> 200 <item> 201 <widget class="QPushButton" name="playPauseTrackButton" > 202 <property name="sizePolicy" > 203 <sizepolicy vsizetype="Fixed" hsizetype="Maximum" > 204 <horstretch>0</horstretch> 205 <verstretch>0</verstretch> 206 </sizepolicy> 207 </property> 208 <property name="text" > 209 <string>Play</string> 210 </property> 211 <property name="checkable" > 212 <bool>true</bool> 213 </property> 214 </widget> 215 </item> 216 <item> 217 <widget class="QPushButton" name="nextTrackButton" > 218 <property name="sizePolicy" > 219 <sizepolicy vsizetype="Fixed" hsizetype="Maximum" > 220 <horstretch>0</horstretch> 221 <verstretch>0</verstretch> 222 </sizepolicy> 223 </property> 224 <property name="text" > 225 <string>Next</string> 226 </property> 227 </widget> 175 <layout class="QHBoxLayout" > 176 <item> 177 <widget class="QPushButton" name="prevTrackButton" > 178 <property name="sizePolicy" > 179 <sizepolicy vsizetype="Fixed" hsizetype="Maximum" > 180 <horstretch>0</horstretch> 181 <verstretch>0</verstretch> 182 </sizepolicy> 183 </property> 184 <property name="text" > 185 <string>Previous</string> 186 </property> 187 </widget> 188 </item> 189 <item> 190 <widget class="QPushButton" name="stopTrackButton" > 191 <property name="sizePolicy" > 192 <sizepolicy vsizetype="Fixed" hsizetype="Maximum" > 193 <horstretch>0</horstretch> 194 <verstretch>0</verstretch> 195 </sizepolicy> 196 </property> 197 <property name="text" > 198 <string>Stop</string> 199 </property> 200 </widget> 201 </item> 202 <item> 203 <widget class="QPushButton" name="playPauseTrackButton" > 204 <property name="sizePolicy" > 205 <sizepolicy vsizetype="Fixed" hsizetype="Maximum" > 206 <horstretch>0</horstretch> 207 <verstretch>0</verstretch> 208 </sizepolicy> 209 </property> 210 <property name="text" > 211 <string>Play</string> 212 </property> 213 <property name="checkable" > 214 <bool>true</bool> 215 </property> 216 </widget> 217 </item> 218 <item> 219 <widget class="QPushButton" name="nextTrackButton" > 220 <property name="sizePolicy" > 221 <sizepolicy vsizetype="Fixed" hsizetype="Maximum" > 222 <horstretch>0</horstretch> 223 <verstretch>0</verstretch> 224 </sizepolicy> 225 </property> 226 <property name="text" > 227 <string>Next</string> 228 </property> 229 </widget> 230 </item> 231 </layout> 228 232 </item> 229 233 <item> … … 234 238 <property name="sizeHint" > 235 239 <size> 236 <width> 40</width>240 <width>108</width> 237 241 <height>20</height> 238 242 </size> 239 243 </property> 240 244 </spacer> 245 </item> 246 <item> 247 <layout class="QVBoxLayout" > 248 <property name="leftMargin" > 249 <number>16</number> 250 </property> 251 <property name="rightMargin" > 252 <number>16</number> 253 </property> 254 <item> 255 <widget class="QCheckBox" name="randomCheckBox" > 256 <property name="text" > 257 <string>Random</string> 258 </property> 259 </widget> 260 </item> 261 <item> 262 <widget class="QCheckBox" name="repeatCheckBox" > 263 <property name="text" > 264 <string>Repeat</string> 265 </property> 266 </widget> 267 </item> 268 </layout> 241 269 </item> 242 270 </layout> … … 374 402 <x>0</x> 375 403 <y>0</y> 376 <width> 649</width>404 <width>918</width> 377 405 <height>29</height> 378 406 </rect> -
lib/mpdparseutils.cpp
r27 r28 16 16 destStatus.volume = tokens.at(1).toUInt(); 17 17 } else if(tokens.at(0) == "repeat") { 18 if(tokens.at(1) == "1") {18 if(tokens.at(1).trimmed() == "1") { 19 19 destStatus.repeat = true; 20 20 } else { … … 22 22 } 23 23 } else if(tokens.at(0) == "random") { 24 if(tokens.at(1) == "1") {25 destStatus.random = "1";24 if(tokens.at(1).trimmed() == "1") { 25 destStatus.random = true; 26 26 } else { 27 destStatus.random = "0";27 destStatus.random = false; 28 28 } 29 29 } else if(tokens.at(0) == "playlist") {
Note: See TracChangeset
for help on using the changeset viewer.
