added error checking to ScratchpadWindow::onEditPlaylist();
prettified Widgets::MessageWindow
This commit is contained in:
parent
1769fe5b48
commit
dfc8c0d356
5 changed files with 157 additions and 131 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.3 $
|
||||
Version : $Revision: 1.4 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/MessageWindow.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -56,25 +56,29 @@ using namespace LiveSupport::Widgets;
|
|||
*----------------------------------------------------------------------------*/
|
||||
MessageWindow :: MessageWindow (Ptr<Glib::ustring>::Ref message)
|
||||
throw ()
|
||||
: WhiteWindow(*message,
|
||||
: WhiteWindow("",
|
||||
Colors::White,
|
||||
WidgetFactory::getInstance()->getWhiteWindowCorners(),
|
||||
0)
|
||||
WhiteWindow::isModal)
|
||||
{
|
||||
Ptr<WidgetFactory>::Ref widgetFactory = WidgetFactory::getInstance();
|
||||
|
||||
messageLabel = Gtk::manage(new Gtk::Label(*message));
|
||||
Gtk::Box * messageLabelBox(new Gtk::HBox);
|
||||
messageLabelBox->pack_start(*messageLabel, false, false, 5);
|
||||
|
||||
// init the okButton
|
||||
// TODO: localize the OK text on the button
|
||||
okButton = Gtk::manage(widgetFactory->createButton("OK"));
|
||||
okButton->signal_clicked().connect(sigc::mem_fun(*this,
|
||||
&MessageWindow::onOkButtonClicked));
|
||||
Gtk::ButtonBox * okButtonBox = Gtk::manage(new Gtk::HButtonBox);
|
||||
okButtonBox->pack_start(*okButton, 5, 5);
|
||||
|
||||
layout = Gtk::manage(new Gtk::VBox());
|
||||
|
||||
layout->pack_start(*messageLabel, true, true);
|
||||
layout->pack_start(*okButton);
|
||||
layout->pack_start(*messageLabelBox, true, true, 5);
|
||||
layout->pack_start(*okButtonBox, false, false, 5);
|
||||
|
||||
add(*layout);
|
||||
show_all();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.6 $
|
||||
Version : $Revision: 1.7 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SchedulePlaylistWindow.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -142,18 +142,18 @@ SchedulePlaylistWindow :: onScheduleButtonClicked (void) throw ()
|
|||
|
||||
// get the hour and minute from the entries
|
||||
// and construct an HH:MM:00.00 string from it
|
||||
Glib::ustring timeStr = hourEntry->get_text();
|
||||
timeStr += ":";
|
||||
timeStr += minuteEntry->get_text();
|
||||
timeStr += ":00.00";
|
||||
Ptr<std::string>::Ref timeStr(new std::string(hourEntry->get_text()));
|
||||
*timeStr += ":";
|
||||
*timeStr += minuteEntry->get_text();
|
||||
*timeStr += ":00.00";
|
||||
|
||||
Ptr<posix_time::ptime>::Ref selectedTime;
|
||||
|
||||
try {
|
||||
gregorian::date date(year, month+1, day);
|
||||
posix_time::time_duration time(duration_from_string(timeStr.raw()));
|
||||
|
||||
selectedTime.reset(new posix_time::ptime(date, time));
|
||||
Ptr<posix_time::time_duration>::Ref
|
||||
time = TimeConversion::parseTimeDuration(timeStr);
|
||||
selectedTime.reset(new posix_time::ptime(date, *time));
|
||||
} catch (std::exception &e) {
|
||||
// most probably duration_from_string failed
|
||||
// TODO: notify user
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.27 $
|
||||
Version : $Revision: 1.28 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/ScratchpadWindow.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -507,7 +507,12 @@ void
|
|||
ScratchpadWindow :: onEditPlaylist(void) throw ()
|
||||
{
|
||||
Ptr<Playable>::Ref playable = currentRow[modelColumns.playableColumn];
|
||||
try {
|
||||
gLiveSupport->openPlaylistForEditing(playable->getId());
|
||||
} catch (XmlRpcException &e) {
|
||||
gLiveSupport->displayMessageWindow(getResourceUstring(
|
||||
"cannotEditPlaylistMsg" ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.25 $
|
||||
Version : $Revision: 1.26 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -453,7 +453,8 @@ SimplePlaylistManagementWindow :: onFadeInfoEdited(
|
|||
|
||||
Ptr<time_duration>::Ref newTime;
|
||||
try {
|
||||
newTime.reset(new time_duration(duration_from_string(newText)));
|
||||
Ptr<std::string>::Ref newTextPtr(new std::string(newText));
|
||||
newTime = TimeConversion::parseTimeDuration(newTextPtr);
|
||||
} catch (boost::bad_lexical_cast &e) {
|
||||
showContents(); // bad time format; restore previous state
|
||||
return;
|
||||
|
|
|
@ -8,7 +8,8 @@ root:table
|
|||
liveModeButtonLabel:string { "live mode" }
|
||||
uploadFileButtonLabel:string { "upload file" }
|
||||
scratchpadButtonLabel:string { "scratchpad" }
|
||||
simplePlaylistMgmtButtonLabel:string { "edit playlist" }
|
||||
simplePlaylistMgmtButtonLabel:string
|
||||
{ "edit playlist" }
|
||||
schedulerButtonLabel:string { "scheduler" }
|
||||
searchButtonLabel:string { "search" }
|
||||
|
||||
|
@ -53,7 +54,8 @@ root:table
|
|||
|
||||
typeColumnLabel:string { "Type" }
|
||||
titleColumnLabel:string { "Title" }
|
||||
addToPlaylistButtonLabel:string { "Add to playlist" }
|
||||
addToPlaylistButtonLabel:string
|
||||
{ "Add to playlist" }
|
||||
clearListButtonLabel:string { "Clear list" }
|
||||
removeButtonLabel:string { "Remove item(s)" }
|
||||
|
||||
|
@ -61,10 +63,16 @@ root:table
|
|||
downMenuItem:string { "Move D_own" }
|
||||
removeMenuItem:string { "_Remove" }
|
||||
editPlaylistMenuItem:string { "_Edit" }
|
||||
addToPlaylistMenuItem:string { "_Add To Playlist" }
|
||||
schedulePlaylistMenuItem:string { "_Schedule" }
|
||||
addToPlaylistMenuItem:string
|
||||
{ "_Add To Playlist" }
|
||||
schedulePlaylistMenuItem:string
|
||||
{ "_Schedule" }
|
||||
cueMenuItem:string { "Pre_view" }
|
||||
addToLiveModeMenuItem:string { "Add To _Live Mode" }
|
||||
addToLiveModeMenuItem:string
|
||||
{ "Add To _Live Mode" }
|
||||
|
||||
cannotEditPlaylistMsg:string
|
||||
{ "Could not open playlist for editing." }
|
||||
}
|
||||
|
||||
playlistListWindow:table
|
||||
|
@ -87,7 +95,8 @@ root:table
|
|||
windowTitle:string { "Upload File" }
|
||||
|
||||
chooseFileLabel:string { "Filename" }
|
||||
chooseFileButtonLabel:string { "Browse" }
|
||||
chooseFileButtonLabel:string
|
||||
{ "Browse" }
|
||||
|
||||
mainSectionLabel:string { "Main" }
|
||||
titleLabel:string { "Title" }
|
||||
|
@ -99,7 +108,8 @@ root:table
|
|||
uploadButtonLabel:string { "Upload" }
|
||||
closeButtonLabel:string { "Cancel" }
|
||||
|
||||
fileChooserDialogTitle:string { "Choose a File" }
|
||||
fileChooserDialogTitle:string
|
||||
{ "Choose a File" }
|
||||
clipUploadedMsg:string { "Uploaded clip ''{0}''." }
|
||||
couldNotOpenFileMsg:string { "The file could not be opened." }
|
||||
missingTitleMsg:string { "Please enter a title." }
|
||||
|
@ -107,7 +117,8 @@ root:table
|
|||
|
||||
simplePlaylistManagementWindow:table
|
||||
{
|
||||
windowTitle:string { "LiveSupport Simple Playlist Management Window" }
|
||||
windowTitle:string { "LiveSupport Simple Playlist Management"
|
||||
" Window" }
|
||||
|
||||
startColumnLabel:string { "Start" }
|
||||
titleColumnLabel:string { "Title" }
|
||||
|
@ -126,7 +137,8 @@ root:table
|
|||
removeMenuItem:string { "_Remove" }
|
||||
|
||||
playlistSavedMsg:string { "Saved playlist ''{0}''." }
|
||||
savePlaylistDialogMsg:string { "Do you want to save the playlist?" }
|
||||
savePlaylistDialogMsg:string
|
||||
{ "Do you want to save the playlist?" }
|
||||
emptyTitleErrorMsg:string { "Please enter a title." }
|
||||
}
|
||||
|
||||
|
@ -169,16 +181,20 @@ root:table
|
|||
creatorColumnLabel:string { "Creator" }
|
||||
lengthColumnLabel:string { "Length" }
|
||||
|
||||
partialOperatorDisplay:string { "contains" }
|
||||
prefixOperatorDisplay:string { "starts with" }
|
||||
partialOperatorDisplay:string
|
||||
{ "contains" }
|
||||
prefixOperatorDisplay:string
|
||||
{ "starts with" }
|
||||
=OperatorDisplay:string { "equals" }
|
||||
<=OperatorDisplay:string { "<=" }
|
||||
>=OperatorDisplay:string { ">=" }
|
||||
|
||||
allStringForBrowse { "--- all ---" }
|
||||
|
||||
addToScratchpadMenuItem:string { "_Add To Scratchpad" }
|
||||
addToLiveModeMenuItem:string { "Add To _Live Mode" }
|
||||
addToScratchpadMenuItem:string
|
||||
{ "_Add To Scratchpad" }
|
||||
addToLiveModeMenuItem:string
|
||||
{ "Add To _Live Mode" }
|
||||
}
|
||||
|
||||
liveModeWindow:table
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue