unreadable file handled

master
Denes Matetelki 14 years ago
parent e6d0657b29
commit 1e417c8d47

@ -52,21 +52,21 @@ void GraphWidget::closeScene()
this->hide();
}
void GraphWidget::readContentFromXmlFile(const QString &fileName)
bool GraphWidget::readContentFromXmlFile(const QString &fileName)
{
QDomDocument doc("QtMindMap");
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly))
{
m_parent->statusBarMsg(tr("Couldn't read file."));
return;
return false;
}
if (!doc.setContent(&file))
{
m_parent->statusBarMsg(tr("Couldn't parse XML file."));
file.close();
return;
return false;
}
file.close();
@ -121,6 +121,7 @@ void GraphWidget::readContentFromXmlFile(const QString &fileName)
m_activeNode->setFocus();
this->show();
return true;
}
void GraphWidget::writeContentToXmlFile(const QString &fileName)

@ -26,7 +26,7 @@ public:
void newScene();
void closeScene();
void readContentFromXmlFile(const QString &fileName);
bool readContentFromXmlFile(const QString &fileName);
void writeContentToXmlFile(const QString &fileName);
void writeContentToPngFile(const QString &fileName);

@ -201,6 +201,7 @@ void MainWindow::openFile(const QString &fileName)
if (!closeFile())
return;
QString currFilename(m_fileName);
if (fileName.isEmpty())
{
QFileDialog dialog(this,
@ -224,7 +225,12 @@ void MainWindow::openFile(const QString &fileName)
m_fileName = fileName;
}
m_graphicsView->readContentFromXmlFile(m_fileName);
if (!m_graphicsView->readContentFromXmlFile(m_fileName))
{
m_fileName = currFilename;
return;
}
m_ui->actionSave->setEnabled(true);
m_ui->actionSaveAs->setEnabled(true);

@ -76,70 +76,102 @@
<context>
<name>GraphWidget</name>
<message>
<location filename="graphwidget.cpp" line="60"/>
<location filename="graphwidget.cpp" line="61"/>
<source>Couldn&apos;t read file.</source>
<translation>Nem lehet olvasni a fájlt.</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="66"/>
<location filename="graphwidget.cpp" line="67"/>
<source>Couldn&apos;t parse XML file.</source>
<oldsource>Couldn&apos;t parse XML file</oldsource>
<translation>Nem lehetett elemezni az XML dokumentumot.</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="146"/>
<location filename="graphwidget.cpp" line="177"/>
<source>Couldn&apos;t open file to write.</source>
<translation>Nem lehetett a fájlt megnyitni írásra.</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="154"/>
<location filename="graphwidget.cpp" line="185"/>
<source>Saved.</source>
<translation>Elmentve.</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="174"/>
<location filename="graphwidget.cpp" line="205"/>
<source>MindMap exported as </source>
<translation>Az agytérkép exportálva lett, mint</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="208"/>
<location filename="graphwidget.cpp" line="212"/>
<location filename="graphwidget.cpp" line="242"/>
<location filename="graphwidget.cpp" line="411"/>
<location filename="graphwidget.cpp" line="438"/>
<location filename="graphwidget.cpp" line="463"/>
<location filename="graphwidget.cpp" line="497"/>
<location filename="graphwidget.cpp" line="538"/>
<location filename="graphwidget.cpp" line="551"/>
<location filename="graphwidget.cpp" line="585"/>
<source>No active node.</source>
<translation>Nincs aktív csúcs.</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="220"/>
<location filename="graphwidget.cpp" line="503"/>
<source>Base node cannot be deleted.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="graphwidget.cpp" line="567"/>
<source>Select node color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="graphwidget.cpp" line="601"/>
<source>Select text color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="graphwidget.cpp" line="733"/>
<source>Edge adding cancelled.</source>
<oldsource>Edge adding cancelled</oldsource>
<translation>Él hozzáadása megszakítva.</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="225"/>
<location filename="graphwidget.cpp" line="738"/>
<source>Edge deleting cancelled.</source>
<oldsource>Edge deleting cancelled</oldsource>
<translation>Él törlés megszakítva.</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="333"/>
<source>Last node cannot be deleted.</source>
<translation>Az utolsó csúcs nem törölhető.</translation>
<translation type="obsolete">Az utolsó csúcs nem törölhető.</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="352"/>
<location filename="graphwidget.cpp" line="613"/>
<source>Add edge: select destination node.</source>
<translation>Él hozzáadásához válassz ki cél csúcsot.</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="358"/>
<location filename="graphwidget.cpp" line="619"/>
<source>Delete edge: select other end-node.</source>
<translation>Él törléséhez válaszd ki a másik csúcsot.</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="504"/>
<location filename="graphwidget.cpp" line="753"/>
<source>Root element cannot be an edge target.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="graphwidget.cpp" line="760"/>
<source>There is already an edge between these two nodes.</source>
<translation>Már létezik él e két csúcs között.</translation>
</message>
<message>
<location filename="graphwidget.cpp" line="517"/>
<location filename="graphwidget.cpp" line="768"/>
<source>The graph is acyclic, edge added as secondary edge.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="graphwidget.cpp" line="785"/>
<source>There no edge between these two nodes.</source>
<translation>Nincs él e között a két csúcs között.</translation>
</message>
@ -162,233 +194,363 @@
<translation>&amp;Segítség</translation>
</message>
<message>
<location filename="mainwindow.ui" line="68"/>
<location filename="mainwindow.ui" line="55"/>
<source>main toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="70"/>
<source>insert status icons</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.ui" line="84"/>
<source>&amp;New</source>
<translation>&amp;Új</translation>
</message>
<message>
<location filename="mainwindow.ui" line="79"/>
<location filename="mainwindow.ui" line="95"/>
<source>&amp;Open</source>
<translation>Meg&amp;nyitás</translation>
</message>
<message>
<location filename="mainwindow.ui" line="90"/>
<location filename="mainwindow.ui" line="106"/>
<source>&amp;Save</source>
<translation>&amp;Mentés</translation>
</message>
<message>
<location filename="mainwindow.ui" line="98"/>
<location filename="mainwindow.ui" line="114"/>
<source>&amp;Quit</source>
<translation>&amp;Kilépés</translation>
</message>
<message>
<location filename="mainwindow.ui" line="106"/>
<location filename="mainwindow.ui" line="122"/>
<source>&amp;About QtMindMap</source>
<translation>A QtMindMap-ről</translation>
</message>
<message>
<location filename="mainwindow.ui" line="114"/>
<location filename="mainwindow.ui" line="130"/>
<source>&amp;Close</source>
<translation>&amp;Bezárás</translation>
</message>
<message>
<location filename="mainwindow.ui" line="122"/>
<location filename="mainwindow.ui" line="141"/>
<source>E&amp;xport</source>
<translation>E&amp;xportálás</translation>
</message>
<message>
<location filename="mainwindow.ui" line="125"/>
<location filename="mainwindow.ui" line="144"/>
<source>Export</source>
<translation>Exportálás</translation>
</message>
<message>
<location filename="mainwindow.ui" line="136"/>
<location filename="mainwindow.ui" line="155"/>
<source>Save&amp;As</source>
<translation>Mentés min&amp;t</translation>
</message>
<message>
<location filename="mainwindow.ui" line="139"/>
<location filename="mainwindow.ui" line="158"/>
<source>Ctrl+A</source>
<translation>Ctrl+A</translation>
</message>
<message>
<location filename="mainwindow.ui" line="144"/>
<location filename="mainwindow.ui" line="163"/>
<source>&amp;Keys</source>
<translation type="unfinished">&amp;Billentyűk</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="94"/>
<location filename="mainwindow.cpp" line="45"/>
<source>Add node (ins)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="47"/>
<source>Del node (del)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="49"/>
<source>Edit node (F2, dubclick)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="53"/>
<source>ScaleUp Node (Ctrl +)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="54"/>
<source>ScaleDown Node (Ctrl -)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="56"/>
<source>Node color (c)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="58"/>
<source>Node textcolor (t)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="60"/>
<source>Add edge (a)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="62"/>
<source>Del edge (d)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="64"/>
<source>Move node
(Ctrl cursor, drag)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="66"/>
<source>Change on wholesubtree
(Ctrl shift)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="68"/>
<source>Zoom in (+, scrollup)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="70"/>
<source>Zoom out (-, scrolldown)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="72"/>
<source>Leave editing,
edge eadd/remove (esc)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="74"/>
<source>Hint mode (f)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="76"/>
<source>Show main toolbar
(Ctrl m)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="79"/>
<source>Insert status icons
(Ctrl i)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="104"/>
<source>Insert icon:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="119"/>
<source>&amp;Blocked</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="123"/>
<source>&amp;How?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="127"/>
<source>&amp;Postpone</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="131"/>
<source>&amp;Comission</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="135"/>
<source>&amp;Maybe</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="207"/>
<source>Open MindMap</source>
<translation>Agytérkép megynyitása</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="132"/>
<location filename="mainwindow.cpp" line="247"/>
<source>Save MindMap as</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="200"/>
<location filename="mainwindow.cpp" line="317"/>
<source>Export MindMap to image</source>
<translation>Az agytérkép képként exportálása</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="202"/>
<location filename="mainwindow.cpp" line="319"/>
<source>PNG image file (*.png)</source>
<translation>PNG kép fájl (*.png)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="215"/>
<location filename="mainwindow.cpp" line="332"/>
<source>Keys of QtMindMap</source>
<translation>A QtMindMap billentyűkiosztása</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="216"/>
<location filename="mainwindow.cpp" line="333"/>
<source>Usage of keys &amp; mouse buttons</source>
<translation>A billentyűk és az egér használata</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="221"/>
<location filename="mainwindow.cpp" line="338"/>
<source>Keys</source>
<translation>Billentyúk</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="223"/>
<location filename="mainwindow.cpp" line="259"/>
<location filename="mainwindow.cpp" line="340"/>
<location filename="mainwindow.cpp" line="376"/>
<source>zoom in/out of the view</source>
<translation>A nézeten ki/be nagyítás</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="225"/>
<location filename="mainwindow.cpp" line="342"/>
<source>cursors</source>
<translation>Kurzor gombok</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="227"/>
<location filename="mainwindow.cpp" line="344"/>
<source>move view scrollbars</source>
<translation>A nézet gördítősávjának mozgatása</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="229"/>
<location filename="mainwindow.cpp" line="346"/>
<source>ctrl + cursors</source>
<translation>ctrl + korzor gombok</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="231"/>
<location filename="mainwindow.cpp" line="348"/>
<source>move active node</source>
<translation>Az aktív csúcs mozgatása</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="233"/>
<location filename="mainwindow.cpp" line="350"/>
<source>remove active node</source>
<translation>Az aktív csúcs törlése</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="235"/>
<location filename="mainwindow.cpp" line="352"/>
<source>add new node to active node</source>
<translation>Új csúcs hozzáadása az aktív csúcshoz</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="237"/>
<location filename="mainwindow.cpp" line="354"/>
<source>enter/leave hint mode (vimperator style select)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="239"/>
<location filename="mainwindow.cpp" line="356"/>
<source>numbers, backspace, enter</source>
<translation>számok, törlés, enter</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="241"/>
<location filename="mainwindow.cpp" line="358"/>
<source>select numbers in hint mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="243"/>
<location filename="mainwindow.cpp" line="360"/>
<source>edit active node</source>
<translation>Az aktív csúcs szerkesztése.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="245"/>
<location filename="mainwindow.cpp" line="362"/>
<source>leaving node editing/adding/deleting mode</source>
<translation>A szerkesztés/éltörlés/élhozzáadás mód elhagyása.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="247"/>
<location filename="mainwindow.cpp" line="364"/>
<source>editing mode: ctrl+cursors</source>
<translation>Szerkesző mód: ctrl + kurzorok</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="249"/>
<location filename="mainwindow.cpp" line="366"/>
<source>jump to beginning of next/prev word</source>
<translation>A következő/előző szó elejére ugrás.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="251"/>
<location filename="mainwindow.cpp" line="368"/>
<source>add new edge to active node (select the destination)</source>
<translation>Az aktív csúcshoz új él hozzáadása (válaszd ki az él másik végpontját)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="253"/>
<location filename="mainwindow.cpp" line="370"/>
<source>delete edge of active node (select other end)</source>
<translation>Az aktív csúcsról él törlése (válaszd ki az él másik csúcspontját)</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="255"/>
<location filename="mainwindow.cpp" line="372"/>
<source>Mouse</source>
<translation>Egér</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="257"/>
<location filename="mainwindow.cpp" line="374"/>
<source>scroll</source>
<translation>görgetés</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="261"/>
<location filename="mainwindow.cpp" line="378"/>
<source>click</source>
<translation>klikk</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="263"/>
<location filename="mainwindow.cpp" line="380"/>
<source>select node</source>
<translation>csúcs kiválasztása</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="265"/>
<location filename="mainwindow.cpp" line="382"/>
<source>double clikk</source>
<translation>duplakatt</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="267"/>
<location filename="mainwindow.cpp" line="384"/>
<source>set node editable</source>
<translation>a csúcs szerkeszthetővé tétele.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="269"/>
<location filename="mainwindow.cpp" line="386"/>
<source>drag</source>
<translation>megragadás</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="271"/>
<location filename="mainwindow.cpp" line="388"/>
<source>move node</source>
<translation>A csúcs mozgatása.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="280"/>
<location filename="mainwindow.cpp" line="397"/>
<source>About QtMindMap</source>
<translation>A QtMindMap-ről</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="281"/>
<location filename="mainwindow.cpp" line="398"/>
<source>MindMap software written in Qt.</source>
<translation>Agytérkép program Qt-ben írva.</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="283"/>
<location filename="mainwindow.cpp" line="400"/>
<source>Homepage:</source>
<translation>Honlap:</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="285"/>
<location filename="mainwindow.cpp" line="402"/>
<source>Report bugs to:</source>
<translation>Ide jelentsd a hibákat:</translation>
</message>

Loading…
Cancel
Save