From 2eb906099dece64705e51f4e79bfef0ac1c54843 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 23 Aug 2011 07:52:47 +0000 Subject: Increase libkrandr functionality Part 1/2 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1248961 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- krandr/randr.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'krandr/randr.cpp') 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); -- cgit v1.2.1