Merged in Rogier-5/minetestmappergui/misc-changes-2 (pull request #3)

Misc changes 2
master
adrido 2015-07-02 20:34:49 +02:00
commit 718c222590
6 changed files with 172 additions and 9 deletions

9
.gitignore vendored
View File

@ -17,3 +17,12 @@
#Qt Translator Files
*.qm
# Other
Makefile
MinetestMapperGui
*.o
moc_mainwindow.cpp
qrc_minetestmappergui.cpp
ui_mainwindow.h

2
AUTHORS Normal file
View File

@ -0,0 +1,2 @@
adrido <addi@king-arthur.eu>
rogier <rogier777@gmail.com>

4
LICENSE Normal file
View File

@ -0,0 +1,4 @@
Copyright: adrido <addi@king-arthur.eu> and other authors. See AUTHORS.
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
See: http://creativecommons.org/licenses/by/3.0/

View File

@ -42,6 +42,7 @@ InitStatics::InitStatics(void)
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
@ -926,3 +927,39 @@ void MainWindow::on_actionEdit_heightmap_colors_txt_triggered()
{
QDesktopServices::openUrl(QUrl::fromLocalFile(QFileInfo(ui->path_HeightmapColors->text()).absoluteFilePath()));
}
void MainWindow::on_drawScaleLeft_toggled(bool checked)
{
bool state = checked || ui->drawScaleTop->isChecked();
ui->sidescaleInterval->setEnabled(state);
state = state && ui->sidescaleInterval->isChecked();
ui->sidescaleIntervalMajor->setEnabled(state);
ui->sidescaleIntervalMinor->setEnabled(state);
}
void MainWindow::on_drawScaleTop_toggled(bool checked)
{
bool state = checked || ui->drawScaleLeft->isChecked();
ui->sidescaleInterval->setEnabled(state);
state = state && ui->sidescaleInterval->isChecked();
ui->sidescaleIntervalMajor->setEnabled(state);
ui->sidescaleIntervalMinor->setEnabled(state);
}
void MainWindow::on_drawHeightscale_toggled(bool checked)
{
ui->heightscaleInterval->setEnabled(checked);
bool state = checked && ui->heightscaleInterval->isChecked();
ui->heightscaleIntervalMajor->setEnabled(state);
ui->heightscaleIntervalMinor->setEnabled(state);
}
void MainWindow::on_tilecenter_clicked()
{
ui->tiles_map->setText(tr("map center"));
}
void MainWindow::on_tileorigin_clicked()
{
ui->tiles_map->setText(tr("map origin (top left)"));
}

View File

@ -83,6 +83,16 @@ private slots:
void on_actionEdit_heightmap_colors_txt_triggered();
void on_drawScaleLeft_toggled(bool checked);
void on_drawScaleTop_toggled(bool checked);
void on_drawHeightscale_toggled(bool checked);
void on_tilecenter_clicked();
void on_tileorigin_clicked();
private:
Ui::MainWindow *ui;
QProgressBar *progressBar;

View File

@ -1966,8 +1966,11 @@
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="tile_chunk">
<property name="toolTip">
<string>A chunk is the unit of map generation. Usually 5x5x5 blocks.</string>
</property>
<property name="text">
<string>chunk</string>
<string>chunk-aligned</string>
</property>
</widget>
</item>
@ -1980,8 +1983,11 @@
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="tile_block">
<property name="toolTip">
<string>A block is 16x16x16 nodes</string>
</property>
<property name="text">
<string>block</string>
<string>block-aligned</string>
</property>
<property name="checked">
<bool>true</bool>
@ -2012,16 +2018,28 @@
<property name="title">
<string>arrange</string>
</property>
<layout class="QGridLayout" name="gridLayout_12">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_12" columnstretch="1,2">
<item row="1" column="0">
<widget class="QRadioButton" name="tilecenter">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>tilecenter</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QRadioButton" name="tileorigin">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>tileorigin</string>
</property>
@ -2030,10 +2048,29 @@
</property>
</widget>
</item>
<item row="0" column="1" rowspan="2">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Arrange:</string>
</property>
</widget>
</item>
<item row="0" column="1" rowspan="3">
<widget class="QGroupBox" name="groupBox_13">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>arrange at</string>
<string>at:</string>
</property>
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="0">
@ -2046,7 +2083,7 @@
<item row="1" column="0">
<widget class="QRadioButton" name="tiles_world">
<property name="text">
<string>world</string>
<string>world center (0,0)</string>
</property>
<property name="checked">
<bool>true</bool>
@ -2056,7 +2093,7 @@
<item row="2" column="0">
<widget class="QRadioButton" name="tiles_map">
<property name="text">
<string>map</string>
<string>map origin (top-left)</string>
</property>
</widget>
</item>
@ -2947,6 +2984,70 @@ p, li { white-space: pre-wrap; }
</hint>
</hints>
</connection>
<connection>
<sender>heightscaleInterval</sender>
<signal>toggled(bool)</signal>
<receiver>heightscaleIntervalMajor</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>124</x>
<y>368</y>
</hint>
<hint type="destinationlabel">
<x>284</x>
<y>369</y>
</hint>
</hints>
</connection>
<connection>
<sender>heightscaleInterval</sender>
<signal>toggled(bool)</signal>
<receiver>heightscaleIntervalMinor</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>124</x>
<y>368</y>
</hint>
<hint type="destinationlabel">
<x>434</x>
<y>369</y>
</hint>
</hints>
</connection>
<connection>
<sender>sidescaleInterval</sender>
<signal>toggled(bool)</signal>
<receiver>sidescaleIntervalMajor</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>95</x>
<y>138</y>
</hint>
<hint type="destinationlabel">
<x>359</x>
<y>142</y>
</hint>
</hints>
</connection>
<connection>
<sender>sidescaleInterval</sender>
<signal>toggled(bool)</signal>
<receiver>sidescaleIntervalMinor</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>95</x>
<y>138</y>
</hint>
<hint type="destinationlabel">
<x>359</x>
<y>171</y>
</hint>
</hints>
</connection>
</connections>
<buttongroups>
<buttongroup name="geometrymode_size_group"/>