22 #include <glxcommandhandlers.hrh> |
22 #include <glxcommandhandlers.hrh> |
23 #include <glxattributecontext.h> |
23 #include <glxattributecontext.h> |
24 #include <glxattributeretriever.h> |
24 #include <glxattributeretriever.h> |
25 #include <glxfetchcontextremover.h> |
25 #include <glxfetchcontextremover.h> |
26 #include <glxcollectionpluginalbums.hrh> |
26 #include <glxcollectionpluginalbums.hrh> |
27 |
27 #include <glxcommondialogs.h> |
28 #include <hbinputdialog.h> |
28 #include <hbinputdialog.h> |
29 #include <hblabel.h> |
29 #include <hblabel.h> |
30 #include <hbmessagebox.h> |
30 #include <hbmessagebox.h> |
31 #include "OstTraceDefinitions.h" |
31 #include "OstTraceDefinitions.h" |
32 #ifdef OST_TRACE_COMPILER_IN_USE |
32 #ifdef OST_TRACE_COMPILER_IN_USE |
33 #include "glxcommandhandlernewmediaTraces.h" |
33 #include "glxcommandhandlernewmediaTraces.h" |
34 #endif |
34 #endif |
35 #include <hbaction.h> |
35 #include <hbaction.h> |
36 |
|
37 GlxTextInputDialog::GlxTextInputDialog() |
|
38 { |
|
39 } |
|
40 |
|
41 GlxTextInputDialog::~GlxTextInputDialog() |
|
42 { |
|
43 } |
|
44 |
|
45 QString GlxTextInputDialog::getText(const QString &label, |
|
46 const QString &text, bool *ok) |
|
47 { |
|
48 mDialog = new HbInputDialog(); |
|
49 mDialog->setPromptText(label); |
|
50 mDialog->setInputMode(HbInputDialog::TextInput); |
|
51 mDialog->setValue(text); |
|
52 connect(mDialog->lineEdit(0), SIGNAL( textChanged (const QString &) ), |
|
53 this, SLOT( textChanged (const QString &))); |
|
54 HbAction* action = mDialog->exec(); |
|
55 QString retText = NULL; |
|
56 if (action == mDialog->secondaryAction()) |
|
57 { //Cancel was pressed |
|
58 if (ok) |
|
59 { |
|
60 *ok = false; |
|
61 } |
|
62 } |
|
63 else |
|
64 { //OK was pressed |
|
65 if (ok) |
|
66 { |
|
67 *ok = true; |
|
68 } |
|
69 retText = mDialog->value().toString().trimmed(); |
|
70 } |
|
71 disconnect(mDialog->lineEdit(0), SIGNAL( textChanged (const QString &) ), |
|
72 this, SLOT( textChanged (const QString &))); |
|
73 delete mDialog; |
|
74 mDialog = NULL; |
|
75 return retText; |
|
76 } |
|
77 |
|
78 void GlxTextInputDialog::textChanged(const QString &text) |
|
79 { |
|
80 if (text.trimmed().isEmpty()) |
|
81 { |
|
82 mDialog->primaryAction()->setEnabled(false); |
|
83 } |
|
84 else |
|
85 { |
|
86 mDialog->primaryAction()->setEnabled(true); |
|
87 } |
|
88 } |
|
89 |
|
90 |
36 |
91 GlxCommandHandlerNewMedia::GlxCommandHandlerNewMedia() : |
37 GlxCommandHandlerNewMedia::GlxCommandHandlerNewMedia() : |
92 iNewMediaCreationError(KErrNone), iNewMediaItemTitle(0) , mShowConfirmation(false) |
38 iNewMediaCreationError(KErrNone), iNewMediaItemTitle(0) , mShowConfirmation(false) |
93 { |
39 { |
94 OstTraceFunctionEntry0( GLXCOMMANDHANDLERNEWMEDIA_GLXCOMMANDHANDLERNEWMEDIA_ENTRY ); |
40 OstTraceFunctionEntry0( GLXCOMMANDHANDLERNEWMEDIA_GLXCOMMANDHANDLERNEWMEDIA_ENTRY ); |