forked from milohr/babe-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetadataForm.cpp
76 lines (63 loc) · 2.29 KB
/
metadataForm.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
Babe - tiny music player
Copyright (C) 2017 Camilo Higuita
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "metadataForm.h"
#include "ui_metadataForm.h"
metadataForm::metadataForm(QMap<int,QString> info, QWidget *parent) :
QWidget(parent),
ui(new Ui::metadataForm)
{
ui->setupUi(this);
Qt::WindowFlags flags = Qt::Dialog;
setWindowFlags(flags);
//mapFromParent(QPoint(100, 100));
track=info[BabeTable::TRACK];
title=info[BabeTable::TITLE];
artist=info[BabeTable::ARTIST];
album=info[BabeTable::ALBUM];
genre=info[BabeTable::GENRE];
ui->trackLine->setText(track);
ui->titleLine->setText(title);
ui->genreLine->setText(genre);
ui->artistLine->setText(artist);
ui->albumLine->setText(album);
}
metadataForm::~metadataForm()
{
delete ui;
}
void metadataForm::on_pushButton_2_clicked()
{
this->close();
this->destroy();
}
void metadataForm::on_changebtn_clicked()
{
QString _track = ui->trackLine->text();
QString _title = ui->titleLine->text();
QString _artist = ui->artistLine->text();
QString _album = ui->albumLine->text();
QString _genre = ui->genreLine->text();
if(_track!=this->track || _title!=this->title || _artist!=this->artist || _album!=this->album || _genre!=this->genre)
{
qDebug()<< "the info did changed";
const QMap<int, QString> map{{BabeTable::TRACK, _track}, {BabeTable::TITLE, _title}, {BabeTable::ARTIST, _artist},{BabeTable::ALBUM,_album},{BabeTable::GENRE,_genre}};
emit infoModified(map);
}else
{
qDebug()<< "the info didn't changed";
}
this->close();
}