Skip to content

Commit

Permalink
Add the feature of displaying version information.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamscottxu committed Jul 11, 2021
1 parent 3c0f1d7 commit 461314f
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 66 deletions.
9 changes: 9 additions & 0 deletions rtsp_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ RtspProperties::RtspProperties(std::string rtspOutputName, QWidget *parent)
connect(this, &RtspProperties::setLabelMessageStatus, this,
&RtspProperties::onLabelMessageStatusChanging);

//ui->lineEditUrlSuffix->setValidator(new QRegExpValidator(QRegExp("^([-A-Za-z0-9+&@#%=~_|]+)(\\/[-A-Za-z0-9+&@#%=~_|]+)*$"), this));

#ifdef VERSION_STRING
ui->labelVersion->setText(VERSION_STRING);
#endif

settings = rtspOutputHelper->GetSettings();
onButtonStatusChanging(!rtspOutputHelper->IsActive(),
rtspOutputHelper->IsActive());
Expand Down Expand Up @@ -114,6 +120,9 @@ void RtspProperties::onSpinBoxPortValueChanged(int value)

void RtspProperties::onLineEditUrlSuffixValueChanged(const QString value)
{
//auto rx = QRegExp("^[-A-Za-z0-9+&@#%=~_|]+(/[-A-Za-z0-9+&@#%=~_|]+)*$");
//if (!rx.exactMatch(value))
//return;
obs_data_set_string(settings, "url_suffix",
value.toStdString().c_str());
}
Expand Down
173 changes: 107 additions & 66 deletions rtsp_properties.ui
Original file line number Diff line number Diff line change
Expand Up @@ -537,82 +537,123 @@
</property>
</spacer>
</item>
<item alignment="Qt::AlignRight">
<widget class="QWidget" name="widgetStartOrStop" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item>
<layout class="QHBoxLayout" name="horizontalLayoutBottom">
<property name="leftMargin">
<number>0</number>
</property>
<layout class="QHBoxLayout" name="widgetStartOrStop_layout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pushButtonStart">
<property name="minimumSize">
<size>
<width>75</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>RtspServer.Properties.StartOutput</string>
</property>
<property name="default">
<bool>true</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonStop">
<property name="minimumSize">
<size>
<width>75</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>RtspServer.Properties.StopOutput</string>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="labelVersionTitle">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>RtspServer.Properties.Version</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignRight|Qt::AlignTrailing</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelVersion">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widgetStartOrStop" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="widgetStartOrStop_layout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="autoDefault">
<bool>true</bool>
<property name="topMargin">
<number>0</number>
</property>
<property name="default">
<bool>true</bool>
<property name="rightMargin">
<number>0</number>
</property>
<property name="flat">
<bool>false</bool>
<property name="bottomMargin">
<number>0</number>
</property>
</widget>
</item>
</layout>
</widget>
<item>
<widget class="QPushButton" name="pushButtonStart">
<property name="minimumSize">
<size>
<width>75</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>RtspServer.Properties.StartOutput</string>
</property>
<property name="default">
<bool>true</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonStop">
<property name="minimumSize">
<size>
<width>75</width>
<height>23</height>
</size>
</property>
<property name="text">
<string>RtspServer.Properties.StopOutput</string>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
<zorder>groupBoxTarget</zorder>
<zorder>groupBoxOption</zorder>
<zorder>groupBoxAuthentication</zorder>
<zorder>widgetStartOrStop</zorder>
<zorder>groupBoxStatus</zorder>
<zorder>RtspPropertiesverSpacer</zorder>
</widget>
Expand Down

0 comments on commit 461314f

Please sign in to comment.