[PC-BSD Commits] r6554 - pbibuild/pbi-source/PBCsource

svn at pcbsd.org svn at pcbsd.org
Mon Apr 19 11:59:23 PDT 2010


Author: kris
Date: 2010-04-19 11:59:23 -0700 (Mon, 19 Apr 2010)
New Revision: 6554

Modified:
   pbibuild/pbi-source/PBCsource/PBC.pro
   pbibuild/pbi-source/PBCsource/exedialog.cpp
   pbibuild/pbi-source/PBCsource/main.cpp
   pbibuild/pbi-source/PBCsource/mimedialog.cpp
   pbibuild/pbi-source/PBCsource/pbcwizard.cpp
Log:

Updated PBC, don't use KDE libs anymore, unnecessary. Also fix some crashes when selecting
directories / icons



Modified: pbibuild/pbi-source/PBCsource/PBC.pro
===================================================================
--- pbibuild/pbi-source/PBCsource/PBC.pro	2010-04-19 17:55:34 UTC (rev 6553)
+++ pbibuild/pbi-source/PBCsource/PBC.pro	2010-04-19 18:59:23 UTC (rev 6554)
@@ -5,9 +5,7 @@
 TEMPLATE = app
 TARGET = PBC
 DEPENDPATH += .
-INCLUDEPATH += /PCBSD/local/kde4/include /usr/local/kde4/include
 RESOURCES += PBC.qrc
-LIBS	+= -lkdecore -lkio -lkdeui -Ikdelibs
 
 # Input
 HEADERS += exedialog.h pbcwizard.h mimedialog.h
@@ -76,4 +74,4 @@
 		i18n/PBC_zh_TW.ts \
 		i18n/PBC_zu.ts
 
-QMAKE_LIBDIR = /PCBSD/local/kde4/lib /PCBSD/local/lib/qt4 /PCBSD/local/lib /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib
+QMAKE_LIBDIR = /PCBSD/local/lib/qt4 /PCBSD/local/lib /usr/local/lib/qt4 /usr/local/lib

Modified: pbibuild/pbi-source/PBCsource/exedialog.cpp
===================================================================
--- pbibuild/pbi-source/PBCsource/exedialog.cpp	2010-04-19 17:55:34 UTC (rev 6553)
+++ pbibuild/pbi-source/PBCsource/exedialog.cpp	2010-04-19 18:59:23 UTC (rev 6554)
@@ -10,8 +10,8 @@
 ** destructor.
 *****************************************************************************/
 #include "exedialog.h"
-#include <kfiledialog.h>
 #include <qstring.h>
+#include <QFileDialog>
 #include <qicon.h>
 
 
@@ -75,12 +75,10 @@
     
     
         // Get the path to the icon
