Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ElPincheTopo/Abigail
base: 9d32fde5c8
...
head fork: ElPincheTopo/Abigail
compare: fe55e29f76
  • 8 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 01, 2012
@ElPincheTopo Issue #64 Null Name in Unsaved changes window
Modify the 'on_tabsManager_tabCloseRequested' slot on MainWindow
to display Untitled as the document name when asking to save
unsaved changes on a new document tab.
205c0f9
@ElPincheTopo Small README change
Add link to the known issues in the README.md
1a09e26
@ElPincheTopo Issue #57 Tab Name Empty on New File Save
Modify tabManager to check if a file was selected in the save dialog, if
not it doesn't continue to save and rename the tab.
532fe9c
@ElPincheTopo Issue #62 Document Lost When Cancelling Save As
Now the save functions check if you didn't cancel the save as dialog
before closing the document. Also when a tab is closed the new current
tab get focus in it's text area.
17a9508
@ElPincheTopo Issue #61 Check Unsaved Tabs on Exit
In the main window close action, it loops through tabsManager tabs and
send the close tab request for each one.
9c06c44
@ElPincheTopo Add License to Abigail.pro 531016c
@ElPincheTopo Attempt to Solve Issue #70
Because of bug on Issue #75 I didn't implement(I did but it is
commented) this function but it should work when the bug is fixed.
7fa8ce7
@ElPincheTopo Merge branch 'dev' fe55e29
View
20 Abigail.pro
@@ -1,5 +1,25 @@
#-------------------------------------------------
#
+# Abigail, A lightweight, powerful and customizable cross-platform IDE.
+# Copyright (C) 2012 Roberto Lapuente topo@asustin.net
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# For more information visit https://github.com/ElPincheTopo/Abigail
+# or send an e-mail to topo@asustin.net.
+#
+#
# Project created by QtCreator 2012-03-08T16:40:59
#
#-------------------------------------------------
View
5 README.md
@@ -1,6 +1,6 @@
# Abigail
- Abigail, A lightweight, powerful and customizable cross-platform IDE.
+ Abigail, A lightweight, powerful and customizable cross-platform IDE.
Copyright (C) 2012 Roberto Lapuente
This program is free software: you can redistribute it and/or modify
@@ -34,10 +34,11 @@ At this moment there are so many ways someone can contribute to the project. Not
## Bug Reports
Please report any bugs you find here: https://github.com/ElPincheTopo/Abigail/issues
+The current known issues can be found here: http://asust.in/006z
Or by e-mail to this adress: topo@asustin.net
## Licensing
-Abigail is currently licensed under the [GNU GPL v3](https://github.com/ElPincheTopo/Abigail/blob/master/COPYING) but it may be licensed in other ways upon request. All the artwork(Icons, Logos, etc...) is property of their authors and could be licensed with other conditions.
+Abigail is currently licensed under the [GNU GPL v3](https://github.com/ElPincheTopo/Abigail/blob/master/COPYING) but it may be licensed in other ways upon request. All the artwork(Icons, Logos, etc...) is property of their authors and could be licensed with other conditions.
For more information please e-mail me at: topo@asustin.net
View
1  code/main.cpp
@@ -38,6 +38,5 @@ int main(int argc, char *argv[])
int exec = a.exec();
std::cout << "Goodbye!" << std::endl;
-
return exec;
}
View
29 code/mainwindow.cpp
@@ -78,6 +78,11 @@ void MainWindow::on_actionSave_All_triggered()
void MainWindow::on_actionOpen_triggered()
{
+ /*Document* doc = dynamic_cast<Document*>(ui->tabsManager->currentWidget());
+ if (doc->title == 0 && doc->docHasChanged == false) {
+ delete doc;
+ ui->tabsManager->removeTab(doc->tabIndex);
+ }*/
ui->tabsManager->open();
}
@@ -93,8 +98,9 @@ void MainWindow::on_tabsManager_tabCloseRequested(int index)
int ret = QMessageBox::Discard;
// If the Document has changed since las save, ask the user what to do
if (doc->docHasChanged) {
+ QString title = (doc->title == 0 ? QString("Untitled") : *(doc->title));
QString msgText("The document '");
- msgText.append(doc->title).append("'' has been modified.");
+ msgText.append(title).append("' has been modified.");
QMessageBox msgBox;
msgBox.setText(msgText);
msgBox.setInformativeText("Do you want to save your changes?");
@@ -105,11 +111,13 @@ void MainWindow::on_tabsManager_tabCloseRequested(int index)
}
// If the user clicked 'cancel' do nothing, else...
- if (ret != QMessageBox::Cancel) {
- // If the user clicked 'save' emit save signal, then...
- if (ret == QMessageBox::Save)
- emit ui->actionSave->trigger();
- // No matter what, delte the doc and remove the tab
+ // If the user clicked 'save' call 'save' and retry closing tab
+ if (ret == QMessageBox::Save) {
+ ui->tabsManager->save(index);
+ on_tabsManager_tabCloseRequested(index);
+ }
+ // If the user clicked 'discard' or if the document was saved delete the tab
+ if (ret == QMessageBox::Discard) {
delete doc;
ui->tabsManager->removeTab(index);
}
@@ -134,6 +142,9 @@ void MainWindow::on_actionCloseFile_triggered()
void MainWindow::closeEvent(QCloseEvent *event)
{
// Here it must check if the tabs are already saved
+ for (int i=0; i<ui->tabsManager->count(); ++i)
+ on_tabsManager_tabCloseRequested(i);
+
event->accept();
}
@@ -171,3 +182,9 @@ void MainWindow::on_actionDelete_triggered()
{
// Erase current selected text or object in project manager
}
+
+void MainWindow::on_tabsManager_currentChanged(QWidget *arg1)
+{
+ Document* doc = dynamic_cast<Document*>(arg1);
+ doc->textArea->setFocus();
+}
View
8 code/mainwindow.h
@@ -54,19 +54,13 @@ private slots:
void on_actionFile_triggered();
void on_actionCloseFile_triggered();
void closeEvent(QCloseEvent *event);
-
-
void on_actionUndo_triggered();
-
void on_actionRedo_triggered();
-
void on_actionCopy_triggered();
-
void on_actionCut_triggered();
-
void on_actionPaste_triggered();
-
void on_actionDelete_triggered();
+ void on_tabsManager_currentChanged(QWidget *arg1);
private:
Ui::MainWindow *ui;
View
19 code/tabmanager.cpp
@@ -22,11 +22,9 @@
#include "tabmanager.h"
#include <QTabBar>
-#include <algorithm>
#include <QFileDialog>
#include <QMessageBox>
-
TabManager::TabManager(QWidget *parent) : QTabWidget(parent)
{
newDoc();
@@ -53,8 +51,10 @@ void TabManager::save(int index)
// Checar si no esta guardado
Document *doc = dynamic_cast<Document*>(widget(index));
doc->title == 0 ? saveAs() : doc->save(); // If the document has no title it's a new document and 'saveAs()' should be called instead
- QString str = *(doc->title);
- this->setTabText(index, str);
+ if (doc->title != 0) { // If the Save as was canceled then end
+ QString str = *(doc->title);
+ this->setTabText(index, str);
+ }
}
void TabManager::saveCurrentDoc()
@@ -66,18 +66,19 @@ void TabManager::saveCurrentDoc()
void TabManager::saveAll()
{
- for (int i=0; i<count(); ++i) {
+ for (int i=0; i<count(); ++i)
save(i);
- }
}
void TabManager::saveAs()
{
Document* doc = dynamic_cast<Document*>(currentWidget());
if (doc != 0) {
- QString archivo = QFileDialog::getSaveFileName(this, "Choose a file name...", "/home");
- QString* title = doc->saveAs(archivo);
- this->setTabText(this->currentIndex(), *title);
+ QString archivo = QFileDialog::getSaveFileName(this, "Save As", "/home/Untitled.txt");
+ if (archivo != "") {
+ QString* title = doc->saveAs(archivo);
+ this->setTabText(this->currentIndex(), *title);
+ }
}
}
View
2  code/tabmanager.h
@@ -33,7 +33,6 @@ class TabManager : public QTabWidget
explicit TabManager(QWidget *parent = 0);
~TabManager();
private:
- void save(int index);
void open(QString archivo);
signals:
@@ -41,6 +40,7 @@ class TabManager : public QTabWidget
public slots:
void newDoc();
+ void save(int index);
void saveCurrentDoc();
void saveAll();
void saveAs();

No commit comments for this range

Something went wrong with that request. Please try again.