diff options
author | Sky <git@bunnies.cc> | 2013-10-14 02:59:21 +0100 |
---|---|---|
committer | Sky <git@bunnies.cc> | 2013-10-14 03:00:06 +0100 |
commit | 40a2456646df96e0dd8731ab78cba920a734a8e3 (patch) | |
tree | c73b382b68c739ab1605eddc095f0cd9a4ca4cc7 /gui/versionselectdialog.cpp | |
parent | 0ae8073d41de014beb8fd386cfb4713ad86c4766 (diff) | |
download | MultiMC-40a2456646df96e0dd8731ab78cba920a734a8e3.tar MultiMC-40a2456646df96e0dd8731ab78cba920a734a8e3.tar.gz MultiMC-40a2456646df96e0dd8731ab78cba920a734a8e3.tar.lz MultiMC-40a2456646df96e0dd8731ab78cba920a734a8e3.tar.xz MultiMC-40a2456646df96e0dd8731ab78cba920a734a8e3.zip |
Huge Java detection refactor, version dialogs on first run (no JavaPath set) and "auto detect" button
Diffstat (limited to 'gui/versionselectdialog.cpp')
-rw-r--r-- | gui/versionselectdialog.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gui/versionselectdialog.cpp b/gui/versionselectdialog.cpp index d975a7b4..900cd092 100644 --- a/gui/versionselectdialog.cpp +++ b/gui/versionselectdialog.cpp @@ -26,7 +26,7 @@ #include <logic/lists/BaseVersionList.h> #include <logic/tasks/Task.h> -VersionSelectDialog::VersionSelectDialog(BaseVersionList *vlist, QString title, QWidget *parent) +VersionSelectDialog::VersionSelectDialog(BaseVersionList *vlist, QString title, QWidget *parent, bool cancelable) : QDialog(parent), ui(new Ui::VersionSelectDialog) { ui->setupUi(this); @@ -40,7 +40,12 @@ VersionSelectDialog::VersionSelectDialog(BaseVersionList *vlist, QString title, ui->listView->setModel(m_proxyModel); ui->listView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); - ui->listView->header()->setSectionResizeMode(0, QHeaderView::Stretch); + ui->listView->header()->setSectionResizeMode(resizeOnColumn, QHeaderView::Stretch); + + if(!cancelable) + { + ui->buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(false); + } } VersionSelectDialog::~VersionSelectDialog() @@ -48,6 +53,13 @@ VersionSelectDialog::~VersionSelectDialog() delete ui; } +void VersionSelectDialog::setResizeOn(int column) +{ + ui->listView->header()->setSectionResizeMode(resizeOnColumn, QHeaderView::ResizeToContents); + resizeOnColumn = column; + ui->listView->header()->setSectionResizeMode(resizeOnColumn, QHeaderView::Stretch); +} + int VersionSelectDialog::exec() { QDialog::open(); |