Changeset c9d1400


Ignore:
Timestamp:
08/21/13 09:55:52 (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
5313c46
Parents:
ea4b713
Message:

Update NetworkManager?, now it runs via single-instance and has a '-installer' mode option,
for use during the system installer

Location:
src-qt4/pc-netmanager/src/NetworkManager
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-netmanager/src/NetworkManager/main.cpp

    r1620346 rc9d1400  
    1 #include <qtranslator.h> 
     1#include <QApplication> 
    22#include <qlocale.h> 
     3#include <qtsingleapplication.h> 
    34#include <QDebug> 
    45#include <QFile> 
    5 #include <QApplication> 
     6#include <QObject> 
     7#include <QString> 
     8#include <QTranslator> 
    69#include "networkman.h" 
    710#include "../../../config.h" 
     
    912int main( int argc, char ** argv ) 
    1013{ 
    11     QApplication a(argc, argv); 
     14    QtSingleApplication a(argc, argv); 
     15    if (a.isRunning()) 
     16      return !(a.sendMessage("show")); 
    1217 
    1318    QTranslator translator; 
     
    2429    w.Init(); 
    2530 
     31    // Are we running via the system-installer? 
     32    if ( argc == 2 ) { 
     33       QString tmp = argv[1]; 
     34       if ( tmp == "-installer" ) 
     35         w.setInstallerMode(); 
     36    } 
     37 
    2638    w.show(); 
     39 
     40    a.connect( &a, SIGNAL( messageReceived(const QString &) ), &w, SLOT( slotSingleInstance() ) ); 
    2741    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); 
    2842    return a.exec(); 
  • src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp

    r0f79dd90 rc9d1400  
    3434void NetworkMan::Init() 
    3535{ 
     36    InstallerMode = false; 
    3637    Changed = FALSE; 
    3738     
     
    411412     textStatus2->setText(SSID); 
    412413   } else { 
    413      checkSysTray->setVisible(TRUE); 
     414     if ( ! InstallerMode ) 
     415       checkSysTray->setVisible(TRUE); 
    414416     textStatusLabel2->setText(tr("MAC Address:")); 
    415417     textStatus2->setText(DevsMAC[sel]); 
     
    10881090    } 
    10891091} 
     1092 
     1093void NetworkMan::slotSingleInstance() 
     1094{ 
     1095  this->show(); 
     1096} 
     1097 
     1098 
     1099void NetworkMan::setInstallerMode() 
     1100{ 
     1101  checkSysTray->setHidden(true); 
     1102  groupBoxMisc->setHidden(true); 
     1103  InstallerMode = true; 
     1104} 
  • src-qt4/pc-netmanager/src/NetworkManager/networkman.h

    r1620346 rc9d1400  
    2525public slots: 
    2626    void Init(); 
     27    void setInstallerMode(); 
    2728 
    2829private slots: 
     
    4849    void slotIPV6DNS1Clicked(); 
    4950    void slotIPV6DNS2Clicked(); 
     51    void slotSingleInstance(); 
    5052 
    5153 
    5254private: 
     55    bool InstallerMode; 
    5356    QString Devs[100]; 
    5457    QString DevsParent[100]; 
  • src-qt4/pc-netmanager/src/NetworkManager/networkman.ui

    r2e77b02 rc9d1400  
    220220      <layout class="QGridLayout" name="gridLayout_8"> 
    221221       <item row="4" column="0"> 
    222         <widget class="QGroupBox" name="groupBox"> 
     222        <widget class="QGroupBox" name="groupBoxMisc"> 
    223223         <property name="title"> 
    224224          <string>Misc</string> 
Note: See TracChangeset for help on using the changeset viewer.