[PC-BSD Commits] r18463 - pcbsd-projects/PCDM

svn at pcbsd.org svn at pcbsd.org
Thu Aug 16 09:20:33 PDT 2012


Author: kenmoore
Date: 2012-08-16 16:20:33 +0000 (Thu, 16 Aug 2012)
New Revision: 18463

Added:
   pcbsd-projects/PCDM/startPCDM
Modified:
   pcbsd-projects/PCDM/PCDM.pro
   pcbsd-projects/PCDM/pcdm-backend.cpp
   pcbsd-projects/PCDM/pcdm-backend.h
Log:
Add a PCDM startup wrapper script



Modified: pcbsd-projects/PCDM/PCDM.pro
===================================================================
--- pcbsd-projects/PCDM/PCDM.pro	2012-08-16 16:00:38 UTC (rev 18462)
+++ pcbsd-projects/PCDM/PCDM.pro	2012-08-16 16:20:33 UTC (rev 18463)
@@ -92,6 +92,9 @@
 dotrans.path=/usr/local/share/PCDM/i18n/
 dotrans.extra=cd i18n && lrelease-qt4 -nounfinished *.ts && cp *.qm /usr/local/share/pcbsd/i18n/
 
-INSTALLS += dotrans TARGET
+scripts.path = /usr/local/bin
+scripts.files = startPCDM
 
+INSTALLS += scripts dotrans TARGET
+
 RESOURCES += PCDM.qrc

Modified: pcbsd-projects/PCDM/pcdm-backend.cpp
===================================================================
--- pcbsd-projects/PCDM/pcdm-backend.cpp	2012-08-16 16:00:38 UTC (rev 18462)
+++ pcbsd-projects/PCDM/pcdm-backend.cpp	2012-08-16 16:20:33 UTC (rev 18463)
@@ -68,14 +68,25 @@
   if(allowed){
     qDebug() << "Username/Password Authorized";
     //Setup the system command to run the selected DE
-    //QString cmd = "su - "+username+" -c "+xBinary;
-    //system(cmd.toUtf8());  //run the command to start the DE
+    QString cmd = "su - "+username+" -c "+xBinary;
+    slotStartXSession(cmd);
   }else{
     qDebug() << "Username/Password not authorized";	  
   }
   return allowed;
 }
 
+void Backend::startXSession(QString cmd){
+  QFile xfile("/usr/local/bin/.pcdm-startup");
+  if(xfile.open(QIODevice::WriteOnly | QIODevice::Text)){
+    QTextStream out(&xfile);
+    out << "#!/bin/sh" << "\n\n";
+    out << cmd << "\n";
+    xfile.close();
+  }
+  //system(cmd.toUtf8());  //create the command to start the DE
+}
+
 QString Backend::getUsernameFromDisplayname(QString dspname){
   int i = displaynameList.indexOf(dspname);
   return usernameList[i];

Modified: pcbsd-projects/PCDM/pcdm-backend.h
===================================================================
--- pcbsd-projects/PCDM/pcdm-backend.h	2012-08-16 16:00:38 UTC (rev 18462)
+++ pcbsd-projects/PCDM/pcdm-backend.h	2012-08-16 16:20:33 UTC (rev 18463)
@@ -44,6 +44,10 @@
     static void loadXSessionsData();
     static QStringList readXSessionsFile(QString, QString);
     static bool verifyUsernamePassword(QString, QString);
+    
+private slots:
+    void startXSession(QString);
+    
 };
 
 

Index: pcbsd-projects/PCDM/startPCDM
===================================================================
--- pcbsd-projects/PCDM/startPCDM	2012-08-16 16:00:38 UTC (rev 18462)
+++ pcbsd-projects/PCDM/startPCDM	2012-08-16 16:20:33 UTC (rev 18463)

Property changes on: pcbsd-projects/PCDM/startPCDM
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*


More information about the Commits mailing list