~vbursian/research-assistant/intervers

« back to all changes in this revision

Viewing changes to RAGUI/CSVImportDialog.cpp

  • Committer: Viktor Bursian at blin-ubuntu
  • Date: 2017-02-22 17:55:06 UTC
  • mto: (8.6.1 DN)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: vbursian@gmail.com-20170222175506-z3dli284ilsu4ycj
Classes s*TypeDependence renamed to sData*Record; new classes sData*Folder added; CSVImportDialog changed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
////////////////////////////////////////////////////////////////////////////////
2
 
/*! @file CSVImportDialog.cpp   Редактирование текстового атрибута.
 
2
/*! @file CSVImportDialog.cpp   CSV-file import as a sDataListFolder.
3
3
- Part of RAGUI - Research Assistant Graphical User Interface.
4
4
- Uses  QtGui v.4.6  -  http://qt.nokia.com/
5
5
- Uses  RANet - Research Assistant Net Library (based on ANSI C++).
9
9
#include "CSVImportDialog.h"
10
10
#include "StringsAndQStrings.h"
11
11
#include "attr.h"
 
12
#include <QFileInfo>
12
13
namespace RA {
13
14
//------------------------------------------------------------------------------
14
15
 
19
20
 
20
21
sCSVImportDialog::sCSVImportDialog (QString    file_path
21
22
                                   ,QWidget *  parent)
22
 
  :sAttrDlg(parent)
 
23
  :sEditDocketDialog(parent)
23
24
  ,File(new QFile(file_path,this))
24
25
{
25
26
  //create widgets
77
78
  }
78
79
  //initial settings
79
80
  {
 
81
    fldDocket->setText(QFileInfo(*File).completeBaseName());
80
82
    DelimiterField->addItem("comma");
81
83
    DelimiterField->addItem("tabulation");
82
84
    ReadUnitsChkBox->setChecked(true);
104
106
 
105
107
bool  sCSVImportDialog::Validate ()
106
108
{
107
 
  if( ! sAttrDlg::Validate() || ! ParseOnly() )
 
109
  if( ! sEditDocketDialog::Validate() || ! ParseOnly() )
108
110
    return false;
109
111
  return ParseAndCreate();
110
112
}
202
204
        if( X_OK && Y_OK ){
203
205
          if( create_record ){
204
206
            if( PointNo == 0 ){
205
 
              Value = sNodePtr(new sListTypeDependence);
 
207
              Value = sNodePtr(new sDataListFolder(FromQString(fldDocket
 
208
                                                                   ->text())));
206
209
              Value->SetMultiplier(sPhysPair(sPhysValue(UX),sPhysValue(UY)));
207
210
              Value << attr("imported from",FromQString(File->fileName()));
208
211
            }