Skip to content

Commit

Permalink
Fixed Bug
Browse files Browse the repository at this point in the history
 - Solve the problem of showing buttons
- Solve the problem of tasks
  • Loading branch information
mohsenahmadi2003 committed Jun 30, 2022
1 parent 20b47af commit c6cb5a9
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 13 deletions.
6 changes: 3 additions & 3 deletions ProjectManagement.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.0, 2022-06-28T23:36:05. -->
<!-- Written by QtCreator 4.10.0, 2022-06-30T20:20:14. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down Expand Up @@ -67,7 +67,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.13.1 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.13.1 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5131.win32_mingw73_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
Expand Down Expand Up @@ -317,7 +317,7 @@
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/Mohsen/Documents/build-untitled3-Desktop_Qt_5_13_1_MinGW_32_bit-Debug</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/Mohsen/Documents/build-untitled3-Desktop_Qt_5_13_1_MinGW_32_bit-Release</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
Expand Down
6 changes: 6 additions & 0 deletions addtaskwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ AddTaskWindow::AddTaskWindow(QWidget *parent, Task *task) :
} else {
ui->finished_button->setChecked(true);
}
if(ui->assigned->text() == "No One" && database.find_position(MainWindow::getUser().get_id(), MainWindow::get_id_porject()) == "member" ){
ui->save_button->setDisabled(true);
ui->finished_button->setEnabled(false);
ui->doing_button->setEnabled(false);
}


QString position = database.find_position(MainWindow::getUser().get_id(), MainWindow::get_id_porject());
Expand All @@ -52,6 +57,7 @@ AddTaskWindow::AddTaskWindow(QWidget *parent, Task *task) :
ui->task_name->setEnabled(false);
ui->task_description->setEnabled(false);
ui->my_team_list->setEnabled(false);

}

}
Expand Down
4 changes: 2 additions & 2 deletions addtaskwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 170, 0);</string>
<string notr="true">color: rgb(255, 85, 0);</string>
</property>
<property name="text">
<string>Doing</string>
Expand All @@ -244,7 +244,7 @@
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(74, 223, 0);</string>
<string notr="true">color: rgb(0, 191, 44);</string>
</property>
<property name="text">
<string>Finished</string>
Expand Down
3 changes: 1 addition & 2 deletions data/database/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ QString Database::find_position(int user_id, int id_project) {
value, project.getMembers()) {
if (value["user_id"].toInt() == user_id) {
position = value["position"].toString();
return position;

break;
}
}
return position;
Expand Down Expand Up @@ -539,7 +539,6 @@ bool Database::exsit_group(int project_id)
}

return exist;

}


Expand Down
1 change: 1 addition & 0 deletions data/model/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ QJsonObject Task::toJsonObject() {
QJsonObject result;

result["name"] = get_task_name();
result["task_id"] = get_task_id();
result["description"] = get_task_description();
result["assignment"] = get_assignment();
result["status"] = get_task_status();
Expand Down
1 change: 0 additions & 1 deletion loginwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "forgetpasswordwindow.h"
#include "mainwindow.h"
#include <QString>
#include <QDebug>
#include <QMessageBox>

using namespace std;
Expand Down
8 changes: 6 additions & 2 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "QJsonArray"
#include "QJsonValue"
#include "chatwindow.h"

#include <iostream>

using namespace std;
Expand Down Expand Up @@ -92,14 +91,15 @@ void MainWindow::on_my_account_button_clicked() {
}

void MainWindow::on_my_project_button_clicked() {
ProjectsWindow *projectsWindow = new ProjectsWindow();
ProjectsWindow *projectsWindow = new ProjectsWindow(this);
projectsWindow->show();

connect(projectsWindow, SIGNAL(send_project_id(int)), this, SLOT(catch_id(int)));

}

void MainWindow::catch_id(int id) {

id_project = id;
Database database;
Project project = database.get_project_by_id(id);
Expand All @@ -119,8 +119,12 @@ void MainWindow::on_add_member_button_clicked() {
}

void MainWindow::show_button() {
ui->add_task_button->setDisabled(true);
ui->add_member_button->setDisabled(true);
ui->chat_button->setDisabled(true);
Database database;


if (database.find_position(user.get_id(), get_id_porject()) == "leader") {
ui->add_task_button->setEnabled(true);
ui->add_member_button->setEnabled(true);
Expand Down
2 changes: 1 addition & 1 deletion projectswindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ProjectsWindow::~ProjectsWindow() {
}

void ProjectsWindow::on_create_project_button_clicked() {
CreateProjectWindow *createProjectWindow = new CreateProjectWindow();
CreateProjectWindow *createProjectWindow = new CreateProjectWindow(this);
createProjectWindow->show();

connect(createProjectWindow, SIGNAL(changedEvent()), this, SLOT(changedEvent()));
Expand Down
8 changes: 7 additions & 1 deletion projectswindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
<bold>true</bold>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="text">
<string>Add Project</string>
</property>
Expand All @@ -64,6 +67,9 @@
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="text">
<string>Cancel</string>
</property>
Expand All @@ -88,7 +94,7 @@
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
<enum>Qt::TabFocus</enum>
</property>
<property name="text">
<string>OK</string>
Expand Down
1 change: 0 additions & 1 deletion settingwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "mainwindow.h"
#include "utils/exception.h"
#include <QMessageBox>
#include <QDebug>


SettingWindow::SettingWindow(QWidget *parent) :
Expand Down

0 comments on commit c6cb5a9

Please sign in to comment.