Restructuring directory layout. Move towards "Modern CMake" usage.
This commit is contained in:
+21
-20
@@ -20,12 +20,13 @@
|
||||
|
||||
#include "File.h"
|
||||
|
||||
#include "FileUtil.h"
|
||||
#include "LabelModel.h"
|
||||
#include "MainWindow.h"
|
||||
#include "SelectProductDialog.h"
|
||||
#include "XmlLabelParser.h"
|
||||
#include "XmlLabelCreator.h"
|
||||
|
||||
#include "model/FileUtil.h"
|
||||
#include "model/Model.h"
|
||||
#include "model/XmlLabelParser.h"
|
||||
#include "model/XmlLabelCreator.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
@@ -49,26 +50,26 @@ namespace glabels
|
||||
SelectProductDialog dialog;
|
||||
dialog.exec();
|
||||
|
||||
const Template* tmplate = dialog.tmplate();
|
||||
const model::Template* tmplate = dialog.tmplate();
|
||||
if ( tmplate )
|
||||
{
|
||||
LabelModel* label = new LabelModel();
|
||||
label->setTmplate( tmplate );
|
||||
label->clearModified();
|
||||
model::Model* model = new model::Model();
|
||||
model->setTmplate( tmplate );
|
||||
model->clearModified();
|
||||
|
||||
// Intelligently decide to rotate label by default
|
||||
const Frame* frame = tmplate->frames().first();
|
||||
label->setRotate( frame->h() > frame->w() );
|
||||
const model::Frame* frame = tmplate->frames().first();
|
||||
model->setRotate( frame->h() > frame->w() );
|
||||
|
||||
// Either apply to current window or open a new one
|
||||
if ( window->isEmpty() )
|
||||
{
|
||||
window->setModel( label );
|
||||
window->setModel( model );
|
||||
}
|
||||
else
|
||||
{
|
||||
MainWindow *newWindow = new MainWindow();
|
||||
newWindow->setModel( label );
|
||||
newWindow->setModel( model );
|
||||
newWindow->show();
|
||||
}
|
||||
|
||||
@@ -105,20 +106,20 @@ namespace glabels
|
||||
);
|
||||
if ( !fileName.isEmpty() )
|
||||
{
|
||||
LabelModel *label = XmlLabelParser::readFile( fileName );
|
||||
if ( label )
|
||||
model::Model *model = model::XmlLabelParser::readFile( fileName );
|
||||
if ( model )
|
||||
{
|
||||
label->setFileName( fileName );
|
||||
model->setFileName( fileName );
|
||||
|
||||
// Either apply to current window or open a new one
|
||||
if ( window->isEmpty() )
|
||||
{
|
||||
window->setModel( label );
|
||||
window->setModel( model );
|
||||
}
|
||||
else
|
||||
{
|
||||
MainWindow *newWindow = new MainWindow();
|
||||
newWindow->setModel( label );
|
||||
newWindow->setModel( model );
|
||||
newWindow->show();
|
||||
}
|
||||
|
||||
@@ -152,7 +153,7 @@ namespace glabels
|
||||
return true;
|
||||
}
|
||||
|
||||
XmlLabelCreator::writeFile( window->model(), window->model()->fileName() );
|
||||
model::XmlLabelCreator::writeFile( window->model(), window->model()->fileName() );
|
||||
window->model()->clearModified();
|
||||
|
||||
// Save CWD
|
||||
@@ -187,7 +188,7 @@ namespace glabels
|
||||
QFileDialog::DontConfirmOverwrite );
|
||||
if ( !rawFileName.isEmpty() )
|
||||
{
|
||||
QString fileName = FileUtil::addExtension( rawFileName, ".glabels" );
|
||||
QString fileName = model::FileUtil::addExtension( rawFileName, ".glabels" );
|
||||
|
||||
|
||||
if ( QFileInfo(fileName).exists() )
|
||||
@@ -206,7 +207,7 @@ namespace glabels
|
||||
}
|
||||
}
|
||||
|
||||
XmlLabelCreator::writeFile( window->model(), fileName );
|
||||
model::XmlLabelCreator::writeFile( window->model(), fileName );
|
||||
window->model()->setFileName( fileName );
|
||||
window->model()->clearModified();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user