Changeset 188 for smplayer/trunk/src/prefnetwork.cpp
- Timestamp:
- Jan 24, 2017, 12:41:54 PM (8 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 186
- Property svn:mergeinfo changed
-
smplayer/trunk/src/prefnetwork.cpp
r181 r188 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 6Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 24 24 #ifdef YOUTUBE_SUPPORT 25 25 #include "retrieveyoutubeurl.h" 26 #endif 27 28 #ifdef CHROMECAST_SUPPORT 29 #include "chromecast.h" 26 30 #endif 27 31 … … 106 110 yt_user_agent_edit->setText( pref->yt_user_agent ); 107 111 #endif 112 113 #ifdef CHROMECAST_SUPPORT 114 Chromecast * cc = Chromecast::instance(); 115 setLocalIP(cc->localAddress(), cc->localAddresses()); 116 port_spin->setValue(cc->serverPort()); 117 directory_listing_check->setChecked(cc->directoryListing()); 118 #endif 108 119 } 109 120 … … 124 135 pref->yt_user_agent = yt_user_agent_edit->text(); 125 136 #endif 137 138 #ifdef CHROMECAST_SUPPORT 139 Chromecast * cc = Chromecast::instance(); 140 cc->setLocalAddress(localIP()); 141 cc->setServerPort(port_spin->value()); 142 cc->setDirectoryListing(directory_listing_check->isChecked()); 143 #endif 126 144 } 127 145 … … 163 181 youtube_box->setEnabled(i == Preferences::StreamingYT || i == Preferences::StreamingAuto); 164 182 } 183 184 #ifdef CHROMECAST_SUPPORT 185 void PrefNetwork::setLocalIP(const QString & ip, const QStringList & values) { 186 local_ip_combo->clear(); 187 local_ip_combo->addItem(tr("Auto")); 188 local_ip_combo->addItems(values); 189 190 if (ip.isEmpty()) { 191 local_ip_combo->setCurrentIndex(0); 192 } else { 193 int pos = local_ip_combo->findText(ip); 194 if (pos > -1) { 195 local_ip_combo->setCurrentIndex(pos); 196 } else { 197 local_ip_combo->setEditText(ip); 198 } 199 } 200 } 201 202 QString PrefNetwork::localIP() { 203 if (local_ip_combo->currentIndex() == 0) { 204 return ""; 205 } else { 206 return local_ip_combo->currentText(); 207 } 208 } 209 #endif 165 210 166 211 void PrefNetwork::createHelp() { … … 204 249 #endif 205 250 251 #ifdef CHROMECAST_SUPPORT 252 addSectionTitle(tr("Chromecast")); 253 254 setWhatsThis(local_ip_combo, tr("Local IP"), 255 tr("The local IP address of this computer. It will be passed to Chromecast " 256 "so that it can access the files from this computer.") ); 257 258 setWhatsThis(port_spin, tr("Port"), 259 tr("The port that the web server will use.") ); 260 261 setWhatsThis(directory_listing_check, tr("Directory listing"), 262 tr("When the web server is running, any device in your network can access the " 263 "files from this computer. If this option is on, any device can get a listing " 264 "of the files in this computer. " 265 "If this option is off, the list won't be available.") ); 266 #endif 267 206 268 addSectionTitle(tr("Proxy")); 207 269
Note:
See TracChangeset
for help on using the changeset viewer.