mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 00:53:53 +02:00
2021-01-20 Fred Gleason <fredg@paravelsystems.com>
* Updated the 'Username' control in rdlogin(1) to use 'RDUserListModel'. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -20854,3 +20854,6 @@
|
||||
2021-01-20 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Updated the 'Default User' control in the 'Host' dialog in
|
||||
rdadmin(1) to use 'RDUserListModel'.
|
||||
2021-01-20 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Updated the 'Username' control in rdlogin(1) to use
|
||||
'RDUserListModel'.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// The User Login/Logout Utility for Rivendell.
|
||||
//
|
||||
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -98,14 +98,19 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
|
||||
//
|
||||
login_username_box=new QComboBox(this);
|
||||
login_username_box->setFocus();
|
||||
login_username_model=new RDUserListModel(this);
|
||||
login_username_model->setTypeFilter(RDUser::TypeUser);
|
||||
login_username_box->setModel(login_username_model);
|
||||
QFontMetrics fm(font());
|
||||
sql="select LOGIN_NAME from USERS where ADMIN_CONFIG_PRIV=\"N\"\
|
||||
order by LOGIN_NAME";
|
||||
sql=QString("select ")+
|
||||
"LOGIN_NAME "+ // 00
|
||||
"from USERS where "+
|
||||
"ADMIN_CONFIG_PRIV='N'"+
|
||||
"order by LOGIN_NAME";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
login_username_box->insertItem(q->value(0).toString());
|
||||
if(fm.width(q->value(0).toString())>login_user_width) {
|
||||
login_user_width=fm.width(q->value(0).toString());
|
||||
if((20+fm.width(q->value(0).toString()))>login_user_width) {
|
||||
login_user_width=20+fm.width(q->value(0).toString());
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
@@ -257,11 +262,11 @@ void MainWidget::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
if(login_resize) {
|
||||
login_label->setGeometry(0,10,size().width(),21);
|
||||
login_username_box->setGeometry(110,40,size().width()-120,19);
|
||||
login_username_edit->setGeometry(110,40,size().width()-120,19);
|
||||
login_username_box->setGeometry(110,38,size().width()-120,23);
|
||||
login_username_edit->setGeometry(110,38,size().width()-120,23);
|
||||
login_username_label->setGeometry(10,40,85,19);
|
||||
login_password_edit->setGeometry(110,61,size().width()-120,19);
|
||||
login_password_label->setGeometry(10,61,85,19);
|
||||
login_password_edit->setGeometry(110,65,size().width()-120,23);
|
||||
login_password_label->setGeometry(10,67,85,19);
|
||||
login_button->setGeometry(size().width()-270,size().height()-60,80,50);
|
||||
logout_button->setGeometry(size().width()-180,size().height()-60,80,50);
|
||||
cancel_button->setGeometry(size().width()-90,size().height()-60,80,50);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// The User Login/Logout Utility for Rivendell.
|
||||
//
|
||||
// (C) Copyright 2002-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -21,11 +21,12 @@
|
||||
#ifndef RDLOGIN_H
|
||||
#define RDLOGIN_H
|
||||
|
||||
#include <qcombobox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <QComboBox>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
|
||||
#include <rduserlistmodel.h>
|
||||
#include <rdwidget.h>
|
||||
|
||||
#define RDLOGIN_USAGE "\n"
|
||||
@@ -55,6 +56,7 @@ class MainWidget : public RDWidget
|
||||
QLabel *login_label;
|
||||
QLabel *login_username_label;
|
||||
QComboBox *login_username_box;
|
||||
RDUserListModel *login_username_model;
|
||||
QLineEdit *login_username_edit;
|
||||
QLabel *login_password_label;
|
||||
QLineEdit *login_password_edit;
|
||||
|
Reference in New Issue
Block a user