Better UI for local server and make http URL read-only

This commit is contained in:
Nikhil Tanwar 2021-12-04 19:07:44 +05:30
parent 1336aacc2e
commit 11d6641415
2 changed files with 34 additions and 30 deletions

View File

@ -72,6 +72,7 @@ void LocalKiwixServer::runOrStopServer()
KiwixApp::instance()->getSettingsManager()->setKiwixServerPort(m_port);
mp_server->setAddress(ui->IpChooser->currentText().toStdString());
ui->IpAddress->setText("http://" + m_ipAddress + ":" + QString::number(m_port));
ui->IpAddress->setReadOnly(true);
if (!mp_server->start()) {
QMessageBox messageBox;
messageBox.critical(0,gt("error-title"),gt("error-launch-server-message"));

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>495</width>
<height>203</height>
<width>594</width>
<height>271</height>
</rect>
</property>
<property name="sizePolicy">
@ -108,37 +108,10 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="KiwixServerText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>450</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QStackedWidget" name="stackedWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -162,6 +135,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget>
</item>
<item>
@ -208,6 +184,33 @@
</widget>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="KiwixServerText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>450</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>