Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwinoptions/windows.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | |||||
48 | #define KWIN_AUTORAISE "AutoRaise" | 48 | #define KWIN_AUTORAISE "AutoRaise" | ||
49 | #define KWIN_DELAYFOCUS_INTERVAL "DelayFocusInterval" | 49 | #define KWIN_DELAYFOCUS_INTERVAL "DelayFocusInterval" | ||
50 | #define KWIN_CLICKRAISE "ClickRaise" | 50 | #define KWIN_CLICKRAISE "ClickRaise" | ||
51 | #define KWIN_SHADEHOVER "ShadeHover" | 51 | #define KWIN_SHADEHOVER "ShadeHover" | ||
52 | #define KWIN_SHADEHOVER_INTERVAL "ShadeHoverInterval" | 52 | #define KWIN_SHADEHOVER_INTERVAL "ShadeHoverInterval" | ||
53 | #define KWIN_FOCUS_STEALING "FocusStealingPreventionLevel" | 53 | #define KWIN_FOCUS_STEALING "FocusStealingPreventionLevel" | ||
54 | #define KWIN_HIDE_UTILITY "HideUtilityWindowsForInactive" | 54 | #define KWIN_HIDE_UTILITY "HideUtilityWindowsForInactive" | ||
55 | #define KWIN_INACTIVE_SKIP_TASKBAR "InactiveTabsSkipTaskbar" | 55 | #define KWIN_INACTIVE_SKIP_TASKBAR "InactiveTabsSkipTaskbar" | ||
56 | #define KWIN_AUTOGROUP_SIMILAR "AutogroupSimilarWindows" | | |||
57 | #define KWIN_AUTOGROUP_FOREGROUND "AutogroupInForeground" | | |||
58 | #define KWIN_SEPARATE_SCREEN_FOCUS "SeparateScreenFocus" | 56 | #define KWIN_SEPARATE_SCREEN_FOCUS "SeparateScreenFocus" | ||
59 | #define KWIN_ACTIVE_MOUSE_SCREEN "ActiveMouseScreen" | 57 | #define KWIN_ACTIVE_MOUSE_SCREEN "ActiveMouseScreen" | ||
60 | 58 | | |||
61 | //CT 15mar 98 - magics | 59 | //CT 15mar 98 - magics | ||
62 | #define KWM_BRDR_SNAP_ZONE "BorderSnapZone" | 60 | #define KWM_BRDR_SNAP_ZONE "BorderSnapZone" | ||
63 | #define KWM_BRDR_SNAP_ZONE_DEFAULT 10 | 61 | #define KWM_BRDR_SNAP_ZONE_DEFAULT 10 | ||
64 | #define KWM_WNDW_SNAP_ZONE "WindowSnapZone" | 62 | #define KWM_WNDW_SNAP_ZONE "WindowSnapZone" | ||
65 | #define KWM_WNDW_SNAP_ZONE_DEFAULT 10 | 63 | #define KWM_WNDW_SNAP_ZONE_DEFAULT 10 | ||
▲ Show 20 Lines • Show All 318 Lines • ▼ Show 20 Line(s) | 380 | { | |||
384 | m_ui->placementCombo->setItemData(1, "Maximizing"); | 382 | m_ui->placementCombo->setItemData(1, "Maximizing"); | ||
385 | m_ui->placementCombo->setItemData(2, "Cascade"); | 383 | m_ui->placementCombo->setItemData(2, "Cascade"); | ||
386 | m_ui->placementCombo->setItemData(3, "Random"); | 384 | m_ui->placementCombo->setItemData(3, "Random"); | ||
387 | m_ui->placementCombo->setItemData(4, "Centered"); | 385 | m_ui->placementCombo->setItemData(4, "Centered"); | ||
388 | m_ui->placementCombo->setItemData(5, "ZeroCornered"); | 386 | m_ui->placementCombo->setItemData(5, "ZeroCornered"); | ||
389 | m_ui->placementCombo->setItemData(6, "UnderMouse"); | 387 | m_ui->placementCombo->setItemData(6, "UnderMouse"); | ||
390 | 388 | | |||
391 | connect(m_ui->shadeHoverOn, SIGNAL(toggled(bool)), this, SLOT(shadeHoverChanged(bool))); | 389 | connect(m_ui->shadeHoverOn, SIGNAL(toggled(bool)), this, SLOT(shadeHoverChanged(bool))); | ||
392 | connect(m_ui->inactiveTabsSkipTaskbar, SIGNAL(toggled(bool)), SLOT(changed())); | | |||
393 | connect(m_ui->autogroupSimilarWindows, SIGNAL(toggled(bool)), SLOT(changed())); | | |||
394 | connect(m_ui->autogroupInForeground, SIGNAL(toggled(bool)), SLOT(changed())); | | |||
395 | connect(m_ui->shadeHoverOn, SIGNAL(toggled(bool)), SLOT(changed())); | 390 | connect(m_ui->shadeHoverOn, SIGNAL(toggled(bool)), SLOT(changed())); | ||
396 | connect(m_ui->shadeHover, SIGNAL(valueChanged(int)), SLOT(changed())); | 391 | connect(m_ui->shadeHover, SIGNAL(valueChanged(int)), SLOT(changed())); | ||
397 | connect(m_ui->placementCombo, SIGNAL(activated(int)), SLOT(changed())); | 392 | connect(m_ui->placementCombo, SIGNAL(activated(int)), SLOT(changed())); | ||
398 | connect(m_ui->hideUtilityWindowsForInactive, SIGNAL(toggled(bool)), SLOT(changed())); | 393 | connect(m_ui->hideUtilityWindowsForInactive, SIGNAL(toggled(bool)), SLOT(changed())); | ||
399 | m_ui->inactiveTabsSkipTaskbar->setVisible(false); // TODO: We want translations in case this is fixed... | | |||
400 | load(); | 394 | load(); | ||
401 | 395 | | |||
402 | } | 396 | } | ||
403 | 397 | | |||
404 | void KAdvancedConfig::setShadeHover(bool on) | 398 | void KAdvancedConfig::setShadeHover(bool on) | ||
405 | { | 399 | { | ||
406 | m_ui->shadeHoverOn->setChecked(on); | 400 | m_ui->shadeHoverOn->setChecked(on); | ||
407 | m_ui->shadeHover->setEnabled(on); | 401 | m_ui->shadeHover->setEnabled(on); | ||
Show All 34 Lines | 430 | { | |||
442 | QString key; | 436 | QString key; | ||
443 | key = cg.readEntry(KWIN_PLACEMENT); | 437 | key = cg.readEntry(KWIN_PLACEMENT); | ||
444 | int idx = m_ui->placementCombo->findData(key); | 438 | int idx = m_ui->placementCombo->findData(key); | ||
445 | if (idx < 0) | 439 | if (idx < 0) | ||
446 | idx = m_ui->placementCombo->findData("Smart"); | 440 | idx = m_ui->placementCombo->findData("Smart"); | ||
447 | m_ui->placementCombo->setCurrentIndex(idx); | 441 | m_ui->placementCombo->setCurrentIndex(idx); | ||
448 | 442 | | |||
449 | setHideUtilityWindowsForInactive(cg.readEntry(KWIN_HIDE_UTILITY, true)); | 443 | setHideUtilityWindowsForInactive(cg.readEntry(KWIN_HIDE_UTILITY, true)); | ||
450 | setInactiveTabsSkipTaskbar(cg.readEntry(KWIN_INACTIVE_SKIP_TASKBAR, false)); | | |||
451 | setAutogroupSimilarWindows(cg.readEntry(KWIN_AUTOGROUP_SIMILAR, false)); | | |||
452 | setAutogroupInForeground(cg.readEntry(KWIN_AUTOGROUP_FOREGROUND, true)); | | |||
453 | 444 | | |||
454 | emit KCModule::changed(false); | 445 | emit KCModule::changed(false); | ||
455 | } | 446 | } | ||
456 | 447 | | |||
457 | void KAdvancedConfig::save(void) | 448 | void KAdvancedConfig::save(void) | ||
458 | { | 449 | { | ||
459 | int v; | 450 | int v; | ||
460 | 451 | | |||
461 | KConfigGroup cg(config, "Windows"); | 452 | KConfigGroup cg(config, "Windows"); | ||
462 | cg.writeEntry(KWIN_SHADEHOVER, m_ui->shadeHoverOn->isChecked()); | 453 | cg.writeEntry(KWIN_SHADEHOVER, m_ui->shadeHoverOn->isChecked()); | ||
463 | 454 | | |||
464 | v = getShadeHoverInterval(); | 455 | v = getShadeHoverInterval(); | ||
465 | if (v < 0) v = 0; | 456 | if (v < 0) v = 0; | ||
466 | cg.writeEntry(KWIN_SHADEHOVER_INTERVAL, v); | 457 | cg.writeEntry(KWIN_SHADEHOVER_INTERVAL, v); | ||
467 | | ||||
468 | cg.writeEntry(KWIN_PLACEMENT, m_ui->placementCombo->itemData(m_ui->placementCombo->currentIndex()).toString()); | 458 | cg.writeEntry(KWIN_PLACEMENT, m_ui->placementCombo->itemData(m_ui->placementCombo->currentIndex()).toString()); | ||
469 | | ||||
470 | cg.writeEntry(KWIN_HIDE_UTILITY, m_ui->hideUtilityWindowsForInactive->isChecked()); | 459 | cg.writeEntry(KWIN_HIDE_UTILITY, m_ui->hideUtilityWindowsForInactive->isChecked()); | ||
471 | cg.writeEntry(KWIN_INACTIVE_SKIP_TASKBAR, m_ui->inactiveTabsSkipTaskbar->isChecked()); | | |||
472 | cg.writeEntry(KWIN_AUTOGROUP_SIMILAR, m_ui->autogroupSimilarWindows->isChecked()); | | |||
473 | cg.writeEntry(KWIN_AUTOGROUP_FOREGROUND, m_ui->autogroupInForeground->isChecked()); | | |||
474 | 460 | | |||
475 | if (standAlone) { | 461 | if (standAlone) { | ||
476 | config->sync(); | 462 | config->sync(); | ||
477 | // Send signal to all kwin instances | 463 | // Send signal to all kwin instances | ||
478 | QDBusMessage message = | 464 | QDBusMessage message = | ||
479 | QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); | 465 | QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); | ||
480 | QDBusConnection::sessionBus().send(message); | 466 | QDBusConnection::sessionBus().send(message); | ||
481 | 467 | | |||
482 | } | 468 | } | ||
483 | emit KCModule::changed(false); | 469 | emit KCModule::changed(false); | ||
484 | } | 470 | } | ||
485 | 471 | | |||
486 | void KAdvancedConfig::defaults() | 472 | void KAdvancedConfig::defaults() | ||
487 | { | 473 | { | ||
488 | setShadeHover(false); | 474 | setShadeHover(false); | ||
489 | setShadeHoverInterval(250); | 475 | setShadeHoverInterval(250); | ||
490 | m_ui->placementCombo->setCurrentIndex(0); // default to Smart | 476 | m_ui->placementCombo->setCurrentIndex(0); // default to Smart | ||
491 | setHideUtilityWindowsForInactive(true); | 477 | setHideUtilityWindowsForInactive(true); | ||
492 | setInactiveTabsSkipTaskbar(false); | | |||
493 | setAutogroupSimilarWindows(false); | | |||
494 | setAutogroupInForeground(true); | | |||
495 | emit KCModule::changed(true); | 478 | emit KCModule::changed(true); | ||
496 | } | 479 | } | ||
497 | 480 | | |||
498 | 481 | | |||
499 | void KAdvancedConfig::setHideUtilityWindowsForInactive(bool s) | 482 | void KAdvancedConfig::setHideUtilityWindowsForInactive(bool s) | ||
500 | { | 483 | { | ||
501 | m_ui->hideUtilityWindowsForInactive->setChecked(s); | 484 | m_ui->hideUtilityWindowsForInactive->setChecked(s); | ||
502 | } | 485 | } | ||
503 | 486 | | |||
504 | void KAdvancedConfig::setInactiveTabsSkipTaskbar(bool s) | | |||
505 | { | | |||
506 | m_ui->inactiveTabsSkipTaskbar->setChecked(s); | | |||
507 | } | | |||
508 | | ||||
509 | void KAdvancedConfig::setAutogroupSimilarWindows(bool s) | | |||
510 | { | | |||
511 | m_ui->autogroupSimilarWindows->setChecked(s); | | |||
512 | } | | |||
513 | | ||||
514 | void KAdvancedConfig::setAutogroupInForeground(bool s) | | |||
515 | { | | |||
516 | m_ui->autogroupInForeground->setChecked(s); | | |||
517 | } | | |||
518 | | ||||
519 | KWinMovingConfigForm::KWinMovingConfigForm(QWidget* parent) | 487 | KWinMovingConfigForm::KWinMovingConfigForm(QWidget* parent) | ||
520 | : QWidget(parent) | 488 | : QWidget(parent) | ||
521 | { | 489 | { | ||
522 | setupUi(parent); | 490 | setupUi(parent); | ||
523 | } | 491 | } | ||
524 | 492 | | |||
525 | KMovingConfig::~KMovingConfig() | 493 | KMovingConfig::~KMovingConfig() | ||
526 | { | 494 | { | ||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |