QtiPlot  0.9.8.2
Public Types | Public Slots | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
ImportASCIIDialog Class Reference

Import ASCII file(s) dialog. More...

#include <ImportASCIIDialog.h>

Inheritance diagram for ImportASCIIDialog:
ExtensibleFileDialog

Public Types

enum  ImportMode {
  NewTables, NewMatrices, NewColumns, NewRows,
  Overwrite
}
 Possible destinations for the imported data. More...
 

Public Slots

void selectFilter (const QString &filter)
 

Public Member Functions

QStringList columnFormats ()
 
const QString columnSeparator () const
 Return the selected column separator. More...
 
QList< int > columnTypes ()
 
QString commentString ()
 Returns a string used to comment lines when importing ASCII files. More...
 
QLocale decimalSeparators ()
 Returns a locale having the decimal separators set to user custom settings. More...
 
int endLineChar ()
 Returns the convention used for the end line character! More...
 
int ignoredLines () const
 Return the number of lines to be skipped at the start of each file. More...
 
 ImportASCIIDialog (bool new_windows_only, QWidget *parent=0, bool extended=true, Qt::WFlags flags=0)
 Constructor. More...
 
bool importComments ()
 Returns true if the second line of the ASCII file should be used to set comments in table. More...
 
ImportMode importMode () const
 Return the selected import mode. More...
 
bool readOnly () const
 Whether the user wants the import options to be saved. More...
 
bool renameColumns () const
 Whether to rename columns based on the first (non-skipped) line. More...
 
void setColumnSeparator (const QString &sep)
 Set the selected columns separator. More...
 
void setCurrentPath (const QString &path)
 
bool simplifySpaces () const
 Whether to replace sequences of whitespace charecters with a single space. More...
 
bool stripSpaces () const
 Whether to remove whitespace from beginning and end of lines. More...
 
bool useFirstRow () const
 
bool useSecondRow () const
 
- Public Member Functions inherited from ExtensibleFileDialog
 ExtensibleFileDialog (QWidget *parent=0, bool extended=true, Qt::WFlags flags=0)
 Constructor. More...
 
bool isExtendable ()
 Tells weather the dialog has a valid extension widget. More...
 
bool isExtended ()
 
void setEditableFilter (bool on=true)
 Enables/Disables editing of the file type filter. More...
 
void setExtended (bool extended)
 Toggle extension widget on/off. More...
 
void setExtensionWidget (QWidget *extension)
 Set the extension widget to be displayed when the user presses the toggle button. More...
 
void setExtentionToggleButtonText (const QString &text)
 Sets the text to be displayed in the toggle button. More...
 

Private Slots

void changePreviewFile (const QString &path)
 
void displayHelp ()
 Display help for advanced options. More...
 
void enableComments ()
 
void enableTableOptions (bool on)
 Enable/Disable options which are only available for tables. More...
 
void preview ()
 
void showColTypeDialog ()
 
void updateImportMode (int mode)
 For Overwrite mode, allow only one file to be selected. More...
 

Private Member Functions

void closeEvent (QCloseEvent *)
 
void initAdvancedOptions ()
 Initialise d_advanced_options and everything it contains. More...
 
void initPreview (int previewMode)
 
void previewMatrix ()
 
void previewTable ()
 
void setNewWindowsOnly (bool on)
 

Private Attributes

QComboBox * boxDecimalSeparator
 
QComboBox * boxEndLine
 
QGroupBox * d_advanced_options
 Container widget for all advanced options. More...
 
QPushButton * d_col_types_button
 
QComboBox * d_column_separator
 
QLineEdit * d_comment_string
 
QString d_current_path
 
QComboBox * d_first_line_role
 
QPushButton * d_help_button
 
QSpinBox * d_ignored_lines
 
QCheckBox * d_import_comments
 
QComboBox * d_import_mode
 
QCheckBox * d_omit_thousands_sep
 
QCheckBox * d_preview_button
 
QSpinBox * d_preview_lines_box
 
PreviewMatrixd_preview_matrix
 
QStackedWidget * d_preview_stack
 
PreviewTabled_preview_table
 
QCheckBox * d_read_only
 
