Browse Source

Use FlowLayout in AddTorrentParamsWidget

adaptive-webui-19844
Vladimir Golovnev (Glassez) 2 years ago
parent
commit
341b2f345a
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7
  1. 9
      src/gui/addtorrentparamswidget.cpp
  2. 218
      src/gui/addtorrentparamswidget.ui

9
src/gui/addtorrentparamswidget.cpp

@ -33,6 +33,7 @@
#include "base/bittorrent/session.h" #include "base/bittorrent/session.h"
#include "base/bittorrent/torrent.h" #include "base/bittorrent/torrent.h"
#include "base/utils/compare.h" #include "base/utils/compare.h"
#include "flowlayout.h"
#include "fspathedit.h" #include "fspathedit.h"
#include "torrenttagsdialog.h" #include "torrenttagsdialog.h"
#include "ui_addtorrentparamswidget.h" #include "ui_addtorrentparamswidget.h"
@ -92,6 +93,14 @@ AddTorrentParamsWidget::AddTorrentParamsWidget(BitTorrent::AddTorrentParams addT
dlg->open(); dlg->open();
}); });
auto *miscParamsLayout = new FlowLayout(m_ui->miscParamsWidget);
miscParamsLayout->setContentsMargins(0, 0, 0, 0);
miscParamsLayout->addWidget(m_ui->contentLayoutWidget);
miscParamsLayout->addWidget(m_ui->skipCheckingWidget);
miscParamsLayout->addWidget(m_ui->startTorrentWidget);
miscParamsLayout->addWidget(m_ui->stopConditionWidget);
miscParamsLayout->addWidget(m_ui->addToQueueTopWidget);
populate(); populate();
} }

218
src/gui/addtorrentparamswidget.ui

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>503</width> <width>503</width>
<height>338</height> <height>366</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -169,7 +169,16 @@
</item> </item>
<item> <item>
<widget class="QWidget" name="miscParamsWidget" native="true"> <widget class="QWidget" name="miscParamsWidget" native="true">
<layout class="QVBoxLayout" name="miscParamsLayout"> <widget class="QWidget" name="startTorrentWidget" native="true">
<property name="geometry">
<rect>
<x>9</x>
<y>65</y>
<width>143</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -177,137 +186,163 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>2</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="QLabel" name="startTorrentLabel">
<item>
<widget class="QLabel" name="contentLayoutLabel">
<property name="text"> <property name="text">
<string>Content layout:</string> <string>Start torrent:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="contentLayoutComboBox"> <widget class="QComboBox" name="startTorrentComboBox">
<property name="currentIndex"> <property name="currentIndex">
<number>-1</number> <number>-1</number>
</property> </property>
</widget> </widget>
</item> </item>
<item> </layout>
<spacer name="contentLayoutSpacer"> </widget>
<property name="orientation"> <widget class="QWidget" name="skipCheckingWidget" native="true">
<enum>Qt::Horizontal</enum> <property name="geometry">
<rect>
<x>9</x>
<y>37</y>
<width>164</width>
<height>22</height>
</rect>
</property> </property>
<property name="sizeHint" stdset="0"> <layout class="QHBoxLayout" name="skipCheckingLayout">
<size> <property name="leftMargin">
<width>40</width> <number>0</number>
<height>20</height> </property>
</size> <property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property> </property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="startTorrentLayout">
<item> <item>
<widget class="QLabel" name="startTorrentLabel"> <widget class="QLabel" name="skipCheckingLabel">
<property name="text"> <property name="text">
<string>Start torrent:</string> <string>Skip hash check:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="startTorrentComboBox"> <widget class="QComboBox" name="skipCheckingComboBox">
<property name="currentIndex"> <property name="currentIndex">
<number>-1</number> <number>-1</number>
</property> </property>
</widget> </widget>
</item> </item>
<item> </layout>
<spacer name="startTorrentSpacer"> </widget>
<property name="orientation"> <widget class="QWidget" name="contentLayoutWidget" native="true">
<enum>Qt::Horizontal</enum> <property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>159</width>
<height>22</height>
</rect>
</property> </property>
<property name="sizeHint" stdset="0"> <layout class="QHBoxLayout" name="contentLayoutLayout">
<size> <property name="leftMargin">
<width>40</width> <number>0</number>
<height>20</height> </property>
</size> <property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property> </property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="stopConditionLayout">
<item> <item>
<widget class="QLabel" name="stopConditionLabel"> <widget class="QLabel" name="contentLayoutLabel">
<property name="text"> <property name="text">
<string>Stop condition:</string> <string>Content layout:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="stopConditionComboBox"> <widget class="QComboBox" name="contentLayoutComboBox">
<property name="currentIndex"> <property name="currentIndex">
<number>-1</number> <number>-1</number>
</property> </property>
</widget> </widget>
</item> </item>
<item> </layout>
<spacer name="stopConditionSpacer"> </widget>
<property name="orientation"> <widget class="QWidget" name="stopConditionWidget" native="true">
<enum>Qt::Horizontal</enum> <property name="geometry">
<rect>
<x>9</x>
<y>93</y>
<width>158</width>
<height>22</height>
</rect>
</property> </property>
<property name="sizeHint" stdset="0"> <layout class="QHBoxLayout" name="stopConditionLayout">
<size> <property name="leftMargin">
<width>40</width> <number>0</number>
<height>20</height> </property>
</size> <property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property> </property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="skipCheckingLayout">
<item> <item>
<widget class="QLabel" name="skipCheckingLabel"> <widget class="QLabel" name="stopConditionLabel">
<property name="text"> <property name="text">
<string>Skip hash check:</string> <string>Stop condition:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="skipCheckingComboBox"> <widget class="QComboBox" name="stopConditionComboBox">
<property name="currentIndex"> <property name="currentIndex">
<number>-1</number> <number>-1</number>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="skipCheckingSpacer">
<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> </layout>
</item> </widget>
<item> <widget class="QWidget" name="addToQueueTopWidget" native="true">
<property name="geometry">
<rect>
<x>9</x>
<y>121</y>
<width>187</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="addToQueueTopLayout"> <layout class="QHBoxLayout" name="addToQueueTopLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QLabel" name="addToQueueTopLabel"> <widget class="QLabel" name="addToQueueTopLabel">
<property name="text"> <property name="text">
@ -322,36 +357,9 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="addToQueueTopSpacer">
<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>
</item>
</layout> </layout>
</widget> </widget>
</item> </widget>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>

Loading…
Cancel
Save