[PC-BSD Commits] r7217 - in pcbsd/current/pcbsd-netmanager: . src/NetworkManager src/NetworkManagerAdmin src/NetworkTray src/ethernetconfig src/wificonfig

svn at pcbsd.org svn at pcbsd.org
Wed Jul 14 13:03:34 PDT 2010


Author: kris
Date: 2010-07-14 13:03:34 -0700 (Wed, 14 Jul 2010)
New Revision: 7217

Modified:
   pcbsd/current/pcbsd-netmanager/pcbsdnetmanager.pro
   pcbsd/current/pcbsd-netmanager/src/NetworkManager/networkman.cpp
   pcbsd/current/pcbsd-netmanager/src/NetworkManagerAdmin/NetworkManagerAdmin.pro
   pcbsd/current/pcbsd-netmanager/src/NetworkManagerAdmin/main.cpp
   pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.cpp
   pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.h
   pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.pro
   pcbsd/current/pcbsd-netmanager/src/NetworkTray/main.cpp
   pcbsd/current/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.pro
   pcbsd/current/pcbsd-netmanager/src/ethernetconfig/main.cpp
   pcbsd/current/pcbsd-netmanager/src/wificonfig/main.cpp
   pcbsd/current/pcbsd-netmanager/src/wificonfig/wificonfig.pro
   pcbsd/current/pcbsd-netmanager/src/wificonfig/wifiscanssid.cpp
   pcbsd/current/pcbsd-netmanager/src/wificonfig/wifiscanssid.h
Log:

Started making pcbsd-netmanager tools 100% QT4 based, and localized in /usr/local PREFIX

Neex to finish the regular "NetworkManager", since its a kcm based application still



Modified: pcbsd/current/pcbsd-netmanager/pcbsdnetmanager.pro
===================================================================
--- pcbsd/current/pcbsd-netmanager/pcbsdnetmanager.pro	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/pcbsdnetmanager.pro	2010-07-14 20:03:34 UTC (rev 7217)
@@ -2,7 +2,7 @@
 
 SUBDIRS+=src
 
