1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2025-10-16 15:38:43 +02:00

The first three tasks are done. Some 16x16 icons are missing (for example 'both')

This commit is contained in:
2008-02-09 13:27:33 +00:00
parent a543589c61
commit 0c8a2c80c8
14 changed files with 691 additions and 183 deletions

View File

@ -96,6 +96,13 @@ const char* WindowGeometrySetpath= SETTINGS_PATH_PREFIX "/Layout/";
const char* screenPositionSetpath= SETTINGS_PATH_PREFIX "/ScreenPos/";
const char* SSHPath = SETTINGS_PATH_PREFIX "/SSH/SSHPath";
const char* showIconsInRules = SETTINGS_PATH_PREFIX "/UI/Icons/ShowIconsInRules";
const char* iconsInRulesSize = SETTINGS_PATH_PREFIX "/UI/Icons/IconsInRulesSize";
const char* rulesFont = SETTINGS_PATH_PREFIX "/UI/Fonts/RulesFont";
const char* treeFont = SETTINGS_PATH_PREFIX "/UI/Fonts/TreeFont";
const char* uiFont = SETTINGS_PATH_PREFIX "/UI/Fonts/UiFont";
const char* showCommentTip = SETTINGS_PATH_PREFIX "/UI/ShowCommentTip";
FWBSettings::FWBSettings() : QSettings(QSettings::UserScope, "netcitadel.com", "Firewall Builder")
{
@ -162,7 +169,7 @@ void FWBSettings::init()
QString c;
if (getLabelColor(RED ).isEmpty())
{ setLabelColor(RED ,"#C86E6E"); setLabelText(RED ,"Red"); }
{ setLabelColor(RED ,"#C86E6E"); setLabelText(RED,"Red"); }
if (getLabelColor(ORANGE).isEmpty())
{ setLabelColor(ORANGE,"#C08B5A"); setLabelText(ORANGE,"Orange"); }
if (getLabelColor(YELLOW).isEmpty())
@ -176,6 +183,24 @@ void FWBSettings::init()
if (getLabelColor(GRAY ).isEmpty())
{ setLabelColor(GRAY ,"#C0C0C0"); setLabelText(GRAY ,"Gray"); }
ok = contains(showIconsInRules);
if (!ok) setShowIconsInRules(true);
ok = contains(iconsInRulesSize);
if (!ok) setIconsInRulesSize(SIZE25X25);
ok = contains(rulesFont);
if (!ok) setRulesFont(QFont("times", 11, QFont::Normal));
ok = contains(treeFont);
if (!ok) setTreeFont(QFont("times", 11, QFont::Normal));
ok = contains(uiFont);
if (!ok) setUiFont(QFont("times", 11, QFont::Normal));
ok = contains(showCommentTip);
if (!ok) setShowCommentTip(false);
#ifndef _WIN32
if (getSSHPath().isEmpty()) setSSHPath("ssh");
#endif
@ -486,7 +511,7 @@ QString FWBSettings::getSSHPath()
return value(SSHPath).toString();
}
void FWBSettings::setSSHPath(const QString &path)
void FWBSettings::setSSHPath(const QString &path)
{
setValue(SSHPath,path);
}
@ -529,3 +554,77 @@ void FWBSettings::setPrinterOptions(QPrinter *printer,int pageWidth,int pageH
setInt("PrintSetup/pageHeight",pageHeight);
}
FWBSettings::IconSize FWBSettings::getIconsInRulesSize()
{
QString val = value(QString(iconsInRulesSize)).toString();
if ("SIZE25X25" == val)
return SIZE25X25;
if ("SIZE16X16" == val)
return SIZE16X16;
return SIZE25X25;
}
void FWBSettings::setIconsInRulesSize(FWBSettings::IconSize size)
{
setValue(QString(iconsInRulesSize), QString(SIZE25X25 == size ? "SIZE25X25":"SIZE16X16"));
}
bool FWBSettings::getShowIconsInRules()
{
return value(showIconsInRules).toBool();
}
void FWBSettings::setShowIconsInRules(bool showIcons)
{
setValue(showIconsInRules, showIcons);
}
QFont FWBSettings::getRulesFont()
{
return getFontByType(rulesFont);
}
void FWBSettings::setRulesFont(const QFont &font)
{
setValue(rulesFont, font.toString());
}
QFont FWBSettings::getTreeFont()
{
return getFontByType(treeFont);
}
void FWBSettings::setTreeFont(const QFont &font)
{
setValue(treeFont, font.toString());
}
QFont FWBSettings::getUiFont()
{
return getFontByType(uiFont);
}
void FWBSettings::setUiFont(const QFont &font)
{
setValue(uiFont, font.toString());
}
QFont FWBSettings::getFontByType(const char *type)
{
QFont font = QFont();
bool ok = font.fromString(value(type).toString());
if (ok)
return font;
return QFont("times", 11, QFont::Normal);
}
bool FWBSettings::getShowCommentTip()
{
return value(showCommentTip).toBool();
}
void FWBSettings::setShowCommentTip(bool showTooltip)
{
setValue(showCommentTip, showTooltip);
}

View File

