[PC-BSD Commits] r684 - pcbsd/trunk/PBCsource

svn at pcbsd.org svn at pcbsd.org
Mon Sep 10 07:16:28 PDT 2007


Author: tim
Date: 2007-09-10 07:16:28 -0700 (Mon, 10 Sep 2007)
New Revision: 684

Modified:
   pcbsd/trunk/PBCsource/PBC.pro
   pcbsd/trunk/PBCsource/exedialog.ui
   pcbsd/trunk/PBCsource/exedialog.ui.h
   pcbsd/trunk/PBCsource/mimedialog.ui
   pcbsd/trunk/PBCsource/mimedialog.ui.h
   pcbsd/trunk/PBCsource/pbcwizard.ui
   pcbsd/trunk/PBCsource/pbcwizard.ui.h
Log:
Made several improvements to PBI Creator:
- Report failure to write preset file
- Changed QMessageBox entries to KMessageBox.
- Changed QFileDialog entires to KFileDialog. Means we get much prettier (and easier to use) file dialogs.
- Removed compile warnings



Modified: pcbsd/trunk/PBCsource/PBC.pro
===================================================================
--- pcbsd/trunk/PBCsource/PBC.pro	2007-09-09 14:10:41 UTC (rev 683)
+++ pcbsd/trunk/PBCsource/PBC.pro	2007-09-10 14:16:28 UTC (rev 684)
@@ -3,7 +3,7 @@
 
 CONFIG	+= qt warn_on release
 
-LIBS	+= -lkdecore -Ikdelibs
+LIBS	+= -lkdecore -Ikdelibs -lkdeui -lkio
 
 SOURCES	+= main.cpp
 

Modified: pcbsd/trunk/PBCsource/exedialog.ui
===================================================================
--- pcbsd/trunk/PBCsource/exedialog.ui	2007-09-09 14:10:41 UTC (rev 683)
+++ pcbsd/trunk/PBCsource/exedialog.ui	2007-09-10 14:16:28 UTC (rev 684)
@@ -8,7 +8,7 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>450</width>
+            <width>452</width>
             <height>561</height>
         </rect>
     </property>
@@ -486,7 +486,7 @@
     <tabstop>CancelButton</tabstop>
 </tabstops>
 <includes>
-    <include location="local" impldecl="in implementation">qfiledialog.h</include>
+    <include location="global" impldecl="in implementation">kfiledialog.h</include>
     <include location="local" impldecl="in implementation">exedialog.ui.h</include>
 </includes>
 <variables>
@@ -502,10 +502,10 @@
     <slot access="private">CancelSlot()</slot>
     <slot access="private">SaveSlot()</slot>
     <slot access="private">ExeButtonSlot()</slot>
-    <slot access="private">CheckFieldSlot( const QString &amp; myText )</slot>
+    <slot>CheckFieldSlot()</slot>
     <slot access="private">checkWebSlot()</slot>
     <slot>SetEditValues( QString Prog, QString Icon, QString Desc, int noDesktop, int noMenu, int runRoot, int runShell, int notify, int link, int webLink, int taskbar, int owndir, QString kdeCat )</slot>
-    <slot access="private">checkOwnDirSlot( int number )</slot>
+    <slot>checkOwnDirSlot()</slot>
 </slots>
 <layoutdefaults spacing="6" margin="11"/>
 </UI>

Modified: pcbsd/trunk/PBCsource/exedialog.ui.h
===================================================================
--- pcbsd/trunk/PBCsource/exedialog.ui.h	2007-09-09 14:10:41 UTC (rev 683)
+++ pcbsd/trunk/PBCsource/exedialog.ui.h	2007-09-10 14:16:28 UTC (rev 684)
@@ -19,13 +19,13 @@
     ProgDir = Dir;
     ExeIconButton->setPixmap(*IconPixmap);
     SaveButton->setEnabled(FALSE);
-    connect( ProgLineEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckFieldSlot(const QString &)) );  
-    connect( DescriptionLineEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckFieldSlot(const QString &)) ); 
+    connect( ProgLineEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckFieldSlot()) );  
+    connect( DescriptionLineEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckFieldSlot()) ); 
     connect( WebLinkCheckBox, SIGNAL(clicked()), this, SLOT(checkWebSlot()) ); 
