kwave  18.07.70
Kwave::SaveBlocksWidget Class Reference

#include <SaveBlocksWidget.h>

Inheritance diagram for Kwave::SaveBlocksWidget:
Inheritance graph
Collaboration diagram for Kwave::SaveBlocksWidget:
Collaboration graph

Public Slots

void setNewExample (const QString &example)
 

Signals

void somethingChanged ()
 

Public Member Functions

 SaveBlocksWidget (QWidget *widget, QString filename_pattern, Kwave::SaveBlocksPlugin::numbering_mode_t numbering_mode, bool selection_only, bool have_selection)
 
virtual ~SaveBlocksWidget ()
 
virtual void showPreview (const QUrl &url)
 
virtual void clearPreview ()
 
QString pattern ()
 
Kwave::SaveBlocksPlugin::numbering_mode_t numberingMode ()
 
bool selectionOnly ()
 

Detailed Description

Definition at line 28 of file SaveBlocksWidget.h.

Constructor & Destructor Documentation

◆ SaveBlocksWidget()

Kwave::SaveBlocksWidget::SaveBlocksWidget ( QWidget *  widget,
QString  filename_pattern,
Kwave::SaveBlocksPlugin::numbering_mode_t  numbering_mode,
bool  selection_only,
bool  have_selection 
)

Constructor

Parameters
widgetpointer to the parent widget
filename_patternthe pattern used for generating the file names
numbering_modethe way the numbers are given
selection_onlyif true, save only the selection
have_selectionif true, there is a selection

Definition at line 31 of file SaveBlocksWidget.cpp.

References _, Kwave::connect(), Kwave::INF_NAME, Kwave::FileInfo::name(), and somethingChanged().

36  :QWidget(parent), Ui::SaveBlocksWidgetBase()
37 {
38  setupUi(this);
39 
40  Kwave::FileInfo info;
41 
42  // the file name pattern combo box
43  cbPattern->addItem(_("[%2nr]-[%title]"));
44  cbPattern->addItem(_("[%filename] part [%nr] of [%total]"));
45  cbPattern->addItem(
46  _("[%fileinfo{") +
47  info.name(Kwave::INF_NAME) +
48  _("}] (part [%nr] of [%total])"));
49  cbPattern->addItem(_("[%filename] - [%04nr]"));
50  cbPattern->addItem(_("[%2nr] [%filename]"));
51  cbPattern->addItem(_("[%2nr]-[%filename]"));
52  cbPattern->addItem(_("[%02nr]-[%filename]"));
53  cbPattern->addItem(_("[%04nr]-[%filename]"));
54  cbPattern->addItem(_("[%02nr] of [%count] [%filename]"));
55  cbPattern->addItem(_("[%02nr] of [%total] [%filename]"));
56  if (filename_pattern.length())
57  cbPattern->setEditText(filename_pattern);
58  else
59  cbPattern->setCurrentIndex(0);
60 
61  // the numbering mode combo box
62  cbNumbering->setCurrentIndex(static_cast<int>(numbering_mode));
63 
64  // the "selection only" checkbox
65  if (have_selection) {
66  // we have a selection
67  chkSelectionOnly->setEnabled(true);
68  chkSelectionOnly->setChecked(selection_only);
69  } else {
70  // no selection -> force it to "off"
71  chkSelectionOnly->setEnabled(false);
72  chkSelectionOnly->setChecked(false);
73  }
74 
75  // combo box with pattern
76  connect(cbPattern, SIGNAL(editTextChanged(QString)),
77  this, SIGNAL(somethingChanged()));
78  connect(cbPattern, SIGNAL(highlighted(int)),
79  this, SIGNAL(somethingChanged()));
80  connect(cbPattern, SIGNAL(activated(int)),
81  this, SIGNAL(somethingChanged()));
82 
83  // combo box with numbering
84  connect(cbNumbering, SIGNAL(editTextChanged(QString)),
85  this, SIGNAL(somethingChanged()));
86  connect(cbNumbering, SIGNAL(highlighted(int)),
87  this, SIGNAL(somethingChanged()));
88  connect(cbNumbering, SIGNAL(activated(int)),
89  this, SIGNAL(somethingChanged()));
90 
91  // selection only checkbox
92  connect(chkSelectionOnly, SIGNAL(stateChanged(int)),
93  this, SIGNAL(somethingChanged()));
94 }
QString name(FileProperty key) const
Definition: FileInfo.h:227
bool connect(Kwave::StreamObject &source, const char *output, Kwave::StreamObject &sink, const char *input)
Definition: Connect.cpp:48
#define _(m)
Definition: memcpy.c:66
Here is the call graph for this function:

