summaryrefslogtreecommitdiffstats
path: root/krandr/randr.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-23 07:52:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-23 07:52:47 +0000
commit2eb906099dece64705e51f4e79bfef0ac1c54843 (patch)
tree3e2373375d1f8a6bc47a974dce29717633474692 /krandr/randr.cpp
parentec0ac5ba48e15d1df22f3cdd427b773c7e5b6988 (diff)
downloadtdelibs-2eb906099dece64705e51f4e79bfef0ac1c54843.tar.gz
tdelibs-2eb906099dece64705e51f4e79bfef0ac1c54843.zip
Increase libkrandr functionality
Part 1/2 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1248961 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krandr/randr.cpp')
-rw-r--r--krandr/randr.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/krandr/randr.cpp b/krandr/randr.cpp
index 5987d8808..378a1fdb7 100644
--- a/krandr/randr.cpp
+++ b/krandr/randr.cpp
@@ -708,6 +708,45 @@ void RandRDisplay::applyProposed(bool confirm)
}
}
+bool RandRDisplay::showTestConfigurationDialog()
+{
+ return screen(0)->showTestConfigurationDialog();
+}
+
+bool RandRScreen::showTestConfigurationDialog()
+{
+ // uncomment the line below and edit out the KTimerDialog stuff to get
+ // a version which works on today's kdelibs (no accept dialog is presented)
+
+ // FIXME remember to put the dialog on the right screen
+
+ KTimerDialog acceptDialog ( 15000, KTimerDialog::CountDown,
+ KApplication::kApplication()->mainWidget(),
+ "mainKTimerDialog",
+ true,
+ i18n("Confirm Display Settings"),
+ KTimerDialog::Ok|KTimerDialog::Cancel,
+ KTimerDialog::Cancel);
+
+ acceptDialog.setButtonOK(KGuiItem(i18n("&Accept Configuration"), "button_ok"));
+ acceptDialog.setButtonCancel(KGuiItem(i18n("&Return to Previous Configuration"), "button_cancel"));
+
+ KActiveLabel *label = new KActiveLabel(i18n("Your display devices has been configured "
+ "to match the settings shown above. Please indicate whether you wish to "
+ "keep this configuration. In 15 seconds the display will revert to your previous "
+ "settings."), &acceptDialog, "userSpecifiedLabel");
+
+ acceptDialog.setMainWidget(label);
+
+ KDialog::centerOnScreen(&acceptDialog, 0);
+
+ m_shownDialog = &acceptDialog;
+ connect( m_shownDialog, TQT_SIGNAL( destroyed()), this, TQT_SLOT( shownDialogDestroyed()));
+ connect( kapp->desktop(), TQT_SIGNAL( resized(int)), this, TQT_SLOT( desktopResized()));
+
+ return acceptDialog.exec();
+}
+
int RandRScreen::pixelCount( int index ) const
{
TQSize sz = pixelSize(index);