Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>pull/172/head
parent
6b2d46a548
commit
53f8622a6a
@ -0,0 +1,59 @@
|
||||
/* This file is part of the KDE project
|
||||
* Copyright (C) 2007 Jan Klötzke <jan kloetzke at freenet de>
|
||||
*
|
||||
* Based on kryptomedia- Another KDE cryto media application.
|
||||
* Copyright (C) 2006 Daniel Gollub <dgollub@suse.de>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public License
|
||||
* along with this library; see the file COPYING.LIB. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "passworddlg.h"
|
||||
|
||||
PasswordDlg::PasswordDlg(TQString url, TQString iconName) :
|
||||
KDialogBase(NULL, "PasswordDlg", true, i18n("Unlock Storage Device"), (Cancel|User1), User1, false, KGuiItem(i18n("Unlock"), "unlocked" ))
|
||||
{
|
||||
unlockDialog = new UnlockDialog(this);
|
||||
|
||||
unlockDialog->descLabel->setText(unlockDialog->descLabel->text().arg(url));
|
||||
unlockDialog->descLabel->adjustSize();
|
||||
unlockDialog->adjustSize();
|
||||
|
||||
enableButton( User1, false );
|
||||
|
||||
TQPixmap pixmap = TDEGlobal::iconLoader()->loadIcon(iconName, TDEIcon::NoGroup, TDEIcon::SizeLarge);
|
||||
unlockDialog->encryptedIcon->setPixmap( pixmap );
|
||||
|
||||
connect(unlockDialog->passwordEdit, TQT_SIGNAL (textChanged(const TQString &)), this, TQT_SLOT (slotPasswordChanged(const TQString &)));
|
||||
|
||||
setMainWidget(unlockDialog);
|
||||
}
|
||||
|
||||
PasswordDlg::~PasswordDlg()
|
||||
{
|
||||
delete unlockDialog;
|
||||
}
|
||||
|
||||
TQString PasswordDlg::getPassword()
|
||||
{
|
||||
return unlockDialog->passwordEdit->text();
|
||||
}
|
||||
|
||||
void PasswordDlg::slotPasswordChanged(const TQString &text)
|
||||
{
|
||||
enableButton( User1, !text.isEmpty() );
|
||||
}
|
||||
|
||||
#include "passworddlg.moc"
|
@ -0,0 +1,58 @@
|
||||
/* This file is part of the KDE project
|
||||
* Copyright (C) 2007 Jan Klötzke <jan kloetzke at freenet de>
|
||||
*
|
||||
* Based on kryptomedia- Another KDE cryto media application.
|
||||
* Copyright (C) 2006 Daniel Gollub <dgollub@suse.de>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public License
|
||||
* along with this library; see the file COPYING.LIB. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef DIALOG_H_
|
||||
#define DIALOG_H_
|
||||
|
||||
#include <tdemessagebox.h>
|
||||
#include <tdelocale.h>
|
||||
#include <tdeconfig.h>
|
||||
#include <kdebug.h>
|
||||
#include <kdialogbase.h>
|
||||
#include <kiconloader.h>
|
||||
|
||||
#include <tqlineedit.h>
|
||||
#include <tqlabel.h>
|
||||
#include <tqgroupbox.h>
|
||||
|
||||
#include "unlockdialog.h"
|
||||
|
||||
class PasswordDlg : public KDialogBase
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PasswordDlg(TQString url, TQString iconName);
|
||||
~PasswordDlg();
|
||||
|
||||
TQString getPassword();
|
||||
|
||||
public slots:
|
||||
void slotPasswordChanged(const TQString &text);
|
||||
|
||||
private:
|
||||
UnlockDialog *unlockDialog;
|
||||
};
|
||||
|
||||
#endif // DIALOG_H_
|
||||
|
@ -0,0 +1,161 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>UnlockDialog</class>
|
||||
<widget class="TQWidget">
|
||||
<property name="name">
|
||||
<cstring>UnlockDialog</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>207</width>
|
||||
<height>172</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>3</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>Decrypting Storage Device</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="TQLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout5</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="TQLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout4</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="TQLabel">
|
||||
<property name="name">
|
||||
<cstring>encryptedIcon</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>48</width>
|
||||
<height>48</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer2_2</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>41</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</vbox>
|
||||
</widget>
|
||||
<widget class="TQLabel">
|
||||
<property name="name">
|
||||
<cstring>descLabel</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>3</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><p><b>%1</b> is an encrypted storage device.</p>
|
||||
<p>Please enter the password to unlock the storage device.</p></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>WordBreak|AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="TQLayoutWidget" row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout4</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="TQLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel1</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Password:</string>
|
||||
</property>
|
||||
<property name="buddy" stdset="0">
|
||||
<cstring>passwordEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="TQLineEdit">
|
||||
<property name="name">
|
||||
<cstring>passwordEdit</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
Loading…
Reference in new issue