Added ignore auto connect clients check box in dialog
This commit is contained in:
parent
471e198efc
commit
ec4ef549bb
|
@ -19,15 +19,73 @@
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Dialog</string>
|
<string>Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QDialogButtonBox" name="m_pDialogButtonBox">
|
<widget class="QWidget" name="gridLayoutWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>50</x>
|
<x>10</x>
|
||||||
<y>320</y>
|
<y>10</y>
|
||||||
<width>341</width>
|
<width>381</width>
|
||||||
<height>20</height>
|
<height>301</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="m_pLabelHead">
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>320</y>
|
||||||
|
<width>381</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="m_pCheckBoxIgnoreClient">
|
||||||
|
<property name="text">
|
||||||
|
<string>Ignore auto connect clients</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="m_pDialogButtonBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -44,16 +102,8 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="gridLayoutWidget">
|
</item>
|
||||||
<property name="geometry">
|
</layout>
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>381</width>
|
|
||||||
<height>301</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|
|
@ -24,13 +24,13 @@
|
||||||
AddClientDialog::AddClientDialog(const QString& clientName, QWidget* parent) :
|
AddClientDialog::AddClientDialog(const QString& clientName, QWidget* parent) :
|
||||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||||
Ui::AddClientDialog(),
|
Ui::AddClientDialog(),
|
||||||
m_AddResult(kAddClientIgnore)
|
m_AddResult(kAddClientIgnore),
|
||||||
|
m_IgnoreAutoConnectClient(false)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
m_pLabelHead = new QLabel(this);
|
m_pLabelHead->setText("A client wants to connect. "
|
||||||
m_pLabelHead->setText("Client " + clientName + " wants to connect...");
|
"Please choose a location for " + clientName + ".");
|
||||||
gridLayout->addWidget(m_pLabelHead, 0, 1, 1, 1, Qt::AlignCenter);
|
|
||||||
|
|
||||||
QIcon icon(":res/icons/64x64/video-display.png");
|
QIcon icon(":res/icons/64x64/video-display.png");
|
||||||
QSize IconSize(32,32);
|
QSize IconSize(32,32);
|
||||||
|
@ -74,7 +74,6 @@ AddClientDialog::~AddClientDialog()
|
||||||
delete m_pButtonDown;
|
delete m_pButtonDown;
|
||||||
delete m_pButtonLeft;
|
delete m_pButtonLeft;
|
||||||
delete m_pButtonRight;
|
delete m_pButtonRight;
|
||||||
delete m_pLabelHead;
|
|
||||||
delete m_pLabelCenter;
|
delete m_pLabelCenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,3 +118,8 @@ void AddClientDialog::handleButtonAdvanced()
|
||||||
m_AddResult = kAddClientOther;
|
m_AddResult = kAddClientOther;
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AddClientDialog::on_m_pCheckBoxIgnoreClient_toggled(bool checked)
|
||||||
|
{
|
||||||
|
m_IgnoreAutoConnectClient = checked;
|
||||||
|
}
|
||||||
|
|
|
@ -41,12 +41,14 @@ public:
|
||||||
AddClientDialog(const QString& clientName, QWidget* parent = 0);
|
AddClientDialog(const QString& clientName, QWidget* parent = 0);
|
||||||
~AddClientDialog();
|
~AddClientDialog();
|
||||||
|
|
||||||
int getAddResult() { return m_AddResult; }
|
int addResult() { return m_AddResult; }
|
||||||
|
bool ignoreAutoConnectClient() { return m_IgnoreAutoConnectClient; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent *e);
|
void changeEvent(QEvent *e);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void on_m_pCheckBoxIgnoreClient_toggled(bool checked);
|
||||||
void handleButtonLeft();
|
void handleButtonLeft();
|
||||||
void handleButtonUp();
|
void handleButtonUp();
|
||||||
void handleButtonRight();
|
void handleButtonRight();
|
||||||
|
@ -59,8 +61,8 @@ private:
|
||||||
QPushButton* m_pButtonRight;
|
QPushButton* m_pButtonRight;
|
||||||
QPushButton* m_pButtonDown;
|
QPushButton* m_pButtonDown;
|
||||||
QLabel* m_pLabelCenter;
|
QLabel* m_pLabelCenter;
|
||||||
QLabel* m_pLabelHead;
|
|
||||||
int m_AddResult;
|
int m_AddResult;
|
||||||
|
bool m_IgnoreAutoConnectClient;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ADDCLIENTDIALOG_H
|
#endif // ADDCLIENTDIALOG_H
|
||||||
|
|
|
@ -374,7 +374,8 @@ int ServerConfig::showAddClientDialog(const QString& clientName)
|
||||||
{
|
{
|
||||||
AddClientDialog addClientDialog(clientName, m_pMainWindow);
|
AddClientDialog addClientDialog(clientName, m_pMainWindow);
|
||||||
addClientDialog.exec();
|
addClientDialog.exec();
|
||||||
int result = addClientDialog.getAddResult();
|
int result = addClientDialog.addResult();
|
||||||
|
m_IgnoreAutoConnectClient = addClientDialog.ignoreAutoConnectClient();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue