//============================================== // copyright : (C) 2003-2005 by Will Stokes //============================================== // 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. //============================================== //Systemwide includes #include #include #include #include #include //Projectwide includes #include "shortcuts.h" #include "helpWindow.h" #include "../../config.h" //============================================== QString Shortcuts::filename() { return QString("%1/shortcuts.html").arg(TEMP_DIR); } //============================================== void Shortcuts::generateHTML(QTextStream::Encoding type, QString charSet) { QString Control = "Ctrl"; QString ControlPlus = "Ctrl+"; #if defined(Q_OS_MACX) Control = (QString(QChar(0x2318))); ControlPlus = Control; #endif //create/open html file QFile file( filename() ); if(file.open(IO_WriteOnly)) { //----- QTextStream stream; stream.setEncoding( type ); stream.setDevice( &file ); //----- stream << "\n"; stream << "\n"; stream << "\n"; //----- stream << "\n"; stream << " \n"; stream << " \n"; stream << "
"; stream << HelpWindow::tr("Keyboard Shortcuts") << "
\n"; stream << "\n"; stream << "\n"; stream << "
\n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << " \n"; stream << "\n"; stream << "
" << HelpWindow::tr("Action") << "" << HelpWindow::tr("Shortcut") << "
" << HelpWindow::tr("Opening & Saving") << "
" << HelpWindow::tr("New album") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_N)) << "
" << HelpWindow::tr("Open album") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_O)) << "
" << HelpWindow::tr("Open recent album") << "" << ControlPlus << "[1-9]" << "
" << HelpWindow::tr("Save album") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_S)) << "
" << HelpWindow::tr("Save album as") << "" << ((QString)QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_S)) << "
" << HelpWindow::tr("Quit") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_Q)) << "

" << HelpWindow::tr("Organizing") << "
" << HelpWindow::tr("Move to the first photo in the collection") << " Home
" << HelpWindow::tr("Move to the last photo in the collection") << " End
" << HelpWindow::tr("Select all photos") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_A)) << "
" << HelpWindow::tr("Deselect all photos") << "" << ((QString)QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_A)) << "
" << HelpWindow::tr("Rotate selected photos right") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_R)) << "
" << HelpWindow::tr("Rotate selected photos left") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_L)) << "
" << HelpWindow::tr("Delete selected photos") << " Del
" << HelpWindow::tr("Modify selected photo description") << " Enter
" << HelpWindow::tr("Finish modifying selected photo description") << " Esc
" << HelpWindow::tr("Edit first of selected photos") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_E)) << "

" << HelpWindow::tr("Editing") << "
" << HelpWindow::tr("Go to previous photo") << " PgUp
" << HelpWindow::tr("Go to next photo") << " PgDown
" << HelpWindow::tr("Go to first photo in the collection") << " Home
" << HelpWindow::tr("Go to last photo in the collection") << " End
" << HelpWindow::tr("Return to organizing") << " Esc
 
" << HelpWindow::tr("Rotate photo right") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_R)) << "
" << HelpWindow::tr("Rotate photo left") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_L)) << "
" << HelpWindow::tr("Flip photo horizontally") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_F)) << "
" << HelpWindow::tr("Flip photo vertically") << "" << ((QString)QKeySequence(Qt::ALT + Qt::CTRL + Qt::Key_F)) << "
 
" << HelpWindow::tr("Select all") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_A)) << "
" << HelpWindow::tr("Deselect all") << "" << ((QString)QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_A)) << "
" << HelpWindow::tr("Nudge selection left") << "
" << HelpWindow::tr("Nudge selection right") << "
" << HelpWindow::tr("Nudge selection up") << "
" << HelpWindow::tr("Nudge selection down") << "
" << HelpWindow::tr("Expand selection") << "" << ((QString)QKeySequence(Qt::Key_Plus,Qt::Key_Equal)) << "
" << HelpWindow::tr("Shrink selection") << "" << ((QString)QKeySequence(Qt::Key_Minus,Qt::Key_Underscore)) << "
" << HelpWindow::tr("Resize selection") << "" << HelpWindow::tr("Press and hold Shift, then Click and Drag Left / Right") << "
" << HelpWindow::tr("Rotate selection") << "" << (QString(HelpWindow::tr("Press and hold %1, then Click selection")) .arg( Control )) << "

" << HelpWindow::tr("Levels and Grain Editors") << "
" << HelpWindow::tr("Show alternative") << "" << QString(HelpWindow::tr("Hold %1")).arg( Control ) << "
" << HelpWindow::tr("Select entire luminosity/color range") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_A)) << "
" << HelpWindow::tr("Apply") << " Enter
" << HelpWindow::tr("Cancel") << " Esc

" << HelpWindow::tr("Miscellaneous") << "
" << HelpWindow::tr("View album statistics") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_I)) << "
" << HelpWindow::tr("Album Shaper help") << "" << ((QString)QKeySequence(Qt::CTRL + Qt::Key_Question)) << "
\n"; stream << "
\n"; stream << "\n"; file.close(); } } //==============================================