All pastes #801031 Raw Edit

Stuff

public text v1 · immutable
#801031 ·published 2007-11-28 22:39 UTC
rendered paste body
Index: mythplugins/mythvideo/mythvideo/editmetadata.cpp
===================================================================
--- mythplugins/mythvideo/mythvideo/editmetadata.cpp	(revision 14973)
+++ mythplugins/mythvideo/mythvideo/editmetadata.cpp	(working copy)
@@ -43,8 +43,6 @@
 
     working_metadata = new Metadata(*m_orig_metadata);
 
-    title_hack = NULL;
-    player_hack = NULL;
     category_select = NULL;
     level_select = NULL;
     child_check = NULL;
@@ -341,19 +339,6 @@
         MythThemedDialog::keyPressEvent(e);
 }
 
-
-void EditMetadataDialog::takeFocusAwayFromEditor(bool up_or_down)
-{
-    nextPrevWidgetFocus(up_or_down);
-
-    MythRemoteLineEdit *which_editor = (MythRemoteLineEdit *)sender();
-
-    if (which_editor)
-    {
-        which_editor->clearFocus();
-    }
-}
-
 void EditMetadataDialog::saveAndExit()
 {
     //
@@ -442,18 +427,10 @@
 
 void EditMetadataDialog::wireUpTheme()
 {
-    title_hack = getUIBlackHoleType("title_hack");
-    if (title_hack)
+    title_editor = getUIRemoteEditType("title");
+    if (title_editor)
     {
-        title_hack->allowFocus(true);
-        QFont f = gContext->GetMediumFont();
-        title_editor = new MythRemoteLineEdit(&f, this);
-        title_editor->setFocusPolicy(QWidget::NoFocus);
-        title_editor->setGeometry(title_hack->getScreenArea());
-        connect(title_hack, SIGNAL(takingFocus()),
-                title_editor, SLOT(setFocus()));
-        connect(title_editor, SIGNAL(tryingToLooseFocus(bool)),
-                this, SLOT(takeFocusAwayFromEditor(bool)));
+        title_editor->createEdit(this);
         connect(title_editor, SIGNAL(textChanged(QString)),
                 this, SLOT(setTitle(QString)));
     }
@@ -465,18 +442,10 @@
                 this, SLOT(setCategory(int)));
     }
 
-    player_hack = getUIBlackHoleType("player_hack");
-    if (player_hack)
+    player_editor = getUIRemoteEditType("player");
+    if (player_editor)
     {
-        player_hack->allowFocus(true);
-        QFont f = gContext->GetMediumFont();
-        player_editor = new MythRemoteLineEdit(&f, this);
-        player_editor->setFocusPolicy(QWidget::NoFocus);
-        player_editor->setGeometry(player_hack->getScreenArea());
-        connect(player_hack, SIGNAL(takingFocus()),
-                player_editor, SLOT(setFocus()));
-        connect(player_editor, SIGNAL(tryingToLooseFocus(bool)),
-                this, SLOT(takeFocusAwayFromEditor(bool)));
+        title_editor->createEdit(this);
         connect(player_editor, SIGNAL(textChanged(QString)),
                 this, SLOT(setPlayer(QString)));
     }
Index: mythplugins/mythvideo/mythvideo/editmetadata.h
===================================================================
--- mythplugins/mythvideo/mythvideo/editmetadata.h	(revision 14973)
+++ mythplugins/mythvideo/mythvideo/editmetadata.h	(working copy)
@@ -62,12 +62,8 @@
     //  GUI stuff
     //
 
-    MythRemoteLineEdit  *title_editor;
-    UIBlackHoleType     *title_hack;
-
-    MythRemoteLineEdit  *player_editor;
-    UIBlackHoleType     *player_hack;
-
+    UIRemoteEditType    *title_editor;
+    UIRemoteEditType    *player_editor;
     UISelectorType      *category_select;
     UISelectorType      *level_select;
     UICheckBoxType      *child_check;
Index: mythplugins/mythvideo/mythvideo/fileassoc.cpp
===================================================================
--- mythplugins/mythvideo/mythvideo/fileassoc.cpp	(revision 14973)
+++ mythplugins/mythvideo/mythvideo/fileassoc.cpp	(working copy)
@@ -189,15 +189,6 @@
         MythThemedDialog::keyPressEvent(e);
 }
 
-void FileAssocDialog::takeFocusAwayFromEditor(bool up_or_down)
-{
-    nextPrevWidgetFocus(up_or_down);
-    if (command_editor)
-    {
-        command_editor->clearFocus();
-    }
-}
-
 void FileAssocDialog::loadFileAssociations()
 {
     const FileAssociations::association_list &fa_list =
@@ -242,7 +233,7 @@
         if (command_editor)
         {
             command_editor->hide();
-            command_hack->SetContext(-2);
+            command_editor->SetContext(-2);
         }
         if (default_check)
         {
@@ -292,7 +283,7 @@
 
         if (command_editor)
         {
-            command_hack->SetContext(-1);
+            command_editor->SetContext(-1);
             command_editor->show();
             command_editor->setText(current_fa->getCommand());
         }
@@ -445,18 +436,10 @@
         connect(extension_select, SIGNAL(pushed(int)), this,
                 SLOT(switchToFA(int)));
     }
-    command_hack = getUIBlackHoleType("command_hack");
-    if (command_hack)
+    command_editor = getUIRemoteEditType("command");
+    if (command_editor)
     {
-        command_hack->allowFocus(true);
-        QFont f = gContext->GetMediumFont();
-        command_editor = new MythRemoteLineEdit(&f, this);
-        command_editor->setFocusPolicy(QWidget::NoFocus);
-        command_editor->setGeometry(command_hack->getScreenArea());
-        connect(command_hack, SIGNAL(takingFocus()),
-                command_editor, SLOT(setFocus()));
-        connect(command_editor, SIGNAL(tryingToLooseFocus(bool)),
-                this, SLOT(takeFocusAwayFromEditor(bool)));
+        command_editor->createEdit(this);
         connect(command_editor, SIGNAL(textChanged(QString)),
                 this, SLOT(setPlayerCommand(QString)));
     }
Index: mythplugins/mythvideo/mythvideo/fileassoc.h
===================================================================
--- mythplugins/mythvideo/mythvideo/fileassoc.h	(revision 14973)
+++ mythplugins/mythvideo/mythvideo/fileassoc.h	(working copy)
@@ -43,7 +43,6 @@
 
   public slots:
 
-    void takeFocusAwayFromEditor(bool up_or_down);
     void switchToFA(int which_one);
     void saveAndExit();
     void toggleDefault(bool on_or_off);
@@ -63,9 +62,8 @@
     //  GUI stuff
     //
 
-    MythRemoteLineEdit  *command_editor;
+    UIRemoteEditType    *command_editor;
     UISelectorType      *extension_select;
-    UIBlackHoleType     *command_hack;
     UICheckBoxType      *default_check;
     UICheckBoxType      *ignore_check;
     UITextButtonType    *done_button;