00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
#include <qfile.h>
00013
#include <qtextstream.h>
00014
#include <qstringlist.h>
00015
00016
#include <qtextbrowser.h>
00017
#include <qpushbutton.h>
00018
#include <qlayout.h>
00019
00020
#include <qkeysequence.h>
00021
00022
00023
#include "shortcuts.h"
00024
#include "../../config.h"
00025
00026
00027 Shortcuts::Shortcuts(
QWidget* parent,
const char* name ) :
QDialog(parent,name)
00028 {
00029 resize( 800, 550 );
00030
00031
00032
00033
00034
00035 QFile* shortcutsFile =
new QFile(
TEMP_DIR + QString(
"/shortcuts.html") );;
00036
if(shortcutsFile->open(IO_WriteOnly))
00037 {
00038
00039 QTextStream stream( shortcutsFile );
00040 stream.setEncoding( QTextStream::Unicode );
00041
00042 stream <<
"<html><body>\n";
00043 stream <<
"<table cellpadding='4'><tr>\n";
00044 stream <<
" <td><img src='" <<
IMAGE_PATH <<
"miscImages/asHelpLogoSmall.png'></td>\n";
00045 stream <<
" <td valign='middle'><font face='Arial, sans-serif' size='+3'>";
00046 stream <<
"<b>" << tr(
"Keyboard Shortcuts") <<
"</b></font></td>\n";
00047 stream <<
"</tr></table>\n";
00048 stream <<
"<p>\n";
00049 stream <<
"<font face='Arial, sans-serif'>\n";
00050 stream <<
" <table width='100%' cellpadding='4' cellspacing='0'>\n";
00051 stream <<
" <tr><td width='50%' bgcolor='lightgray'><b>" << tr(
"Action") <<
"</b></td>\n";
00052 stream <<
" <td width='50%' bgcolor='lightgray'><b>" << tr(
"Shortcut") <<
"</b></td></tr>\n";
00053 stream <<
" <!-- -------------------------------------------------- -->\n";
00054 stream <<
" <tr><td colspan='2'><b><u>" << tr(
"Opening & Saving") <<
"</u></b></td></tr>\n";
00055 stream <<
" <tr><td>" << tr(
"New album") <<
"</td>\n";
00056 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_N)) <<
"</td></tr>\n";
00057 stream <<
" <tr><td>" << tr(
"Open album") <<
"</td>\n";
00058 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_O)) <<
"</td></tr>\n";
00059 stream <<
" <tr><td>" << tr(
"Open recent album") <<
"</td>\n";
00060 stream <<
" <td>" << ((QString)QKeySequence(CTRL)) <<
"[" <<
00061 ((QString)QKeySequence(Key_1)) <<
"-" <<
00062 ((QString)QKeySequence(Key_9)) <<
"]" <<
"</td></tr>\n";
00063 stream <<
" <tr><td>" << tr(
"Save album") <<
"</td>\n";
00064 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_S)) <<
"</td></tr>\n";
00065 stream <<
" <tr><td>" << tr(
"Save album as") <<
"</td>\n";
00066 stream <<
" <td>" << ((QString)QKeySequence(SHIFT+CTRL+Key_S)) <<
"</td></tr>\n";
00067 stream <<
" <tr><td>" << tr(
"Quit") <<
"</td>\n";
00068 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_Q)) <<
"</td></tr>\n";
00069 stream <<
" <!-- -------------------------------------------------- -->\n";
00070 stream <<
" <tr><td colspan='2'><hr></td></tr>\n";
00071 stream <<
" <tr><td colspan='2'><b><u>" << tr(
"Organizing") <<
"</u></b></td></tr>\n";
00072 stream <<
" <tr><td>" << tr(
"Move to the first photo in the collection") <<
"</td>\n";
00073 stream <<
" <td>" << ((QString)QKeySequence(Key_Home)) <<
"</td></tr>\n";
00074 stream <<
" <tr><td>" << tr(
"Move to the last photo in the collection") <<
"</td>\n";
00075 stream <<
" <td>" << ((QString)QKeySequence(Key_End)) <<
"</td></tr>\n";
00076 stream <<
" <tr><td>" << tr(
"Select all photos") <<
"</td>\n";
00077 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_A)) <<
"</td></tr>\n";
00078 stream <<
" <tr><td>" << tr(
"Deselect all photos") <<
"</td>\n";
00079 stream <<
" <td>" << ((QString)QKeySequence(SHIFT+CTRL+Key_A)) <<
"</td></tr>\n";
00080 stream <<
" <tr><td>" << tr(
"Rotate selected photos right") <<
"</td>\n";
00081 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_R)) <<
"</td></tr>\n";
00082 stream <<
" <tr><td>" << tr(
"Rotate selected photos left") <<
"</td>\n";
00083 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_L)) <<
"</td></tr>\n";
00084 stream <<
" <tr><td>" << tr(
"Delete selected photos") <<
"</td>\n";
00085 stream <<
" <td>" << ((QString)QKeySequence(Key_Delete)) <<
"</td></tr>\n";
00086 stream <<
" <tr><td>" << tr(
"Modify selected photo description") <<
"</td>\n";
00087 stream <<
" <td>" << ((QString)QKeySequence(Key_Enter)) <<
"</td></tr>\n";
00088 stream <<
" <tr><td>" << tr(
"Finish modifying selected photo description") <<
"</td>\n";
00089 stream <<
" <td>" << ((QString)QKeySequence(Key_Escape)) <<
"</td></tr>\n";
00090 stream <<
" <tr><td>" << tr(
"Edit first of selected photos") <<
"</td>\n";
00091 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_E)) <<
"</td></tr>\n";
00092 stream <<
" <!-- -------------------------------------------------- -->\n";
00093 stream <<
" <tr><td colspan='2'><hr></td></tr>\n";
00094 stream <<
" <tr><td colspan='2'><b><u>Editing</u></b></td></tr>\n";
00095 stream <<
" <tr><td>" << tr(
"Go to previous photo") <<
"</td>\n";
00096 stream <<
" <td>" << ((QString)QKeySequence(Key_PageUp)) <<
"</td></tr>\n";
00097 stream <<
" <tr><td>" << tr(
"Go to next photo") <<
"</td>\n";
00098 stream <<
" <td>" << ((QString)QKeySequence(Key_PageDown)) <<
"</td></tr>\n";
00099 stream <<
" <tr><td>" << tr(
"Go to first photo in the collection") <<
"</td>\n";
00100 stream <<
" <td>" << ((QString)QKeySequence(Key_Home)) <<
"</td></tr>\n";
00101 stream <<
" <tr><td>" << tr(
"Go to last photo in the collection") <<
"</td>\n";
00102 stream <<
" <td>" << ((QString)QKeySequence(Key_End)) <<
"</td></tr>\n";
00103 stream <<
" <tr><td>" << tr(
"Return to organizing") <<
"</td>\n";
00104 stream <<
" <td>" << ((QString)QKeySequence(Key_Escape)) <<
"</td></tr>\n";
00105 stream <<
" <!-- =-=-=-=-=-=-=-=-=-=-= -->\n";
00106 stream <<
" <tr><td colspan='2'> </td></tr>\n";
00107 stream <<
" <!-- =-=-=-=-=-=-=-=-=-=-= -->\n";
00108 stream <<
" <tr><td>" << tr(
"Rotate photo left") <<
"</td>\n";
00109 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_L)) <<
"</td></tr>\n";
00110 stream <<
" <tr><td>" << tr(
"Rotate photo right") <<
"</td>\n";
00111 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_R)) <<
"</td></tr>\n";
00112 stream <<
" <tr><td>" << tr(
"Flip photo horizontally") <<
"</td>\n";
00113 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_F)) <<
"</td></tr>\n";
00114 stream <<
" <tr><td>" << tr(
"Flip photo vertically") <<
"</td>\n";
00115 stream <<
" <td>" << ((QString)QKeySequence(ALT+CTRL+Key_F)) <<
"</td></tr>\n";
00116 stream <<
" <!-- =-=-=-=-=-=-=-=-=-=-= -->\n";
00117 stream <<
" <tr><td colspan='2'> </td></tr>\n";
00118 stream <<
" <!-- =-=-=-=-=-=-=-=-=-=-= -->\n";
00119 stream <<
" <tr><td>" << tr(
"Select all") <<
"</td>\n";
00120 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_A)) <<
"</td></tr>\n";
00121 stream <<
" <tr><td>" << tr(
"Deselect all") <<
"</td>\n";
00122 stream <<
" <td>" << ((QString)QKeySequence(SHIFT+CTRL+Key_A)) <<
"</td></tr>\n";
00123 stream <<
" <tr><td>" << tr(
"Nudge selection left") <<
"</td>\n";
00124 stream <<
" <td>" << ((QString)QKeySequence(Key_Left)) <<
"</td></tr>\n";
00125 stream <<
" <tr><td>" << tr(
"Nudge selection right") <<
"</td>\n";
00126 stream <<
" <td>" << ((QString)QKeySequence(Key_Right)) <<
"</td></tr>\n";
00127 stream <<
" <tr><td>" << tr(
"Nudge selection up") <<
"</td>\n";
00128 stream <<
" <td>" << ((QString)QKeySequence(Key_Up)) <<
"</td></tr>\n";
00129 stream <<
" <tr><td>" << tr(
"Nudge selection down") <<
"</td>\n";
00130 stream <<
" <td>" << ((QString)QKeySequence(Key_Down)) <<
"</td></tr>\n";
00131 stream <<
" <tr><td>" << tr(
"Expand selection") <<
"</td>\n";
00132 stream <<
" <td>" << ((QString)QKeySequence(Key_Plus,Key_Equal)) <<
"</td></tr>\n";
00133 stream <<
" <tr><td>" << tr(
"Shrink selection") <<
"</td>\n";
00134 stream <<
" <td>" << ((QString)QKeySequence(Key_Minus,Key_Underscore)) <<
"</td></tr>\n";
00135 stream <<
" <tr><td>" << tr(
"Resize selection") <<
"</td>\n";
00136 stream <<
" <td>" << tr(
"Press and hold Shift, then Click and Drag Left / Right") <<
"</td></tr>\n";
00137 stream <<
" <tr><td>" << tr(
"Rotate selection") <<
"</td>\n";
00138 stream <<
" <td>" << (QString(tr(
"Press and hold %1, then Click selection"))
00139 .arg( ((QString)QKeySequence(CTRL)) )) <<
"</td></tr>\n";
00140 stream <<
" <!-- -------------------------------------------------- -->\n";
00141 stream <<
" <tr><td colspan='2'><hr></td></tr>\n";
00142 stream <<
" <tr><td colspan='2'><b><u>" << tr(
"Levels and Grain Editors") <<
"</u></b></td></tr>\n";
00143 stream <<
" <tr><td>" << tr(
"Show alternative") <<
"</td>\n";
00144 stream <<
" <td>" << QString(tr(
"Hold %1")).arg( ((QString)QKeySequence(CTRL)) ) <<
"</td></tr>\n";
00145 stream <<
" <tr><td>" << tr(
"Apply") <<
"</td>\n";
00146 stream <<
" <td>" << ((QString)QKeySequence(Key_Enter)) <<
"</td></tr>\n";
00147 stream <<
" <tr><td>" << tr(
"Cancel") <<
"</td>\n";
00148 stream <<
" <td>" << ((QString)QKeySequence(Key_Escape)) <<
"</td></tr>\n";
00149 stream <<
" <!-- -------------------------------------------------- -->\n";
00150 stream <<
" <tr><td colspan='2'><hr></td></tr>\n";
00151 stream <<
" <tr><td colspan='2'><b><u>" << tr(
"Miscellaneous") <<
"</u></b></td></tr>\n";
00152 stream <<
" <tr><td>" << tr(
"View album statistics") <<
"</td>\n";
00153 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_I)) <<
"</td></tr>\n";
00154 stream <<
" <tr><td>" << tr(
"Album Shaper help") <<
"</td>\n";
00155 stream <<
" <td>" << ((QString)QKeySequence(CTRL+Key_Question)) <<
"</td></tr>\n";
00156 stream <<
" <!-- -------------------------------------------------- -->\n";
00157 stream <<
" </table>\n";
00158 stream <<
"</font>\n";
00159 stream <<
"</body></html>\n";
00160 shortcutsFile->close();
00161 }
00162
00163
00164 setCaption( tr(
"Album Shaper: Shortcuts"));
00165
00166
00167
QTextBrowser* content =
new QTextBrowser(
this );
00168
00169 content->setHScrollBarMode( QScrollView::AlwaysOff );
00170 content->setVScrollBarMode( QScrollView::Auto );
00171
00172
00173 content->mimeSourceFactory()->setFilePath( QStringList(
TEMP_DIR) );
00174 content->setSource(
"shortcuts.html");
00175
00176
00177 QGridLayout* grid =
new QGridLayout(
this, 2, 2, 0);
00178 grid->addMultiCellWidget( content, 0,0, 0,1 );
00179 grid->setColStretch( 0, 1 );
00180 grid->setRowStretch( 0, 1 );
00181
00182
00183
#if (!defined(Q_OS_WIN) && !defined(Q_OS_MACX))
00184
QPushButton* closeButton =
new QPushButton( tr(
"Close"),
this );
00185 closeButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
00186 closeButton->setDefault(
true);
00187 connect( closeButton, SIGNAL(clicked()), SLOT(close()) );
00188 grid->addWidget( closeButton, 1, 0, Qt::AlignCenter );
00189
#endif
00190
00191 }
00192
00193 void Shortcuts::closeEvent( QCloseEvent* e)
00194 {
00195 QWidget::closeEvent( e );
00196 emit
closed();
00197 }
00198
00199 void Shortcuts::reject()
00200 {
00201 QDialog::reject();
00202 emit
closed();
00203 }
00204