Permalink
Browse files

Fixes #285

  • Loading branch information...
1 parent c2d6da3 commit 45319879aba4894a483c30f245a3497186ccd81e Daniel Kabel committed Mar 26, 2013
View
@@ -153,6 +153,10 @@ MainWindow::MainWindow(QWidget *parent) :
connect(m_settingsWidget, SIGNAL(accepted()), this, SLOT(onRenewModels()));
connect(m_settingsWidget, SIGNAL(accepted()), this, SLOT(onFilesRenamed()));
+ connect(ui->setsWidget, SIGNAL(sigJumpToMovie(Movie*)), this, SLOT(onJumpToMovie(Movie*)));
+ connect(ui->certificationWidget, SIGNAL(sigJumpToMovie(Movie*)), this, SLOT(onJumpToMovie(Movie*)));
+ connect(ui->genreWidget, SIGNAL(sigJumpToMovie(Movie*)), this, SLOT(onJumpToMovie(Movie*)));
+
MovieSearch::instance(ui->centralWidget);
TvShowSearch::instance(ui->centralWidget);
ImageDialog::instance(ui->centralWidget);
@@ -731,3 +735,9 @@ void MainWindow::onRenewModels()
ui->tvShowFilesWidget->renewModel();
ui->concertFilesWidget->renewModel();
}
+
+void MainWindow::onJumpToMovie(Movie *movie)
+{
+ onMenuMovies();
+ ui->filesWidget->selectMovie(movie);
+}
View
@@ -62,6 +62,7 @@ private slots:
void onXbmcSyncFinished();
void onFilesRenamed(Renamer::RenameType type = Renamer::TypeAll);
void onRenewModels();
+ void onJumpToMovie(Movie *movie);
private:
Ui::MainWindow *ui;
@@ -43,6 +43,7 @@ CertificationWidget::CertificationWidget(QWidget *parent) :
connect(ui->certifications, SIGNAL(itemSelectionChanged()), this, SLOT(onCertificationSelected()));
connect(ui->certifications, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(onCertificationNameChanged(QTableWidgetItem*)));
+ connect(ui->movies, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(onJumpToMovie(QTableWidgetItem*)));
}
/**
@@ -274,3 +275,9 @@ void CertificationWidget::onSaveInformation()
loadCertifications();
MessageBox::instance()->showMessage(tr("All Movies Saved"));
}
+
+void CertificationWidget::onJumpToMovie(QTableWidgetItem *item)
+{
+ Movie *movie = item->data(Qt::UserRole).value<Movie*>();
+ emit sigJumpToMovie(movie);
+}
@@ -6,6 +6,7 @@
#include <QTableWidgetItem>
#include <QWidget>
#include "globals/Globals.h"
+#include "movies/Movie.h"
namespace Ui {
class CertificationWidget;
@@ -24,6 +25,7 @@ class CertificationWidget : public QWidget
signals:
void setActionSaveEnabled(bool, MainWidgets);
+ void sigJumpToMovie(Movie*);
public slots:
void onSaveInformation();
@@ -38,6 +40,7 @@ private slots:
void addMovie();
void removeMovie();
void showCertificationsContextMenu(QPoint point);
+ void onJumpToMovie(QTableWidgetItem *item);
private:
Ui::CertificationWidget *ui;
View
@@ -419,3 +419,10 @@ void FilesWidget::onLeftEdge(bool isEdge)
else
m_alphaList->hide();
}
+
+void FilesWidget::selectMovie(Movie *movie)
+{
+ int row = Manager::instance()->movieModel()->movies().indexOf(movie);
+ QModelIndex index = Manager::instance()->movieModel()->index(row, 0, QModelIndex());
+ ui->files->selectRow(m_movieProxyModel->mapFromSource(index).row());
+}
View
@@ -34,6 +34,7 @@ class FilesWidget : public QWidget
static FilesWidget *instance();
QList<Movie*> selectedMovies();
void renewModel();
+ void selectMovie(Movie *movie);
public slots:
void restoreLastSelection();
View
@@ -40,6 +40,7 @@ GenreWidget::GenreWidget(QWidget *parent) :
connect(actionAddGenre, SIGNAL(triggered()), this, SLOT(addGenre()));
connect(actionDeleteGenre, SIGNAL(triggered()), this, SLOT(deleteGenre()));
connect(ui->genres, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showGenresContextMenu(QPoint)));
+ connect(ui->movies, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(onJumpToMovie(QTableWidgetItem*)));
connect(ui->genres, SIGNAL(itemSelectionChanged()), this, SLOT(onGenreSelected()));
connect(ui->genres, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(onGenreNameChanged(QTableWidgetItem*)));
@@ -258,7 +259,6 @@ void GenreWidget::addMovie()
return;
}
-
if (MovieListDialog::instance()->execWithoutGenre(ui->genres->item(ui->genres->currentRow(), 0)->text()) == QDialog::Accepted) {
Movie *movie = MovieListDialog::instance()->selectedMovie();
QString genreName = ui->genres->item(ui->genres->currentRow(), 0)->text();
@@ -283,3 +283,9 @@ void GenreWidget::onSaveInformation()
loadGenres();
MessageBox::instance()->showMessage(tr("All Movies Saved"));
}
+
+void GenreWidget::onJumpToMovie(QTableWidgetItem *item)
+{
+ Movie *movie = item->data(Qt::UserRole).value<Movie*>();
+ emit sigJumpToMovie(movie);
+}
View
@@ -6,6 +6,7 @@
#include <QTableWidgetItem>
#include <QWidget>
#include "globals/Globals.h"
+#include "movies/Movie.h"
namespace Ui {
class GenreWidget;
@@ -24,6 +25,7 @@ class GenreWidget : public QWidget
signals:
void setActionSaveEnabled(bool, MainWidgets);
+ void sigJumpToMovie(Movie*);
public slots:
void onSaveInformation();
@@ -38,6 +40,7 @@ private slots:
void addMovie();
void removeMovie();
void showGenresContextMenu(QPoint point);
+ void onJumpToMovie(QTableWidgetItem *item);
private:
Ui::GenreWidget *ui;
View
@@ -58,6 +58,7 @@ SetsWidget::SetsWidget(QWidget *parent) :
connect(ui->sets, SIGNAL(itemSelectionChanged()), this, SLOT(onSetSelected()));
connect(ui->sets, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(onSetNameChanged(QTableWidgetItem*)));
connect(ui->movies, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(onSortTitleChanged(QTableWidgetItem*)));
+ connect(ui->movies, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(onJumpToMovie(QTableWidgetItem*)));
connect(ui->buttonAddMovie, SIGNAL(clicked()), this, SLOT(onAddMovie()));
connect(ui->buttonRemoveMovie, SIGNAL(clicked()), this, SLOT(onRemoveMovie()));
connect(ui->poster, SIGNAL(clicked()), this, SLOT(chooseSetPoster()));
@@ -552,3 +553,12 @@ void SetsWidget::onDownloadFinished(DownloadManagerElement elem)
if (elem.movie)
delete elem.movie;
}
+
+void SetsWidget::onJumpToMovie(QTableWidgetItem *item)
+{
+ if (item->column() != 0)
+ return;
+
+ Movie *movie = item->data(Qt::UserRole).value<Movie*>();
+ emit sigJumpToMovie(movie);
+}
View
@@ -29,6 +29,7 @@ public slots:
signals:
void setActionSaveEnabled(bool, MainWidgets);
+ void sigJumpToMovie(Movie *movie);
private slots:
void onSetSelected();
@@ -45,6 +46,7 @@ private slots:
void showSetsContextMenu(QPoint point);
void onSetNameChanged(QTableWidgetItem *item);
void onDownloadFinished(DownloadManagerElement elem);
+ void onJumpToMovie(QTableWidgetItem *item);
private:
Ui::SetsWidget *ui;

0 comments on commit 4531987

Please sign in to comment.