diff options
Diffstat (limited to 'kcontrol/displayconfig')
-rw-r--r-- | kcontrol/displayconfig/displayconfig.cpp | 29 | ||||
-rw-r--r-- | kcontrol/displayconfig/displayconfig.h | 2 | ||||
-rw-r--r-- | kcontrol/displayconfig/displayconfigbase.ui | 79 |
3 files changed, 78 insertions, 32 deletions
diff --git a/kcontrol/displayconfig/displayconfig.cpp b/kcontrol/displayconfig/displayconfig.cpp index faeffa1f5..47c45a3a9 100644 --- a/kcontrol/displayconfig/displayconfig.cpp +++ b/kcontrol/displayconfig/displayconfig.cpp @@ -447,7 +447,7 @@ void KDisplayConfig::updateDraggableMonitorInformationInternal (int monitor_id, } TQString rotationDesired = *screendata->rotations.at(screendata->current_rotation_index); - bool isvisiblyrotated = ((rotationDesired == "Rotate 90 degrees") || (rotationDesired == "Rotate 270 degrees")); + bool isvisiblyrotated = ((rotationDesired == ROTATION_90_DEGREES_STRING) || (rotationDesired == ROTATION_270_DEGREES_STRING)); if (screendata->is_extended) { moved_monitor->show(); @@ -742,6 +742,8 @@ void KDisplayConfig::setRealResolutionSliderValue(int index) { KDisplayConfig::KDisplayConfig(TQWidget *parent, const char *name, const TQStringList &) : KCModule(KDisplayCFactory::instance(), parent, name), iccTab(0), m_randrsimple(0), m_gammaApplyTimer(0) { + TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices(); + connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*))); m_randrsimple = new KRandrSimpleAPI(); @@ -773,9 +775,18 @@ KDisplayConfig::KDisplayConfig(TQWidget *parent, const char *name, const TQStrin base->systemEnableSupport->setText(i18n("&Enable local display control for this session")); } - setRootOnlyMsg(i18n("<b>The global display configuration is a system wide setting, and requires administrator access</b><br>To alter the system's global display configuration, click on the \"Administrator Mode\" button below.<br>Otherwise, you may change your session-specific display configuration below.")); +// setRootOnlyMsg(i18n("<b>The global display configuration is a system wide setting, and requires administrator access</b><br>To alter the system's global display configuration, click on the \"Administrator Mode\" button below.<br>Otherwise, you may change your session-specific display configuration below.")); // setUseRootOnlyMsg(true); // Setting this hides the Apply button! + base->nonRootWarningLabel->setFrameShape(TQFrame::Box); + base->nonRootWarningLabel->setFrameShadow(TQFrame::Raised); + if (getuid() != 0) { + base->nonRootWarningLabel->setText(i18n("<b>The global display configuration is a system wide setting, and requires administrator access</b><br>To alter the system's global display configuration, click on the \"Administrator Mode\" button below.<br>Otherwise, you may change your session-specific display configuration below.")); + } + else { + base->nonRootWarningLabel->hide(); + } + connect(base->systemEnableSupport, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); connect(base->systemEnableSupport, TQT_SIGNAL(clicked()), TQT_SLOT(processLockoutControls())); connect(base->monitorDisplaySelectDD, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); @@ -833,6 +844,16 @@ KDisplayConfig::~KDisplayConfig() } } +void KDisplayConfig::deviceChanged (TDEGenericDevice* device) { + if (device->type() == TDEGenericDeviceType::Monitor) { + if (base->rescanHardware->isEnabled()) { + base->rescanHardware->setEnabled(false); + rescanHardware(); + base->rescanHardware->setEnabled(true); + } + } +} + void KDisplayConfig::updateExtendedMonitorInformation () { SingleScreenData *screendata; @@ -987,7 +1008,7 @@ void KDisplayConfig::updateDisplayedInformation () { base->orientationVFlip->setChecked(screendata->has_y_flip); } else { - base->rotationSelectDD->insertItem("Normal", 0); + base->rotationSelectDD->insertItem(ROTATION_0_DEGREES_STRING, 0); base->rotationSelectDD->setCurrentItem(0); base->orientationHFlip->hide(); base->orientationVFlip->hide(); @@ -1097,7 +1118,7 @@ void KDisplayConfig::updateDragDropDisplay() { screendata = m_screenInfoArray.at(i); if (((j==0) && (screendata->is_primary==true)) || ((j==1) && (screendata->is_primary==false))) { // This ensures that the primary monitor is always the first one created and placed on the configuration widget TQString rotationDesired = *screendata->rotations.at(screendata->current_rotation_index); - bool isvisiblyrotated = ((rotationDesired == "Rotate 90 degrees") || (rotationDesired == "Rotate 270 degrees")); + bool isvisiblyrotated = ((rotationDesired == ROTATION_90_DEGREES_STRING) || (rotationDesired == ROTATION_270_DEGREES_STRING)); DraggableMonitor *m = new DraggableMonitor( base->monitorPhyArrange, 0, WStyle_Customize | WDestructiveClose | WStyle_NoBorder | WX11BypassWM ); connect(m, TQT_SIGNAL(workspaceRelayoutNeeded()), this, TQT_SLOT(layoutDragDropDisplay())); connect(m, TQT_SIGNAL(monitorSelected(int)), this, TQT_SLOT(selectScreen(int))); diff --git a/kcontrol/displayconfig/displayconfig.h b/kcontrol/displayconfig/displayconfig.h index 53541d8f8..8f7681c81 100644 --- a/kcontrol/displayconfig/displayconfig.h +++ b/kcontrol/displayconfig/displayconfig.h @@ -35,6 +35,7 @@ #include <dcopobject.h> #include <libkrandr/libkrandr.h> +#include <tdehardwaredevices.h> #include "monitorworkspace.h" #include "displayconfigbase.h" @@ -128,6 +129,7 @@ private slots: void gammaTargetChanged (int slotNumber); void dpmsChanged (void); void processDPMSControls (void); + void deviceChanged (TDEGenericDevice*); }; #endif diff --git a/kcontrol/displayconfig/displayconfigbase.ui b/kcontrol/displayconfig/displayconfigbase.ui index 3ea1c57e7..dfa7e57fd 100644 --- a/kcontrol/displayconfig/displayconfigbase.ui +++ b/kcontrol/displayconfig/displayconfigbase.ui @@ -26,7 +26,12 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="TQGroupBox" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> + <property name="name"> + <cstring>nonRootWarningLabel</cstring> + </property> + </widget> + <widget class="TQGroupBox" row="1" column="0"> <property name="name"> <cstring>groupSystemSettings</cstring> </property> @@ -47,7 +52,7 @@ </widget> </grid> </widget> - <spacer row="1" column="0"> + <spacer row="2" column="0"> <property name="name" stdset="0"> <cstring>Spacer4</cstring> </property> @@ -225,7 +230,15 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="KComboBox" row="0" column="0" colspan="1"> + <widget class="TQLabel" row="0" column="0" colspan="1"> + <property name="name"> + <cstring>textLabel7_9</cstring> + </property> + <property name="text"> + <string>Rotate screen by:</string> + </property> + </widget> + <widget class="KComboBox" row="1" column="0" colspan="1"> <property name="name"> <cstring>rotationSelectDD</cstring> </property> @@ -265,36 +278,46 @@ </property> </widget> <widget class="KPushButton" row="8" column="0" colspan="1"> - <property name="name"> - <cstring>rescanHardware</cstring> - </property> - <property name="text"> - <string>&Rescan Displays</string> - </property> + <property name="name"> + <cstring>rescanHardware</cstring> + </property> + <property name="text"> + <string>&Rescan Displays</string> + </property> </widget> <widget class="KPushButton" row="8" column="1" colspan="1"> - <property name="name"> - <cstring>loadExistingProfile</cstring> - </property> - <property name="text"> - <string>Load &Existing Profile</string> - </property> + <property name="name"> + <cstring>loadExistingProfile</cstring> + </property> + <property name="text"> + <string>Load &Existing Profile</string> + </property> </widget> - <widget class="KPushButton" row="8" column="2" colspan="1"> + <widget class="TQLayoutWidget" row="8" column="3" colspan="1"> <property name="name"> - <cstring>previewConfiguration</cstring> - </property> - <property name="text"> - <string>&Test Settings</string> - </property> - </widget> - <widget class="KPushButton" row="8" column="3" colspan="1"> - <property name="name"> - <cstring>identifyMonitors</cstring> - </property> - <property name="text"> - <string>&Identify</string> + <cstring>layout7</cstring> </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KPushButton" row="8" column="0" colspan="1"> + <property name="name"> + <cstring>previewConfiguration</cstring> + </property> + <property name="text"> + <string>&Test Settings</string> + </property> + </widget> + <widget class="KPushButton" row="8" column="1" colspan="1"> + <property name="name"> + <cstring>identifyMonitors</cstring> + </property> + <property name="text"> + <string>&Identify</string> + </property> + </widget> + </hbox> </widget> </grid> </widget> |