fix for server GUI, connect dlg fix

This commit is contained in:
Volker Fischer 2011-05-01 19:33:29 +00:00
parent 29a185da97
commit 50cf3e54dc
6 changed files with 97 additions and 71 deletions

View file

@ -65,6 +65,10 @@ CConnectDlg::CConnectDlg ( QWidget* parent, Qt::WindowFlags f )
// Connections ------------------------------------------------------------- // Connections -------------------------------------------------------------
// list view // list view
QObject::connect ( ListViewServers,
SIGNAL ( itemClicked ( QTreeWidgetItem*, int ) ),
this, SLOT ( OnServerListItemClicked ( QTreeWidgetItem*, int ) ) );
QObject::connect ( ListViewServers, QObject::connect ( ListViewServers,
SIGNAL ( itemDoubleClicked ( QTreeWidgetItem*, int ) ), SIGNAL ( itemDoubleClicked ( QTreeWidgetItem*, int ) ),
this, SLOT ( OnServerListItemDoubleClicked ( QTreeWidgetItem*, int ) ) ); this, SLOT ( OnServerListItemDoubleClicked ( QTreeWidgetItem*, int ) ) );
@ -259,6 +263,16 @@ void CConnectDlg::SetServerList ( const CHostAddress& InetAddr,
TimerPing.start ( PING_UPDATE_TIME_SERVER_LIST_MS ); TimerPing.start ( PING_UPDATE_TIME_SERVER_LIST_MS );
} }
void CConnectDlg::OnServerListItemClicked ( QTreeWidgetItem* Item,
int )
{
// if an item is clicked, copy the server name to the combo box
if ( Item != 0 )
{
LineEditServerAddr->setEditText ( Item->text ( 0 ) );
}
}
void CConnectDlg::OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, void CConnectDlg::OnServerListItemDoubleClicked ( QTreeWidgetItem* Item,
int ) int )
{ {

View file

@ -84,6 +84,7 @@ protected:
bool bServerListItemWasChosen; bool bServerListItemWasChosen;
public slots: public slots:
void OnServerListItemClicked ( QTreeWidgetItem* Item, int );
void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int ); void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int );
void OnConnectButtonClicked(); void OnConnectButtonClicked();
void OnTimerPing(); void OnTimerPing();

View file

@ -54,7 +54,7 @@
<item> <item>
<widget class="QLabel" name="TextLabelServerAddr" > <widget class="QLabel" name="TextLabelServerAddr" >
<property name="text" > <property name="text" >
<string>Server Address</string> <string>Server Name/Address</string>
</property> </property>
<property name="alignment" > <property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>

View file

@ -26,8 +26,10 @@
/* Implementation *************************************************************/ /* Implementation *************************************************************/
CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent ) CLlconServerDlg::CLlconServerDlg ( CServer* pNServP,
: QDialog ( parent ), pServer ( pNServP ) QWidget* parent,
Qt::WindowFlags f )
: QDialog ( parent, f ), pServer ( pNServP )
{ {
setupUi ( this ); setupUi ( this );

View file

@ -55,7 +55,9 @@ class CLlconServerDlg : public QDialog, private Ui_CLlconServerDlgBase
Q_OBJECT Q_OBJECT
public: public:
CLlconServerDlg ( CServer* pNServP, QWidget* parent = 0 ); CLlconServerDlg ( CServer* pNServP,
QWidget* parent = 0,
Qt::WindowFlags f = 0 );
protected: protected:
QTimer Timer; QTimer Timer;

View file

@ -363,7 +363,14 @@ int main ( int argc, char** argv )
Server.UpdateServerList(); Server.UpdateServerList();
// GUI object for the server // GUI object for the server
CLlconServerDlg ServerDlg ( &Server, 0 ); CLlconServerDlg ServerDlg (
&Server,
0
#ifdef _WIN32
// this somehow only works reliable on Windows
, Qt::WindowMinMaxButtonsHint
#endif
);
// set main window // set main window
pMainWindow = &ServerDlg; pMainWindow = &ServerDlg;