[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    QUANTA_3_1_BRANCH: quanta
From:       Andras Mantia <amantia () freemail ! hu>
Date:       2003-05-10 11:26:05
[Download RAW message or body]

CVS commit by amantia: 

Default to the project dir when saving a new document. Backport for #57654.


  M +5 -1      ChangeLog   1.90.2.71
  M +13 -12    quanta/quanta.cpp   1.188.2.35
  M +3 -0      quanta/quantadoc.cpp   1.79.2.8


--- quanta/ChangeLog  #1.90.2.70:1.90.2.71
@@ -4,4 +4,8 @@
   - bugfixes:
     - fix possible crashes when using plugins
+    - use the project base directory as the working directory for script actions [  \
#36415] +     
+  - usability enhancements:
+    - default to the project dir when saving a new document [#57654]    
 
 Version 3.1.2 (Release date: 12-05-2003)

--- quanta/quanta/quanta.cpp  #1.188.2.34:1.188.2.35
@@ -75,4 +75,5 @@
 #if (KDE_VERSION > 308)
 #include <ktexteditor/dynwordwrapinterface.h>
+#include <ktexteditor/encodinginterface.h>
 #endif
 
@@ -206,21 +207,21 @@ bool QuantaApp::slotFileSaveAs()
   w->checkDirtyStatus();
   fileWatcher->stopScan();
-  if (w->kate_view->saveAs() == Kate::View::SAVE_OK)
-  {
-    w->createTempFile();
-
-    KURL url = w->doc()->url();
+#if KDE_VERSION >= 308
+  QString myEncoding =  \
dynamic_cast<KTextEditor::EncodingInterface*>(w->doc())->encoding(); +#else
+  QString myEncoding = w->kate_doc->encoding();
+#endif
 
+  KateFileDialog dialog(projectBaseURL().path(), myEncoding, this, i18n ("Save \
File"), KateFileDialog::saveDialog); +  KateFileDialogData data = dialog.exec();
+  if (doc->saveDocument(data.url))
+  {
     if ( ( project->hasProject() ) &&
-         ( KMessageBox::Yes == KMessageBox::questionYesNo(0,i18n("Add file\n %1 \n \
to project ?").arg(url.url())) ) +         ( KMessageBox::Yes == \
KMessageBox::questionYesNo(0,i18n("Add file\n %1 \n to project \
?").arg(data.url.prettyURL())) )  )
     {
-      project->insertFile(url,true);
+      project->insertFile(data.url, true);
     }
 
-    if ( oldURL != url )
-    {
-      doc->changeFileTabName();
-    }
     slotUpdateStatus(w);
     result = true;

--- quanta/quanta/quantadoc.cpp  #1.79.2.7:1.79.2.8
@@ -233,4 +233,7 @@ bool QuantaDoc::saveDocument(const KURL&
       fileWatcher->addFile(w->url().path());
     }
+  } else
+  {
+    result = false;
   }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic