m_catalogsModel = new CatalogListModel(this, m_packageRoot);
m_ui->catalogsList->setModel(m_catalogsModel);
+ // enable drag-drop to re-order the paths
+ m_ui->sceneryPathsList->setDragEnabled(true);
+ m_ui->sceneryPathsList->setDragDropMode(QAbstractItemView::InternalMove);
+ m_ui->sceneryPathsList->setDropIndicatorShown(true);
+
+ m_ui->aircraftPathsList->setDragEnabled(true);
+ m_ui->aircraftPathsList->setDragDropMode(QAbstractItemView::InternalMove);
+ m_ui->aircraftPathsList->setDropIndicatorShown(true);
+
connect(m_ui->addCatalog, &QToolButton::clicked,
this, &PathsDialog::onAddCatalog);
connect(m_ui->addDefaultCatalogButton, &QPushButton::clicked,
if (!path.isEmpty()) {
m_ui->sceneryPathsList->addItem(path);
}
+
+ // work around a Qt OS-X bug - this dialog is ending ordered
+ // behind the main settings dialog (consequence of modal-dialog
+ // showing a modla dialog showing a modial dialog)
+ window()->raise();
}
void PathsDialog::onRemoveSceneryPath()
if (!path.isEmpty()) {
m_ui->aircraftPathsList->addItem(path);
}
+ // work around a Qt OS-X bug - this dialog is ending ordered
+ // behind the main settings dialog (consequence of modal-dialog
+ // showing a modla dialog showing a modial dialog)
+ window()->raise();
}
void PathsDialog::onRemoveAircraftPath()
<property name="spacing">
<number>0</number>
</property>
- <item row="1" column="0">
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>567</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="1">
+ <item row="1" column="2">
<widget class="QToolButton" name="addSceneryPath">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
</property>
</widget>
</item>
- <item row="0" column="0" colspan="3">
- <widget class="QListWidget" name="sceneryPathsList"/>
- </item>
- <item row="1" column="2">
+ <item row="1" column="3">
<widget class="QToolButton" name="removeSceneryPath">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
</property>
</widget>
</item>
+ <item row="1" column="1">
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>567</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Drag to re-order</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" colspan="4">
+ <widget class="QListWidget" name="sceneryPathsList"/>
+ </item>
</layout>
</widget>
</item>
<property name="spacing">
<number>0</number>
</property>
- <item row="0" column="0" colspan="3">
- <widget class="QListWidget" name="aircraftPathsList"/>
- </item>
- <item row="1" column="0">
+ <item row="1" column="1">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</spacer>
</item>
<item row="1" column="2">
- <widget class="QToolButton" name="removeAircraftPath">
+ <widget class="QToolButton" name="addAircraftPath">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
</size>
</property>
<property name="text">
- <string>-</string>
+ <string>+</string>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QToolButton" name="addAircraftPath">
+ <item row="1" column="3">
+ <widget class="QToolButton" name="removeAircraftPath">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
</size>
</property>
<property name="text">
- <string>+</string>
+ <string>-</string>
</property>
</widget>
</item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Drag to re-order</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" colspan="4">
+ <widget class="QListWidget" name="aircraftPathsList"/>
+ </item>
</layout>
</widget>
</item>