From cfc9255ef835ae3e1b6fd11b2260165fc2420493 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sat, 18 Feb 2006 13:36:55 +0000 Subject: [PATCH] fix for text output in no GUI case, longer time out for channels --- src/channel.h | 11 ++++++----- src/main.cpp | 5 +---- src/util.cpp | 43 +++++++++++++++++++++++++++++++++++-------- src/util.h | 2 +- 4 files changed, 43 insertions(+), 18 deletions(-) diff --git a/src/channel.h b/src/channel.h index 62e9278a..a18c9efc 100755 --- a/src/channel.h +++ b/src/channel.h @@ -37,17 +37,18 @@ /* Definitions ****************************************************************/ /* Set the time-out for the input buffer until the state changes from connected to not-connected (the actual time depends on the way the error - correction is implemented) */ -#define CON_TIME_OUT_CNT_MAX 50 + correction is implemented) */ +#define CON_TIME_OUT_SEC_MAX 5 // seconds +#define CON_TIME_OUT_CNT_MAX ( ( CON_TIME_OUT_SEC_MAX * 1000 ) / BLOCK_DURATION_MS ) /* maximum number of internet connections (channels) */ -#define MAX_NUM_CHANNELS 10 /* max number channels for server */ +#define MAX_NUM_CHANNELS 10 /* max number channels for server */ /* no valid channel number */ -#define INVALID_CHANNEL_ID (MAX_NUM_CHANNELS + 1) +#define INVALID_CHANNEL_ID (MAX_NUM_CHANNELS + 1) /* no valid time stamp index */ -#define INVALID_TIME_STAMP_IDX -1 +#define INVALID_TIME_STAMP_IDX -1 /* Classes ********************************************************************/ diff --git a/src/main.cpp b/src/main.cpp index 98c4546f..baef8fe4 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -95,9 +95,6 @@ int main ( int argc, char** argv ) // actual server object CServer Server; - /* start the server */ - Server.Start (); - if ( bUseGUI ) { // GUI object for the server @@ -115,7 +112,7 @@ int main ( int argc, char** argv ) else { // only start application without using the GUI - qDebug ( CAboutDlg::GetVersionAndNameStr () ); + qDebug ( CAboutDlg::GetVersionAndNameStr ( false ) ); app.exec (); } } diff --git a/src/util.cpp b/src/util.cpp index 0ba4c478..478234c2 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -257,17 +257,44 @@ CAboutDlg::CAboutDlg(QWidget* parent, const char* name, bool modal, WFlags f) TextLabelVersion->setText(GetVersionAndNameStr()); } -QString CAboutDlg::GetVersionAndNameStr() +QString CAboutDlg::GetVersionAndNameStr ( const bool bWithHtml ) { - QString strVersionText; + QString strVersionText = ""; // name, short description and GPL hint - strVersionText = "
" + tr("llcon, Version "); - strVersionText += VERSION; - strVersionText += "
" + - tr("llcon, Low-Latency (Internet) Connection") + "
"; - strVersionText += tr("Under the GNU General Public License (GPL)") + - "
"; + if ( bWithHtml ) + { + strVersionText += "
"; + } + + strVersionText += tr("llcon, Version ") + VERSION; + + if ( bWithHtml ) + { + strVersionText += "
"; + } + else + { + strVersionText += "\n"; + } + + strVersionText += tr("llcon, Low-Latency (Internet) Connection"); + + if ( bWithHtml ) + { + strVersionText += "
"; + } + else + { + strVersionText += "\n"; + } + + strVersionText += tr("Under the GNU General Public License (GPL)"); + + if ( bWithHtml ) + { + strVersionText += "
"; + } return strVersionText; } diff --git a/src/util.h b/src/util.h index d08562ee..4a97268c 100755 --- a/src/util.h +++ b/src/util.h @@ -304,7 +304,7 @@ public: CAboutDlg(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags f = 0); - static QString GetVersionAndNameStr(); + static QString GetVersionAndNameStr ( const bool bWithHtml = true ); };