-    CheckFieldSlot(" ");
+    CheckFieldSlot();
     IconDir="";
 
-     connect( buttonGroupDir, SIGNAL(clicked(int)), this, SLOT(checkOwnDirSlot(int)) ); 
+     connect( buttonGroupDir, SIGNAL(clicked(int)), this, SLOT(checkOwnDirSlot()) ); 
     
 }
 
@@ -36,11 +36,10 @@
     
     
         // Get the path to the icon
-   QString TmpIcon = QFileDialog::getOpenFileName(
+   QString TmpIcon = KFileDialog::getOpenFileName(
                     ProgDir,
-                    tr("Icon Files") + " (*.png *.xpm)",
+                    " *.png *.xpm|" + tr("Icon Files"),
                     this,
-                    tr("Open file"),
                     tr("Choose an Icon") );
    
     if(!TmpIcon.isNull() && TmpIcon.find(ProgDir) == 0 )
@@ -131,11 +130,10 @@
 
 void ExeDialog::ExeButtonSlot()
 {
-       QString ExePath = QFileDialog::getOpenFileName(
+       QString ExePath = KFileDialog::getOpenFileName(
                     ProgDir,
-                    tr("All Files") + " (*)",
+	    QString::null,
                     this,
-                    tr("Select Executable"),
                     tr("Select Executable") );
    
     if(!ExePath.isNull() && ExePath.find(ProgDir) == 0)
@@ -145,7 +143,7 @@
 
 }
 
-void ExeDialog::CheckFieldSlot( const QString &myText )
+void ExeDialog::CheckFieldSlot()
 {
     SaveButton->setEnabled(FALSE);
     
@@ -178,8 +176,7 @@
 
 void ExeDialog::checkWebSlot()
 {
-    QString tmp;
-    CheckFieldSlot( tmp );
+    CheckFieldSlot();
 }
 
 
@@ -206,17 +203,17 @@
     if ( owndir == 0)
     {
 	radioTopLevel->setChecked(TRUE);
-	checkOwnDirSlot(1);
+	checkOwnDirSlot();
     }
      if ( owndir == 1)
     {
 	radioKDESubDir->setChecked(TRUE);
-	checkOwnDirSlot(1);
+	checkOwnDirSlot();
     }
      if ( owndir == 2)
     {
 	radioKDEDirDirect->setChecked(TRUE);
-	checkOwnDirSlot(1);
+	checkOwnDirSlot();
     }
      if ( noDesktop == 1)
     {
@@ -267,7 +264,7 @@
 }
 
 
-void ExeDialog::checkOwnDirSlot( int number )
+void ExeDialog::checkOwnDirSlot()
 {
       if ( radioTopLevel->isChecked() )
     {

Modified: pcbsd/trunk/PBCsource/mimedialog.ui
===================================================================
--- pcbsd/trunk/PBCsource/mimedialog.ui	2007-09-09 14:10:41 UTC (rev 683)
+++ pcbsd/trunk/PBCsource/mimedialog.ui	2007-09-10 14:16:28 UTC (rev 684)
@@ -184,7 +184,7 @@
 </widget>
 <includes>
     <include location="local" impldecl="in implementation">qfile.h</include>
-    <include location="local" impldecl="in implementation">qfiledialog.h</include>
+    <include location="global" impldecl="in implementation">kfiledialog.h</include>
     <include location="local" impldecl="in implementation">mimedialog.ui.h</include>
 </includes>
 <variables>

Modified: pcbsd/trunk/PBCsource/mimedialog.ui.h
===================================================================
--- pcbsd/trunk/PBCsource/mimedialog.ui.h	2007-09-09 14:10:41 UTC (rev 683)
+++ pcbsd/trunk/PBCsource/mimedialog.ui.h	2007-09-10 14:16:28 UTC (rev 684)
@@ -48,11 +48,10 @@
 {
     
             // Get the path to the icon
-   QString TmpIcon = QFileDialog::getOpenFileName(
+   QString TmpIcon = KFileDialog::getOpenFileName(
                     ProgDir,
-                    tr("Icon Files") + " (*.png *.xpm)",
+                    "*.png *.xpm|" + tr("Icon Files"),
                     this,
-                    tr("Open file"),
                     tr("Choose an Icon") );
    
     if(!TmpIcon.isNull() && TmpIcon.find(ProgDir) == 0 )

Modified: pcbsd/trunk/PBCsource/pbcwizard.ui
===================================================================
--- pcbsd/trunk/PBCsource/pbcwizard.ui	2007-09-09 14:10:41 UTC (rev 683)
+++ pcbsd/trunk/PBCsource/pbcwizard.ui	2007-09-10 14:16:28 UTC (rev 684)
@@ -1133,17 +1133,17 @@
     <tabstop>LicYesButton</tabstop>
 </tabstops>
 <includes>
-    <include location="local" impldecl="in implementation">qfiledialog.h</include>
+    <include location="local" impldecl="in declaration">exedialog.h</include>
+    <include location="local" impldecl="in declaration">qprocess.h</include>
+    <include location="local" impldecl="in declaration">mimedialog.h</include>
     <include location="local" impldecl="in implementation">qpixmap.h</include>
     <include location="local" impldecl="in implementation">qimage.h</include>
     <include location="local" impldecl="in implementation">qdir.h</include>
     <include location="local" impldecl="in implementation">qprocess.h</include>
-    <include location="local" impldecl="in implementation">qmessagebox.h</include>
     <include location="local" impldecl="in implementation">qapplication.h</include>
     <include location="local" impldecl="in implementation">qtimer.h</include>
-    <include location="local" impldecl="in declaration">exedialog.h</include>
-    <include location="local" impldecl="in declaration">qprocess.h</include>
-    <include location="local" impldecl="in declaration">mimedialog.h</include>
+    <include location="global" impldecl="in implementation">kmessagebox.h</include>
+    <include location="global" impldecl="in implementation">kfiledialog.h</include>
     <include location="local" impldecl="in implementation">pbcwizard.ui.h</include>
 </includes>
 <variables>
@@ -1186,8 +1186,8 @@
 <slots>
     <slot>ProgramInit()</slot>
     <slot>PageChangedSlot( const QString &amp; PageName )</slot>
-    <slot>CheckInfoInput( const QString &amp; text )</slot>
-    <slot>LicenseButtonSlot( int button )</slot>
+    <slot>CheckInfoInput()</slot>
+    <slot>LicenseButtonSlot()</slot>
     <slot>SelectDirectorySlot()</slot>
     <slot>SelectLibDirectorySlot()</slot>
     <slot>DirPageCheckSlot()</slot>
@@ -1222,8 +1222,8 @@
     <slot>CreatePBI_CLI()</slot>
     <slot>AddExeDataSlot( QString ProgDir, QString IconPath, QString Desc, int noDesktop, int noMenu, int runRoot, int runShell, int notify, int link, int webLink, int taskbar, int owndir, QString KDECat )</slot>
     <slot>EditExeDataSlot( QString ProgDir, QString IconPath, QString Desc, int noDesktop, int noMenu, int runRoot, int runShell, int notify, int link, int webLink, int taskbar, int owndir, QString KDECat )</slot>
-    <slot>ExeBoxDoubleClick( QListBoxItem * item )</slot>
-    <slot>MimeBoxDoubleClick( QListBoxItem * item )</slot>
+    <slot>ExeBoxDoubleClick()</slot>
+    <slot>MimeBoxDoubleClick()</slot>
     <slot>AddMimeDataSlot( QString Extension, QString IconDir, int ProgNum )</slot>
     <slot>help()</slot>
 </slots>

Modified: pcbsd/trunk/PBCsource/pbcwizard.ui.h
===================================================================
--- pcbsd/trunk/PBCsource/pbcwizard.ui.h	2007-09-09 14:10:41 UTC (rev 683)
+++ pcbsd/trunk/PBCsource/pbcwizard.ui.h	2007-09-10 14:16:28 UTC (rev 684)
@@ -27,10 +27,10 @@
      connect( this, SIGNAL(selected( const QString &)), this, SLOT(PageChangedSlot(const QString &)) );
      
      // Checks fields on the info page for data
-     connect( PackageVerEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckInfoInput(const QString &)) );
-     connect( PackageWebEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckInfoInput(const QString &)) );
-     connect( PackageAuthorEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckInfoInput(const QString &)) );
-     connect( PackageNameEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckInfoInput(const QString &)) );     
+     connect( PackageVerEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckInfoInput()) );
+     connect( PackageWebEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckInfoInput()) );
+     connect( PackageAuthorEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckInfoInput()) );
+     connect( PackageNameEdit, SIGNAL(textChanged( const QString &)), this, SLOT(CheckInfoInput()) );     
      
      // Connects the buttons to edit various setup scripts
      connect( pushEditFirst, SIGNAL(clicked()), this, SLOT(editFirstRunSlot()));
