//============================================== // 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 #include #include //Projectwide includes #include "shortcuts.h" #include "../../config.h" //============================================== Shortcuts::Shortcuts( QWidget* parent, const char* name ) : QDialog(parent,name) { resize( 800, 550 ); //-- //Generate shortcuts HTML file //create/open xml file QFile* shortcutsFile = new QFile(TEMP_DIR + QString("/shortcuts.html") );; if(shortcutsFile->open(IO_WriteOnly)) { //----- QTextStream stream( shortcutsFile ); stream.setEncoding( QTextStream::Unicode ); //----- stream << "\n"; stream << "\n"; stream << " \n"; stream << " \n"; stream << "
"; stream << "" << 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 << "
" << tr("Action") << "" << tr("Shortcut") << "
" << tr("Opening & Saving") << "
" << tr("New album") << "" << ((QString)QKeySequence(CTRL+Key_N)) << "
" << tr("Open album") << "" << ((QString)QKeySequence(CTRL+Key_O)) << "
" << tr("Open recent album") << "" << ((QString)QKeySequence(CTRL)) << "[" << ((QString)QKeySequence(Key_1)) << "-" << ((QString)QKeySequence(Key_9)) << "]" << "
" << tr("Save album") << "" << ((QString)QKeySequence(CTRL+Key_S)) << "
" << tr("Save album as") << "" << ((QString)QKeySequence(SHIFT+CTRL+Key_S)) << "
" << tr("Quit") << "" << ((QString)QKeySequence(CTRL+Key_Q)) << "

" << tr("Organizing") << "
" << tr("Move to the first photo in the collection") << "" << ((QString)QKeySequence(Key_Home)) << "
" << tr("Move to the last photo in the collection") << "" << ((QString)QKeySequence(Key_End)) << "
" << tr("Select all photos") << "" << ((QString)QKeySequence(CTRL+Key_A)) << "
" << tr("Deselect all photos") << "" << ((QString)QKeySequence(SHIFT+CTRL+Key_A)) << "
" << tr("Rotate selected photos right") << "" << ((QString)QKeySequence(CTRL+Key_R)) << "
" << tr("Rotate selected photos left") << "" << ((QString)QKeySequence(CTRL+Key_L)) << "
" << tr("Delete selected photos") << "" << ((QString)QKeySequence(Key_Delete)) << "
" << tr("Modify selected photo description") << "" << ((QString)QKeySequence(Key_Enter)) << "
" << tr("Finish modifying selected photo description") << "" << ((QString)QKeySequence(Key_Escape)) << "
" << tr("Edit first of selected photos") << "" << ((QString)QKeySequence(CTRL+Key_E)) << "

Editing
" << tr("Go to previous photo") << "" << ((QString)QKeySequence(Key_PageUp)) << "
" << tr("Go to next photo") << "" << ((QString)QKeySequence(Key_PageDown)) << "
" << tr("Go to first photo in the collection") << "" << ((QString)QKeySequence(Key_Home)) << "
" << tr("Go to last photo in the collection") << "" << ((QString)QKeySequence(Key_End)) << "
" << tr("Return to organizing") << "" << ((QString)QKeySequence(Key_Escape)) << "
 
" << tr("Rotate photo left") << "" << ((QString)QKeySequence(CTRL+Key_L)) << "
" << tr("Rotate photo right") << "" << ((QString)QKeySequence(CTRL+Key_R)) << "
" << tr("Flip photo horizontally") << "" << ((QString)QKeySequence(CTRL+Key_F)) << "
" << tr("Flip photo vertically") << "" << ((QString)QKeySequence(ALT+CTRL+Key_F)) << "
 
" << tr("Select all") << "" << ((QString)QKeySequence(CTRL+Key_A)) << "
" << tr("Deselect all") << "" << ((QString)QKeySequence(SHIFT+CTRL+Key_A)) << "
" << tr("Nudge selection left") << "" << ((QString)QKeySequence(Key_Left)) << "
" << tr("Nudge selection right") << "" << ((QString)QKeySequence(Key_Right)) << "
" << tr("Nudge selection up") << "" << ((QString)QKeySequence(Key_Up)) << "
" << tr("Nudge selection down") << "" << ((QString)QKeySequence(Key_Down)) << "
" << tr("Expand selection") << "" << ((QString)QKeySequence(Key_Plus,Key_Equal)) << "
" << tr("Shrink selection") << "" << ((QString)QKeySequence(Key_Minus,Key_Underscore)) << "
" << tr("Resize selection") << "" << tr("Press and hold Shift, then Click and Drag Left / Right") << "
" << tr("Rotate selection") << "" << (QString(tr("Press and hold %1, then Click selection")) .arg( ((QString)QKeySequence(CTRL)) )) << "

" << tr("Levels and Grain Editors") << "
" << tr("Show alternative") << "" << QString(tr("Hold %1")).arg( ((QString)QKeySequence(CTRL)) ) << "
" << tr("Apply") << "" << ((QString)QKeySequence(Key_Enter)) << "
" << tr("Cancel") << "" << ((QString)QKeySequence(Key_Escape)) << "

" << tr("Miscellaneous") << "
" << tr("View album statistics") << "" << ((QString)QKeySequence(CTRL+Key_I)) << "
" << tr("Album Shaper help") << "" << ((QString)QKeySequence(CTRL+Key_Question)) << "
\n"; stream << "
\n"; stream << "\n"; shortcutsFile->close(); } //-- //set window title setCaption( tr("Album Shaper: Shortcuts")); //-- //create shortcuts text browser QTextBrowser* content = new QTextBrowser( this ); content->setHScrollBarMode( QScrollView::AlwaysOff ); content->setVScrollBarMode( QScrollView::Auto ); // content->setFrameStyle( QFrame::Panel | QFrame::Sunken ); content->mimeSourceFactory()->setFilePath( QStringList(TEMP_DIR) ); content->setSource( "shortcuts.html"); //-- //place handbook and close button in grid layout QGridLayout* grid = new QGridLayout( this, 2, 2, 0); grid->addMultiCellWidget( content, 0,0, 0,1 ); grid->setColStretch( 0, 1 ); grid->setRowStretch( 0, 1 ); //-- //PLATFORM_SPECIFIC_CODE - Close Button #if (!defined(Q_OS_WIN) && !defined(Q_OS_MACX)) QPushButton* closeButton = new QPushButton( tr("Close"), this ); closeButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); closeButton->setDefault(true); connect( closeButton, SIGNAL(clicked()), SLOT(close()) ); grid->addWidget( closeButton, 1, 0, Qt::AlignCenter ); #endif //-- } //============================================== void Shortcuts::closeEvent( QCloseEvent* e) { QWidget::closeEvent( e ); emit closed(); } //============================================== void Shortcuts::reject() { QDialog::reject(); emit closed(); } //==============================================