Skip to content

Commit

Permalink
Merge pull request #183 from code-mancers/update-askhost-ui
Browse files Browse the repository at this point in the history
Cleanup askhost UI and add "Reset defaults" button
  • Loading branch information
iffyuva committed Aug 6, 2015
2 parents c623fae + 696bfc8 commit 5f26757
Show file tree
Hide file tree
Showing 6 changed files with 317 additions and 79 deletions.
13 changes: 11 additions & 2 deletions rbkit-lib/ui/askhost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ AskHost::AskHost(QWidget *parent) :
{
ui->setupUi(this);
connect(ui->hostSelectedButton, SIGNAL(clicked()), this, SLOT(userSelectedHost()));
connect(ui->hostResetButton, SIGNAL(clicked()), this, SLOT(userResetHost()));
}

AskHost::~AskHost()
Expand All @@ -17,9 +18,17 @@ AskHost::~AskHost()

void AskHost::userSelectedHost()
{
QString commandsSocket = ui->commandsSocket->text();
QString eventsSocket = ui->eventsSocket->text();
QString serverHost = ui->serverHost->text();
QString commandsSocket = serverHost + ":" + ui->commandsPort->text();
QString eventsSocket = serverHost + ":" + ui->eventsPort->text();

qDebug() << commandsSocket << eventsSocket;
emit userHasSelectedHost(commandsSocket, eventsSocket);
}

void AskHost::userResetHost()
{
ui->commandsPort->setText("5556");
ui->eventsPort->setText("5555");
ui->serverHost->setText("tcp://127.0.0.1");
}
1 change: 1 addition & 0 deletions rbkit-lib/ui/askhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class AskHost : public QDialog

private slots:
void userSelectedHost();
void userResetHost();

signals:
void userHasSelectedHost(QString, QString);
Expand Down
281 changes: 206 additions & 75 deletions rbkit-lib/ui/askhost.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,93 +9,224 @@
<rect>
<x>0</x>
<y>0</y>
<width>395</width>
<height>194</height>
<width>321</width>
<height>195</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>100</height>
<width>321</width>
<height>195</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>321</width>
<height>195</height>
</size>
</property>
<property name="windowTitle">
<string>Enter address of your Ruby app</string>
<string>Enter Ruby app's address</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="hostInfo">
<property name="text">
<string>Enter connection information for events</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="eventsSocket">
<property name="text">
<string>tcp://127.0.0.1:5555</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Enter connection information for commands</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLineEdit" name="commandsSocket">
<property name="text">
<string>tcp://127.0.0.1:5556</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>178</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="hostSelectedButton">
<property name="text">
<string>&amp;Ok</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
<widget class="QLineEdit" name="commandsPort">
<property name="geometry">
<rect>
<x>165</x>
<y>111</y>
<width>125</width>
<height>25</height>
</rect>
</property>
<property name="font">
<font>
<family>Lucida Grande</family>
<pointsize>18</pointsize>
</font>
</property>
<property name="text">
<string>5556</string>
</property>
</widget>
<widget class="QLineEdit" name="eventsPort">
<property name="geometry">
<rect>
<x>29</x>
<y>111</y>
<width>125</width>
<height>25</height>
</rect>
</property>
<property name="font">
<font>
<family>Lucida Grande</family>
<pointsize>18</pointsize>
</font>
</property>
<property name="text">
<string>5555</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>164</x>
<y>90</y>
<width>121</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Lucida Grande</family>
</font>
</property>
<property name="text">
<string>Command Port</string>
</property>
</widget>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>30</x>
<y>38</y>
<width>261</width>
<height>27</height>
</rect>
</property>
<property name="font">
<font>
<family>Lucida Grande</family>
</font>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="serverHost">
<property name="font">
<font>
<family>Lucida Grande</family>
<pointsize>18</pointsize>
</font>
</property>
<property name="text">
<string>tcp://127.0.0.1</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="serverIpAddressLabel">
<property name="geometry">
<rect>
<x>30</x>
<y>14</y>
<width>221</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Lucida Grande</family>
</font>
</property>
<property name="text">
<string>Enter the IP address of the server</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>30</x>
<y>90</y>
<width>59</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Lucida Grande</family>
</font>
</property>
<property name="text">
<string>Data Port</string>
</property>
</widget>
<widget class="QPushButton" name="hostResetButton">
<property name="geometry">
<rect>
<x>20</x>
<y>150</y>
<width>150</width>
<height>32</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Lucida Grande</family>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="text">
<string>&amp;Reset to Defaults</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
<widget class="QPushButton" name="hostSelectedButton">
<property name="geometry">
<rect>
<x>200</x>
<y>150</y>
<width>94</width>
<height>32</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Lucida Grande</family>
</font>
</property>
<property name="text">
<string>&amp;Connect</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</widget>
<resources/>
<connections/>
<slots>
<slot>hostSelected()</slot>
<slot>hostReset()</slot>
</slots>
</ui>
Loading

0 comments on commit 5f26757

Please sign in to comment.