-images.path=/usr/local/kde4/share/apps/pc-netmanager/pics/
+images.path=/usr/local/share/pc-netmanager/pics/
 images.files=pics/*.png
 
 INSTALLS+= images

Modified: pcbsd/current/pcbsd-netmanager/src/NetworkManager/networkman.cpp
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/NetworkManager/networkman.cpp	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/NetworkManager/networkman.cpp	2010-07-14 20:03:34 UTC (rev 7217)
@@ -314,7 +314,7 @@
 
 	
     // Check to see if the network tray icon is enabled or not
-     QString filename = "/home/" + username + "/.kde4/Autostart/tray-" + Devs[sel] + ".desktop";
+     QString filename = "/home/" + username + "/.config/autostart/tray-" + Devs[sel] + ".desktop";
 
 
   // First run a check to if we need to enable or disable the checkbox
@@ -768,7 +768,7 @@
     { 
 	
 	         // Save the new file
-                 QFile fileout( "/home/" + username + "/.kde4/Autostart/tray-" + Devs[sel] + ".desktop" );
+                 QFile fileout( "/home/" + username + "/.config/autostart/tray-" + Devs[sel] + ".desktop" );
                  if ( fileout.open( QIODevice::WriteOnly ) ) {
                     QTextStream streamout( &fileout );
                     streamout << "#!/usr/bin/env xdg-open\n";
@@ -776,8 +776,8 @@
 		    streamout << "\nIcon=network\nStartupNotify=false\nType=Application\n";
                                 fileout.close();
 		    
-		    runCommand("chown " + username + ":" + username + " \"/home/" + username + "/.kde4/Autostart/tray-" + Devs[sel] + ".desktop\"");
-		    runCommand("chmod 744 \"/home/" + username + "/.kde4/Autostart/tray-" + Devs[sel] + ".desktop\"");
+		    runCommand("chown " + username + ":" + username + " \"/home/" + username + "/.config/autostart/tray-" + Devs[sel] + ".desktop\"");
+		    runCommand("chmod 744 \"/home/" + username + "/.config/autostart/tray-" + Devs[sel] + ".desktop\"");
 
                     // Now start the tray icon
 		    runCommand("pc-nettray " + Devs[sel] + " &");
@@ -786,7 +786,7 @@
 	
     } else {
 	// Kill the tray applet
-	runCommand("rm -f \"/home/" + username + "/.kde4/Autostart/tray-" + Devs[sel] + ".desktop\"");
+	runCommand("rm -f \"/home/" + username + "/.config/autostart/tray-" + Devs[sel] + ".desktop\"");
     }
 
 }

Modified: pcbsd/current/pcbsd-netmanager/src/NetworkManagerAdmin/NetworkManagerAdmin.pro
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/NetworkManagerAdmin/NetworkManagerAdmin.pro	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/NetworkManagerAdmin/NetworkManagerAdmin.pro	2010-07-14 20:03:34 UTC (rev 7217)
@@ -3,7 +3,7 @@
 
 CONFIG	+= qt warn_on release
 
-LIBS	+= -lkdecore -lkdeui -lkio -Ikdelibs -lpcbsd
+LIBS	+= -lpcbsd
 
 HEADERS	+= netmanadmin.h
 
@@ -13,10 +13,6 @@
 
 RESOURCES += NetworkManagerAdmin.qrc
 
-INCLUDEPATH += /usr/local/kde4/include /usr/local/kde4/include
-
-LIBS += -L/usr/local/kde4/lib -L/usr/local/kde4/lib
-
 TRANSLATIONS =  i18n/NetworkManagerAdmin_af.ts \
 		i18n/NetworkManagerAdmin_ar.ts \
 		i18n/NetworkManagerAdmin_az.ts \
@@ -79,12 +75,12 @@
 		i18n/NetworkManagerAdmin_zh_TW.ts \
 		i18n/NetworkManagerAdmin_zu.ts
 
-dotrans.path=/usr/local/kde4/share/apps/pcbsd/i18n/
-dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/kde4/share/apps/pcbsd/i18n/
+dotrans.path=/usr/local/share/apps/pcbsd/i18n/
+dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/share/apps/pcbsd/i18n/
 
 INSTALLS += dotrans target
 
-QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib
+QMAKE_LIBDIR = /usr/local/lib/qt4 /usr/local/lib
 
 TARGET  = pc-netadmin
-target.path = /usr/local/kde4/bin
+target.path = /usr/local/bin

Modified: pcbsd/current/pcbsd-netmanager/src/NetworkManagerAdmin/main.cpp
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/NetworkManagerAdmin/main.cpp	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/NetworkManagerAdmin/main.cpp	2010-07-14 20:03:34 UTC (rev 7217)
@@ -2,43 +2,19 @@
 #include <qlocale.h>
 #include <QDebug>
 #include <QFile>
-#include <kapplication.h>
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-#include <kstandarddirs.h>
+#include <QApplication>
 #include "netmanadmin.h"
 
-static const char description[] = I18N_NOOP("Network Manager - Admin");
-
 int main( int argc, char ** argv )
 {
+    QApplication a(argc, argv);
 
-    KAboutData aboutData("NetManAdmin", 0, ki18n("NetManAdmin"),
-                            "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;
-    options.add("", ki18n("Start the Network Manager"));
-
-
-
-    // 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/NetworkManagerAdmin_" + langCode + ".qm" ) )
+    if ( ! QFile::exists("/usr/local/share/apps/pcbsd/i18n/NetworkManagerAdmin_" + langCode + ".qm" ) )
       langCode.truncate(langCode.indexOf("_"));
-    translator.load( QString("NetworkManagerAdmin_") + langCode, "/usr/local/kde4/share/apps/pcbsd/i18n/" );
+    translator.load( QString("NetworkManagerAdmin_") + langCode, "/usr/local/share/apps/pcbsd/i18n/" );
     a.installTranslator( &translator );
     qDebug() << "Locale:" << langCode;
 

Modified: pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.cpp
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.cpp	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.cpp	2010-07-14 20:03:34 UTC (rev 7217)
@@ -9,12 +9,6 @@
 #include <qtextstream.h>
 #include <qmenu.h>
 #include <QDebug>
-
-/* KDE */
-#include <kiconloader.h>
-#include <kpassivepopup.h>
-#include <kmessagebox.h>
-#include <kstandarddirs.h>
 #include <iostream>
 
 #include "NetworkTray.h"
