fix for server GUI, connect dlg fix
This commit is contained in:
parent
29a185da97
commit
50cf3e54dc
6 changed files with 97 additions and 71 deletions
|
@ -65,6 +65,10 @@ CConnectDlg::CConnectDlg ( QWidget* parent, Qt::WindowFlags f )
|
|||
|
||||
// Connections -------------------------------------------------------------
|
||||
// list view
|
||||
QObject::connect ( ListViewServers,
|
||||
SIGNAL ( itemClicked ( QTreeWidgetItem*, int ) ),
|
||||
this, SLOT ( OnServerListItemClicked ( QTreeWidgetItem*, int ) ) );
|
||||
|
||||
QObject::connect ( ListViewServers,
|
||||
SIGNAL ( itemDoubleClicked ( 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 );
|
||||
}
|
||||
|
||||
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,
|
||||
int )
|
||||
{
|
||||
|
|
|
@ -84,6 +84,7 @@ protected:
|
|||
bool bServerListItemWasChosen;
|
||||
|
||||
public slots:
|
||||
void OnServerListItemClicked ( QTreeWidgetItem* Item, int );
|
||||
void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int );
|
||||
void OnConnectButtonClicked();
|
||||
void OnTimerPing();
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<item>
|
||||
<widget class="QLabel" name="TextLabelServerAddr" >
|
||||
<property name="text" >
|
||||
<string>Server Address</string>
|
||||
<string>Server Name/Address</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
|
|
|
@ -26,8 +26,10 @@
|
|||
|
||||
|
||||
/* Implementation *************************************************************/
|
||||
CLlconServerDlg::CLlconServerDlg ( CServer* pNServP, QWidget* parent )
|
||||
: QDialog ( parent ), pServer ( pNServP )
|
||||
CLlconServerDlg::CLlconServerDlg ( CServer* pNServP,
|
||||
QWidget* parent,
|
||||
Qt::WindowFlags f )
|
||||
: QDialog ( parent, f ), pServer ( pNServP )
|
||||
{
|
||||
setupUi ( this );
|
||||
|
||||
|
|
|
@ -55,7 +55,9 @@ class CLlconServerDlg : public QDialog, private Ui_CLlconServerDlgBase
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CLlconServerDlg ( CServer* pNServP, QWidget* parent = 0 );
|
||||
CLlconServerDlg ( CServer* pNServP,
|
||||
QWidget* parent = 0,
|
||||
Qt::WindowFlags f = 0 );
|
||||
|
||||
protected:
|
||||
QTimer Timer;
|
||||
|
|
|
@ -363,7 +363,14 @@ int main ( int argc, char** argv )
|
|||
Server.UpdateServerList();
|
||||
|
||||
// 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
|
||||
pMainWindow = &ServerDlg;
|
||||
|
|
Loading…
Reference in a new issue