diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-15 07:07:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-15 07:07:43 +0000 |
commit | bd27b8e587811a2d607905fcd822ee2da7fcddc7 (patch) | |
tree | 24d84280aea3b1aa2d4a056f7829d9dd07da0424 | |
parent | 05b7686a12889c994a2edc3f1a8c1604474db59b (diff) | |
download | tdelibs-bd27b8e587811a2d607905fcd822ee2da7fcddc7.tar.gz tdelibs-bd27b8e587811a2d607905fcd822ee2da7fcddc7.zip |
Split out system modal dialog header widget
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1253788 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r-- | kdeui/kdialog.cpp | 52 | ||||
-rw-r--r-- | kdeui/kdialog.h | 16 |
2 files changed, 55 insertions, 13 deletions
diff --git a/kdeui/kdialog.cpp b/kdeui/kdialog.cpp index 9988aecba..b41c8c479 100644 --- a/kdeui/kdialog.cpp +++ b/kdeui/kdialog.cpp @@ -324,24 +324,18 @@ void KDialogQueue::slotShowQueuedDialog() void KDialog::virtual_hook( int, void* ) { /*BASE::virtual_hook( id, data );*/ } -KSMModalDialog::KSMModalDialog(TQWidget* parent) - : TQWidget( 0, "", Qt::WStyle_Customize | Qt::WType_Dialog | Qt::WStyle_Title | Qt::WStyle_StaysOnTop | Qt::WDestructiveClose ), m_allowClose(false) - +KSMModalDialogHeader::KSMModalDialogHeader(TQWidget* parent) + : TQWidget( parent, "", Qt::WDestructiveClose ) { - // Signal that we do not want any window controls to be shown at all - Atom kde_wm_system_modal_notification; - kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); - XChangeProperty(qt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); - TQVBoxLayout* vbox = new TQVBoxLayout( this ); - + TQFrame* frame = new TQFrame( this ); frame->setFrameStyle( TQFrame::NoFrame ); - frame->setLineWidth( tqstyle().tqpixelMetric( TQStyle::PM_DefaultFrameWidth, frame ) ); + frame->setLineWidth( 0 ); // we need to set the minimum size for the window frame->setMinimumWidth(400); vbox->addWidget( frame ); - TQGridLayout* gbox = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); + TQGridLayout* gbox = new TQGridLayout( frame, 1, 1, 0, KDialog::spacingHint() ); TQHBoxLayout* centerbox = new TQHBoxLayout( frame, 0, KDialog::spacingHint() ); TQHBoxLayout* seperatorbox = new TQHBoxLayout( frame, 0, 0 ); @@ -388,15 +382,47 @@ KSMModalDialog::KSMModalDialog(TQWidget* parent) label->setFont( fnt ); centerbox->addWidget( label, AlignCenter ); + gbox->addLayout(centerbox, 0, 0); + gbox->addLayout(seperatorbox, 1, 0); + + setFixedSize( sizeHint() ); +} + +KSMModalDialogHeader::~KSMModalDialogHeader() +{ +} + +KSMModalDialog::KSMModalDialog(TQWidget* parent) + : TQWidget( 0, "", Qt::WStyle_Customize | Qt::WType_Dialog | Qt::WStyle_Title | Qt::WStyle_StaysOnTop | Qt::WDestructiveClose ), m_allowClose(false) + +{ + // Signal that we do not want any window controls to be shown at all + Atom kde_wm_system_modal_notification; + kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False); + XChangeProperty(qt_xdisplay(), winId(), kde_wm_system_modal_notification, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); + + TQVBoxLayout* vbox = new TQVBoxLayout( this ); + + TQFrame* frame = new TQFrame( this ); + frame->setFrameStyle( TQFrame::NoFrame ); + frame->setLineWidth( tqstyle().tqpixelMetric( TQStyle::PM_DefaultFrameWidth, frame ) ); + // we need to set the minimum size for the window + frame->setMinimumWidth(400); + vbox->addWidget( frame ); + TQGridLayout* gbox = new TQGridLayout( frame, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); + TQHBoxLayout* centerbox = new TQHBoxLayout( frame, 0, KDialog::spacingHint() ); + m_statusLabel = new TQLabel( i18n("Pondering what to do next").append("..."), frame ); - fnt = m_statusLabel->font(); + TQFont fnt = m_statusLabel->font(); fnt.setBold( false ); fnt.setPointSize( fnt.pointSize() * 1 ); m_statusLabel->setFont( fnt ); gbox->addMultiCellWidget( m_statusLabel, 2, 2, 0, 0, AlignLeft | AlignVCenter ); + KSMModalDialogHeader *theader = new KSMModalDialogHeader(this); + centerbox->addWidget( theader, AlignCenter ); + gbox->addLayout(centerbox, 0, 0); - gbox->addLayout(seperatorbox, 1, 0); setFixedSize( sizeHint() ); setCaption( i18n("Please wait...") ); diff --git a/kdeui/kdialog.h b/kdeui/kdialog.h index 07aa31f24..f26e82f41 100644 --- a/kdeui/kdialog.h +++ b/kdeui/kdialog.h @@ -209,6 +209,22 @@ protected: }; /** + * \brief The default system modal dialog header + * + * Internal use only + * + * @author Timothy Pearson <kb9vqf@pearsoncomputing.net> + */ +class KDEUI_EXPORT KSMModalDialogHeader : public TQWidget +{ + Q_OBJECT + +public: + KSMModalDialogHeader( TQWidget* parent ); + ~KSMModalDialogHeader(); +}; + + /** * \brief The default system modal dialog * * This displays the special TDE system modal dialog, |