• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • libs
  • kasten
  • controllers
  • io
  • copyas
copyasdialog.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the Kasten Framework, made within the KDE community.
3 
4  Copyright 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #include "copyasdialog.h"
24 
25 // Kasten gui
26 #include <abstractmodelstreamencoderconfigeditor.h>
27 #include <abstractselectionview.h>
28 // KDE
29 #include <KGlobal>
30 #include <KLocale>
31 // Qt
32 #include <QtGui/QSplitter>
33 #include <QtGui/QGroupBox>
34 #include <QtGui/QLayout>
35 #include <QtGui/QLabel>
36 #include <QtGui/QFont>
37 
38 
39 namespace Kasten2
40 {
41 
42 CopyAsDialog::CopyAsDialog( const QString& remoteTypeName,
43  AbstractModelStreamEncoderConfigEditor* configEditor,
44  QWidget* parent )
45  : KDialog( parent ),
46  mConfigEditor( configEditor )
47 {
48  setCaption( i18nc("@title:window","Copy As") );
49  setButtons( Ok | Cancel );
50  setButtonGuiItem( Ok, KGuiItem(i18nc("@action:button","&Copy to clipboard"), QLatin1String("edit-copy"),
51  i18nc("@info:tooltip","Copy the selected data to the clipboard."),
52  i18nc("@info:whatsthis","If you press the <interface>Copy to clipboard</interface> "
53  "button, the selected data will be copied to the clipboard "
54  "with the settings you entered above.")) );
55  setDefaultButton( Ok );
56 
57  QSplitter* splitter = new QSplitter( this );
58 
59  setMainWidget( splitter );
60 
61  // config editor
62  QWidget* editorPage = new QWidget( splitter );
63  QVBoxLayout* editorPageLayout = new QVBoxLayout( editorPage );
64  QLabel* editorLabel = new QLabel( remoteTypeName );
65  QFont font = editorLabel->font();
66  font.setBold( true );
67  editorLabel->setFont( font );
68  editorPageLayout->addWidget( editorLabel );
69  editorPageLayout->addWidget( mConfigEditor );
70  editorPageLayout->addStretch();
71 
72  splitter->addWidget( editorPage );
73  splitter->setCollapsible( 0, false );
74 
75  mPreviewView = configEditor->createPreviewView();
76 
77  if( mPreviewView )
78  {
79  QGroupBox* previewBox = new QGroupBox( i18nc("@title:group","Preview"), this );
80  splitter->addWidget( previewBox );
81 
82  QHBoxLayout* previewBoxLayout = new QHBoxLayout( previewBox );
83 
84  previewBoxLayout->addWidget( mPreviewView->widget() );
85  }
86 
87  enableButtonOk( configEditor->isValid() );
88  connect( configEditor, SIGNAL(validityChanged(bool)), SLOT(enableButtonOk(bool)) );
89 }
90 
91 void CopyAsDialog::setData( AbstractModel* model, const AbstractModelSelection* selection )
92 {
93  if( mPreviewView )
94  mPreviewView->setData( model, selection );
95 }
96 
97 CopyAsDialog::~CopyAsDialog()
98 {
99  delete mPreviewView;
100 }
101 
102 }
Kasten2::AbstractSelectionView::widget
virtual QWidget * widget() const =0
QWidget
KDialog
copyasdialog.h
Kasten2::AbstractModelStreamEncoderConfigEditor
Definition: abstractmodelstreamencoderconfigeditor.h:38
abstractmodelstreamencoderconfigeditor.h
Kasten2::AbstractSelectionView::setData
virtual void setData(AbstractModel *model, const AbstractModelSelection *selection)=0
Kasten2::CopyAsDialog::~CopyAsDialog
virtual ~CopyAsDialog()
Definition: copyasdialog.cpp:97
Kasten2::AbstractModelSelection
Definition: abstractmodelselection.h:35
Kasten2::AbstractModelStreamEncoderConfigEditor::isValid
virtual bool isValid() const
default returns true
Definition: abstractmodelstreamencoderconfigeditor.cpp:34
Kasten2::Ok
Definition: kastencore.h:61
Kasten2::Cancel
Definition: kastencore.h:60
Kasten2::AbstractModelStreamEncoderConfigEditor::createPreviewView
virtual AbstractSelectionView * createPreviewView() const
default returns none
Definition: abstractmodelstreamencoderconfigeditor.cpp:39
Kasten2::AbstractModel
Definition: abstractmodel.h:40
abstractselectionview.h
Kasten2::CopyAsDialog::CopyAsDialog
CopyAsDialog(const QString &remoteTypeName, AbstractModelStreamEncoderConfigEditor *configEditor, QWidget *parent=0)
Definition: copyasdialog.cpp:42
Kasten2::CopyAsDialog::setData
void setData(AbstractModel *model, const AbstractModelSelection *selection)
Definition: copyasdialog.cpp:91
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal