artwork: add "Add art" button to video artwork selection dialog
authormontellese <montellese@xbmc.org>
Sat, 2 Feb 2013 14:22:29 +0000 (15:22 +0100)
committermontellese <montellese@xbmc.org>
Sat, 2 Feb 2013 14:22:29 +0000 (15:22 +0100)
language/English/strings.po
xbmc/video/dialogs/GUIDialogVideoInfo.cpp

index 5a7f5a5..52fa7a3 100644 (file)
@@ -5392,7 +5392,12 @@ msgctxt "#13515"
 msgid "No art"
 msgstr ""
 
-#empty strings from id 13516 to 13549
+#: xbmc/video/dialogs/GUIDialogVideoInfo.cpp
+msgctxt "#13516"
+msgid "Add art"
+msgstr ""
+
+#empty strings from id 13517 to 13549
 
 #: xbmc/settings/GUISettings.cpp
 msgctxt "#13550"
index 35d2923..aa829a7 100644 (file)
@@ -29,6 +29,7 @@
 #include "video/VideoInfoScanner.h"
 #include "ApplicationMessenger.h"
 #include "video/VideoInfoTag.h"
+#include "guilib/GUIKeyboardFactory.h"
 #include "guilib/GUIWindowManager.h"
 #include "dialogs/GUIDialogOK.h"
 #include "dialogs/GUIDialogYesNo.h"
@@ -604,6 +605,7 @@ string CGUIDialogVideoInfo::ChooseArtType(const CFileItem &videoItem, map<string
   dialog->SetHeading(13511);
   dialog->Reset();
   dialog->SetUseDetails(true);
+  dialog->EnableButton(true, 13516);
 
   CVideoDatabase db;
   db.Open();
@@ -631,6 +633,16 @@ string CGUIDialogVideoInfo::ChooseArtType(const CFileItem &videoItem, map<string
   dialog->SetItems(&items);
   dialog->DoModal();
 
+  if (dialog->IsButtonPressed())
+  {
+    // Get the new artwork name
+    CStdString strArtworkName;
+    if (!CGUIKeyboardFactory::ShowAndGetInput(strArtworkName, g_localizeStrings.Get(13516), false))
+      return "";
+
+    return strArtworkName;
+  }
+
   return dialog->GetSelectedItem()->GetLabel();
 }