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

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>495</width> <width>594</width>
<height>203</height> <height>271</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -108,37 +108,10 @@
</property> </property>
</widget> </widget>
</item> </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"> <item row="2" column="0" colspan="3">
<widget class="QStackedWidget" name="stackedWidget"> <widget class="QStackedWidget" name="stackedWidget">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -162,6 +135,9 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -208,6 +184,33 @@
</widget> </widget>
</widget> </widget>
</item> </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> </layout>
</widget> </widget>
<resources/> <resources/>