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. 366
      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();
} }

366
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,190 +169,198 @@
</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="leftMargin"> <property name="geometry">
<number>0</number> <rect>
<x>9</x>
<y>65</y>
<width>143</width>
<height>22</height>
</rect>
</property> </property>
<property name="topMargin"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<number>0</number> <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>
<widget class="QLabel" name="startTorrentLabel">
<property name="text">
<string>Start torrent:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="startTorrentComboBox">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="skipCheckingWidget" native="true">
<property name="geometry">
<rect>
<x>9</x>
<y>37</y>
<width>164</width>
<height>22</height>
</rect>
</property> </property>
<property name="rightMargin"> <layout class="QHBoxLayout" name="skipCheckingLayout">
<number>0</number> <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>
<widget class="QLabel" name="skipCheckingLabel">
<property name="text">
<string>Skip hash check:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="skipCheckingComboBox">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="contentLayoutWidget" native="true">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>159</width>
<height>22</height>
</rect>
</property> </property>
<property name="bottomMargin"> <layout class="QHBoxLayout" name="contentLayoutLayout">
<number>0</number> <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>
<widget class="QLabel" name="contentLayoutLabel">
<property name="text">
<string>Content layout:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="contentLayoutComboBox">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="stopConditionWidget" native="true">
<property name="geometry">
<rect>
<x>9</x>
<y>93</y>
<width>158</width>
<height>22</height>
</rect>
</property> </property>
<item> <layout class="QHBoxLayout" name="stopConditionLayout">
<layout class="QHBoxLayout" name="horizontalLayout"> <property name="leftMargin">
<item> <number>0</number>
<widget class="QLabel" name="contentLayoutLabel"> </property>
<property name="text"> <property name="topMargin">
<string>Content layout:</string> <number>0</number>
</property> </property>
</widget> <property name="rightMargin">
</item> <number>2</number>
<item> </property>
<widget class="QComboBox" name="contentLayoutComboBox"> <property name="bottomMargin">
<property name="currentIndex"> <number>0</number>
<number>-1</number> </property>
</property> <item>
</widget> <widget class="QLabel" name="stopConditionLabel">
</item> <property name="text">
<item> <string>Stop condition:</string>
<spacer name="contentLayoutSpacer"> </property>
<property name="orientation"> </widget>
<enum>Qt::Horizontal</enum> </item>
</property> <item>
<property name="sizeHint" stdset="0"> <widget class="QComboBox" name="stopConditionComboBox">
<size> <property name="currentIndex">
<width>40</width> <number>-1</number>
<height>20</height> </property>
</size> </widget>
</property> </item>
</spacer> </layout>
</item> </widget>
</layout> <widget class="QWidget" name="addToQueueTopWidget" native="true">
</item> <property name="geometry">
<item> <rect>
<layout class="QHBoxLayout" name="startTorrentLayout"> <x>9</x>
<item> <y>121</y>
<widget class="QLabel" name="startTorrentLabel"> <width>187</width>
<property name="text"> <height>22</height>
<string>Start torrent:</string> </rect>
</property> </property>
</widget> <layout class="QHBoxLayout" name="addToQueueTopLayout">
</item> <property name="leftMargin">
<item> <number>0</number>
<widget class="QComboBox" name="startTorrentComboBox"> </property>
<property name="currentIndex"> <property name="topMargin">
<number>-1</number> <number>0</number>
</property> </property>
</widget> <property name="rightMargin">
</item> <number>2</number>
<item> </property>
<spacer name="startTorrentSpacer"> <property name="bottomMargin">
<property name="orientation"> <number>0</number>
<enum>Qt::Horizontal</enum> </property>
</property> <item>
<property name="sizeHint" stdset="0"> <widget class="QLabel" name="addToQueueTopLabel">
<size> <property name="text">
<width>40</width> <string>Add to top of queue:</string>
<height>20</height> </property>
</size> </widget>
</property> </item>
</spacer> <item>
</item> <widget class="QComboBox" name="addToQueueTopComboBox">
</layout> <property name="currentIndex">
</item> <number>-1</number>
<item> </property>
<layout class="QHBoxLayout" name="stopConditionLayout"> </widget>
<item> </item>
<widget class="QLabel" name="stopConditionLabel"> </layout>
<property name="text"> </widget>
<string>Stop condition:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="stopConditionComboBox">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item>
<spacer name="stopConditionSpacer">
<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>
<item>
<layout class="QHBoxLayout" name="skipCheckingLayout">
<item>
<widget class="QLabel" name="skipCheckingLabel">
<property name="text">
<string>Skip hash check:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="skipCheckingComboBox">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</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>
</item>
<item>
<layout class="QHBoxLayout" name="addToQueueTopLayout">
<item>
<widget class="QLabel" name="addToQueueTopLabel">
<property name="text">
<string>Add to top of queue:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="addToQueueTopComboBox">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</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>
</widget> </widget>
</item> </item>
<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>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>

Loading…
Cancel
Save