QCheckBox * d_rename_columns
 
QCheckBox * d_simplify_spaces
 
QCheckBox * d_strip_spaces
 

Additional Inherited Members

- Protected Attributes inherited from ExtensibleFileDialog
QPushButton * d_extension_toggle
 Button for toggling display of extension on/off. More...
 

Detailed Description

Import ASCII file(s) dialog.

Member Enumeration Documentation

§ ImportMode

Possible destinations for the imported data.

Important: Keep this in sync with the initialization of d_import_mode in initAdvancedOptions().

Enumerator
NewTables 

create a new table for each file (default)

NewMatrices 

create a new matrix for each file

NewColumns 

add each file as new columns to the current table

NewRows 

add each file as new rows to the current table

Overwrite 

replace content of current table with the selected file (like importing a single file in previous versions of QtiPlot)

Constructor & Destructor Documentation

§ ImportASCIIDialog()

ImportASCIIDialog::ImportASCIIDialog ( bool  new_windows_only,
QWidget *  parent = 0,
bool  extended = true,
Qt::WFlags  flags = 0 
)

Member Function Documentation

§ changePreviewFile

void ImportASCIIDialog::changePreviewFile ( const QString &  path)
privateslot

References d_current_path, and preview().

Referenced by ImportASCIIDialog(), and setCurrentPath().

§ closeEvent()

void ImportASCIIDialog::closeEvent ( QCloseEvent *  e)
private

§ columnFormats()

QStringList ImportASCIIDialog::columnFormats ( )
inline

§ columnSeparator()

const QString ImportASCIIDialog::columnSeparator ( ) const

Return the selected column separator.

References d_column_separator, and d_simplify_spaces.

Referenced by ApplicationWindow::importASCII(), previewMatrix(), and previewTable().

§ columnTypes()

QList<int> ImportASCIIDialog::columnTypes ( )
inline

§ commentString()

QString ImportASCIIDialog::commentString ( )
inline

Returns a string used to comment lines when importing ASCII files.

Referenced by ApplicationWindow::importASCII().

§ decimalSeparators()

QLocale ImportASCIIDialog::decimalSeparators ( )

Returns a locale having the decimal separators set to user custom settings.

References boxDecimalSeparator, and d_omit_thousands_sep.

Referenced by ApplicationWindow::importASCII(), previewMatrix(), and previewTable().

§ displayHelp

void ImportASCIIDialog::displayHelp ( )
privateslot

Display help for advanced options.

Referenced by initAdvancedOptions().

§ enableComments

void ImportASCIIDialog::enableComments ( )
privateslot

§ enableTableOptions

void ImportASCIIDialog::enableTableOptions ( bool  on)
privateslot

Enable/Disable options which are only available for tables.

References d_col_types_button, d_import_comments, d_read_only, and d_rename_columns.

Referenced by initPreview().

§ endLineChar()

int ImportASCIIDialog::endLineChar ( )
inline

Returns the convention used for the end line character!

Referenced by ApplicationWindow::importASCII().

§ ignoredLines()

int ImportASCIIDialog::ignoredLines ( ) const
inline

Return the number of lines to be skipped at the start of each file.

Referenced by ApplicationWindow::importASCII().

§ importComments()

bool ImportASCIIDialog::importComments ( )

Returns true if the second line of the ASCII file should be used to set comments in table.

References d_first_line_role, d_import_comments, and d_rename_columns.

Referenced by ApplicationWindow::importASCII(), and previewTable().

§ importMode()

ImportMode ImportASCIIDialog::importMode ( ) const
inline

Return the selected import mode.

See also
ImportMode

Referenced by ApplicationWindow::importASCII(), previewMatrix(), and previewTable().

§ initAdvancedOptions()

void ImportASCIIDialog::initAdvancedOptions ( )
private

§ initPreview()

void ImportASCIIDialog::initPreview ( int  previewMode)
private

§ preview

void ImportASCIIDialog::preview ( )
privateslot

§ previewMatrix()

void ImportASCIIDialog::previewMatrix ( )
private

§ previewTable()

void ImportASCIIDialog::previewTable ( )
private

§ readOnly()

