Huggle  build:^490^dce1e5c
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
userinfoform.cpp
1 //This program is free software: you can redistribute it and/or modify
2 //it under the terms of the GNU General Public License as published by
3 //the Free Software Foundation, either version 3 of the License, or
4 //(at your option) any later version.
5 
6 //This program is distributed in the hope that it will be useful,
7 //but WITHOUT ANY WARRANTY; without even the implied warranty of
8 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 //GNU General Public License for more details.
10 
11 #include "userinfoform.hpp"
12 #include "ui_userinfoform.h"
13 
14 using namespace Huggle;
15 
16 UserinfoForm::UserinfoForm(QWidget *parent) : QDockWidget(parent), ui(new Ui::UserinfoForm)
17 {
18  ui->setupUi(this);
19  ui->pushButton->setEnabled(false);
20 }
21 
22 UserinfoForm::~UserinfoForm()
23 {
24  delete ui;
25 }
26 
27 void UserinfoForm::ChangeUser(WikiUser *user)
28 {
29  if (user == NULL)
30  {
31  throw new Exception("WikiUser *user can't be NULL in this fc", "void UserinfoForm::ChangeUser(WikiUser *user)");
32  }
33  this->User = user;
34  ui->pushButton->setEnabled(true);
35  ui->pushButton->setText("Retrieve info");
36  ui->label->setText("Flags: " + user->Flags() + " Score: " + QString::number(user->getBadnessScore()) + " level: " + QString::number(user->WarningLevel));
37 }
long getBadnessScore(bool _resync=true)
Retrieve a badness score for current user, see WikiUser::BadnessScore for more.
Definition: wikiuser.cpp:271
The UserinfoForm class is a widget that displays the information about user including their history a...
int WarningLevel
Current warning level of user.
Definition: wikiuser.hpp:54
QString Flags()
Flags.
Definition: wikiuser.cpp:286
Every exception raised by huggle is defined by this class.
Definition: exception.hpp:20