Browse Source

Attached savePrompt to New Project and exiting (but it doesn't work correctly at all).

git-svn-id: file:///var/svn/tigccpp/trunk@439 9552661e-59e3-4036-b4f2-dbe53926924f
joeyadams 18 years ago
parent
commit
5e5060fe32
2 changed files with 11 additions and 0 deletions
  1. 1 0
      ktigcc/mainform.ui
  2. 10 0
      ktigcc/mainform.ui.h

+ 1 - 0
ktigcc/mainform.ui

@@ -1379,6 +1379,7 @@
     <slot>m_view_cursorPositionChanged()</slot>
     <slot>m_view_textChanged()</slot>
     <slot>fileTreeItemRenamed( QListViewItem * item, int col, const QString &amp; newName )</slot>
+    <slot access="protected">closeEvent( QCloseEvent * e )</slot>
 </slots>
 <functions>
     <function access="private" specifier="non virtual">clearProject()</function>

+ 10 - 0
ktigcc/mainform.ui.h

@@ -578,6 +578,8 @@ void MainForm::clearProject()
 
 void MainForm::fileNewProject()
 {
+  if (savePrompt())
+    return;
   clearProject();
   pconfig->setGroup("Recent files");
   pconfig->writeEntry("Current project","");
@@ -1809,5 +1811,13 @@ void MainForm::fileTreeItemRenamed( QListViewItem *item, int col, const QString
   updateRightStatusLabel();
 }
 
+void MainForm::closeEvent(QCloseEvent *e)
+{
+  if (savePrompt())
+    e->ignore();
+  else
+    e->accept();
+}
+
 // Yes, this is an ugly hack... Any better suggestions?
 #define QListView DnDListView