@@ -84,14 +78,14 @@
   }
 
   // Add configuration button to the context menu
-  //setIcon(Icon);
-  contextMenu()->clear();
-  contextMenu()->addSeparator();
-  contextMenu()->addAction( tr("Configure ") + DeviceName, this, SLOT(openConfigDlg()));
-  contextMenu()->addAction( tr("Device Information "), this, SLOT(openDeviceInfo()));
-  contextMenu()->addAction( tr("Start the Network Manager"), this, SLOT(openNetManager()));
-  contextMenu()->addSeparator();
-  contextMenu()->addAction( tr("Restart the Network"), this, SLOT(slotRestartNetwork()));
+  trayIconMenu = new QMenu(this);
+  trayIconMenu->clear();
+  trayIconMenu->addSeparator();
+  trayIconMenu->addAction( tr("Configure ") + DeviceName, this, SLOT(openConfigDlg()));
+  trayIconMenu->addAction( tr("Device Information "), this, SLOT(openDeviceInfo()));
+  trayIconMenu->addAction( tr("Start the Network Manager"), this, SLOT(openNetManager()));
+  trayIconMenu->addSeparator();
+  trayIconMenu->addAction( tr("Restart the Network"), this, SLOT(slotRestartNetwork()));
 
   // Check if we are on a ethernet device and PPPOE is enabled
   if ( DeviceType == "Ethernet" )
@@ -112,9 +106,9 @@
           // Check if we are on a profile line
 	  if ( line.indexOf(":") == line.length() -1 && line.indexOf(ProfileName) != -1  ) {
 	    // If we find the existing profile for this device, add the context menu shortcuts
-	    contextMenu()->addSeparator();
-  	    contextMenu()->addAction( tr("Connect to PPPoE service."), this, SLOT(slotEnablePPPOE()));
-	    contextMenu()->addAction( tr("Disconnect from PPPoE service."), this, SLOT(slotDisablePPPOE()));
+	    trayIconMenu->addSeparator();
+  	    trayIconMenu->addAction( tr("Connect to PPPoE service."), this, SLOT(slotEnablePPPOE()));
+	    trayIconMenu->addAction( tr("Disconnect from PPPoE service."), this, SLOT(slotDisablePPPOE()));
 	  }
 	}
        filein.close();
@@ -123,6 +117,13 @@
      } // end of TMP = YES line
 
    } // End of PPPOE check
+
+  trayIconMenu->addAction( tr("Close the Network Monitor"), this, SLOT(slotQuit()));
+
+  trayIcon = new QSystemTrayIcon(this);
+  trayIcon->setContextMenu(trayIconMenu);
+  trayIcon->show();
+
   
   // Create the tooltip popup now
   displayTooltip();
@@ -149,7 +150,7 @@
    {
       // Opps, this device doesn't seem to exist!
       // First run a check to see if this device has a auto-start .desktop associated with it
-      QFile desktopfile("/home/" + username + "/.kde4/Autostart/tray-" + device + ".desktop");
+      QFile desktopfile("/home/" + username + "/.config/autostart/tray-" + device + ".desktop");
       if ( desktopfile.exists() )
          desktopfile.remove(); // Remove this file
       exit(1);
@@ -368,27 +369,31 @@
    }
 
   // Update the tooltop