@@ -38,7 +38,7 @@
      connect( pushEditRemove, SIGNAL(clicked()), this, SLOT(editRemoveScriptSlot()));
      
      // Connects the buttons for Directory / Lib data
-     connect( LicButtonGroup, SIGNAL(clicked(int)), this, SLOT(LicenseButtonSlot(int)) );
+     connect( LicButtonGroup, SIGNAL(clicked(int)), this, SLOT(LicenseButtonSlot()) );
      connect( SelDirButton, SIGNAL(clicked()), this, SLOT(SelectDirectorySlot()));	
      connect( SelLibButton, SIGNAL(clicked()), this, SLOT(SelectLibDirectorySlot()) );
    
@@ -54,13 +54,13 @@
      connect( AddExeButton, SIGNAL(clicked()), this, SLOT(AddExeButtonSlot()) );     
      connect( EditExeButton, SIGNAL(clicked()), this, SLOT(EditExeButtonSlot()) );
      connect( RemoveExeButton, SIGNAL(clicked()), this, SLOT(RemoveExeButtonSlot()) );
-     connect(ExeListBox, SIGNAL(doubleClicked( QListBoxItem *) ), this, SLOT(ExeBoxDoubleClick(QListBoxItem *) ) );
+     connect(ExeListBox, SIGNAL(doubleClicked( QListBoxItem *) ), this, SLOT(ExeBoxDoubleClick() ) );
      
      // Connects the Add / Edit / Remove Mime Buttons
      connect( AddMimeButton, SIGNAL(clicked()), this, SLOT(AddMimeButtonSlot()) );     
      connect( EditMimeButton, SIGNAL(clicked()), this, SLOT(EditMimeButtonSlot()) );
      connect( RemoveMimeButton, SIGNAL(clicked()), this, SLOT(RemoveMimeButtonSlot()) );
