diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-24 03:21:22 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-24 03:21:22 +0000 |
commit | 9cff39bc34d1f0579b2f9841f55c6cebc87fed57 (patch) | |
tree | 3d809111cc494a4e2267a55bb6fd327fd0194830 /kcontrol/displayconfig | |
parent | 422e6d3a19cb512c83ae4145bb4ffb8cc491f454 (diff) | |
download | tdebase-9cff39bc34d1f0579b2f9841f55c6cebc87fed57.tar.gz tdebase-9cff39bc34d1f0579b2f9841f55c6cebc87fed57.zip |
Enable the new display configuration module
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1249201 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/displayconfig')
-rw-r--r-- | kcontrol/displayconfig/displayconfig.cpp | 59 | ||||
-rw-r--r-- | kcontrol/displayconfig/displayconfig.desktop | 2 | ||||
-rw-r--r-- | kcontrol/displayconfig/displayconfig.h | 3 | ||||
-rw-r--r-- | kcontrol/displayconfig/displayconfigbase.ui | 16 |
4 files changed, 79 insertions, 1 deletions
diff --git a/kcontrol/displayconfig/displayconfig.cpp b/kcontrol/displayconfig/displayconfig.cpp index 7c75df2f2..98285276a 100644 --- a/kcontrol/displayconfig/displayconfig.cpp +++ b/kcontrol/displayconfig/displayconfig.cpp @@ -693,7 +693,10 @@ KDisplayConfig::KDisplayConfig(TQWidget *parent, const char *name, const TQStrin connect(base->systemEnableSupport, TQT_SIGNAL(toggled(bool)), base->monitorDisplaySelectDD, TQT_SLOT(setEnabled(bool))); + connect(base->rescanHardware, TQT_SIGNAL(clicked()), TQT_SLOT(rescanHardware())); + connect(base->loadExistingProfile, TQT_SIGNAL(clicked()), TQT_SLOT(reloadProfile())); connect(base->previewConfiguration, TQT_SIGNAL(clicked()), TQT_SLOT(activatePreview())); + connect(base->identifyMonitors, TQT_SIGNAL(clicked()), TQT_SLOT(identifyMonitors())); load(); @@ -720,6 +723,59 @@ void KDisplayConfig::updateExtendedMonitorInformation () { refreshDisplayedInformation(); } +void KDisplayConfig::rescanHardware (void) { + m_randrsimple->destroyScreenInformationObject(m_screenInfoArray); + m_screenInfoArray = m_randrsimple->readCurrentDisplayConfiguration(); + m_randrsimple->ensureMonitorDataConsistency(m_screenInfoArray); + numberOfScreens = m_screenInfoArray.count(); + refreshDisplayedInformation(); +} + +void KDisplayConfig::reloadProfile (void) { + // FIXME + m_randrsimple->destroyScreenInformationObject(m_screenInfoArray); + m_screenInfoArray = m_randrsimple->loadSystemwideDisplayConfiguration("", KDE_CONFDIR); + m_randrsimple->ensureMonitorDataConsistency(m_screenInfoArray); + numberOfScreens = m_screenInfoArray.count(); + refreshDisplayedInformation(); +} + +void KDisplayConfig::identifyMonitors () { + int i; + + TQLabel* idWidget; + TQPtrList<TQWidget> widgetList; + + Display *randr_display; + ScreenInfo *randr_screen_info; + XRROutputInfo *output_info; + + randr_display = XOpenDisplay(NULL); + randr_screen_info = m_randrsimple->read_screen_info(randr_display); + + for (i = 0; i < randr_screen_info->n_output; i++) { + output_info = randr_screen_info->outputs[i]->info; + // Look for ON outputs... + if (!randr_screen_info->outputs[i]->cur_crtc) { + continue; + } + SingleScreenData *screendata = m_screenInfoArray.at(i); + idWidget = new TQLabel(TQString("Screen\n%1").arg(i+1), (TQWidget*)0, "", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_StaysOnTop | Qt::WX11BypassWM | Qt::WDestructiveClose); + widgetList.append(idWidget); + idWidget->resize(150, 100); + idWidget->setAlignment(Qt::AlignCenter); + TQFont font = idWidget->font(); + font.setBold( true ); + font.setPointSize(24); + idWidget->setFont( font ); + idWidget->setPaletteForegroundColor(Qt::white); + idWidget->setPaletteBackgroundColor(Qt::black); + idWidget->show(); + KDialog::centerOnScreen(idWidget, i); + TQTimer::singleShot(3000, idWidget, SLOT(close())); + } +} + void KDisplayConfig::deleteProfile () { } @@ -1038,6 +1094,9 @@ void KDisplayConfig::processLockoutControls() { base->resolutionTab->setEnabled(false); } } + + base->loadExistingProfile->setEnabled(false); // Disable this until it works properly! + base->loadExistingProfile->hide(); // Same as above } void KDisplayConfig::addTab( const TQString name, const TQString label ) diff --git a/kcontrol/displayconfig/displayconfig.desktop b/kcontrol/displayconfig/displayconfig.desktop index 9fc6a06c4..653e2f002 100644 --- a/kcontrol/displayconfig/displayconfig.desktop +++ b/kcontrol/displayconfig/displayconfig.desktop @@ -20,4 +20,4 @@ MimeType= Name=Monitor and Display Name[en_US]=Monitor and Display -NoDisplay=true
\ No newline at end of file +NoDisplay=false
\ No newline at end of file diff --git a/kcontrol/displayconfig/displayconfig.h b/kcontrol/displayconfig/displayconfig.h index 643ff81af..835f1209a 100644 --- a/kcontrol/displayconfig/displayconfig.h +++ b/kcontrol/displayconfig/displayconfig.h @@ -111,6 +111,9 @@ private slots: void rotationInfoChanged (void); void refreshInfoChanged (void); void activatePreview (void); + void identifyMonitors (void); + void rescanHardware (void); + void reloadProfile (void); }; #endif diff --git a/kcontrol/displayconfig/displayconfigbase.ui b/kcontrol/displayconfig/displayconfigbase.ui index 56b5416a6..cbffc91fd 100644 --- a/kcontrol/displayconfig/displayconfigbase.ui +++ b/kcontrol/displayconfig/displayconfigbase.ui @@ -249,6 +249,22 @@ <string>&Extend my Trinity desktop onto this monitor.</string> </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> + </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> + </widget> <widget class="KPushButton" row="8" column="2" colspan="1"> <property name="name"> <cstring>previewConfiguration</cstring> |