summaryrefslogtreecommitdiffstats
path: root/kcontrol/displayconfig
diff options
context:
space:
mode:
Diffstat (limited to 'kcontrol/displayconfig')
-rw-r--r--kcontrol/displayconfig/displayconfig.cpp59
-rw-r--r--kcontrol/displayconfig/displayconfig.desktop2
-rw-r--r--kcontrol/displayconfig/displayconfig.h3
-rw-r--r--kcontrol/displayconfig/displayconfigbase.ui16
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>&amp;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>&amp;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 &amp;Existing Profile</string>
+ </property>
+ </widget>
<widget class="KPushButton" row="8" column="2" colspan="1">
<property name="name">
<cstring>previewConfiguration</cstring>