Changeset 127 for smplayer/vendor/current/src/prefinterface.cpp
- Timestamp:
- Mar 29, 2012, 3:09:42 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/prefinterface.cpp
r121 r127 67 67 } 68 68 69 #ifdef SINGLE_INSTANCE 69 70 connect(single_instance_check, SIGNAL(toggled(bool)), 70 71 this, SLOT(changeInstanceImages())); 72 #else 73 tabWidget->setTabEnabled(SINGLE_INSTANCE_TAB, false); 74 #endif 71 75 72 76 #ifdef Q_OS_WIN … … 121 125 /* volume_icon->setPixmap( Images::icon("speaker") ); */ 122 126 127 #ifdef SINGLE_INSTANCE 123 128 changeInstanceImages(); 129 #endif 124 130 125 131 // Seek widgets … … 171 177 setResizeMethod( pref->resize_method ); 172 178 setSaveSize( pref->save_window_size_on_exit ); 179 #ifdef SINGLE_INSTANCE 173 180 setUseSingleInstance(pref->use_single_instance); 174 setServerPort(pref->connection_port); 175 setUseAutoPort(pref->use_autoport); 181 #endif 176 182 setRecentsMaxItems(pref->history_recents->maxItems()); 177 183 … … 208 214 language_changed = false; 209 215 iconset_changed = false; 216 gui_changed = false; 217 style_changed = false; 210 218 recents_changed = false; 211 port_changed = false;212 style_changed = false;213 219 214 220 if (pref->language != language()) { … … 223 229 } 224 230 231 if (pref->gui != GUI()) { 232 pref->gui = GUI(); 233 gui_changed = true; 234 } 235 225 236 pref->resize_method = resizeMethod(); 226 237 pref->save_window_size_on_exit = saveSize(); 227 238 239 #ifdef SINGLE_INSTANCE 228 240 pref->use_single_instance = useSingleInstance(); 229 if (pref->connection_port != serverPort()) { 230 pref->connection_port = serverPort(); 231 port_changed = true; 232 } 233 234 if (pref->use_autoport != useAutoPort()) { 235 pref->use_autoport = useAutoPort(); 236 port_changed = true; 237 } 241 #endif 238 242 239 243 if (pref->history_recents->maxItems() != recentsMaxItems()) { … … 261 265 } 262 266 #endif 263 264 pref->gui = GUI();265 267 266 268 pref->floating_control_animated = floatingAnimated(); … … 348 350 } 349 351 352 #ifdef SINGLE_INSTANCE 350 353 void PrefInterface::setUseSingleInstance(bool b) { 351 354 single_instance_check->setChecked(b); … … 356 359 return single_instance_check->isChecked(); 357 360 } 358 359 void PrefInterface::setServerPort(int port) { 360 server_port_spin->setValue(port); 361 } 362 363 int PrefInterface::serverPort() { 364 return server_port_spin->value(); 365 } 366 367 void PrefInterface::setUseAutoPort(bool b) { 368 automatic_port_button->setChecked(b); 369 manual_port_button->setChecked(!b); 370 } 371 372 bool PrefInterface::useAutoPort() { 373 return automatic_port_button->isChecked(); 374 } 375 376 void PrefInterface::setSingleInstanceTabEnabled(bool b) { 377 tabWidget->setTabEnabled(SINGLE_INSTANCE_TAB, b); 378 } 379 380 bool PrefInterface::singleInstanceTabEnabled() { 381 return tabWidget->isTabEnabled(SINGLE_INSTANCE_TAB); 382 } 361 #endif 383 362 384 363 void PrefInterface::setRecentsMaxItems(int n) { … … 473 452 } 474 453 454 #ifdef SINGLE_INSTANCE 475 455 void PrefInterface::changeInstanceImages() { 476 456 if (single_instance_check->isChecked()) … … 479 459 instances_icon->setPixmap( Images::icon("instance2") ); 480 460 } 461 #endif 481 462 482 463 void PrefInterface::setHideVideoOnAudioFiles(bool b) { … … 605 586 tr("Note: this option only works with MPlayer2") ); 606 587 588 #ifdef SINGLE_INSTANCE 607 589 addSectionTitle(tr("Instances")); 608 590 … … 611 593 tr("Check this option if you want to use an already running instance " 612 594 "of SMPlayer when opening other files.") ); 613 614 setWhatsThis(automatic_port_button, tr("Automatic port"), 615 tr("SMPlayer needs to listen to a port to receive commands from other " 616 "instances. If you select this option, a port will be " 617 "automatically chosen.") ); 618 619 setWhatsThis(server_port_spin, tr("Manual port"), 620 tr("SMPlayer needs to listen to a port to receive commands from other " 621 "instances. You can change the port in case the default one is " 622 "used by another application.") ); 623 624 manual_port_button->setWhatsThis( server_port_spin->whatsThis() ); 595 #endif 625 596 626 597 addSectionTitle(tr("Floating control"));
Note:
See TracChangeset
for help on using the changeset viewer.