@ -29,6 +29,7 @@
#include <qsettings.h>
#include <qrect.h>
#include <qprinter.h>
#include <qfont.h>
class QWidget;
@ -47,6 +48,7 @@ class FWBSettings : public QSettings {
public:
enum LabelColors { RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE, GRAY };
enum IconSize{ SIZE25X25, SIZE16X16};
private:
QString getLabelColorStr(enum LabelColors c);
@ -134,6 +136,26 @@ class FWBSettings : public QSettings {
void getPrinterOptions(QPrinter *printer,int &pageWidth,int &pageHeight);
void setPrinterOptions(QPrinter *printer,int pageWidth,int pageHeight);
enum IconSize getIconsInRulesSize();
void setIconsInRulesSize(enum IconSize size);
bool getShowIconsInRules();
void setShowIconsInRules(bool showIcons);
QFont getRulesFont();
void setRulesFont(const QFont &font);
QFont getTreeFont();
void setTreeFont(const QFont &font);
QFont getUiFont();
void setUiFont(const QFont &font);
bool getShowCommentTip();
void setShowCommentTip(bool);
private:
QFont getFontByType(const char*type);
};
#endif

View File

@ -298,8 +298,7 @@ FWBTree::FWBTree()
deleteMenuState["Services/TCP"] = false;
deleteMenuState["Services/UDP"] = false;
deleteMenuState["Services/TagServices"] = false;
deleteMenuState["Time"] = false;
deleteMenuState["Time"] = false;
}
/**

View File

@ -159,10 +159,10 @@ FWWindow::FWWindow()
qDebug("FWWindow constructor");
setUnifiedTitleAndToolBarOnMac(true);
m_mainWindow = new Ui::FWBMainWindow_q();
m_mainWindow->setupUi(dynamic_cast<QMainWindow*>(this));
QApplication::setFont(st->getUiFont());
rcs = NULL;
systemFile = true;
visibleFirewall = NULL;
@ -2369,7 +2369,13 @@ void FWWindow::editPaste()
void FWWindow::editPrefs()
{
PrefsDialog pd(this);
pd.exec();
if ((QDialog::Accepted == pd.exec()) && (m_mainWindow->ruleSets->count()!=0))
{
QApplication::setFont(st->getUiFont());
for (int i = 0; i < m_mainWindow->ruleSets->count(); i++)
dynamic_cast<RuleSetView*>(m_mainWindow->ruleSets->widget(i))->updateAll();
om->getCurrentObjectTree()->updateAfterPrefEdit();
}
}
void FWWindow::closeEvent( QCloseEvent * ev)

View File

@ -80,6 +80,7 @@ ObjectTreeView::ObjectTreeView(QWidget* parent, const char * name, Qt::WFlags f)
{
setObjectName(name);
this->setParent(parent, f);
setFont (st->getTreeFont());
// setAcceptDrops( TRUE );
item_before_drag_started=NULL;
lastSelected = NULL;
@ -879,3 +880,7 @@ int ObjectTreeView::getNumSelected()
return selectedObjects.size();
}
void ObjectTreeView::updateAfterPrefEdit()
{
setFont(st->getTreeFont());
}

View File

@ -112,7 +112,7 @@ class ObjectTreeView : public QTreeWidget {
void becomingVisible() { visible=true; }
void becomingHidden() { visible=false; }
void updateAfterPrefEdit();
/* Under some circumstances, user may select several host or fw
* objects so that their children objects are selected as well
* (e.g. when shift-click is used). "Delete objects" or "group

View File

@ -14,7 +14,7 @@
version 2 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
but WITHOUT ANY WARRANTY; without even the implied wdarranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@ -49,7 +49,7 @@
#include <qcolordialog.h>
#include <qcolor.h>
#include <qpixmapcache.h>
#include <qfontdialog.h>
/*
#include <sys/types.h>
@ -174,6 +174,18 @@ PrefsDialog::PrefsDialog(QWidget *parent) : QDialog(parent)
setButtonColor(m_dialog->grayBtn,colors[FWBSettings::GRAY]);
m_dialog->grayText->setText(t);
m_dialog->chShowIcons->setChecked(st->getShowIconsInRules() );
if (FWBSettings::SIZE25X25 == st->getIconsInRulesSize())
m_dialog->rb25->setChecked(true);
else
m_dialog->rb16->setChecked(true);
changeShowIcons();
rulesFont = st->getRulesFont();
treeFont = st->getTreeFont();
uiFont = st->getUiFont();
m_dialog->chCommentTip->setChecked(st->getShowCommentTip() );
}
void PrefsDialog::changeColor(QPushButton *btn,
@ -187,7 +199,6 @@ void PrefsDialog::changeColor(QPushButton *btn,
setButtonColor(btn,colors[colorCode]);
}
void PrefsDialog::changeRedColor()
{
changeColor(m_dialog->redBtn, FWBSettings::RED);
@ -223,6 +234,45 @@ void PrefsDialog::changeGrayColor()
changeColor(m_dialog->grayBtn, FWBSettings::GRAY);
}
void PrefsDialog::changeIconSize25()
{
//st->setIconsInRulesSize(FWBSettings::SIZE25X25);
}
void PrefsDialog::changeIconSize16()
{
//st->setIconsInRulesSize(FWBSettings::SIZE16X16);
}
void PrefsDialog::changeShowIcons()
{
bool areShown = m_dialog->chShowIcons->isChecked();
m_dialog->rb16->setEnabled(areShown);
m_dialog->rb25->setEnabled(areShown);
}
void PrefsDialog::changeRulesFont()
{
changeFont(&rulesFont);
}
void PrefsDialog::changeTreeFont()
{
changeFont(&treeFont);
}
void PrefsDialog::changeUiFont()
{
changeFont(&uiFont);
}
void PrefsDialog::changeFont(QFont *font)
{
bool ok;
QFont f = QFontDialog::getFont(&ok, *font, this);
if (ok)
*font = f;
}
void PrefsDialog::findWDir()
{
@ -384,9 +434,20 @@ void PrefsDialog::accept()
st->setLabelText (FWBSettings::BLUE, m_dialog->blueText->text() );
st->setLabelText (FWBSettings::PURPLE, m_dialog->purpleText->text() );
st->setLabelText (FWBSettings::GRAY, m_dialog->grayText->text() );
st->setShowIconsInRules(m_dialog->chShowIcons->isChecked());
FWBSettings::IconSize sz = m_dialog->rb25->isChecked() ?
FWBSettings::SIZE25X25 : FWBSettings::SIZE16X16;
st->setIconsInRulesSize(sz);
st->setRulesFont(rulesFont);
st->setTreeFont(treeFont);
st->setUiFont(uiFont);
st->setShowCommentTip(m_dialog->chCommentTip->isChecked());
st->setSSHPath( m_dialog->sshPath->text() );
QDir d;
d.mkdir( wd );
@ -395,4 +456,3 @@ void PrefsDialog::accept()
QDialog::accept();
}

View File

@ -36,11 +36,13 @@
#include <list>
#include <string>
#include <map>
#include <qfont.h>
#include <qstring.h>
class QPushButton;
class PrefsDialog : public QDialog
{
Q_OBJECT
@ -50,7 +52,11 @@ class PrefsDialog : public QDialog
std::map<int,QString> colors;
Ui::prefsDialog_q *m_dialog;
QFont rulesFont;
QFont treeFont;
QFont uiFont;
void changeFont(QFont *font);
public:
PrefsDialog(QWidget *parent);
~PrefsDialog();
@ -69,7 +75,12 @@ public slots:
virtual void changeBlueColor();
virtual void changePurpleColor();
virtual void changeGrayColor();
virtual void changeIconSize25();
virtual void changeIconSize16();
virtual void changeShowIcons();
virtual void changeRulesFont();
virtual void changeTreeFont();
virtual void changeUiFont();
};
#endif // __PREFSDIALOG_H

View File

@ -47,6 +47,7 @@
#include <iostream>
#include <sstream>
#include <list>
#include "fwbuilder/Firewall.h"
#include "fwbuilder/Resources.h"
@ -122,7 +123,7 @@ void RuleTableModel::setRowCount ( const int &value )
//need to reset model for RuleSetView::iinit (two is)
}
QVariant RuleTableModel::data ( const QModelIndex &, int ) const
QVariant RuleTableModel::data ( const QModelIndex &, int role) const
{
return QVariant();
}
@ -145,7 +146,8 @@ QVariant RuleTableModel::headerData(int section, Qt::Orientation orientation, in
return QString::number(section);
if (role == Qt::FontRole)
{
QFont f = QAbstractTableModel::headerData(section, orientation, role ).value<QFont>();
//QFont f = QAbstractTableModel::headerData(section, orientation, role ).value<QFont>();
QFont f = st->getRulesFont();
if ((section >= ruleSetView->firstSelectedRule) && (section <= ruleSetView->lastSelectedRule))
f.setBold(true);
@ -172,21 +174,21 @@ bool RuleTableModel::setHeader ( QStringList qsl )
void RuleTableModel::insertRow( const int before_pos )
{
m_rowCount++;
ruleSetView->freezeRowSizing();
ruleSetView->rowHeights.push_back(0);
for (int i = static_cast<int>(ruleSetView->rowHeights.size())-1; i >= before_pos; i--)
ruleSetView->rowHeights[i+1] = ruleSetView->rowHeights[i];
ruleSetView->rowHeights[before_pos] = 30; //standard size
//we add a row here and system resets below rows' sizes
//so we had to freeze our sizes for restoring them later
QAbstractTableModel::beginInsertRows( QModelIndex(), before_pos, before_pos );
QAbstractTableModel::insertRow(before_pos);
QAbstractTableModel::endInsertRows();
//somehow QAbstractItemModel breaks all the sizes after "before_pos" row
//so we restore them
if (before_pos > 0)
@ -404,7 +406,7 @@ RuleSetView::RuleSetView( int r, int c, QWidget *parent ) : QTableView( /*r, c,*
{
firstSelectedRule = -1;
lastSelectedRule = -1;
setFont(st->getRulesFont());
rowSizingFrozen = false;
ruleModel = new RuleTableModel(r, c, this);
@ -430,7 +432,7 @@ RuleSetView::RuleSetView( int r, int c, QWidget *parent ) : QTableView( /*r, c,*
setSelectionMode( QAbstractItemView::ContiguousSelection );
setSelectionBehavior( QAbstractItemView::SelectRows );
int lm, tm, rm, bm;
getContentsMargins(&lm, &tm, &rm, &bm);
setContentsMargins(fontMetrics().width( "W999W" ), tm, rm, bm);
@ -473,17 +475,52 @@ RuleSetView::~RuleSetView()
{
}
bool RuleSetView::showComment(QPoint pos, QHelpEvent *he)
{
if (!st->getShowCommentTip())
return false;
int col = columnAt(pos.x() - verticalHeader()->width());
if((pos.y() >= horizontalHeader()->height()) && RuleSetView::Comment == getColType(col))
{
QString t="";
int row = rowAt(pos.y() - horizontalHeader()->height());
QRect cr;
cr=ruleDelegate->cellGeometry(row,col);
PolicyRule *rule = PolicyRule::cast( getRule(row) );
if (rule!=NULL)
{
Rule *rule = Rule::cast(ruleIndex[row]);
t= QString::fromUtf8(rule->getComment().c_str());
}
cr = QRect(
cr.left() - horizontalOffset() - 2,
cr.top() - verticalOffset() - 2,
cr.width() + 4,
cr.height() + 4);
QRect global = QRect(
viewport()->mapToGlobal(cr.topLeft()), viewport()->mapToGlobal(cr.bottomRight()));
QToolTip::showText(mapToGlobal( he->pos() ), t, this, global);
return true;
}
return false;
}
bool RuleSetView::event ( QEvent * event )
{
if (event->type() == QEvent::ToolTip)
{
QHelpEvent *he = (QHelpEvent*) event;
QPoint pos = he->pos();
if (showComment(pos, he))
return true;
if ((st->getObjTooltips()) && (pos.y() >= horizontalHeader()->height()))
{
int row = rowAt(pos.y() - horizontalHeader()->height());
int col = columnAt(pos.x() - verticalHeader()->width());
int row = rowAt(pos.y() - horizontalHeader()->height());
if ((row < 0) || (col < 0)) return true;
@ -494,6 +531,7 @@ bool RuleSetView::event ( QEvent * event )
contentsMouse.setY(contentsMouse.y() + verticalOffset() + 3);//+3 for fitting purposed
cr=ruleDelegate->cellGeometry(row,col);
qDebug("%d", getColType(col));
if ( RuleSetView::Options == getColType(col) )
{
@ -706,7 +744,7 @@ void RuleSetView::init()
map<int,int> colW;
bool userColWidth=false;
QFontMetrics p(font());
QFontMetrics p(st->getRulesFont());
QString k = settingsKey();
QString v = st->getStr(k);
@ -721,6 +759,7 @@ void RuleSetView::init()
{
QString lbl = ruleModel->headerData(col, Qt::Horizontal, Qt::DisplayRole).toString();//horzHeaderLabels->stringList()[col];
QRect br=p.boundingRect(QRect(0,0,1000,1000),
Qt::AlignLeft|Qt::AlignVCenter,
lbl );
@ -739,7 +778,7 @@ void RuleSetView::init()
}
// adjustRow(row);
int h=20;
int h=16;
for (int col=0; col<ncols; col++)
{
QRect cr = calculateCellSize(row,col);
@ -762,26 +801,43 @@ void RuleSetView::init()
QApplication::restoreOverrideCursor();
}
QSize RuleSetView::getPMSize()
{
if (!st->getShowIconsInRules()){
pixmap_h = 0;
pixmap_w = 0;
return QSize();
}
QString icn="icon-ref";
if (FWBSettings::SIZE16X16 == st->getIconsInRulesSize())
icn="icon-tree";
// return QPixmap::fromMimeSource(
// Resources::global_res->getObjResourceStr(obj, icn).c_str() );
QString icn_file = QString(":/Icons/AddressTable/")+icn;
if (fwbdebug)
qDebug("RuleSetView::getPMSize() icn=%s",icn.toAscii().constData());
QPixmap pm;
LoadPixmap(icn_file, pm);
pixmap_h = pm.height();
pixmap_w = pm.width();
return pm.size();
}
void RuleSetView::iinit()
{
ruleModel->setRowCount( ruleset->size() );
QString icn = ":/Icons/Accept";
QSize sz = getPMSize();
if (fwbdebug)
qDebug("RuleSetView::iinit() icn=%s",icn.toAscii().constData());
QPixmap pm;
LoadPixmap(icn, pm);
pixmap_h = pm.height();
pixmap_w = pm.width();
QFontMetrics p(font());
QFontMetrics p(st->getRulesFont());
QRect br = p.boundingRect(QRect(0, 0, 1000, 1000),
Qt::AlignLeft|Qt::AlignVCenter,"WMWM" );
text_h = br.height();
item_h = ( (pixmap_h>text_h)?pixmap_h:text_h ) + RuleElementSpacing;
//qDebug("pixmap_h = %d text_h = %d item_h = %d", pixmap_h, text_h, item_h);
FWObject *f = getFirewall();
@ -816,16 +872,20 @@ void RuleSetView::clear()
QRect RuleSetView::calculateCellSize( int row, int col )
{
int h = 20;
int h = 16;
int re_size;
getPMSize();
// if (fwbdebug)
// qDebug("RuleSetView::calculateCellSize: row=%d col=%d",
// row,col);
//QPainter p(this);
QFontMetrics p(font());
QFontMetrics p(st->getRulesFont());
QRect br = p.boundingRect(QRect(0, 0, 1000, 1000),
Qt::AlignLeft|Qt::AlignVCenter,"WMWM" );
text_h = br.height();
item_h = ((pixmap_h>text_h) ? pixmap_h:text_h) + RuleElementSpacing;
Rule *rule = Rule::cast( ruleIndex[row] );
int hc=0;
@ -914,7 +974,7 @@ QRect RuleSetView::calculateCellSize( int row, int col )
Qt::AlignLeft|Qt::AlignVCenter,
QString::fromUtf8(rule->getComment().c_str()) );
hc = br.height() + RuleElementSpacing;
hc = item_h; // br.height() + RuleElementSpacing; //
wc = RuleElementSpacing/2 + br.width();
break;
}
@ -924,7 +984,7 @@ QRect RuleSetView::calculateCellSize( int row, int col )
QRect br=p.boundingRect(QRect(0, 0, 1000, 1000),
Qt::AlignLeft|Qt::AlignVCenter,
QString::fromUtf8(RoutingRule::cast(rule)->getMetricAsString().c_str()) );
hc = br.height() + RuleElementSpacing;
hc = item_h; //br.height() + RuleElementSpacing;
wc = RuleElementSpacing/2 + br.width();
break;
}
@ -934,6 +994,7 @@ QRect RuleSetView::calculateCellSize( int row, int col )
}
h = QMAX(h, hc);
h = QMAX(h, pixmap_h+RuleElementSpacing);
wc = QMAX(wc, QApplication::globalStrut().width());
wc += RuleElementSpacing/2; // some padding
@ -985,6 +1046,7 @@ QPixmap RuleSetView::getPixmap(FWObject *obj, PixmapAttr pmattr) const
QString icn_file = (":/Icons/"+obj->getTypeName()+"/"+icn).c_str();// = Resources::global_res->getObjResourceStr(obj, icn).c_str();
QPixmap pm;
LoadPixmap(icn_file, pm);
//qDebug("here %s", icn_file.toAscii().constData());
return pm;
}
@ -1011,9 +1073,8 @@ void RuleSetView::paintCell(QPainter *pntr,
/*if (fwbdebug)
qDebug("Draw cell: row=%d col=%d current palette=%d",
row,col,palette().serialNumber());*/
if (ruleIndex.count(row)==0) return;
QString rclr;
Rule *rule = Rule::cast( ruleIndex[row] );
if (rule==NULL) return;
@ -1034,6 +1095,8 @@ void RuleSetView::paintCell(QPainter *pntr,
bufferpixmap.fill( cg.base().color() );
QPainter p( &bufferpixmap );
QFont font = st->getRulesFont();
p.setFont(font);
QRect r = ruleDelegate->cellRect(row,col);
@ -1094,24 +1157,13 @@ void RuleSetView::paintCell(QPainter *pntr,
}
x = r.left()+1;
//QPixmap pm = getPixmap(o1 , re->getNeg()?Neg:Normal );
string icn = "icon";
if (re->getNeg()) icn = "icon-neg";
QString icn_file = (":/Icons/"+o1->getTypeName()+"/"+icn).c_str();
QPixmap pm;
LoadPixmap(icn_file, pm);
if (!re->isAny())
p.drawPixmap( x, y + RuleElementSpacing/2, pm );
x += pm.width()+1;
QSize sz = drawIconInRule(p, x, y, re, o1);
x += sz.width()+1;
p.drawText( x, y + RuleElementSpacing/2,
cr.width()-pm.width()-1, item_h,
cr.width()-sz.width()-1, item_h,
Qt::AlignLeft|Qt::AlignVCenter, objectText(re,o1) );
FWObject *mwSelObj = selectedObject;
@ -1166,14 +1218,12 @@ void RuleSetView::paintCell(QPainter *pntr,
if (rule==NULL) return;
QString platform=getPlatform();
string act = rule->getActionAsString();
string act = rule->getActionAsString();
QString icn = (":/Icons/" + act).c_str(); //for example :/Icons/Continue
QString icn = chooseIcon((":/Icons/" + act).c_str()); //for example :/Icons/Continue
QString res="";
//FWOptions *ropt = rule->getOptionsObject();
res = FWObjectPropertiesFactory::getRuleActionProperties(rule);
assert(icn!="");
QPixmap pm;
LoadPixmap(icn, pm);
@ -1193,8 +1243,8 @@ void RuleSetView::paintCell(QPainter *pntr,
string dir = rule->getDirectionAsString();
if (dir.empty()) dir = "Both";
QString icn = (":/Icons/" + dir).c_str();
assert(icn!="");
QString icn = chooseIcon((":/Icons/" + dir).c_str());
QPixmap pm;
LoadPixmap(icn, pm);
@ -1231,7 +1281,8 @@ void RuleSetView::paintCell(QPainter *pntr,
(natRule && ! isDefaultNATRuleOptions( rule->getOptionsObject()))
)
{
QString icn = ":/Icons/Options";
QString icn = chooseIcon(":/Icons/Options");
//QString icn = ":/Icons/Options";//There isn't icon 16x16 for options...
QPixmap pm;
LoadPixmap(icn, pm);
@ -1242,19 +1293,7 @@ void RuleSetView::paintCell(QPainter *pntr,
}
case Comment:
{
/* comments are found in both policy and nat rules, so we cast to Rule here */
Rule *rule = Rule::cast( ruleIndex[row] );
if (rule==NULL) return;
QRect br=p.boundingRect(QRect(x, y, 1000, 1000),
Qt::AlignLeft|Qt::AlignVCenter,
QString::fromUtf8(rule->getComment().c_str()) );
p.drawText( x, y + RuleElementSpacing/2,
br.width(),
br.height(),
Qt::AlignLeft|Qt::AlignVCenter,
QString::fromUtf8(rule->getComment().c_str()) );
drawComment(p, row, col, cr);
break;
}
case Metric:
@ -1280,6 +1319,70 @@ void RuleSetView::paintCell(QPainter *pntr,
return;
}
void RuleSetView::drawComment(QPainter &p, int row, int col, const QRect &cr)
{
/* comments are found in both policy and nat rules, so we cast to Rule here */
Rule *rule = Rule::cast( ruleIndex[row] );
if (rule==NULL) return;
QRect r = ruleDelegate->cellRect(row,col);
int x = r.left() + RuleElementSpacing/2;
int y = r.top();
QString comm = QString::fromUtf8(rule->getComment().c_str());
QRect br=p.boundingRect(QRect(x, y, 1000, 1000),
Qt::AlignLeft|Qt::AlignVCenter,
comm);
if (st->getShowCommentTip() && text_h > 0)
{
QStringList strs = comm.split('\n');
int h = cr.height()/text_h;
if (h >= 1 && h<= strs.size())
{
std::list<QString> lst(strs.begin(), strs.begin()+h);
comm = QStringList(QStringList::fromStdList(lst)).join("\n");
}
}
p.drawText( x, y + RuleElementSpacing/2,
br.width(),
br.height(),
Qt::AlignLeft|Qt::AlignTop,
comm);
}
QString RuleSetView::chooseIcon(QString icn)
{
if (!st->getShowIconsInRules())
return QString();
if (FWBSettings::SIZE16X16 == st->getIconsInRulesSize())
{
if (icn.contains("-ref"))
return icn.replace("-ref", "-tree");
if (icn.contains("-neg"))
return icn.replace("-neg", "-tree");
return QString();
}
return icn;
}
QSize RuleSetView::drawIconInRule(QPainter &p, int x, int y, RuleElement *re, FWObject *o1)
{
if (!st->getShowIconsInRules())
return QSize();
QPixmap pm;
if (FWBSettings::SIZE16X16 == st->getIconsInRulesSize())
pm = getPixmap(o1, Tree);
if (FWBSettings::SIZE25X25 == st->getIconsInRulesSize())
pm = getPixmap(o1, Normal);
if (!re->isAny())
p.drawPixmap( x, y + RuleElementSpacing/2, pm );
return pm.size();
}
QString RuleSetView::getPlatform()
{
return getFirewall()->getStr("platform").c_str();
@ -1382,7 +1485,7 @@ void RuleSetView::adjustColumn( int col )
{
QString lbl = ruleModel->headerData(col, Qt::Horizontal, Qt::DisplayRole).toString();
QFontMetrics p(font());//(this);
QFontMetrics p(st->getRulesFont());//(this);
QRect br=p.boundingRect(QRect(0, 0, 1000, 1000),
Qt::AlignLeft|Qt::AlignVCenter,
lbl );
@ -1406,16 +1509,19 @@ void RuleSetView::adjustRow_int( int row, int h )
* element as defined in QApplication)
*/
QHeaderView * leftHeader = verticalHeader();
h = QMAX(h, leftHeader->fontMetrics().height() + 2);
h = QMAX(h, QApplication::globalStrut().height());
if (h == leftHeader->sectionSize(row))
//if new height is equal to old function vertSectionResized is
//not called and row heights are not set
setRowHeight(row, h);
verticalHeader()->resizeSection(row, h);
}
void RuleSetView::adjustRow( int row )
{
int h = 20;
int h = 18;
for (int col=0; col<ncols; col++)
{
@ -3438,6 +3544,11 @@ void RuleSetView::restoreSelection(bool same_widget)
void RuleSetView::updateAll()
{
int r=0;
init();
QFontMetrics p(st->getRulesFont());
QRect br = p.boundingRect(QRect(0, 0, 1000, 1000),
Qt::AlignLeft|Qt::AlignVCenter,"WMWM" );
text_h = br.height();
for (FWObject::iterator i=ruleset->begin(); i!=ruleset->end(); i++,r++)
adjustRow(r);
//dirtyRows[r] = 1;
@ -3456,8 +3567,6 @@ void RuleSetView::updateCurrentCell()
PolicyView::PolicyView(Policy *p, QWidget *parent) : RuleSetView(1, 7, parent)
{
setName("PolicyView");

View File

@ -422,8 +422,15 @@ private:
QPixmap getPixmap(libfwbuilder::FWObject *obj, PixmapAttr pmattr = Normal) const;
QString objectText(libfwbuilder::RuleElement *re,libfwbuilder::FWObject *obj);
QSize getPMSize();
void fixRulePosition(libfwbuilder::Rule *r, libfwbuilder::FWObject *parent, int pos);
QSize drawIconInRule(QPainter &p, int x, int y, libfwbuilder::RuleElement *re,
libfwbuilder::FWObject *o1);
QString chooseIcon(QString icn);
bool showComment(QPoint pos, QHelpEvent *he);
void drawComment(QPainter &p, int row, int col, const QRect &cr);
};

Binary file not shown.

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="1.1">
<!DOCTYPE TS><TS version="1.1" language="ru">
<defaultcodec></defaultcodec>
<context>
<name>@default</name>
<message>
@ -4679,7 +4680,7 @@ and special characters.</source>
</message>
<message>
<location filename="actionsdialog_q.ui" line="399"/>
<source>Note: this action translates into MARK target for iptables. Normally this target is non-terminating, that is, other rules with Classify or Tag actions belog this one will process the same packet. However, Firewall Builder can emulate terminating behavior for this action. Option in the &quot;compiler&quot; tab of the firewall object properties dialog activates emulation.</source>
<source>Note: this action translates into MARK target for iptables. Normally this target is non-terminating, that is, other rules with Classify or Tag actions below this one will process the same packet. However, Firewall Builder can emulate terminating behavior for this action. Option in the &quot;compiler&quot; tab of the firewall object properties dialog activates emulation.</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -8267,7 +8268,7 @@ Do you want to delete selected objects anyway ?</source>
<context>
<name>ObjectTreeView</name>
<message>
<location filename="ObjectTreeView.cpp" line="131"/>
<location filename="ObjectTreeView.cpp" line="132"/>
<source>Object</source>
<translation>Объект</translation>
</message>
@ -8361,7 +8362,7 @@ Do you want to delete selected objects anyway ?</source>
<context>
<name>PrefsDialog</name>
<message>
<location filename="PrefsDialog.cpp" line="231"/>
<location filename="PrefsDialog.cpp" line="281"/>
<source>Find working directory</source>
<translation>Определить рабочий каталог</translation>
</message>
@ -8371,12 +8372,12 @@ Do you want to delete selected objects anyway ?</source>
<translation type="obsolete">Определить утилиту scp</translation>
</message>
<message>
<location filename="PrefsDialog.cpp" line="240"/>
<location filename="PrefsDialog.cpp" line="290"/>
<source>Find Secure Shell utility</source>
<translation>Определить утилиту ssh</translation>
</message>
<message>
<location filename="PrefsDialog.cpp" line="290"/>
<location filename="PrefsDialog.cpp" line="340"/>
<source>Find add-on library</source>
<translation>Определить библиотеку дополнений</translation>
</message>
@ -9009,7 +9010,7 @@ because of incompatible type.</source>
из-за несовместимости типов объектов.</translation>
</message>
<message>
<location filename="FWBTree.cpp" line="399"/>
<location filename="FWBTree.cpp" line="398"/>
<source>New Library</source>
<translation>Новая библиотека</translation>
</message>
@ -9297,7 +9298,7 @@ part of the tee or data file was opened read-only</source>
<translation>&lt;b&gt;Имя Объекта:&lt;/b&gt; </translation>
</message>
<message>
<location filename="FWBSettings.cpp" line="149"/>
<location filename="FWBSettings.cpp" line="156"/>
<source>Working directory %1 does not exist and could not be created.
Ignoring this setting.</source>
<translation>Рабочий каталог %1 не существует и не может быть создан.
@ -10967,52 +10968,52 @@ for this rule</source>
<translation type="obsolete">Учёт</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="899"/>
<location filename="RuleSetView.cpp" line="959"/>
<source>Outbound </source>
<translation>Исходящее</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="957"/>
<location filename="RuleSetView.cpp" line="1018"/>
<source>Original</source>
<translation>Исходный</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2029"/>
<location filename="RuleSetView.cpp" line="2135"/>
<source>Insert Rule</source>
<translation>Вставить правило</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1777"/>
<location filename="RuleSetView.cpp" line="1883"/>
<source>Paste Rule</source>
<translation>Вставить правило из буфера обмена</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2081"/>
<location filename="RuleSetView.cpp" line="2187"/>
<source>Edit</source>
<translation>Редактировать</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1931"/>
<location filename="RuleSetView.cpp" line="2037"/>
<source>Copy</source>
<translation>Копировать</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1933"/>
<location filename="RuleSetView.cpp" line="2039"/>
<source>Cut</source>
<translation>Вырезать</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1934"/>
<location filename="RuleSetView.cpp" line="2040"/>
<source>Paste</source>
<translation>Вставить из буфера обмена</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1937"/>
<location filename="RuleSetView.cpp" line="2043"/>
<source>Delete</source>
<translation>Удалить</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1945"/>
<location filename="RuleSetView.cpp" line="2051"/>
<source>Negate</source>
<translation>Отрицание</translation>
</message>
@ -11032,67 +11033,67 @@ for this rule</source>
<translation type="obsolete">Цветовая метка:</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2031"/>
<location filename="RuleSetView.cpp" line="2137"/>
<source>Add Rule Below</source>
<translation>Добавить правило ниже</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2034"/>
<location filename="RuleSetView.cpp" line="2140"/>
<source>Remove Rule</source>
<translation>Удалить правило</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2035"/>
<location filename="RuleSetView.cpp" line="2141"/>
<source>Remove Rules</source>
<translation>Удалить правила</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2038"/>
<location filename="RuleSetView.cpp" line="2144"/>
<source>Move Rule</source>
<translation>Переместить правило</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2039"/>
<location filename="RuleSetView.cpp" line="2145"/>
<source>Move Rules</source>
<translation>Переместить правила</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2045"/>
<location filename="RuleSetView.cpp" line="2151"/>
<source>Copy Rule</source>
<translation>Копировать правило</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2047"/>
<location filename="RuleSetView.cpp" line="2153"/>
<source>Cut Rule</source>
<translation>Вырезать правило</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2049"/>
<location filename="RuleSetView.cpp" line="2155"/>
<source>Paste Rule Above</source>
<translation>Вставить правило выше</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2051"/>
<location filename="RuleSetView.cpp" line="2157"/>
<source>Paste Rule Below</source>
<translation>Вставить правило ниже</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2058"/>
<location filename="RuleSetView.cpp" line="2164"/>
<source>Enable Rule</source>
<translation>Включить правило</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2059"/>
<location filename="RuleSetView.cpp" line="2165"/>
<source>Enable Rules</source>
<translation>Включить правила</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2063"/>
<location filename="RuleSetView.cpp" line="2169"/>
<source>Disable Rule</source>
<translation>Отключить правило</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2064"/>
<location filename="RuleSetView.cpp" line="2170"/>
<source>Disable Rules</source>
<translation>Отключить правила</translation>
</message>
@ -11102,7 +11103,7 @@ for this rule</source>
<translation type="obsolete">Редактор комментариев</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="970"/>
<location filename="RuleSetView.cpp" line="1031"/>
<source>Any</source>
<translation>Любой</translation>
</message>
@ -11127,112 +11128,112 @@ for this rule</source>
<translation type="obsolete">Учитывать</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1898"/>
<location filename="RuleSetView.cpp" line="2004"/>
<source>Inbound</source>
<translation>Входящее</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1900"/>
<location filename="RuleSetView.cpp" line="2006"/>
<source>Outbound</source>
<translation>Исходящее</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1902"/>
<location filename="RuleSetView.cpp" line="2008"/>
<source>Both</source>
<translation>Оба</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1909"/>
<location filename="RuleSetView.cpp" line="2015"/>
<source>Rule Options</source>
<translation>Опции правила</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1915"/>
<location filename="RuleSetView.cpp" line="2021"/>
<source>Logging On</source>
<translation>Включить протоколирование</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1917"/>
<location filename="RuleSetView.cpp" line="2023"/>
<source>Logging Off</source>
<translation>Отключить протоколирование</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="958"/>
<location filename="RuleSetView.cpp" line="1019"/>
<source>Default</source>
<translation>По-умолчанию</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="961"/>
<location filename="RuleSetView.cpp" line="1022"/>
<source>All</source>
<translation>Все</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1883"/>
<location filename="RuleSetView.cpp" line="1989"/>
<source>Parameters</source>
<translation>Параметры</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1942"/>
<location filename="RuleSetView.cpp" line="2048"/>
<source>Reveal in tree</source>
<translation>Показывать в дереве</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1940"/>
<location filename="RuleSetView.cpp" line="2046"/>
<source>Where used</source>
<translation type="unfinished">Используется</translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1993"/>
<location filename="RuleSetView.cpp" line="2099"/>
<source>Rules %1-%2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1996"/>
<location filename="RuleSetView.cpp" line="2102"/>
<source>Rule %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="1998"/>
<location filename="RuleSetView.cpp" line="2104"/>
<source>Change color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2002"/>
<location filename="RuleSetView.cpp" line="2108"/>
<source>No color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2005"/>
<location filename="RuleSetView.cpp" line="2111"/>
<source>Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2008"/>
<location filename="RuleSetView.cpp" line="2114"/>
<source>Orange</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2011"/>
<location filename="RuleSetView.cpp" line="2117"/>
<source>Yellow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2014"/>
<location filename="RuleSetView.cpp" line="2120"/>
<source>Green</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2017"/>
<location filename="RuleSetView.cpp" line="2123"/>
<source>Blue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2020"/>
<location filename="RuleSetView.cpp" line="2126"/>
<source>Purple</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="RuleSetView.cpp" line="2023"/>
<location filename="RuleSetView.cpp" line="2129"/>
<source>Gray</source>
<translation type="unfinished"></translation>
</message>
@ -16963,92 +16964,92 @@ First, create temporary access list to permit connections from the management su
<translation>Настройки</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="55"/>
<location filename="prefsdialog_q.ui" line="76"/>
<source>&amp;OK</source>
<translation>OK</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="71"/>
<location filename="prefsdialog_q.ui" line="92"/>
<source>&amp;Cancel</source>
<translation>Отмена</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="87"/>
<location filename="prefsdialog_q.ui" line="111"/>
<source>General</source>
<translation>Общие</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="381"/>
<location filename="prefsdialog_q.ui" line="427"/>
<source>Working directory:</source>
<translation>Рабочий каталог:</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="507"/>
<location filename="prefsdialog_q.ui" line="578"/>
<source>Browse...</source>
<translation>Выбрать...</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="323"/>
<location filename="prefsdialog_q.ui" line="371"/>
<source>On startup: </source>
<translation>При запуске:</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="334"/>
<location filename="prefsdialog_q.ui" line="382"/>
<source>Load standard objects</source>
<translation>Загрузить стандартные объекты</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="339"/>
<location filename="prefsdialog_q.ui" line="387"/>
<source>Load last edited file</source>
<translation>Загрузить последний редактированный проект</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="347"/>
<location filename="prefsdialog_q.ui" line="395"/>
<source>Expand all branches in the object tree</source>
<translation>Раскрыть все дерево объектов</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="229"/>
<location filename="prefsdialog_q.ui" line="265"/>
<source>Tooltip delay:</source>
<translation>Задержка всплывающей подсказки:</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="269"/>
<location filename="prefsdialog_q.ui" line="305"/>
<source>Automatically save data in dialogs when switching between objects</source>
<translation>Автоматически сохранять данные в диалогах при переключении между объектами</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="215"/>
<location filename="prefsdialog_q.ui" line="251"/>
<source>Periodically save data to file every </source>
<translation>Периодически сохранять данные в файл, каждые</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="195"/>
<location filename="prefsdialog_q.ui" line="231"/>
<source>minutes</source>
<translation>минут</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="239"/>
<location filename="prefsdialog_q.ui" line="275"/>
<source>Enable object tooltips</source>
<translation>Включить всплывающие подсказки для объектов</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="246"/>
<location filename="prefsdialog_q.ui" line="282"/>
<source>Show deleted objects</source>
<translation>Показывать удаленные объекты</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="419"/>
<location filename="prefsdialog_q.ui" line="468"/>
<source>Revision Control</source>
<translation>Управление версиями (ревизиями)</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="431"/>
<location filename="prefsdialog_q.ui" line="492"/>
<source>Do not ask for the log record when checking in new file revision.</source>
<translation>Всегда помещать файл в систему контроля версий с пустой записью в журнал.</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="455"/>
<location filename="prefsdialog_q.ui" line="516"/>
<source>SSH</source>
<translation>SSH</translation>
</message>
@ -17058,92 +17059,92 @@ First, create temporary access list to permit connections from the management su
<translation type="obsolete">Полный путь к утилите SCP (например, scp для Unix и pscp.exe или vcp.exe для Windows):</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="486"/>
<location filename="prefsdialog_q.ui" line="559"/>
<source>A full path to the Secure Shell utility (remote command execution; for example ssh on Unix or plink.exe or vsh.exe on Windows):</source>
<translation>Полный путь к утилите SSH (например, ssh для Unix и plink.exe или vsh.exe для Windows):</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="515"/>
<location filename="prefsdialog_q.ui" line="586"/>
<source>Libraries</source>
<translation>Библиотеки</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="527"/>
<location filename="prefsdialog_q.ui" line="610"/>
<source>Add...</source>
<translation>Добавить...</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="534"/>
<location filename="prefsdialog_q.ui" line="617"/>
<source>Remove</source>
<translation>Удалить</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="549"/>
<location filename="prefsdialog_q.ui" line="630"/>
<source>If you remove libraries from the list, changes get in effect next time you start the program</source>
<translation>При удалении библиотеки, изменения вступят в силу после перезапуска программы</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="562"/>
<location filename="prefsdialog_q.ui" line="643"/>
<source>Available libraries:</source>
<translation>Доступные библиотеки:</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="573"/>
<location filename="prefsdialog_q.ui" line="654"/>
<source>Name</source>
<translation>Название</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="578"/>
<location filename="prefsdialog_q.ui" line="659"/>
<source>Load</source>
<translation>Загрузить</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="583"/>
<location filename="prefsdialog_q.ui" line="664"/>
<source>File Path</source>
<translation>Путь к файлу</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="592"/>
<location filename="prefsdialog_q.ui" line="673"/>
<source>Labels</source>
<translation>Метки</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="604"/>
<location filename="prefsdialog_q.ui" line="697"/>
<source>Use these labels to mark rules in the firewall policy</source>
<translation>Использовать эти метки для маркировки правил в наборе</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="741"/>
<location filename="prefsdialog_q.ui" line="846"/>
<source>Green</source>
<translation>Зеленый</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="727"/>
<location filename="prefsdialog_q.ui" line="832"/>
<source>Purple</source>
<translation>Пурпурный</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="664"/>
<location filename="prefsdialog_q.ui" line="769"/>
<source>Red</source>
<translation>Красный</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="692"/>
<location filename="prefsdialog_q.ui" line="797"/>
<source>Orange</source>
<translation>Оранжевый</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="671"/>
<location filename="prefsdialog_q.ui" line="776"/>
<source>Blue</source>
<translation>Синий</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="748"/>
<location filename="prefsdialog_q.ui" line="853"/>
<source>Gray</source>
<translation>Серый</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="678"/>
<location filename="prefsdialog_q.ui" line="783"/>
<source>Yellow</source>
<translation>Желтый</translation>
</message>
@ -17167,6 +17168,76 @@ First, create temporary access list to permit connections from the management su
<source>Ask user what to do</source>
<translation type="obsolete">Спросить, что делать дальше</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="863"/>
<source>Icons</source>
<translation>Иконки</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="872"/>
<source>Show icons in rules</source>
<translation>Показывать иконки в правилах</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="882"/>
<source>Icon size:</source>
<translation>Размер иконок:</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="898"/>
<source>25x25</source>
<translation>25x25</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="891"/>
<source>16x16</source>
<translation>16x16</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="460"/>
<source>Show comments in tooltips</source>
<translation>Показывать комментарии во всплывающих подсказках</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="866"/>
<source>Icons settings</source>
<translation>Настройки иконок</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="925"/>
<source>Fonts</source>
<translation>Шрифты</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="931"/>
<source>Choose font for rules sets</source>
<translation>Выберите шрифт для правил</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="934"/>
<source>Rules font </source>
<translation>Шрифт правил</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="954"/>
<source>Choose font for tree</source>
<translation>Выберите шрифт для дерева</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="957"/>
<source>Tree font</source>
<translation>Шрифт дерева</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="964"/>
<source>Choose font for the rest of the interface</source>
<translation>Выберите шрифт для остальной части интерфейса</translation>
</message>
<message>
<location filename="prefsdialog_q.ui" line="967"/>
<source>Interface font</source>
<translation>Шрифт интерфейса</translation>
</message>
</context>
<context>
<name>printingProgressDialog_q</name>

View File

@ -407,6 +407,7 @@ int main( int argc, char ** argv )
/* initialize preferences */
st->init();
QApplication::setFont(st->getUiFont());
QString sshcmd=st->getSSHPath();

View File

@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>544</width>
<height>364</height>
<width>555</width>
<height>396</height>
</rect>
</property>
<property name="windowTitle" >
@ -177,7 +177,7 @@
</property>
</spacer>
</item>
<item row="7" column="2" colspan="2" >
<item row="8" column="2" colspan="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
@ -209,7 +209,7 @@
</property>
</spacer>
</item>
<item row="5" column="7" colspan="2" >
<item row="5" column="7">
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
@ -454,6 +454,13 @@
</property>
</widget>
</item>
<item row="7" column="1" colspan="6" >
<widget class="QCheckBox" name="chCommentTip" >
<property name="text" >
<string>Show comments in tooltips</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="Widget3" >
@ -913,6 +920,69 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab" >
<attribute name="title" >
<string>Fonts</string>
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QPushButton" name="btRulesFont" >
<property name="toolTip" >
<string>Choose font for rules sets</string>
</property>
<property name="text" >
<string>Rules font </string>
</property>
</widget>
</item>
<item rowspan="3" row="0" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>121</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" >
<widget class="QPushButton" name="btTreeFont" >
<property name="toolTip" >
<string>Choose font for tree</string>
</property>
<property name="text" >
<string>Tree font</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QPushButton" name="btUiFont" >
<property name="toolTip" >
<string>Choose font for the rest of the interface</string>
</property>
<property name="text" >
<string>Interface font</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
@ -1178,6 +1248,54 @@
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>btRulesFont</sender>
<signal>clicked()</signal>
<receiver>prefsDialog_q</receiver>
<slot>changeRulesFont()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>btTreeFont</sender>
<signal>clicked()</signal>
<receiver>prefsDialog_q</receiver>
<slot>changeTreeFont()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>btUiFont</sender>
<signal>clicked()</signal>
<receiver>prefsDialog_q</receiver>
<slot>changeUiFont()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>