-      connect(MimeListBox, SIGNAL(doubleClicked( QListBoxItem *) ), this, SLOT(MimeBoxDoubleClick(QListBoxItem *) ) );
+      connect(MimeListBox, SIGNAL(doubleClicked( QListBoxItem *) ), this, SLOT(MimeBoxDoubleClick() ) );
      
      // Connect the Preset Buttons
      connect( LoadPresetButton, SIGNAL(clicked()), this, SLOT(selectPresetSlot()) ); 
@@ -80,15 +80,12 @@
     
     if (PageName == tr("Package Info") )
     {
-         CheckInfoInput(" ");
-
-
+         CheckInfoInput();
     }
     
     if (PageName == tr("License Text") )
     {
-	LicenseButtonSlot(1);
-
+	LicenseButtonSlot();
     }
     
     if (PageName == tr("Directory") )
@@ -132,7 +129,7 @@
 }
 
 // Checks for info about the package, enables the next button if all fields have data
-void PBCwizard::CheckInfoInput( const QString &text )
+void PBCwizard::CheckInfoInput()
 {
     	if (PackageNameEdit->text().isEmpty() || PackageAuthorEdit->text().isEmpty() || PackageVerEdit->text().isEmpty() || PackageWebEdit->text().isEmpty() )
 	{
@@ -144,7 +141,7 @@
 }
 
 // Called when the license button option changes
-void PBCwizard::LicenseButtonSlot( int button )
+void PBCwizard::LicenseButtonSlot()
 {
     if (LicNoButton->isChecked() )
     {
@@ -158,7 +155,7 @@
 // Opens a file dialog to select a program directory
 void PBCwizard::SelectDirectorySlot()
 {
-    QString ProgDir = QFileDialog::getExistingDirectory("/",  this, tr("Select program path"),tr("Choose a directory"), TRUE);
+    QString ProgDir = KFileDialog::getExistingDirectory("/",  this,tr("Choose a directory"));
     if(!ProgDir.isNull())
     {
 	DirLineEdit->setText(ProgDir);
@@ -172,7 +169,7 @@
 // Opens a file dialog to select a lib directory
 void PBCwizard::SelectLibDirectorySlot()
 {
-    QString LibDir=QFileDialog::getExistingDirectory(DirLineEdit->text(),  this, tr("Select Library Path"), tr("Choose a directory"), TRUE);
+    QString LibDir=KFileDialog::getExistingDirectory(DirLineEdit->text(),  this, tr("Choose a directory"));
     if(!LibDir.isNull() && LibDir.find(DirLineEdit->text()) == 0)
     {
 	LibLineEdit->setText(LibDir);
@@ -221,11 +218,10 @@
 void PBCwizard::SelectDefaultIconSlot()
 {
     // Get the path to the icon
-   QString TmpIcon = QFileDialog::getOpenFileName(
+   QString TmpIcon = KFileDialog::getOpenFileName(
                     DirLineEdit->text(),
-                    tr("Icon Files") + "(*.png *.xpm)",
+                    "*.png *.xpm|" + tr("Icon Files"),
                     this,
-                    tr("Open file"),
                     tr("Choose an Icon") );
    
     if(!TmpIcon.isNull() &&TmpIcon.find(DirLineEdit->text()) == 0) 
@@ -481,7 +477,7 @@
 	 if ( BinDir.exists() )
 	 {
 	     BinDir.setFilter( QDir::Files | QDir::NoSymLinks);
-	     for ( int i = 0; i < BinDir.count(); i++ ) {
+	     for ( uint i = 0; i < BinDir.count(); i++ ) {
 		 //runCommand(PBCAppDir + "/PBIfiles/copylibs.sh \"" + DirLineEdit->text() + "/bin/" + BinDir[i]  + "\" \"" + HomeDir + "/.PBCtmp/.autolibs/\"");	 
 		 runCommand(PBCAppDir + "/PBIfiles/copylibs.sh \"" + DirLineEdit->text() + "/bin/" + BinDir[i]  + "\" \"" +DirLineEdit->text() + "/autolibs/\"");
 	     }
@@ -667,7 +663,7 @@
 	printf("PBI Created: " + HomeDir + "/" + Name + Ver + "-PV" + PBIVer + ".pbi\n");
 	done(0);
     } else {
-    QMessageBox::information( this, tr("File Created!"), tr("Your file has been created at:\n") + HomeDir + "/" + Name + Ver + "-PV" + PBIVer + ".pbi" );
+    KMessageBox::information(this, tr("Your file has been created at:\n") + HomeDir + "/" + Name + Ver + "-PV" + PBIVer + ".pbi", tr("File Created!"));
         PackageLabel->setText("Complete! ");
         setFinishEnabled(currentPage(), TRUE);
     }
@@ -820,11 +816,10 @@
 void PBCwizard::SavePresetSlot()
 {
     
-    QString saveFile = QFileDialog::getSaveFileName(
+    QString saveFile = KFileDialog::getSaveFileName(
                     HomeDir,
-                    "Package Creator preset (*.pbc)",
+                    "*.pbc|Package Creator preset",
                     this,
-                    "Save file dialog",
                     "Choose a filename to save under" );
     
     if ( ! saveFile.isEmpty() )
@@ -835,89 +830,86 @@
 	  saveFile = saveFile + ".pbc";  
 	}
 	
-	
-	
 	QFile CfgFile( saveFile );
-    if ( CfgFile.open( IO_WriteOnly ) ) {
-        QTextStream stream( &CfgFile );
-	// Save the software name and info
-	stream << "[ PBC 1.0 ]" << "\n";
-	stream << "ProgName: " << PackageNameEdit->text() << "\n";
-	stream << "ProgVersion: " << PackageVerEdit->text() << "\n";
-	stream << "ProgWeb: " << PackageWebEdit->text() << "\n";
-	stream << "ProgAuthor: " << PackageAuthorEdit->text() << "\n";
-	stream << "PBIVer: " << PBIVerEdit->text() << "\n";
-	stream << "PBIUpdate: " << PBIUpdateEdit->text() << "\n";
-	
-	// Save the package directory
-	stream << "PackageDir: " << DirLineEdit->text() << "\n";
-	
-	
-	// Specify what type of libs we are using
-	if (AutoLibRadioButton->isChecked() )
+	if ( CfgFile.open( IO_WriteOnly ) ) {
+	    QTextStream stream( &CfgFile );
+	    // Save the software name and info
+	    stream << "[ PBC 1.0 ]" << "\n";
+	    stream << "ProgName: " << PackageNameEdit->text() << "\n";
+	    stream << "ProgVersion: " << PackageVerEdit->text() << "\n";
+	    stream << "ProgWeb: " << PackageWebEdit->text() << "\n";
+	    stream << "ProgAuthor: " << PackageAuthorEdit->text() << "\n";
+	    stream << "PBIVer: " << PBIVerEdit->text() << "\n";
+	    stream << "PBIUpdate: " << PBIUpdateEdit->text() << "\n";
+	    
+	    // Save the package directory
+	    stream << "PackageDir: " << DirLineEdit->text() << "\n";
+	    
+	    
+	    // Specify what type of libs we are using
+	    if (AutoLibRadioButton->isChecked() )
+	    {
+		stream << "LibDir: Auto\n" ;
+	    } else if (SpecLibRadioButton->isChecked() ) {
+		stream << "LibDir: " << LibLineEdit->text() << "\n";
+	    } else {
+		stream << "LibDir: NONE\n";  
+	    }
+	    
+	    // Save the default icon, if needed
+	    stream << "DefaultIcon: " << DefaultIcon << "\n";
+	    
+	    // Start saving exe info
+	    int TotalExe = ExeListBox->count() - 1;
+	    int i = 0;
+	    while ( i <= TotalExe)
+	    {
+		stream << "ExePath: " << ExeProgPath[i] << "\n" ;
+		stream << "ExeIcon: " <<  ExeIconPath[i]  << "\n" ;
+		stream << "ExeDescr: " << ExeDescr[i]  << "\n" ;
+		stream << "ExeNoDesktop: " << ExeNoDesktop[i] << "\n";
+		stream << "ExeNoMenu: " << ExeNoMenu[i] << "\n";
+		stream << "ExeRunRoot: " << ExeRunRoot[i] << "\n";
+		stream << "ExeRunShell: " << ExeRunShell[i] << "\n";
+		stream << "ExeNotify: " << ExeNotify[i] << "\n";
+		stream << "ExeLink: " << ExeLink[i] << "\n";
+		stream << "ExeWebLink: " << ExeWebLink[i] << "\n";
+		stream << "ExeTaskbar: " << ExeTaskbar[i] << "\n";
+		stream << "ExeOwndir: " << ExeOwndir[i] << "\n";
+		stream << "ExeKdeCat: " << ExeKdeCat[i] << "\n";
+		i++;
+	    }
+	    
+	    i = 0;
+	    while (! MimeExt[i].isEmpty() )
+	    {
+		stream << "MimeExt: " << MimeExt[i] << "\n";
+		stream << "MimeIcon: " << MimeIcon[i] << "\n";
+		stream << "MimeProg: " << MimeProg[i] << "\n";
+		i++;
+	    }
+	    
+	    
+	    if (LicYesButton->isChecked() )
+	    {
+		stream << "License: YES\n" ;
+		stream << LicenseTextEdit->text() ;
+		
+	    } else {
+		stream << "License: NO\n"; 
+	    }
+	    
+	    
+	    CfgFile.close();
+	    
+	    
+	}
+	else
 	{
-	     stream << "LibDir: Auto\n" ;
-	 } else if (SpecLibRadioButton->isChecked() ) {
-	     stream << "LibDir: " << LibLineEdit->text() << "\n";
-	 } else {
-	     stream << "LibDir: NONE\n";  
-	 }
-	 
-	 // Save the default icon, if needed
-	 stream << "DefaultIcon: " << DefaultIcon << "\n";
-	 
-	 // Start saving exe info
-	 int TotalExe = ExeListBox->count() - 1;
-	 int i = 0;
-	 while ( i <= TotalExe)
-	 {
-	     stream << "ExePath: " << ExeProgPath[i] << "\n" ;
-	     stream << "ExeIcon: " <<  ExeIconPath[i]  << "\n" ;
-	     stream << "ExeDescr: " << ExeDescr[i]  << "\n" ;
-	     stream << "ExeNoDesktop: " << ExeNoDesktop[i] << "\n";
-	     stream << "ExeNoMenu: " << ExeNoMenu[i] << "\n";
-	     stream << "ExeRunRoot: " << ExeRunRoot[i] << "\n";
-	     stream << "ExeRunShell: " << ExeRunShell[i] << "\n";
-	     stream << "ExeNotify: " << ExeNotify[i] << "\n";
-	     stream << "ExeLink: " << ExeLink[i] << "\n";
-	     stream << "ExeWebLink: " << ExeWebLink[i] << "\n";
-	     stream << "ExeTaskbar: " << ExeTaskbar[i] << "\n";
-	     stream << "ExeOwndir: " << ExeOwndir[i] << "\n";
-	     stream << "ExeKdeCat: " << ExeKdeCat[i] << "\n";
-	     i++;
-	 }
-	 
-	 i = 0;
-	 while (! MimeExt[i].isEmpty() )
-	 {
-	     stream << "MimeExt: " << MimeExt[i] << "\n";
-	     stream << "MimeIcon: " << MimeIcon[i] << "\n";
-	     stream << "MimeProg: " << MimeProg[i] << "\n";
-	     i++;
-	 }
-	 
-	 
-	if (LicYesButton->isChecked() )
-	{
-	     stream << "License: YES\n" ;
-	     stream << LicenseTextEdit->text() ;
-	     
-	 } else {
-	     stream << "License: NO\n"; 
-	 }
-	 
-	 
-        CfgFile.close();
-	
-	
-       }
-	
-    } else {
-	return;
+	    //We weren't able to open the file for writing, invalid directory or permission denied
+	    KMessageBox::error(this, tr("Unable to write preset file to '") + saveFile + tr("'. Check the location exists, and is writeable."), tr("Unable to save preset"));
+	}
     }
-    
-    
-    
 }
 
 
@@ -1077,11 +1069,10 @@
 void PBCwizard::selectPresetSlot()
 {
     
-        QString loadFile = QFileDialog::getOpenFileName(
+        QString loadFile = KFileDialog::getOpenFileName(
                         HomeDir,
-                    "Package Creator preset (*.pbc)",
+                    "*.pbc|Package Creator preset",
                     this,
-                    "open file dialog",
                     "Choose a file to open" );
 	
         loadPresetSlot(loadFile);
@@ -1120,7 +1111,7 @@
 	    
 	    if ( FoundVer == 0)
 	    {
-		QMessageBox::information( this, tr("Invalid Fle"), tr("Error, this .pbc file is corrupt, or for the wrong version of Package Creator." ) );
+		KMessageBox::information( this,tr("Error, this .pbc file is corrupt, or for the wrong version of Package Creator." ), tr("Invalid Fle"));
 		return 1;
 	    }
 	    
@@ -1386,13 +1377,13 @@
 	   
 }
 
-void PBCwizard::ExeBoxDoubleClick( QListBoxItem *item )
+void PBCwizard::ExeBoxDoubleClick()
 {
 EditExeButtonSlot();
 }
 
 
-void PBCwizard::MimeBoxDoubleClick( QListBoxItem *item )
+void PBCwizard::MimeBoxDoubleClick()
 {
 EditMimeButtonSlot();
 }



More information about the Commits mailing list