• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

  • tdeio
  • tdeio
skipdlg.cpp
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 David Faure <faure@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #include "tdeio/skipdlg.h"
20 
21 #include <stdio.h>
22 #include <assert.h>
23 
24 #include <tqmessagebox.h>
25 #include <tqwidget.h>
26 #include <tqlayout.h>
27 #include <tqlabel.h>
28 
29 #include <tdeapplication.h>
30 #include <tdelocale.h>
31 #include <kurl.h>
32 #include <kpushbutton.h>
33 #include <kstdguiitem.h>
34 
35 #ifdef TQ_WS_X11
36 #include <twin.h>
37 #endif
38 
39 using namespace TDEIO;
40 
41 SkipDlg::SkipDlg(TQWidget *parent, bool _multi, const TQString& _error_text, bool _modal ) :
42  KDialog ( parent, "" , _modal )
43 {
44  // TODO : port to KDialogBase
45  modal = _modal;
46 
47  // Set "StaysOnTop", because this dialog is typically used in tdeio_uiserver,
48  // i.e. in a separate process.
49 #ifdef TQ_WS_X11 //FIXME(E): Implement for QT Embedded, mac & win32
50  if (modal)
51  KWin::setState( winId(), NET::StaysOnTop );
52 #endif
53 
54  b0 = b1 = b2 = 0L;
55 
56  setCaption( i18n( "Information" ) );
57 
58  b0 = new KPushButton( KStdGuiItem::cancel(), this );
59  connect(b0, TQ_SIGNAL(clicked()), this, TQ_SLOT(b0Pressed()));
60 
61  if ( _multi )
62  {
63  b1 = new TQPushButton( i18n( "Skip" ), this );
64  connect(b1, TQ_SIGNAL(clicked()), this, TQ_SLOT(b1Pressed()));
65 
66  b2 = new TQPushButton( i18n( "Auto Skip" ), this );
67  connect(b2, TQ_SIGNAL(clicked()), this, TQ_SLOT(b2Pressed()));
68  }
69 
70  TQVBoxLayout *vlayout = new TQVBoxLayout( this, 10, 0 );
71  // vlayout->addStrut( 360 ); makes dlg at least that wide
72 
73  TQLabel * lb = new TQLabel( _error_text, this );
74  lb->setFixedHeight( lb->sizeHint().height() );
75  lb->setMinimumWidth( lb->sizeHint().width() );
76  vlayout->addWidget( lb );
77 
78  vlayout->addSpacing( 10 );
79 
80  TQHBoxLayout* layout = new TQHBoxLayout();
81  vlayout->addLayout( layout );
82  if ( b0 )
83  {
84  b0->setDefault( true );
85  b0->setFixedSize( b0->sizeHint() );
86  layout->addWidget( b0 );
87  layout->addSpacing( 5 );
88  }
89  if ( b1 )
90  {
91  b1->setFixedSize( b1->sizeHint() );
92  layout->addWidget( b1 );
93  layout->addSpacing( 5 );
94  }
95  if ( b2 )
96  {
97  b2->setFixedSize( b2->sizeHint() );
98  layout->addWidget( b2 );
99  layout->addSpacing( 5 );
100  }
101 
102  vlayout->addStretch( 10 );
103  vlayout->activate();
104  resize( sizeHint() );
105 }
106 
107 SkipDlg::~SkipDlg()
108 {
109 }
110 
111 void SkipDlg::b0Pressed()
112 {
113  if ( modal )
114  done( 0 );
115  else
116  emit result( this, 0 );
117 }
118 
119 void SkipDlg::b1Pressed()
120 {
121  if ( modal )
122  done( 1 );
123  else
124  emit result( this, 1 );
125 }
126 
127 void SkipDlg::b2Pressed()
128 {
129  if ( modal )
130  done( 2 );
131  else
132  emit result( this, 2 );
133 }
134 
135 SkipDlg_Result TDEIO::open_SkipDlg( bool _multi, const TQString& _error_text )
136 {
137  Q_ASSERT(kapp);
138 
139  SkipDlg dlg( 0L, _multi, _error_text, true );
140  return (SkipDlg_Result) dlg.exec();
141 }
142 
143 #include "skipdlg.moc"
TDEIO
A namespace for TDEIO globals.
Definition: authinfo.h:29

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.1
This website is maintained by Timothy Pearson.