diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-10-28 16:51:52 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-10-28 16:51:52 +0100 |
| commit | a67cd9193a6ac04d34c92c1a817fb0f5e44af30f (patch) | |
| tree | 888227edebb4844efb01cd70bcbfc459b09d2a56 /USetPassword.pas | |
| parent | 4234ca950044c27a1b2fcc92f45d816ef217487f (diff) | |
| download | tuxcmd-0.6.54.tar.xz | |
Password callback support from all VFS modulesv0.6.54
Cleanup, remove unused dialogs
Diffstat (limited to 'USetPassword.pas')
| -rw-r--r-- | USetPassword.pas | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/USetPassword.pas b/USetPassword.pas deleted file mode 100644 index cdf7fee..0000000 --- a/USetPassword.pas +++ /dev/null @@ -1,107 +0,0 @@ -(* - Tux Commander - USetPassword - Password prompt dialog - Copyright (C) 2008 Tomas Bzatek <tbzatek@users.sourceforge.net> - Check for updates on tuxcmd.sourceforge.net - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either 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 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*) -unit USetPassword; - -interface - -uses - glib2, gtk2, pango, SysUtils, Types, Classes, GTKControls, GTKForms, GTKStdCtrls, GTKExtCtrls, GTKConsts, GTKView, - GTKUtils, GTKDialogs, GTKPixbuf, GTKClasses; - -type - TFSetPassword = class(TGTKDialog) - Label1, Label2: TGTKLabel; - DialogIcon: TGTKImage; - Entry: TGTKEntry; - Table: TGTKTable; - ShowPasswordCheckButton: TGTKCheckButton; - procedure FormCreate(Sender: TObject); override; - procedure FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean); - procedure ShowPasswordCheckButtonClick(Sender: TObject); - end; - -var - FSetPassword: TFSetPassword; - -implementation - -uses ULocale, UFileAssoc; - - -procedure TFSetPassword.FormCreate(Sender: TObject); -begin - SetDefaultSize(400, -1); - Buttons := [mbOK, mbCancel]; - Caption := LANGFSetPassword_Caption; - - Table := TGTKTable.Create(Self); - DialogIcon := TGTKImage.Create(Self); - if gtk_style_lookup_icon_set(gtk_widget_get_style(FWidget), 'gtk-dialog-authentication') <> nil - then DialogIcon.SetFromStock('gtk-dialog-authentication', isDialog) - else DialogIcon.CopyFromPixbuf(StockLock48); - - Label1 := TGTKLabel.Create(Self); - Label1.Caption := Format('<span size="x-large" weight="bold">%s</span>', [LANGFSetPassword_Label1_Caption]); - Label1.UseMarkup := True; - Label1.XAlign := 0; - Label2 := TGTKLabel.Create(Self); - Label2.Caption := LANGFSetPassword_Label2_Caption; - Label2.LineWrap := True; - Label2.XAlign := 0; - Label2.SetSizeRequest(270, -1); - Entry := TGTKEntry.Create(Self); - Entry.Visibility := False; - ShowPasswordCheckButton := TGTKCheckButton.CreateWithLabel(Self, LANGFSetPassword_ShowPasswordCheckButton); - ShowPasswordCheckButton.OnToggled := ShowPasswordCheckButtonClick; - - Table.AddControlEx(0, 0, 2, 1, Label1, [taoExpand, taoFill], [taoShrink], 20, 3); - Table.AddControlEx(0, 1, 1, 1, DialogIcon, [taoShrink], [taoShrink], 10, 5); - Table.AddControlEx(1, 1, 1, 1, Label2, [taoExpand, taoFill], [taoShrink], 5, 0); - Table.AddControlEx(0, 2, 1, 1, TGTKVBox.Create(Self), [taoShrink], [taoShrink, taoExpand, taoFill], 2, 6); - Table.AddControlEx(0, 3, 2, 1, Entry, [taoExpand, taoFill], [taoShrink], 5, 0); - Table.AddControlEx(0, 4, 2, 1, ShowPasswordCheckButton, [taoExpand, taoFill], [taoShrink], 15, 5); - Table.BorderWidth := 10; - ClientArea.AddControlEx(Table, True, True, 0); - OnKeyDown := FormKeyDown; - Entry.SetFocus; -end; - -procedure TFSetPassword.FormKeyDown(Sender: TObject; Key: Word; Shift: TShiftState; var Accept: boolean); -begin - case Key of - GDK_RETURN, GDK_KP_ENTER: ModalResult := mbOK; - GDK_ESCAPE: ModalResult := mbCancel; - GDK_M, GDK_Capital_M: if (Shift = [ssAlt]) then begin - ShowPasswordCheckButton.Checked := not ShowPasswordCheckButton.Checked; - Accept := False; - end; - end; -end; - -procedure TFSetPassword.ShowPasswordCheckButtonClick(Sender: TObject); -begin - Entry.Visibility := ShowPasswordCheckButton.Checked; -end; - - - - -end. - |