-  setToolTip(tooltipStr);
+  trayIcon->setToolTip(tooltipStr);
    
 }
 
 // Load all the icons we'll be using
 void NetworkTray::loadIcons() {
-  iconWiredConnect.addFile(KStandardDirs::locate("data", "pc-netmanager/pics/tray_local.png"));
-  iconWiredDisconnect.addFile(KStandardDirs::locate("data", "pc-netmanager/pics/tray_local_dis.png"));
-  iconWifiConnect.addFile(KStandardDirs::locate("data", "pc-netmanager/pics/tray_wifi.png"));
-  iconWifiDisconnect.addFile(KStandardDirs::locate("data", "pc-netmanager/pics/tray_wifi_dis.png"));
-  iconWifiConnect30.addFile(KStandardDirs::locate("data", "pc-netmanager/pics/tray_wifi30.png"));
-  iconWifiConnect60.addFile(KStandardDirs::locate("data", "pc-netmanager/pics/tray_wifi60.png"));
-  iconWifiConnect85.addFile(KStandardDirs::locate("data", "pc-netmanager/pics/tray_wifi85.png"));
+  iconWiredConnect.addFile(PROGPATH + "/pics/tray_local.png");
+  iconWiredDisconnect.addFile( PROGPATH + "/pics/tray_local_dis.png");
+  iconWifiConnect.addFile( PROGPATH + "/pics/tray_wifi.png");
+  iconWifiDisconnect.addFile( PROGPATH + "/pics/tray_wifi_dis.png");
+  iconWifiConnect30.addFile( PROGPATH + "/pics/tray_wifi30.png");
+  iconWifiConnect60.addFile( PROGPATH + "/pics/tray_wifi60.png");
+  iconWifiConnect85.addFile( PROGPATH + "/pics/tray_wifi85.png");
 }
 
+void NetworkTray::slotQuit() {
+   exit(0);
+}
+
 void NetworkTray::monitorStatus() {
   // Start checking to see if the device has changed, and if it has inform the user
   QString tmp;  
   QIcon Icon;
   QString NotifyText = "";
-  QString filename = "/home/" + username + "/.kde4/Autostart/tray-" + DeviceName + ".desktop";
+  QString filename = "/home/" + username + "/.config/autostart/tray-" + DeviceName + ".desktop";
 
 
   // First run a check to see if this applet has been disabled in the network manager
@@ -485,7 +490,7 @@
   }
 
   // Set the tray icon now
-  setIcon(Icon);
+  trayIcon->setIcon(Icon);
 
 
   displayTooltip();
@@ -493,7 +498,7 @@
 
   // First run a check to see if this applet has been disabled in the network manager
   if ( ! QFile::exists( filename ) )
-    close(0);
+    exit(0);
 
   QTimer::singleShot(UPDATE_MSEC,  this,  SLOT(monitorStatus()));
 

Modified: pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.h
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.h	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.h	2010-07-14 20:03:34 UTC (rev 7217)
@@ -1,19 +1,20 @@
 // QT Includes
 #include <qpair.h>
 #include <QProcess>
+#include <QDialog>
+#include <QSystemTrayIcon>
+#include <QMenu>
 
-// KDE Includes
-#include <ksystemtrayicon.h>
+#define PROGPATH QString("/usr/local/share/pc-netmanager")
 
-
 class QString;
 class QPixmap;
 
