forked from mzheng/rhythmbox-pandora
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
53 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import gtk | ||
|
||
class ErrorView(object): | ||
def __init__(self, plugin, callback): | ||
self.__plugin = plugin | ||
self.callback = callback | ||
|
||
builder_file = self.__plugin.find_file("pandora/widgets/error_area.ui") | ||
builder = gtk.Builder() | ||
builder.add_from_file(builder_file) | ||
self.error_frame = builder.get_object('error_frame') | ||
error_area = builder.get_object('error_event_box') | ||
self.primary_error = builder.get_object('primary_message') | ||
self.secondary_error = builder.get_object('secondary_message') | ||
# Hack to get the tooltip background color | ||
window = gtk.Window(gtk.WINDOW_POPUP) | ||
window.set_name("gtk-tooltip") | ||
window.ensure_style() | ||
style = window.get_style() | ||
error_area.set_style(style) | ||
self.error_frame.set_style(style) | ||
|
||
account_button = builder.get_object("account_settings") | ||
account_button.connect("clicked", self.on_account_settings_clicked) | ||
|
||
def get_error_frame(self): | ||
return self.error_frame | ||
|
||
def show(self, primary_message, secondary_message=None): | ||
self.primary_error.set_text(primary_message) | ||
if secondary_message is None: | ||
self.secondary_error.hide() | ||
else: | ||
self.secondary_error.set_text(secondary_message) | ||
self.secondary_error.show() | ||
self.error_frame.show() | ||
|
||
def hide(self): | ||
self.error_frame.hide() | ||
|
||
def on_account_settings_clicked(self, *args): | ||
self.__plugin.create_configure_dialog(callback=self.callback) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from SongEntryView import * | ||
from StationEntryView import * | ||
from StationEntryView import * | ||
from ErrorView import * |
File renamed without changes.