bool ImportASCIIDialog::readOnly ( ) const
inline

Whether the user wants the import options to be saved.

Referenced by ApplicationWindow::importASCII().

§ renameColumns()

bool ImportASCIIDialog::renameColumns ( ) const
inline

Whether to rename columns based on the first (non-skipped) line.

Referenced by ApplicationWindow::importASCII(), and previewTable().

§ selectFilter

void ImportASCIIDialog::selectFilter ( const QString &  filter)
slot

§ setColumnSeparator()

void ImportASCIIDialog::setColumnSeparator ( const QString &  sep)

Set the selected columns separator.

References d_column_separator.

Referenced by ImportASCIIDialog().

§ setCurrentPath()

void ImportASCIIDialog::setCurrentPath ( const QString &  path)

§ setNewWindowsOnly()

void ImportASCIIDialog::setNewWindowsOnly ( bool  on)
private

References d_import_mode, and d_preview_button.

Referenced by ImportASCIIDialog().

§ showColTypeDialog

void ImportASCIIDialog::showColTypeDialog ( )
privateslot

§ simplifySpaces()

bool ImportASCIIDialog::simplifySpaces ( ) const
inline

Whether to replace sequences of whitespace charecters with a single space.

Referenced by ApplicationWindow::importASCII().

§ stripSpaces()

bool ImportASCIIDialog::stripSpaces ( ) const
inline

Whether to remove whitespace from beginning and end of lines.

Referenced by ApplicationWindow::importASCII().

§ updateImportMode

void ImportASCIIDialog::updateImportMode ( int  mode)
privateslot

For Overwrite mode, allow only one file to be selected.

References initPreview(), and Overwrite.

Referenced by ImportASCIIDialog().

§ useFirstRow()

bool ImportASCIIDialog::useFirstRow ( ) const
inline

§ useSecondRow()

bool ImportASCIIDialog::useSecondRow ( ) const
inline

Member Data Documentation

§ boxDecimalSeparator

QComboBox * ImportASCIIDialog::boxDecimalSeparator
private

§ boxEndLine

QComboBox * ImportASCIIDialog::boxEndLine
private

§ d_advanced_options

QGroupBox* ImportASCIIDialog::d_advanced_options
private

Container widget for all advanced options.

Referenced by ImportASCIIDialog(), and initAdvancedOptions().

§ d_col_types_button

QPushButton * ImportASCIIDialog::d_col_types_button
private

§ d_column_separator

QComboBox * ImportASCIIDialog::d_column_separator
private

§ d_comment_string

QLineEdit* ImportASCIIDialog::d_comment_string
private

§ d_current_path

QString ImportASCIIDialog::d_current_path
private

§ d_first_line_role

QComboBox* ImportASCIIDialog::d_first_line_role
private

§ d_help_button

QPushButton* ImportASCIIDialog::d_help_button
private

Referenced by initAdvancedOptions().

§ d_ignored_lines

QSpinBox* ImportASCIIDialog::d_ignored_lines
private

§ d_import_comments

QCheckBox * ImportASCIIDialog::d_import_comments
private

§ d_import_mode

QComboBox* ImportASCIIDialog::d_import_mode
private

§ d_omit_thousands_sep

QCheckBox * ImportASCIIDialog::d_omit_thousands_sep
private

§ d_preview_button

QCheckBox* ImportASCIIDialog::d_preview_button
private

§ d_preview_lines_box

QSpinBox * ImportASCIIDialog::d_preview_lines_box
private

§ d_preview_matrix

PreviewMatrix* ImportASCIIDialog::d_preview_matrix
private

§ d_preview_stack

QStackedWidget* ImportASCIIDialog::d_preview_stack
private

§ d_preview_table

PreviewTable* ImportASCIIDialog::d_preview_table
private

§ d_read_only

QCheckBox* ImportASCIIDialog::d_read_only
private

§ d_rename_columns

QCheckBox* ImportASCIIDialog::d_rename_columns
private

§ d_simplify_spaces

QCheckBox * ImportASCIIDialog::d_simplify_spaces
private

§ d_strip_spaces

QCheckBox * ImportASCIIDialog::d_strip_spaces
private

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