-   QString TmpIcon = KFileDialog::getOpenFileName(
-                    ProgDir,
-                    " *.png *.xpm|" + tr("Icon Files"),
-                    this,
-                    tr("Choose an Icon") );
-   
+   QString TmpIcon = QFileDialog::getOpenFileName(this, tr("Choose an Icon"),
+                                                 ProgDir,
+                                                 tr("Images (*.png)"));
+
     if(!TmpIcon.isNull() && TmpIcon.indexOf(ProgDir) == 0 )
     {
 	// Set our Icon Button to the new selected icon
@@ -169,12 +167,9 @@
 
 void ExeDialog::ExeButtonSlot()
 {
-       QString ExePath = KFileDialog::getOpenFileName(
-                    ProgDir,
-	    QString::null,
-                    this,
-                    tr("Select Executable") );
-   
+       QString ExePath = QFileDialog::getOpenFileName(this, tr("Select Executable"),
+                                                 ProgDir);
+
     if(!ExePath.isNull() && ExePath.indexOf(ProgDir) == 0)
     {
 	ProgLineEdit->setText(ExePath);

Modified: pbibuild/pbi-source/PBCsource/main.cpp
===================================================================
--- pbibuild/pbi-source/PBCsource/main.cpp	2010-04-19 17:55:34 UTC (rev 6553)
+++ pbibuild/pbi-source/PBCsource/main.cpp	2010-04-19 18:59:23 UTC (rev 6554)
@@ -1,7 +1,4 @@
 #include <qapplication.h>
-#include <kapplication.h>
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
 #include <qtextcodec.h>
 #include <qtranslator.h>
 #include <qfile.h>
@@ -12,30 +9,11 @@
 
 void show_args(void);
 
-static const char description[] = I18N_NOOP("PBI Creator GUI");
-
 int main( int argc, char ** argv )
 {
-    KAboutData aboutData("PBC", 0, ki18n("PBC"),
-                            "5.0", ki18n(description),
-                            KAboutData::License_BSD,
-                            ki18n("(c) 2008, Kris Moore(c)"));
-
-    aboutData.addAuthor(ki18n("Kris Moore"), ki18n("Current maintainer"), "kris at pcbsd.org");
     
-    KCmdLineArgs::init(argc, argv, &aboutData);
+   QApplication a(argc, argv, TRUE);
 
- KCmdLineOptions options;
-    options.add("create +file", ki18n("Create a PBI file from a specified .pbc file"));
-    options.add("+file", ki18n("Start the PBC GUI using the specified .pbc file"));
-
-
-     // Tell which options are supported
-    KCmdLineArgs::addCmdLineOptions( options );
-
-    
-   KApplication a;
-
    // Check what directory our app is in
    QString appDir;
    if ( QFile::exists("/Programs/share/PBICreator") )

Modified: pbibuild/pbi-source/PBCsource/mimedialog.cpp
===================================================================
--- pbibuild/pbi-source/PBCsource/mimedialog.cpp	2010-04-19 17:55:34 UTC (rev 6553)
+++ pbibuild/pbi-source/PBCsource/mimedialog.cpp	2010-04-19 18:59:23 UTC (rev 6554)
@@ -10,8 +10,8 @@
 ** destructor.
 *****************************************************************************/
 
+#include <QFileDialog>
 #include "mimedialog.h"
-#include <kfiledialog.h>
 
 
 void MimeDialog::CheckExtensionSlot( const QString &newLine )
@@ -44,11 +44,10 @@
 void MimeDialog::GetIconSlot()
 {
             // Get the path to the icon
-   QString TmpIcon = KFileDialog::getOpenFileName(
-                    ProgDir,
-                    "*.png *.xpm|" + tr("Icon Files"),
-                    this,
-                    tr("Choose an Icon") );
+   QString TmpIcon = QFileDialog::getOpenFileName(this, tr("Choose an Icon"),
+                                                 ProgDir,
+                                                 tr("Images (*.png)"));
+
     if(!TmpIcon.isNull() && TmpIcon.indexOf(ProgDir) == 0 )
     {
 	// We create a QImage, then convert it to QPixmap to set our button

Modified: pbibuild/pbi-source/PBCsource/pbcwizard.cpp
===================================================================
--- pbibuild/pbi-source/PBCsource/pbcwizard.cpp	2010-04-19 17:55:34 UTC (rev 6553)
+++ pbibuild/pbi-source/PBCsource/pbcwizard.cpp	2010-04-19 18:59:23 UTC (rev 6554)
@@ -17,14 +17,13 @@
 *     Date: 06-11-08
 *****************************************************************************/
 #include "pbcwizard.h"
-#include <kmessagebox.h>
+#include <qmessagebox.h>
 #include <qfile.h>
 #include <qprocess.h>
 #include <qtextstream.h>
-#include <kfiledialog.h>
+#include <qfiledialog.h>
 #include <qwizard.h>
 #include <qsettings.h>
-#include <kurl.h>
 #include <qvariant.h>
 #include "mimedialog.h"
 #include "exedialog.h"
@@ -181,8 +180,9 @@
 // Opens a file dialog to select a program directory
 void PBCwizard::SelectDirectorySlot()
 {
-    KUrl url("file:/");
-    QString ProgDir = KFileDialog::getExistingDirectory(url,  this,tr("Choose a directory"));
+    QString ProgDir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
+                                                 "/home",
+                                                 QFileDialog::ShowDirsOnly);
     if(!ProgDir.isNull())
     {
 	DirLineEdit->setText(ProgDir);
@@ -196,7 +196,9 @@
 // Opens a file dialog to select a lib directory
 void PBCwizard::SelectLibDirectorySlot()
 {
-    QString LibDir=KFileDialog::getExistingDirectory(DirLineEdit->text(),  this, tr("Choose a directory"));
+    QString LibDir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
+                                                 DirLineEdit->text(),
+                                                 QFileDialog::ShowDirsOnly);
     if(!LibDir.isNull() && LibDir.indexOf(DirLineEdit->text()) == 0)
     {
 	LibLineEdit->setText(LibDir);
@@ -245,12 +247,10 @@
 void PBCwizard::SelectDefaultIconSlot()
 {
     // Get the path to the icon
-   QString TmpIcon = KFileDialog::getOpenFileName(
-                    DirLineEdit->text(),
-                    "*.png *.xpm|" + tr("Icon Files"),
-                    this,
-                    tr("Choose an Icon") );
-   
+   QString TmpIcon = QFileDialog::getOpenFileName(this, tr("Choose an Icon"),
+                                                 DirLineEdit->text(),
+                                                 tr("Icon Files (*.png)"));
+
     if(!TmpIcon.isNull() &&TmpIcon.indexOf(DirLineEdit->text()) == 0) 
     {
 	// We create a QImage, then convert it to QPixmap to set our button
@@ -420,7 +420,6 @@
     
     runCommand(cmd);
     
-    //KMessageBox::information(this, tr("Your file has been created at:\n") + HomeDir + "/" + Name + Ver + "-PV" + PBIVer + ".pbi", tr("File Created!"));
         PackageLabel->setText("Complete! ");
         button(QWizard::FinishButton)->setEnabled(TRUE);
 }
@@ -523,12 +522,10 @@
 void PBCwizard::SavePresetSlot()
 {
     
-    QString saveFile = KFileDialog::getSaveFileName(
-                    HomeDir,
-                    "*.pbc|Package Creator preset",
-                    this,
-                    "Choose a filename to save under" );
-    
+    QString saveFile = QFileDialog::getSaveFileName(this, tr("Package Creator preset"),
+                            HomeDir,
+                            tr("PBI Creator preset (*.pbc)"));
+
    if ( ! saveFile.isEmpty() )
    {
       MakePresetFileSlot(saveFile);    
@@ -683,14 +680,10 @@
 void PBCwizard::selectPresetSlot()
 {
     
-        QString loadFile = KFileDialog::getOpenFileName(
-                        HomeDir,
-                    "*.pbc|Package Creator preset",
-                    this,
-                    "Choose a file to open" );
-	
+        QString loadFile = QFileDialog::getOpenFileName(this, tr("Open File"),
+                                                 HomeDir,
+                                                 tr("PBI Creator preset (*.pbc)"));
         loadPresetSlot(loadFile);
-	
 }
 
 
@@ -725,7 +718,7 @@
 	    
 	    if ( FoundVer == 0)
 	    {
-		KMessageBox::information( this,tr("Error, this .pbc file is corrupt, or for the wrong version of Package Creator." ), tr("Invalid File"));
+		QMessageBox::information( this,tr("Error, this .pbc file is corrupt, or for the wrong version of Package Creator." ), tr("Invalid File"));
 		return 1;
 	    }
 	    
@@ -1089,6 +1082,6 @@
 	else
 	{
 	    //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"));
+	    QMessageBox::critical(this, tr("Unable to write preset file to '") + saveFile + tr("'. Check the location exists, and is writeable."), tr("Unable to save preset"));
 	}
 }



More information about the Commits mailing list