Improve folio list position (user don't know index is 0)

1 for first position
2 for second position
0 always in the end
This commit is contained in:
Laurent Trinques
2019-08-20 13:11:23 +02:00
parent 348a8d9975
commit 7ffa806b1b
3 changed files with 4 additions and 4 deletions

View File

@@ -363,7 +363,7 @@ void ProjectView::addNewDiagram() {
void ProjectView::addNewDiagramFolioList() { void ProjectView::addNewDiagramFolioList() {
if (m_project -> isReadOnly()) return; if (m_project -> isReadOnly()) return;
QSettings settings; QSettings settings;
int i = (settings.value("projectview/foliolist_position").toInt()); //< Each new diagram is added to the end of the project. int i = (settings.value("projectview/foliolist_position").toInt() -1); //< Each new diagram is added to the end of the project.
//< We use @i to move the folio list at second position in the project //< We use @i to move the folio list at second position in the project
foreach (Diagram *d, m_project -> addNewDiagramFolioList()) { foreach (Diagram *d, m_project -> addNewDiagramFolioList()) {
DiagramView *new_diagram_view = new DiagramView(d); DiagramView *new_diagram_view = new DiagramView(d);
@@ -885,7 +885,7 @@ void ProjectView::loadDiagrams()
// If project have the folios list, move it at the beginning of the project // If project have the folios list, move it at the beginning of the project
if (m_project -> getFolioSheetsQuantity()) { if (m_project -> getFolioSheetsQuantity()) {
for (int i = 0; i < m_project->getFolioSheetsQuantity(); i++) for (int i = 0; i < m_project->getFolioSheetsQuantity(); i++)
m_tab -> tabBar() -> moveTab(diagram_views().size()-1, + (settings.value("projectview/foliolist_position").toInt())); m_tab -> tabBar() -> moveTab(diagram_views().size()-1, + (settings.value("projectview/foliolist_position").toInt() -1));
m_project->setModified(false); m_project->setModified(false);
} }
} }

View File

@@ -55,7 +55,7 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
ui->m_export_terminal->setChecked(settings.value("nomenclature-exportlist", true).toBool()); ui->m_export_terminal->setChecked(settings.value("nomenclature-exportlist", true).toBool());
ui->m_border_0->setChecked(settings.value("border-columns_0", false).toBool()); ui->m_border_0->setChecked(settings.value("border-columns_0", false).toBool());
ui->m_autosave_sb->setValue(settings.value("diagrameditor/autosave-interval", 0).toInt()); ui->m_autosave_sb->setValue(settings.value("diagrameditor/autosave-interval", 0).toInt());
ui->m_foliolist_sb->setValue(settings.value("projectview/foliolist_position", 1).toInt()); ui->m_foliolist_sb->setValue(settings.value("projectview/foliolist_position", 2).toInt());
QString fontInfos = settings.value("diagramitemfont").toString() + " " + QString fontInfos = settings.value("diagramitemfont").toString() + " " +
settings.value("diagramitemsize").toString() + " (" + settings.value("diagramitemsize").toString() + " (" +

View File

@@ -176,7 +176,7 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>999999999</number> <number>999</number>
</property> </property>
<property name="value"> <property name="value">
<number>1</number> <number>1</number>