-class NetworkTray : public KSystemTrayIcon {
+class NetworkTray : public QDialog {
    Q_OBJECT
    
 public:
-   NetworkTray() : KSystemTrayIcon()
+   NetworkTray() : QDialog()
    {
 
    }
@@ -30,6 +31,7 @@
    void slotEnablePPPOE();
    void slotDisablePPPOE();
    void slotTrayActivated(QSystemTrayIcon::ActivationReason);
+   void slotQuit();
 
    
 private:
@@ -62,5 +64,6 @@
    QIcon iconWifiConnect30;
    QIcon iconWifiConnect60;
    QIcon iconWifiConnect85;
-
+   QSystemTrayIcon *trayIcon;
+   QMenu *trayIconMenu;
 };

Modified: pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.pro
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.pro	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/NetworkTray/NetworkTray.pro	2010-07-14 20:03:34 UTC (rev 7217)
@@ -3,16 +3,12 @@
 
 CONFIG	+= qt warn_on release
 
-LIBS	+= -lkdecore -lkdeui -lkio -Ikdelibs -lpcbsd
+LIBS	+= -lpcbsd
 
 HEADERS	+= NetworkTray.h
 
 SOURCES	+= main.cpp NetworkTray.cpp
 
-INCLUDEPATH += /usr/local/kde4/include /usr/local/kde4/include
-
-LIBS += -L/usr/local/kde4/lib -L/usr/local/kde4/lib
-
 TRANSLATIONS =  i18n/NetworkTray_af.ts \
 		i18n/NetworkTray_ar.ts \
 		i18n/NetworkTray_az.ts \
@@ -74,12 +70,12 @@
 		i18n/NetworkTray_zh_TW.ts \
 		i18n/NetworkTray_zu.ts
 
-dotrans.path=/usr/local/kde4/share/apps/pcbsd/i18n/
-dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/kde4/share/apps/pcbsd/i18n/
+dotrans.path=/usr/local/share/apps/pcbsd/i18n/
+dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/share/apps/pcbsd/i18n/
 
 INSTALLS += dotrans target
 
-QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib
+QMAKE_LIBDIR = /usr/local/lib/qt4 /usr/local/lib
 
 TARGET  = pc-nettray
-target.path = /usr/local/kde4/bin/
+target.path = /usr/local/bin/

Modified: pcbsd/current/pcbsd-netmanager/src/NetworkTray/main.cpp
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/NetworkTray/main.cpp	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/NetworkTray/main.cpp	2010-07-14 20:03:34 UTC (rev 7217)
@@ -1,66 +1,40 @@
  
 #include <err.h>
 
-#include <kaboutdata.h>
 #include <qtimer.h>
-#include <kcmdlineargs.h>
-#include <kuniqueapplication.h>
-#include <kstandarddirs.h>
 #include <QTranslator>
 #include <QDebug>
 #include <QFile>
 #include <qtextcodec.h>
+#include <QApplication>
 #include <QLocale>
 
 #include <NetworkTray.h>
 
-static const char description[] = I18N_NOOP("PC-BSD Network Tray Icon");
 
 int  main(int argc, char *argv[]) {
 
+   QApplication a(argc, argv);
 
-   KAboutData aboutData("NetworkTray", 0, ki18n("NetworkTray"),
-                            "1.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);
-
-   KCmdLineOptions options;
-   options.add("+<device>", ki18n("Start the tray application on the specified device"));
-
-
-    // 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/NetworkTray_" + langCode + ".qm" ) )
+   if ( ! QFile::exists("/usr/local/share/apps/pcbsd/i18n/NetworkTray_" + langCode + ".qm" ) )
      langCode.truncate(langCode.indexOf("_"));
-   translator.load( QString("NetworkTray_") + langCode, "/usr/local/kde4/share/apps/pcbsd/i18n/" );
+   translator.load( QString("NetworkTray_") + langCode, "/usr/local/share/apps/pcbsd/i18n/" );
    a.installTranslator( &translator );
    qDebug() << "Locale:" << langCode;
 
    NetworkTray tray;
+   QApplication::setQuitOnLastWindowClosed(false);
 
-   //a.setMainWidget(tray.contextMenu());
-   a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
-
-
-    if ( argc == 2)
-    {
-        QString Device = argv[1];
-        tray.programInit(Device);
-	tray.show();
-    } else {
-       exit(1);
-    }
+   if ( argc == 2)
+   {
+       QString Device = argv[1];
+       tray.programInit(Device);
+   } else {
+      exit(1);
+   }
  
 
    return  a.exec();

Modified: pcbsd/current/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.pro
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.pro	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/ethernetconfig/ethernetconfig.pro	2010-07-14 20:03:34 UTC (rev 7217)
@@ -3,7 +3,7 @@
 
 CONFIG	+= qt warn_on release
 
-LIBS	+= -lkdecore -lkdeui -lkio -Ikdelibs -lpcbsd
+LIBS	+= -lpcbsd
 
 HEADERS	+= ethernetconfig.h
 
@@ -13,10 +13,6 @@
 
 RESOURCES += ethernetconfig.qrc
 
-INCLUDEPATH += /usr/local/kde4/include /usr/local/kde4/include
-
-LIBS += -L/usr/local/kde4/lib -L/usr/local/kde4/lib
-
 TRANSLATIONS =  i18n/ethernetconfig_af.ts \
 		i18n/ethernetconfig_ar.ts \
 		i18n/ethernetconfig_az.ts \
@@ -79,12 +75,12 @@
 		i18n/ethernetconfig_zh_TW.ts \
 		i18n/ethernetconfig_zu.ts
 
-dotrans.path=/usr/local/kde4/share/apps/pcbsd/i18n/
-dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/kde4/share/apps/pcbsd/i18n/
+dotrans.path=/usr/local/share/apps/pcbsd/i18n/
+dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/share/apps/pcbsd/i18n/
 
 INSTALLS += dotrans target
 
-QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib
+QMAKE_LIBDIR = /usr/local/lib/qt4 /usr/local/lib
 
 TARGET  = pc-ethernetconfig
-target.path = /usr/local/kde4/bin
+target.path = /usr/local/bin

Modified: pcbsd/current/pcbsd-netmanager/src/ethernetconfig/main.cpp
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/ethernetconfig/main.cpp	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/ethernetconfig/main.cpp	2010-07-14 20:03:34 UTC (rev 7217)
@@ -23,99 +23,55 @@
  ***************************************************************************/
 
 #include "ethernetconfig.h"
-#include <kapplication.h>
-#include <kuniqueapplication.h>
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
-#include <klocale.h>
-#include <kstandarddirs.h>
 #include <QLocale>
 #include <QDebug>
 #include <QFile>
 #include <qtranslator.h>
 #include <qdesktopwidget.h>
 #include <qtextcodec.h>
+#include <QApplication>
 
-static const char description[] = I18N_NOOP("Ethernet Setup GUI");
-
-static const char version[] = "1.0";
-
 int main(int argc, char **argv)
 {
-   KAboutData aboutData("ETHERGUI", 0, ki18n("ETHERGUI"),
-                            "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;
-    options.add("+<device>", ki18n("Start the Network configuration on specified ethernet device"));
-    options.add("info <device>", ki18n("Show the info tab on the specified ethernet device."));
-
-
-
-    // Tell which options are supported
-    KCmdLineArgs::addCmdLineOptions( options );
-
-
-    KApplication app;
-
+    QApplication a(argc, argv);
     QTranslator translator;
     QLocale mylocale;
     QString langCode = mylocale.name();
-    if ( ! QFile::exists("/usr/local/kde4/share/apps/pcbsd/i18n/ethernetconfig_" + langCode + ".qm" ) )
+    if ( ! QFile::exists("/usr/local/share/apps/pcbsd/i18n/ethernetconfig_" + langCode + ".qm" ) )
       langCode.truncate(langCode.indexOf("_"));
-    translator.load( QString("ethernetconfig_") + langCode, "/usr/local/kde4/share/apps/pcbsd/i18n/" );
-    app.installTranslator( &translator );
+    translator.load( QString("ethernetconfig_") + langCode, "/usr/local/share/apps/pcbsd/i18n/" );
+    a.installTranslator( &translator );
     qDebug() << "Locale:" << langCode;
 
-
     ethernetconfig *mainWin = 0;
 
+    // no session.. just start up normally
+    mainWin = new ethernetconfig();
+    if ( argc == 2)
+    {
+	QString Device = argv[1];
+	mainWin->setDevice( Device );
+	mainWin->setWindowTitle(Device + " " + "configuration");
 
-     // no session.. just start up normally
-     KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-     mainWin = new ethernetconfig();
-    // app.setMainWidget( mainWin );
-
-        if ( argc == 2)
-        {
-		QString Device = argv[1];
-		mainWin->setDevice( Device );
-		mainWin->setWindowTitle(Device + " " + "configuration");
-
-       		// Center the dialog window
-   		QDesktopWidget *d = KApplication::desktop();
-   		mainWin->move(d->width() / 3, d->height() / 4);
-	        mainWin->programInit();
-	        mainWin->show();
-	} else if ( argc == 3  ) {
+        mainWin->programInit();
+        mainWin->show();
+     } else if ( argc == 3  ) {
 	 QString val = argv[1];
 	 if ( val != "info" ) {
 	   exit(1);  
 	 }
 	 
-	        QString Device = argv[2];
-		mainWin->setDevice( Device );
-		mainWin->setWindowTitle(Device + " " + "configuration");
-		mainWin->showInfo();
-       		// Center the dialog window
-   		QDesktopWidget *d = KApplication::desktop();
-   		mainWin->move(d->width() / 3, d->height() / 4);
-	        mainWin->programInit();
-		mainWin->show();
-	} else {
-		exit(1);
-	}
+        QString Device = argv[2];
+	mainWin->setDevice( Device );
+	mainWin->setWindowTitle(Device + " " + "configuration");
+	mainWin->showInfo();
+        mainWin->programInit();
+	mainWin->show();
+     } else {
+	exit(1);
+     }
 
-
-
-        args->clear();
-
     // mainWin has WDestructiveClose flag by default, so it will delete itself.
-    return app.exec();
+    return a.exec();
 }
 

Modified: pcbsd/current/pcbsd-netmanager/src/wificonfig/main.cpp
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/wificonfig/main.cpp	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/wificonfig/main.cpp	2010-07-14 20:03:34 UTC (rev 7217)
@@ -1,45 +1,20 @@
-#include <kapplication.h>
-#include <kaboutdata.h>
-#include <kcmdlineargs.h>
+#include <QApplication>
 #include <qtranslator.h>
-#include <kstandarddirs.h>
 #include <qtextcodec.h>
 #include <QDebug>
 #include "wificonfigwidgetbase.h"
 #include "ui_wificonfigwidgetbase.h"
 
-static const char description[] = I18N_NOOP("WIFI Setup GUI");
-
 int main( int argc, char ** argv )
 {
+    QApplication a(argc, argv);
 
-   KAboutData aboutData("WIFIGUI", 0, ki18n("WIFIGUI"),
-                            "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;
-    options.add("+<device>", ki18n("Start the Network configuration on specified wireless device"));
-    options.add("info <device>", ki18n("Show the info tab on the specified wireless device."));
-
-
-
-    // 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/wificonfig_" + langCode + ".qm" ) )
+    if ( ! QFile::exists("/usr/local/share/apps/pcbsd/i18n/wificonfig_" + langCode + ".qm" ) )
       langCode.truncate(langCode.indexOf("_"));
-    translator.load( QString("wificonfig_") + langCode, "/usr/local/kde4/share/apps/pcbsd/i18n/" );
+    translator.load( QString("wificonfig_") + langCode, "/usr/local/share/apps/pcbsd/i18n/" );
     a.installTranslator( &translator );
     qDebug() << "Locale:" << langCode;
 

Modified: pcbsd/current/pcbsd-netmanager/src/wificonfig/wificonfig.pro
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/wificonfig/wificonfig.pro	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/wificonfig/wificonfig.pro	2010-07-14 20:03:34 UTC (rev 7217)
@@ -3,7 +3,7 @@
 
 CONFIG	+= qt warn_on release
 
-LIBS	+= -lkdecore -lkdeui -lkio -Ikdelibs -lpcbsd
+LIBS	+= -lpcbsd
 
 HEADERS	+= dialogwpaenterprise.h dialogwpapersonal.h wepconfig.h wificonfigwidgetbase.h wifiscanssid.h wifiselectiondialog.h
 
@@ -13,10 +13,6 @@
 
 RESOURCES += wificonfig.qrc
 
-INCLUDEPATH += /usr/local/kde4/include /usr/local/kde4/include
-
-LIBS += -L/usr/local/kde4/lib -L/usr/local/kde4/lib
-
 TRANSLATIONS =  i18n/wificonfig_af.ts \
 		i18n/wificonfig_ar.ts \
 		i18n/wificonfig_az.ts \
@@ -79,12 +75,12 @@
 		i18n/wificonfig_zh_TW.ts \
 		i18n/wificonfig_zu.ts
 
-dotrans.path=/usr/local/kde4/share/apps/pcbsd/i18n/
-dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/kde4/share/apps/pcbsd/i18n/
+dotrans.path=/usr/local/share/apps/pcbsd/i18n/
+dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/share/apps/pcbsd/i18n/
 
 INSTALLS += dotrans target
 
-QMAKE_LIBDIR = /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib /usr/local/kde4/lib /usr/local/lib/qt4 /usr/local/lib
+QMAKE_LIBDIR = /usr/local/lib/qt4 /usr/local/lib
 
 TARGET  = pc-wificonfig
-target.path = /usr/local/kde4/bin
+target.path = /usr/local/bin

Modified: pcbsd/current/pcbsd-netmanager/src/wificonfig/wifiscanssid.cpp
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/wificonfig/wifiscanssid.cpp	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/wificonfig/wifiscanssid.cpp	2010-07-14 20:03:34 UTC (rev 7217)
@@ -1,7 +1,6 @@
 #include "wifiscanssid.h"
 #include "ui_wifiscanssid.h"
 #include <qtextstream.h>
-#include <kstandarddirs.h>
 #include <qtimer.h>
 
 void wifiscanssid::init(QString device)
@@ -112,13 +111,13 @@
 		     newStrength = tmp.toInt(&ok);
 		     if ( newStrength < 25 )
 		     {	
-			 FileLoad=KStandardDirs::locate("data", "pc-netmanager/pics/tray_wifi.png");
+			 FileLoad= PROGPATH + "/pics/tray_wifi.png";
 		     } else if ( newStrength < 50 ) {
-			 FileLoad=KStandardDirs::locate("data", "pc-netmanager/pics/tray_wifi30.png");
+			 FileLoad= PROGPATH + "/pics/tray_wifi30.png";
 		     }  else if ( newStrength < 75 ) {
-			 FileLoad=KStandardDirs::locate("data", "pc-netmanager/pics/tray_wifi60.png");
+			 FileLoad= PROGPATH + "/pics/tray_wifi60.png";
 		     } else {;
-			 FileLoad=KStandardDirs::locate("data", "pc-netmanager/pics/tray_wifi85.png");
+			 FileLoad= PROGPATH + "/pics/tray_wifi85.png";
 		     }
 		 
 		       QImage *Icon = new QImage(FileLoad);
@@ -131,7 +130,7 @@
 	     } else {
 		  if ( ! ssid.isEmpty() && ssid != " " ) {
 		       // If we didn't get the signal strength, still display the SSID
-		       FileLoad=KStandardDirs::locate("data", "pc-netmanager/pics/tray_wifi.png");
+		       FileLoad= PROGPATH + "/pics/tray_wifi.png";
 		       QImage *Icon = new QImage(FileLoad);
 		       QPixmap PixmapIcon;
 	                     PixmapIcon.fromImage(Icon->scaled(22,22));

Modified: pcbsd/current/pcbsd-netmanager/src/wificonfig/wifiscanssid.h
===================================================================
--- pcbsd/current/pcbsd-netmanager/src/wificonfig/wifiscanssid.h	2010-07-14 19:11:28 UTC (rev 7216)
+++ pcbsd/current/pcbsd-netmanager/src/wificonfig/wifiscanssid.h	2010-07-14 20:03:34 UTC (rev 7217)
@@ -1,6 +1,8 @@
 #ifndef WIFISCANSSID_H
 #define WIFISCANSSID_H
 
+#define PROGPATH QString("/usr/local/share/pc-netmanager")
+
 #include <qfile.h>
 #include <qmessagebox.h>
 #include <qdialog.h>



More information about the Commits mailing list