mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-12 19:40:28 +02:00
save nearly done, i guess
need help with the open, if(end of fileName = ".idf")
This commit is contained in:
@@ -61,10 +61,12 @@ void IntelliPhotoGui::slotOpen(){
|
||||
IntelliDatamanager::loadProject(paintingArea,fileName);
|
||||
}
|
||||
}
|
||||
paintingArea->open(fileName);
|
||||
}
|
||||
//paintingArea->open(fileName);
|
||||
//TODO remove datamanager funciton and enable painting area function
|
||||
IntelliDatamanager::loadProject(paintingArea,fileName);
|
||||
UpdateGui();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Called when the user clicks Save As in the menu
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
#include "IntelliDatamanager.h"
|
||||
#include "Layer/PaintingArea.h"
|
||||
|
||||
|
||||
bool IntelliDatamanager::saveProject(PaintingArea* Canvas, QString filePath){
|
||||
QFile openFile(filePath);
|
||||
|
||||
if(openFile.open(QIODevice::WriteOnly)){
|
||||
qDebug() << "works.";
|
||||
openFile.write("Hahaha");
|
||||
QTextStream out(&openFile);
|
||||
|
||||
out << "Format: idf\n" << "Version: 0.7\n" << endl;
|
||||
out << "Resolution: " << Canvas->getMaxWidth() << "x" << Canvas->getMaxHeight() << endl;
|
||||
out << "Layers: " << "0" << endl;
|
||||
if(false){
|
||||
out << "width: " << endl;
|
||||
out << "height: " << endl;
|
||||
out << "xoffset: " << endl;
|
||||
out << "yoffset: " << endl;
|
||||
out << "alpha: " << endl;
|
||||
out << "imageData: " << endl;
|
||||
}
|
||||
|
||||
openFile.close();
|
||||
return true;
|
||||
}
|
||||
@@ -19,7 +30,7 @@ bool IntelliDatamanager::loadProject(PaintingArea* Canvas, QString filePath){
|
||||
QFile openFile(filePath);
|
||||
|
||||
if(openFile.open(QIODevice::ReadOnly)){
|
||||
qDebug() << openFile.readAll();
|
||||
qDebug() << openFile.readLine();
|
||||
openFile.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user