mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-21 14:02:58 +02:00
2019-10-01 Fred Gleason <fredg@paravelsystems.com>
* Added an 'RDDialog' class. * Added an 'RDWidget' class. * Refactored rdadmin(1) to use 'RDDialog' and 'RDWidget' base classes.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// List a Rivendell Endpoints
|
||||
//
|
||||
// (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2019 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
|
||||
@@ -18,16 +18,9 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include <qdialog.h>
|
||||
#include <qstring.h>
|
||||
#include <q3textedit.h>
|
||||
#include <qpainter.h>
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#include <rd.h>
|
||||
#include <rddb.h>
|
||||
#include <rdescape_string.h>
|
||||
#include <rdpasswd.h>
|
||||
|
||||
#include "edit_user.h"
|
||||
#include "list_endpoints.h"
|
||||
@@ -35,7 +28,7 @@
|
||||
|
||||
ListEndpoints::ListEndpoints(RDMatrix *matrix,RDMatrix::Endpoint endpoint,
|
||||
QWidget *parent)
|
||||
: QDialog(parent)
|
||||
: RDDialog(parent)
|
||||
{
|
||||
setModal(true);
|
||||
|
||||
@@ -63,29 +56,15 @@ ListEndpoints::ListEndpoints(RDMatrix *matrix,RDMatrix::Endpoint endpoint,
|
||||
//
|
||||
// Fix the Window Size
|
||||
//
|
||||
setMinimumWidth(sizeHint().width());
|
||||
setMaximumWidth(sizeHint().width());
|
||||
setMinimumHeight(sizeHint().height());
|
||||
setMaximumHeight(sizeHint().height());
|
||||
|
||||
//
|
||||
// Create Fonts
|
||||
//
|
||||
QFont bold_font=QFont("Helvetica",12,QFont::Bold);
|
||||
bold_font.setPixelSize(12);
|
||||
QFont font=QFont("Helvetica",12,QFont::Normal);
|
||||
font.setPixelSize(12);
|
||||
setMinimumSize(sizeHint());
|
||||
|
||||
//
|
||||
// Endpoints List Box
|
||||
//
|
||||
list_list_view=new Q3ListView(this);
|
||||
list_list_view->
|
||||
setGeometry(10,24,sizeHint().width()-20,sizeHint().height()-94);
|
||||
QLabel *label=
|
||||
new QLabel(list_list_view,list_table,this);
|
||||
label->setFont(bold_font);
|
||||
label->setGeometry(14,5,85,19);
|
||||
list_type_label=new QLabel(list_list_view,list_table,this);
|
||||
list_type_label->setFont(labelFont());
|
||||
list_type_label->setGeometry(14,5,85,19);
|
||||
list_list_view->setAllColumnsShowFocus(true);
|
||||
list_list_view->setItemMargin(5);
|
||||
switch(list_endpoint) {
|
||||
@@ -157,32 +136,28 @@ ListEndpoints::ListEndpoints(RDMatrix *matrix,RDMatrix::Endpoint endpoint,
|
||||
//
|
||||
// Edit Button
|
||||
//
|
||||
QPushButton *button=new QPushButton(this);
|
||||
button->setGeometry(10,sizeHint().height()-60,80,50);
|
||||
button->setFont(bold_font);
|
||||
button->setText(tr("&Edit"));
|
||||
connect(button,SIGNAL(clicked()),this,SLOT(editData()));
|
||||
button->setDisabled(list_readonly);
|
||||
list_edit_button=new QPushButton(this);
|
||||
list_edit_button->setFont(buttonFont());
|
||||
list_edit_button->setText(tr("&Edit"));
|
||||
connect(list_edit_button,SIGNAL(clicked()),this,SLOT(editData()));
|
||||
list_edit_button->setDisabled(list_readonly);
|
||||
|
||||
//
|
||||
// Ok Button
|
||||
//
|
||||
button=new QPushButton(this);
|
||||
button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
|
||||
button->setDefault(true);
|
||||
button->setFont(bold_font);
|
||||
button->setText(tr("&OK"));
|
||||
connect(button,SIGNAL(clicked()),this,SLOT(okData()));
|
||||
list_ok_button=new QPushButton(this);
|
||||
list_ok_button->setDefault(true);
|
||||
list_ok_button->setFont(buttonFont());
|
||||
list_ok_button->setText(tr("&OK"));
|
||||
connect(list_ok_button,SIGNAL(clicked()),this,SLOT(okData()));
|
||||
|
||||
//
|
||||
// Cancel Button
|
||||
//
|
||||
button=new QPushButton(this);
|
||||
button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
|
||||
80,50);
|
||||
button->setFont(bold_font);
|
||||
button->setText(tr("&Cancel"));
|
||||
connect(button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
||||
list_cancel_button=new QPushButton(this);
|
||||
list_cancel_button->setFont(buttonFont());
|
||||
list_cancel_button->setText(tr("&Cancel"));
|
||||
connect(list_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
||||
|
||||
//
|
||||
// Load Values
|
||||
@@ -719,3 +694,13 @@ void ListEndpoints::cancelData()
|
||||
{
|
||||
done(1);
|
||||
}
|
||||
|
||||
|
||||
void ListEndpoints::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
list_list_view->
|
||||
setGeometry(10,24,size().width()-20,size().height()-94);
|
||||
list_edit_button->setGeometry(10,size().height()-60,80,50);
|
||||
list_ok_button->setGeometry(size().width()-180,size().height()-60,80,50);
|
||||
list_cancel_button->setGeometry(size().width()-90,size().height()-60,80,50);
|
||||
}
|
||||
|
Reference in New Issue
Block a user