summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/rbutilqt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 62a4f583f7..aa0c365303 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -110,6 +110,11 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
110 RegCloseKey(hk); 110 RegCloseKey(hk);
111 } 111 }
112#endif 112#endif
113
114#if !defined(Q_OS_WIN32)
115 /* eject funtionality is only implemented on W32 right now. */
116 ui.buttonEject->setEnabled(false);
117#endif
113 updateDevice(); 118 updateDevice();
114 downloadInfo(); 119 downloadInfo();
115 120
@@ -142,6 +147,7 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
142 connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog())); 147 connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog()));
143 connect(ui.actionE_xit, SIGNAL(triggered()), this, SLOT(shutdown())); 148 connect(ui.actionE_xit, SIGNAL(triggered()), this, SLOT(shutdown()));
144 connect(ui.buttonChangeDevice, SIGNAL(clicked()), this, SLOT(configDialog())); 149 connect(ui.buttonChangeDevice, SIGNAL(clicked()), this, SLOT(configDialog()));
150 connect(ui.buttonEject, SIGNAL(clicked()), this, SLOT(eject()));
145 connect(ui.buttonTalk, SIGNAL(clicked()), this, SLOT(createTalkFiles())); 151 connect(ui.buttonTalk, SIGNAL(clicked()), this, SLOT(createTalkFiles()));
146 connect(ui.buttonCreateVoice, SIGNAL(clicked()), this, SLOT(createVoiceFile())); 152 connect(ui.buttonCreateVoice, SIGNAL(clicked()), this, SLOT(createVoiceFile()));
147 connect(ui.buttonVoice, SIGNAL(clicked()), this, SLOT(installVoice())); 153 connect(ui.buttonVoice, SIGNAL(clicked()), this, SLOT(installVoice()));
@@ -733,3 +739,19 @@ void RbUtilQt::changeEvent(QEvent *e)
733 } 739 }
734} 740}
735 741
742void RbUtilQt::eject(void)
743{
744 QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
745 if(Utils::ejectDevice(mountpoint)) {
746 QMessageBox::information(this, tr("Device ejected"),
747 tr("Device successfully ejected. "
748 "You may now disconnect the player from the PC."));
749 }
750 else {
751 QMessageBox::critical(this, tr("Ejecting failed"),
752 tr("Ejecting the device failed. Please make sure no programs "
753 "are accessing files on the device. If ejecting still "
754 "fails please use your computers eject funtionality."));
755 }
756}
757