Skip to content

Commit dd0fda5

Browse files
author
Tomáš Silber
committed
Renamed tab macros
1 parent 76b58b7 commit dd0fda5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

config.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
#define LINUX //WIN | LINUX
55
#define MAX_ROW_SIZE 40
66
#define MAX_LIST_SIZE 10000
7+
#define LIST_TAB_ID 0
8+
#define NEW_TAB_ID 1
79

810
#endif // CONFIG_HPP

diarywindow.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void DiaryWindow::setDefault()
3939
{
4040
isEdited = false;
4141
clearInput();
42-
ui->tabBar->setCurrentIndex(LIST_TAB);
42+
ui->tabBar->setCurrentIndex(LIST_TAB_ID);
4343
}
4444

4545
void DiaryWindow::on_RemoveButton_clicked()
@@ -59,7 +59,7 @@ void DiaryWindow::on_EditButton_clicked()
5959
try
6060
{
6161
UserData eData = database->getData(selectedItem);
62-
ui->tabBar->setCurrentIndex(NEW_TAB);
62+
ui->tabBar->setCurrentIndex(NEW_TAB_ID);
6363
ui->text_field->setPlainText(eData.getText());
6464
ui->text_label->setText(QString(eData.getDate().c_str()));
6565
isEdited = true;
@@ -98,7 +98,7 @@ void DiaryWindow::on_save_button_clicked()
9898
}
9999
isEdited = false;
100100
clearInput();
101-
ui->tabBar->setCurrentIndex(LIST_TAB);
101+
ui->tabBar->setCurrentIndex(LIST_TAB_ID);
102102
}
103103
else
104104
{
@@ -109,7 +109,7 @@ void DiaryWindow::on_save_button_clicked()
109109
database->addData(usd);
110110
}
111111
clearInput();
112-
ui->tabBar->setCurrentIndex(LIST_TAB);
112+
ui->tabBar->setCurrentIndex(LIST_TAB_ID);
113113
}
114114
}
115115

diarywindow.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#ifndef DIARYWINDOW_HPP
22
#define DIARYWINDOW_HPP
33

4-
#define LIST_TAB 0
5-
#define NEW_TAB 1
6-
74
#include <iostream>
85
#include <QMainWindow>
96

107
#include "database.hpp"
8+
#include "config.hpp"
119

1210
using namespace std;
1311

0 commit comments

Comments
 (0)