[PC-BSD Commits] r7258 - in pcbsd/current: . src-qt4 src-qt4/pc-sounderror

svn at pcbsd.org svn at pcbsd.org
Fri Jul 23 07:22:51 PDT 2010


Author: kris
Date: 2010-07-23 07:22:50 -0700 (Fri, 23 Jul 2010)
New Revision: 7258

Added:
   pcbsd/current/src-qt4/pc-sounderror/
   pcbsd/current/src-qt4/pc-sounderror/pc-sounderror.pro
Removed:
   pcbsd/current/SoundError/
   pcbsd/current/src-qt4/pc-sounderror/SoundError.pro
Modified:
   pcbsd/current/src-qt4/pc-sounderror/main.cpp
   pcbsd/current/src-qt4/pc-sounderror/snddialog.cpp
   pcbsd/current/src-qt4/src-qt4.pro
Log:

Moved SoundError -> src-qt4/pc-sounderror

Converted it to 100% QT4 based, no kde4 api usage



Modified: pcbsd/current/src-qt4/pc-sounderror/main.cpp
===================================================================
--- pcbsd/current/SoundError/main.cpp	2010-07-23 07:04:54 UTC (rev 7257)
+++ pcbsd/current/src-qt4/pc-sounderror/main.cpp	2010-07-23 14:22:50 UTC (rev 7258)
@@ -1,6 +1,3 @@
-#include <kapplication.h>
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
 #include <QDebug>
 #include <QFile>
 #include <qtranslator.h>
@@ -8,34 +5,16 @@
 #include "snddialog.h"
 #include "ui_snddialog.h"
 
-static const char description[] = I18N_NOOP("Sound Diagnostic Tool");
-
 int main( int argc, char ** argv )
 {
+    QApplication a(argc, argv);
 
-   KAboutData aboutData("SoundDiagnostic", 0, ki18n("SoundDiagnostic"),
-                            "1.2", 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);
-
-    KCmdLineOptions options;
-
-
-    // Tell which options are supported
-    KCmdLineArgs::addCmdLineOptions( options );
-
-
-    KApplication a;
     QTranslator translator;
     QLocale mylocale;
     QString langCode = mylocale.name();
-    if ( ! QFile::exists("/usr/local/kde4/share/apps/pcbsd/i18n/SoundError_" + langCode + ".qm" ) )
+    if ( ! QFile::exists("/usr/local/share/apps/pcbsd/i18n/SoundError_" + langCode + ".qm" ) )
       langCode.truncate(langCode.indexOf("_"));
-    translator.load( QString("SoundError_") + langCode, "/usr/local/kde4/share/apps/pcbsd/i18n/" );
+    translator.load( QString("SoundError_") + langCode, "/usr/local/share/apps/pcbsd/i18n/" );
     a.installTranslator( &translator );
     qDebug() << "Locale:" << langCode;
 

Modified: pcbsd/current/src-qt4/pc-sounderror/snddialog.cpp
===================================================================
--- pcbsd/current/SoundError/snddialog.cpp	2010-07-23 07:04:54 UTC (rev 7257)
+++ pcbsd/current/src-qt4/pc-sounderror/snddialog.cpp	2010-07-23 14:22:50 UTC (rev 7258)
@@ -11,9 +11,8 @@
 *****************************************************************************/
 #include "snddialog.h"
 #include <qtextstream.h>
-#include <kfiledialog.h>
-#include <kuser.h>
-#include <kmessagebox.h>
+#include <QMessageBox>
+#include <QFileDialog>
 
 
 void sndDialog::programInit()
@@ -41,14 +40,16 @@
 // Generate the diagnostic sheet and place it somewhere on the system
 void sndDialog::slotDiagnostic()
 {
-  KUser user; 
-  QString diagFile = KFileDialog::getSaveFileName(user.homeDir() + "/Desktop", "*.diag|Diagnostic Files", 0, "Select a location to save the Diagnostic");
+  QString diagFile = QFileDialog::getSaveFileName( this,
+	"Select a location to save the Diagnostic",
+	"/usr/home", 
+	"*.diag|Diagnostic Files");
 
   system("echo 'PC-BSD Sound Diagnostic\n\npciconf -lv:\n' >'" + diagFile.toLatin1() + "'");
   system("pciconf -lv >> '" + diagFile.toLatin1() + "'");
   system("echo '\ndmesg:\n' >> '" + diagFile.toLatin1() + "'");
   system("dmesg >> '" + diagFile.toLatin1() + "'");
 
-  KMessageBox::information(0, tr("Your diagnostic has been saved at: ") + diagFile, tr("Diagnostic Saved"));
+  QMessageBox::information(0, tr("Your diagnostic has been saved at: ") + diagFile, tr("Diagnostic Saved"));
 
 }

Modified: pcbsd/current/src-qt4/src-qt4.pro
===================================================================
--- pcbsd/current/src-qt4/src-qt4.pro	2010-07-23 07:04:54 UTC (rev 7257)
+++ pcbsd/current/src-qt4/src-qt4.pro	2010-07-23 14:22:50 UTC (rev 7258)
@@ -5,6 +5,7 @@
 	 pc-crashhandler \
 	 pc-usermanager \
 	 pc-servicemanager \
+	 pc-sounderror \
 	 pc-sysmanager \
 	 pc-systemupdatertray \
 	 pc-xgui



More information about the Commits mailing list