Subversion Repositories tpanel

Rev

Rev 240 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 240 Rev 242
Line 1736... Line 1736...
1736
{
1736
{
1737
#if defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_SIMULATOR)
1737
#if defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_SIMULATOR)
1738
    QASettings settings;
1738
    QASettings settings;
1739
    localSettings.path = QASettings::getLibraryPath().toStdString();
1739
    localSettings.path = QASettings::getLibraryPath().toStdString();
1740
    localSettings.project = localSettings.path + "/tpanel";
1740
    localSettings.project = localSettings.path + "/tpanel";
-
 
1741
    localSettings.version = "1.0";
-
 
1742
    localSettings.ptype = "iPhone";
-
 
1743
    localSettings.max_cache = 100;
-
 
1744
    localSettings.logLevel = SLOG_NONE;
1741
//    localSettings.logFile = localSettings.path + "/tpanel.log";
1745
    localSettings.logLevelBits = HLOG_NONE;
1742
    mkdir(localSettings.project.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
1746
    mkdir(localSettings.project.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
1743
    localSettings.name = "tpanel.cfg";
1747
    localSettings.name = "tpanel.cfg";
1744
    localSettings.scale = true;
1748
    localSettings.scale = true;
1745
    localSettings.tbforce = false;
1749
    localSettings.tbforce = false;
1746
    localSettings.tbsuppress = false;
1750
    localSettings.tbsuppress = false;
Line 1815... Line 1819...
1815
        localSettings.longformat = false;
1819
        localSettings.longformat = false;
1816
 
1820
 
1817
    localSettings.logLevelBits = logLevel;
1821
    localSettings.logLevelBits = logLevel;
1818
    localSettings.logLevel = logLevelBitsToString(logLevel);
1822
    localSettings.logLevel = logLevelBitsToString(logLevel);
1819
 
1823
 
-
 
1824
    if (settings.getLoggingLogfileEnabled())
-
 
1825
    {
-
 
1826
        string fname = settings.getLoggingLogfile().toStdString();
-
 
1827
 
-
 
1828
        if (!fname.empty())
-
 
1829
        {
-
 
1830
            localSettings.logFile = QASettings::getDocumentPath().toStdString() + "/" + fname;
-
 
1831
            cout << "DEBUG: Logfile was set to " << localSettings.logFile << endl;
-
 
1832
        }
-
 
1833
    }
-
 
1834
    else
-
 
1835
    {
-
 
1836
        localSettings.logFile.clear();
-
 
1837
        cout << "DEBUG: Using of a logfile was disabled!" << endl;
-
 
1838
    }
-
 
1839
 
1820
    if (localSettings.uuid.empty())
1840
    if (localSettings.uuid.empty())
1821
    {
1841
    {
1822
        uuid_t uuid;
1842
        uuid_t uuid;
1823
        char sUUID[256];
1843
        char sUUID[256];
1824
 
1844
 
Line 1828... Line 1848...
1828
        localSettings_temp = localSettings;
1848
        localSettings_temp = localSettings;
1829
    }
1849
    }
1830
 
1850
 
1831
    mInitialized = true;
1851
    mInitialized = true;
1832
 
1852
 
-
 
1853
    if (IS_LOG_DEBUG())
-
 
1854
    {
1833
    cout << "Selected Parameters:" << endl;
1855
        cout << "Selected Parameters:" << endl;
1834
    cout << "    Path to cfg.: " << localSettings.path << endl;
1856
        cout << "    Path to cfg.: " << localSettings.path << endl;
1835
    cout << "    Name of cfg.: " << localSettings.name << endl;
1857
        cout << "    Name of cfg.: " << localSettings.name << endl;
-
 
1858
        cout << "    Logfile use:  " << (settings.getLoggingLogfileEnabled() ? "YES": "NO") << endl;
1836
    cout << "    Logfile:      " << localSettings.logFile  << endl;
1859
        cout << "    Logfile:      " << localSettings.logFile  << endl;
1837
    cout << "    LogLevel:     " << localSettings.logLevel  << endl;
1860
        cout << "    LogLevel:     " << localSettings.logLevel  << endl;
1838
    cout << "    Long format:  " << (localSettings.longformat ? "YES" : "NO")  << endl;
1861
        cout << "    Long format:  " << (localSettings.longformat ? "YES" : "NO")  << endl;
1839
    cout << "    Project path: " << localSettings.project  << endl;
1862
        cout << "    Project path: " << localSettings.project  << endl;
1840
    cout << "    Controller:   " << localSettings.server  << endl;
1863
        cout << "    Controller:   " << localSettings.server  << endl;
1841
    cout << "    Port:         " << localSettings.port  << endl;
1864
        cout << "    Port:         " << localSettings.port  << endl;
1842
    cout << "    Channel:      " << localSettings.ID  << endl;
1865
        cout << "    Channel:      " << localSettings.ID  << endl;
1843
    cout << "    Panel type:   " << localSettings.ptype  << endl;
1866
        cout << "    Panel type:   " << localSettings.ptype  << endl;
1844
    cout << "    Firmware ver. " << localSettings.version  << endl;
1867
        cout << "    Firmware ver. " << localSettings.version  << endl;
1845
    cout << "    Scaling:      " << (localSettings.scale ? "YES" : "NO")  << endl;
1868
        cout << "    Scaling:      " << (localSettings.scale ? "YES" : "NO")  << endl;
1846
    cout << "    Profiling:    " << (localSettings.profiling ? "YES" : "NO")  << endl;
1869
        cout << "    Profiling:    " << (localSettings.profiling ? "YES" : "NO")  << endl;
1847
    cout << "    Button cache: " << localSettings.max_cache  << endl;
1870
        cout << "    Button cache: " << localSettings.max_cache  << endl;
1848
    cout << "    System Sound: " << localSettings.systemSound  << endl;
1871
        cout << "    System Sound: " << localSettings.systemSound  << endl;
1849
    cout << "    Sound state:  " << (localSettings.systemSoundState ? "ACTIVATED" : "DEACTIVATED")  << endl;
1872
        cout << "    Sound state:  " << (localSettings.systemSoundState ? "ACTIVATED" : "DEACTIVATED")  << endl;
1850
    cout << "    Single beep:  " << localSettings.systemSingleBeep  << endl;
1873
        cout << "    Single beep:  " << localSettings.systemSingleBeep  << endl;
1851
    cout << "    Double beep:  " << localSettings.systemDoubleBeep  << endl;
1874
        cout << "    Double beep:  " << localSettings.systemDoubleBeep  << endl;
1852
    cout << "    Volume:       " << localSettings.systemVolume  << endl;
1875
        cout << "    Volume:       " << localSettings.systemVolume  << endl;
1853
    cout << "    Gain:         " << localSettings.systemGain  << endl;
1876
        cout << "    Gain:         " << localSettings.systemGain  << endl;
1854
    cout << "    Rotation:     " << (localSettings.systemRotationFix ? "LOCKED" : "UNLOCKED")  << endl;
1877
        cout << "    Rotation:     " << (localSettings.systemRotationFix ? "LOCKED" : "UNLOCKED")  << endl;
1855
    cout << "    UUID:         " << localSettings.uuid  << endl;
1878
        cout << "    UUID:         " << localSettings.uuid  << endl;
1856
    cout << "    FTP user:     " << localSettings.ftpUser  << endl;
1879
        cout << "    FTP user:     " << localSettings.ftpUser  << endl;
1857
    cout << "    FTP password: " << localSettings.ftpPassword  << endl;
1880
        cout << "    FTP password: " << localSettings.ftpPassword  << endl;
1858
    cout << "    FTP surface:  " << localSettings.ftpSurface  << endl;
1881
        cout << "    FTP surface:  " << localSettings.ftpSurface  << endl;
1859
    cout << "    FTP passive:  " << (localSettings.ftpPassive ? "YES" : "NO")  << endl;
1882
        cout << "    FTP passive:  " << (localSettings.ftpPassive ? "YES" : "NO")  << endl;
1860
    cout << "    FTP dl. time: " << localSettings.ftpLastDownload  << endl;
1883
        cout << "    FTP dl. time: " << localSettings.ftpLastDownload  << endl;
1861
    cout << "    SIP proxy:    " << localSettings.sip_proxy  << endl;
1884
        cout << "    SIP proxy:    " << localSettings.sip_proxy  << endl;
1862
    cout << "    SIP port:     " << localSettings.sip_port  << endl;
1885
        cout << "    SIP port:     " << localSettings.sip_port  << endl;
1863
    cout << "    SIP TLS port: " << localSettings.sip_portTLS  << endl;
1886
        cout << "    SIP TLS port: " << localSettings.sip_portTLS  << endl;
1864
    cout << "    SIP STUN:     " << localSettings.sip_stun  << endl;
1887
        cout << "    SIP STUN:     " << localSettings.sip_stun  << endl;
1865
    cout << "    SIP doamain:  " << localSettings.sip_domain  << endl;
1888
        cout << "    SIP doamain:  " << localSettings.sip_domain  << endl;
1866
    cout << "    SIP user:     " << localSettings.sip_user  << endl;
1889
        cout << "    SIP user:     " << localSettings.sip_user  << endl;
1867
    cout << "    SIP IPv4:     " << (localSettings.sip_ipv4 ? "YES" : "NO")  << endl;
1890
        cout << "    SIP IPv4:     " << (localSettings.sip_ipv4 ? "YES" : "NO")  << endl;
1868
    cout << "    SIP IPv6:     " << (localSettings.sip_ipv6 ? "YES" : "NO")  << endl;
1891
        cout << "    SIP IPv6:     " << (localSettings.sip_ipv6 ? "YES" : "NO")  << endl;
1869
    cout << "    SIP Int.Phone:" << (localSettings.sip_iphone ? "YES" : "NO")  << endl;
1892
        cout << "    SIP Int.Phone:" << (localSettings.sip_iphone ? "YES" : "NO")  << endl;
1870
    cout << "    SIP firewall: " << sipFirewallToString(localSettings.sip_firewall)  << endl;
1893
        cout << "    SIP firewall: " << sipFirewallToString(localSettings.sip_firewall)  << endl;
1871
    cout << "    SIP enabled:  " << (localSettings.sip_enabled ? "YES" : "NO")  << endl;
1894
        cout << "    SIP enabled:  " << (localSettings.sip_enabled ? "YES" : "NO")  << endl;
-
 
1895
    }
1872
#else
1896
#else
1873
    ifstream fs;
1897
    ifstream fs;
1874
 
1898
 
1875
    mTemporary = false;
1899
    mTemporary = false;
1876
    // First initialize the defaults
1900
    // First initialize the defaults