◆ ~SaveBlocksWidget()

Kwave::SaveBlocksWidget::~SaveBlocksWidget ( )
virtual

Destructor

Definition at line 97 of file SaveBlocksWidget.cpp.

98 {
99 }

Member Function Documentation

◆ clearPreview()

virtual void Kwave::SaveBlocksWidget::clearPreview ( )
inlinevirtual
See also
KPreviewWidgetBase::clearPreview

Definition at line 59 of file SaveBlocksWidget.h.

References numberingMode(), pattern(), selectionOnly(), setNewExample(), and somethingChanged().

60  {
61  }
Here is the call graph for this function:

◆ numberingMode()

Kwave::SaveBlocksPlugin::numbering_mode_t Kwave::SaveBlocksWidget::numberingMode ( )

returns the numbering mode

Definition at line 109 of file SaveBlocksWidget.cpp.

References Kwave::SaveBlocksPlugin::CONTINUE.

Referenced by clearPreview(), and Kwave::SaveBlocksDialog::numberingMode().

110 {
111  Q_ASSERT(cbNumbering);
112  return (cbNumbering) ?
114  cbNumbering->currentIndex()) : Kwave::SaveBlocksPlugin::CONTINUE;
115 }
Here is the caller graph for this function:

◆ pattern()

QString Kwave::SaveBlocksWidget::pattern ( )

returns the file name pattern

Definition at line 102 of file SaveBlocksWidget.cpp.

References _.

Referenced by clearPreview(), and Kwave::SaveBlocksDialog::pattern().

103 {
104  Q_ASSERT(cbPattern);
105  return (cbPattern) ? cbPattern->currentText() : _("");
106 }
#define _(m)
Definition: memcpy.c:66
Here is the caller graph for this function:

◆ selectionOnly()

bool Kwave::SaveBlocksWidget::selectionOnly ( )

returns true if only the selection should be saved

Definition at line 118 of file SaveBlocksWidget.cpp.

Referenced by clearPreview(), and Kwave::SaveBlocksDialog::selectionOnly().

119 {
120  Q_ASSERT(chkSelectionOnly);
121  return (chkSelectionOnly) ? chkSelectionOnly->isChecked() : false;
122 }
Here is the caller graph for this function:

◆ setNewExample

void Kwave::SaveBlocksWidget::setNewExample ( const QString &  example)
slot

update the filename preview

Parameters
examplethe example filename

Definition at line 125 of file SaveBlocksWidget.cpp.

Referenced by clearPreview(), and Kwave::SaveBlocksDialog::setNewExample().

126 {
127  Q_ASSERT(txtExample);
128  if (txtExample) txtExample->setText(example);
129 }
Here is the caller graph for this function:

◆ showPreview()

virtual void Kwave::SaveBlocksWidget::showPreview ( const QUrl &  url)
inlinevirtual
See also
KPreviewWidgetBase::showPreview()

Definition at line 53 of file SaveBlocksWidget.h.

54  {
55  Q_UNUSED(url);
56  }

◆ somethingChanged

void Kwave::SaveBlocksWidget::somethingChanged ( )
signal

emitted whenever one of the input controls has changed

Referenced by clearPreview(), and SaveBlocksWidget().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: