⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kfnkeys.cpp

📁 LINUX 下, 以 QT/KDE 写的档案管理员
💻 CPP
字号:
/***************************************************************************                                kfnkeys.cpp                             -------------------    copyright            : (C) 2000 by Shie Erlich & Rafi Yanai    e-mail               : krusader@users.sourceforge.net    web site             : http://krusader.sourceforge.net ---------------------------------------------------------------------------  Description  ***************************************************************************  A      db   dD d8888b. db    db .d8888.  .d8b.  d8888b. d88888b d8888b.     88 ,8P' 88  `8D 88    88 88'  YP d8' `8b 88  `8D 88'     88  `8D     88,8P   88oobY' 88    88 `8bo.   88ooo88 88   88 88ooooo 88oobY'     88`8b   88`8b   88    88   `Y8b. 88~~~88 88   88 88~~~~~ 88`8b     88 `88. 88 `88. 88b  d88 db   8D 88   88 88  .8D 88.     88 `88.     YP   YD 88   YD ~Y8888P' `8888Y' YP   YP Y8888D' Y88888P 88   YD                                                     S o u r c e    F i l e *************************************************************************** *                                                                         * *   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.                                   * *                                                                         * ***************************************************************************/#include <qtooltip.h>#include <klocale.h>#include <kglobalsettings.h>#include <qfontmetrics.h>#include <qwhatsthis.h>#include "kfnkeys.h"#include "../krusader.h"#include "../defaults.h"#include "../krslots.h"KFnKeys::KFnKeys(QWidget *parent, char *name): QWidget(parent,name) {		krConfig->setGroup("Look&Feel");		////////////////////////////////#define SETUP(TARGET) {\	TARGET->setMinimumWidth(45);\}						setFont( KGlobalSettings::generalFont() );		layout=new QGridLayout(this,1,9);	// 9 keys    F2=new QPushButton( i18n("F2 Term  ") ,this);      QToolTip::add( F2, "<qt>" + i18n( "<p>Open terminal in current directory.</p>"                     "<p>The terminal can be defined in Konfigurator, "                     "default is <b>konsole</b>.</p>" ) + "</qt>" );      connect(F2,SIGNAL(clicked()), SLOTS, SLOT(terminal()));      SETUP(F2);					F3=new QPushButton( i18n("F3 View  ") ,this);				QToolTip::add( F3, i18n( "Open file in viewer." ) );			connect(F3,SIGNAL(clicked()), SLOTS, SLOT(view()));			SETUP(F3);				F4=new QPushButton( i18n("F4 Edit  ") ,this);			QToolTip::add( F4, "<qt>" + i18n( "<p>Edit file.</p>"									   "<p>The editor can be defined in Konfigurator, "									   "default is <b>internal editor</b>.</p>" ) + "</qt>" );			connect(F4,SIGNAL(clicked()), SLOTS, SLOT(edit()));			SETUP(F4);					F5=new QPushButton( i18n("F5 Copy  ") ,this);				QToolTip::add( F5, i18n( "Copy file from one panel to the other." ) );			connect(F5,SIGNAL(clicked()), SLOTS, SLOT(copyFiles()));			SETUP(F5);					F6=new QPushButton( i18n("F6 Move") ,this);			QToolTip::add( F6, i18n( "Move file from one panel to the other." ) );			connect(F6,SIGNAL(clicked()), SLOTS, SLOT(moveFiles()));			SETUP(F6);					F7=new QPushButton( i18n("F7 Mkdir ") ,this);				QToolTip::add( F7, i18n( "Create directory in current panel." ) );			connect(F7,SIGNAL(clicked()), SLOTS, SLOT(mkdir()));			SETUP(F7);					F8=new QPushButton( i18n("F8 Delete") ,this);			QToolTip::add( F8, i18n( "Delete file, directory, etc." ) );			connect(F8,SIGNAL(clicked()), SLOTS, SLOT(deleteFiles()));			SETUP(F8);					F9=new QPushButton( i18n("F9 Rename") ,this);				QToolTip::add( F9, i18n( "Rename file, directory, etc." ) );			connect(F9,SIGNAL(clicked()), SLOTS, SLOT(rename()));			SETUP(F9);					F10=new QPushButton( i18n("F10 Quit ") ,this);			QToolTip::add( F10, i18n( "Quit Krusader." ) );			connect(F10,SIGNAL(clicked()),krApp, SLOT(slotClose()));			SETUP(F10);    // set a tighter box around the keys    int h = QFontMetrics(F2->font()).height()+2;    F2->setMaximumHeight(h); F3->setMaximumHeight(h);    F4->setMaximumHeight(h); F5->setMaximumHeight(h);    F6->setMaximumHeight(h); F7->setMaximumHeight(h);    F8->setMaximumHeight(h); F9->setMaximumHeight(h);    F10->setMaximumHeight(h);    		layout->addWidget(F2,0,0);		layout->addWidget(F3,0,1);		layout->addWidget(F4,0,2);		layout->addWidget(F5,0,3);		layout->addWidget(F6,0,4);		layout->addWidget(F7,0,5);		layout->addWidget(F8,0,6);		layout->addWidget(F9,0,7);		layout->addWidget(F10,0,8);				layout->activate();}void KFnKeys::updateShortcuts() {	F2->setText(krF2->shortcut().toString() + i18n(" Term"));	F3->setText(krF3->shortcut().toString() + i18n(" View"));	F4->setText(krF4->shortcut().toString() + i18n(" Edit"));	F5->setText(krF5->shortcut().toString() + i18n(" Copy"));	F6->setText(krF6->shortcut().toString() + i18n(" Move"));	F7->setText(krF7->shortcut().toString() + i18n(" Mkdir"));	F8->setText(krF8->shortcut().toString() + i18n(" Delete"));	F9->setText(krF9->shortcut().toString() + i18n(" Rename"));	F10->setText(krF10->shortcut().toString() + i18n(" Quit"));}#include "kfnkeys.moc"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -