Skip to content

Commit

Permalink
Window title change on open/close project
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Ribelotta <[email protected]>
  • Loading branch information
martinribelotta committed Mar 4, 2017
1 parent dccc5f7 commit 0bb789b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
Binary file modified i18n/es.qm
Binary file not shown.
34 changes: 20 additions & 14 deletions i18n/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,27 @@
<translation>Buscar simbolo bajo el cursor</translation>
</message>
<message>
<location filename="../codeeditor.cpp" line="556"/>
<location filename="../codeeditor.cpp" line="558"/>
<source>Document Modified</source>
<translation>Documento Modificado</translation>
</message>
<message>
<location filename="../codeeditor.cpp" line="557"/>
<location filename="../codeeditor.cpp" line="559"/>
<source>The document is not save. Save it?</source>
<translation>El documentio no esta guardado. ¿Desea guardarlo?</translation>
</message>
<message>
<location filename="../codeeditor.cpp" line="560"/>
<location filename="../codeeditor.cpp" line="562"/>
<source>Yes</source>
<translation>Si</translation>
</message>
<message>
<location filename="../codeeditor.cpp" line="561"/>
<location filename="../codeeditor.cpp" line="563"/>
<source>No</source>
<translation>No</translation>
</message>
<message>
<location filename="../codeeditor.cpp" line="562"/>
<location filename="../codeeditor.cpp" line="564"/>
<source>Abort</source>
<translation>Abortar</translation>
</message>
Expand Down Expand Up @@ -507,6 +507,7 @@
<name>MainWindow</name>
<message>
<location filename="../mainwindow.ui" line="14"/>
<location filename="../mainwindow.cpp" line="265"/>
<source>Embedded IDE</source>
<translation>Embedded IDE</translation>
</message>
Expand Down Expand Up @@ -557,9 +558,9 @@
</message>
<message>
<location filename="../mainwindow.ui" line="140"/>
<location filename="../mainwindow.cpp" line="122"/>
<location filename="../mainwindow.cpp" line="214"/>
<location filename="../mainwindow.cpp" line="233"/>
<location filename="../mainwindow.cpp" line="128"/>
<location filename="../mainwindow.cpp" line="220"/>
<location filename="../mainwindow.cpp" line="239"/>
<source>Open Project</source>
<translation>Abrir Proyecto</translation>
</message>
Expand Down Expand Up @@ -610,28 +611,33 @@
<translation>Configuración</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="170"/>
<location filename="../mainwindow.cpp" line="176"/>
<source>Error</source>
<translation>Error</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="175"/>
<location filename="../mainwindow.cpp" line="181"/>
<source>Export</source>
<translation>Exportar</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="177"/>
<location filename="../mainwindow.cpp" line="183"/>
<source>Success</source>
<translation>Éxito</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="216"/>
<location filename="../mainwindow.cpp" line="222"/>
<source>Makefile (Makefile);;Make (*.mk);;All Files (*)</source>
<translation>Makefile (Makefile);;Make (*.mk);;Todos los archivos (*)</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="122"/>
<location filename="../mainwindow.cpp" line="233"/>
<location filename="../mainwindow.cpp" line="248"/>
<source>Embedded IDE %1</source>
<translation>Embedded IDE %1</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="128"/>
<location filename="../mainwindow.cpp" line="239"/>
<source>Cannot open %1</source>
<translation>No se puede abrir %1</translation>
</message>
Expand Down
12 changes: 9 additions & 3 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,17 @@ MainWindow::MainWindow(QWidget *parent) :
QString name = info.absoluteFilePath();
if (QFileInfo(name).exists()) {
ui->projectView->openProject(name);
QString name = ui->projectView->projectPath().dirName();
QString path = ui->projectView->project();
QSettings sets;
sets.beginGroup("last_projects");
sets.setValue(name, path);
sets.sync();
} else {
QMessageBox::critical(this, tr("Open Project"), tr("Cannot open %1").arg(name));
removeFromLastProject(name);
menuWidget->setProjectList(lastProjectsList());
}
menuWidget->setProjectList(lastProjectsList());
});
connect(menuWidget, SIGNAL(projectClose()), this, SLOT(on_actionProjectClose_triggered()));
connect(menuWidget, SIGNAL(configure()), this, SLOT(on_actionConfigure_triggered()));
Expand Down Expand Up @@ -239,13 +245,12 @@ void MainWindow::openProject()

void MainWindow::projectOpened()
{
// TODO: Implement me
setWindowTitle(tr("Embedded IDE %1").arg(ui->projectView->project()));
}

void MainWindow::on_actionHelp_triggered()
{
AboutDialog(this).exec();
//QMessageBox::about(this, tr("About IDE"), resourceText(":/help/about.txt"));
}

void MainWindow::on_actionProjectExport_triggered()
Expand All @@ -257,6 +262,7 @@ void MainWindow::on_actionProjectClose_triggered()
ui->projectView->closeProject();
ui->centralWidget->closeAll();
ui->loggerCompiler->clearText();
setWindowTitle(tr("Embedded IDE"));
}

void MainWindow::on_projectView_projectOpened()
Expand Down

0 comments on commit 0bb789b

Please sign in to comment.