Esempio n. 1
0
 def on_button_run_subscription_clicked(self, menuitem):
     key = get_value_in_selected_row(self.subscriptions_treeview,
                                     self.subscriptions_store)
     if key:
         self.subscriptions[key]["last_match"] = ""
         self.save_subscription(self.subscriptions[key])
         client.yarss2.initiate_rssfeed_update(None, subscription_key=key)
Esempio n. 2
0
 def on_button_delete_message_clicked(self, button):
     message_key = get_value_in_selected_row(self.email_messages_treeview,
                                             self.email_messages_store)
     if not message_key:
         return
     # Check that this message is not used by any subscriptions
     subscriptions_with_notification = []
     # Go through subscriptions and find those with this notification
     for key in self.subscriptions.keys():
         if message_key in self.subscriptions[key][
                 "email_notifications"].keys():
             subscriptions_with_notification.append(
                 self.subscriptions[key]["name"])
     # Any subscriptions that use this message?
     if subscriptions_with_notification:
         subscription_titles = ''.join([
             "* %s\n" % title for title in subscriptions_with_notification
         ])
         md = gtk.MessageDialog(
             component.get("Preferences").pref_dialog,
             gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO,
             gtk.BUTTONS_CLOSE)
         md.set_markup(
             "This Email Message is used by the following subscriptions:\n<b>%s</b>"
             "You must first remove the notication from the subscriptions "
             "before deleting the email message!" % subscription_titles)
         md.run()
         md.destroy()
         return
     # Delete from core config
     self.save_email_message(None,
                             email_message_key=message_key,
                             delete=True)
Esempio n. 3
0
 def on_button_send_email_clicked(self, menuitem):
     key = get_value_in_selected_row(self.email_messages_treeview, self.email_messages_store)
     # Send email
     torrents = ["Torrent title"]
     self.torrent_handler.send_torrent_email(self.email_config,
                        self.email_messages[key],
                        torrent_name_list=torrents,
                        defered=True, callback_func=self.test_email_callback)
Esempio n. 4
0
 def on_button_delete_subscription_clicked(self,
                                           Event=None,
                                           a=None,
                                           col=None):
     key = get_value_in_selected_row(self.subscriptions_treeview,
                                     self.subscriptions_store)
     if key:
         self.save_subscription(None, subscription_key=key, delete=True)
Esempio n. 5
0
 def on_button_edit_cookie_clicked(self, Event=None, a=None, col=None):
     key = get_value_in_selected_row(self.cookies_treeview, self.cookies_store)
     if key:
         if col and col.get_title() == 'Active':
             # Save to config
             self.cookies[key]["active"] = not self.cookies[key]["active"]
             self.save_cookie(self.cookies[key])
         else:
             dialog_cookie = DialogCookie(self, self.cookies[key])
             dialog_cookie.show()
Esempio n. 6
0
 def on_button_edit_message_clicked(self, Event=None, a=None, col=None):
     key = get_value_in_selected_row(self.email_messages_treeview, self.email_messages_store)
     if key:
         if col and col.get_title() == 'Active':
             # Save to config
             self.email_messages[key]["active"] = not self.email_messages[key]["active"]
             self.save_email_message(self.email_messages[key])
         else:
             edit_message_dialog = DialogEmailMessage(self, self.email_messages[key])
             edit_message_dialog.show()
Esempio n. 7
0
 def on_button_send_email_clicked(self, menuitem):
     key = get_value_in_selected_row(self.email_messages_treeview,
                                     self.email_messages_store)
     # Send email
     torrents = ["Torrent title"]
     self.torrent_handler.send_torrent_email(
         self.email_config,
         self.email_messages[key],
         torrent_name_list=torrents,
         defered=True,
         callback_func=self.test_email_callback)
Esempio n. 8
0
 def on_button_edit_cookie_clicked(self, Event=None, a=None, col=None):
     key = get_value_in_selected_row(self.cookies_treeview,
                                     self.cookies_store)
     if key:
         if col and col.get_title() == 'Active':
             # Save to config
             self.cookies[key]["active"] = not self.cookies[key]["active"]
             self.save_cookie(self.cookies[key])
         else:
             dialog_cookie = DialogCookie(self, self.cookies[key])
             dialog_cookie.show()
Esempio n. 9
0
 def on_button_edit_rssfeed_clicked(self, Event=None, a=None, col=None):
     key = get_value_in_selected_row(self.rssfeeds_treeview, self.rssfeeds_store)
     if key:
         if col and col.get_title() == 'Active':
             # Check if dummy
             if key == yarss_config.DUMMY_RSSFEED_KEY:
                 return
             # Save to config
             self.rssfeeds[key]["active"] = not self.rssfeeds[key]["active"]
             self.save_rssfeed(self.rssfeeds[key])
         else:
             edit_rssfeed_dialog = DialogRSSFeed(self, self.rssfeeds[key])
             edit_rssfeed_dialog.show()
Esempio n. 10
0
 def on_button_edit_message_clicked(self, Event=None, a=None, col=None):
     key = get_value_in_selected_row(self.email_messages_treeview,
                                     self.email_messages_store)
     if key:
         if col and col.get_title() == 'Active':
             # Save to config
             self.email_messages[key][
                 "active"] = not self.email_messages[key]["active"]
             self.save_email_message(self.email_messages[key])
         else:
             edit_message_dialog = DialogEmailMessage(
                 self, self.email_messages[key])
             edit_message_dialog.show()
Esempio n. 11
0
 def on_button_edit_rssfeed_clicked(self, Event=None, a=None, col=None):
     key = get_value_in_selected_row(self.rssfeeds_treeview,
                                     self.rssfeeds_store)
     if key:
         if col and col.get_title() == 'Active':
             # Check if dummy
             if key == yarss_config.DUMMY_RSSFEED_KEY:
                 return
             # Save to config
             self.rssfeeds[key]["active"] = not self.rssfeeds[key]["active"]
             self.save_rssfeed(self.rssfeeds[key])
         else:
             edit_rssfeed_dialog = DialogRSSFeed(self, self.rssfeeds[key])
             edit_rssfeed_dialog.show()
Esempio n. 12
0
 def on_button_edit_subscription_clicked(self, Event=None, a=None, col=None):
     key = get_value_in_selected_row(self.subscriptions_treeview, self.subscriptions_store)
     if key:
         if col and col.get_title() == 'Active':
             self.subscriptions[key]["active"] = not self.subscriptions[key]["active"]
             self.save_subscription(self.subscriptions[key])
         else:
             edit_subscription_dialog = DialogSubscription(self,
                                                           self.log,
                                                           self.subscriptions[key],
                                                           self.rssfeeds,
                                                           self.get_move_completed_list(),
                                                           self.get_download_location_list(),
                                                           self.email_messages,
                                                           self.cookies)
             edit_subscription_dialog.show()
Esempio n. 13
0
 def on_button_edit_subscription_clicked(self,
                                         Event=None,
                                         a=None,
                                         col=None):
     key = get_value_in_selected_row(self.subscriptions_treeview,
                                     self.subscriptions_store)
     if key:
         if col and col.get_title() == 'Active':
             self.subscriptions[key][
                 "active"] = not self.subscriptions[key]["active"]
             self.save_subscription(self.subscriptions[key])
         else:
             edit_subscription_dialog = DialogSubscription(
                 self, self.log, self.subscriptions[key], self.rssfeeds,
                 self.get_move_completed_list(),
                 self.get_download_location_list(), self.email_messages,
                 self.cookies)
             edit_subscription_dialog.show()
Esempio n. 14
0
    def on_button_delete_rssfeed_clicked(self,Event=None, a=None, col=None):
        key = get_value_in_selected_row(self.rssfeeds_treeview, self.rssfeeds_store)
        if not key:
            return
        # Check that this rss feed has no subscriptions
        feed_subscriptions = self.get_subscription_count_for_feeds()

        # Any registered subscriptions?
        if sum(feed_subscriptions[key]) > 0:
            md = gtk.MessageDialog(component.get("Preferences").pref_dialog,
                                   gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO,
                                   gtk.BUTTONS_CLOSE,
                                   "This RSS Feed have subscriptions registered. Delete subscriptions first!")
            md.run()
            md.destroy()
            return
        else:
            self.save_rssfeed(None, rssfeed_key=key, delete=True)
Esempio n. 15
0
    def on_button_delete_rssfeed_clicked(self, Event=None, a=None, col=None):
        key = get_value_in_selected_row(self.rssfeeds_treeview,
                                        self.rssfeeds_store)
        if not key:
            return
        # Check that this rss feed has no subscriptions
        feed_subscriptions = self.get_subscription_count_for_feeds()

        # Any registered subscriptions?
        if sum(feed_subscriptions[key]) > 0:
            md = gtk.MessageDialog(
                component.get("Preferences").pref_dialog,
                gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO,
                gtk.BUTTONS_CLOSE,
                "This RSS Feed have subscriptions registered. Delete subscriptions first!"
            )
            md.run()
            md.destroy()
            return
        else:
            self.save_rssfeed(None, rssfeed_key=key, delete=True)
Esempio n. 16
0
 def on_button_delete_message_clicked(self, button):
     message_key = get_value_in_selected_row(self.email_messages_treeview, self.email_messages_store)
     if not message_key:
         return
     # Check that this message is not used by any subscriptions
     subscriptions_with_notification = []
     # Go through subscriptions and find those with this notification
     for key in self.subscriptions.keys():
         if message_key in self.subscriptions[key]["email_notifications"].keys():
             subscriptions_with_notification.append(self.subscriptions[key]["name"])
     # Any subscriptions that use this message?
     if subscriptions_with_notification:
         subscription_titles = ''.join(["* %s\n" % title for title in subscriptions_with_notification])
         md = gtk.MessageDialog(component.get("Preferences").pref_dialog,
                                gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO,
                                gtk.BUTTONS_CLOSE)
         md.set_markup("This Email Message is used by the following subscriptions:\n<b>%s</b>"
                       "You must first remove the notication from the subscriptions "
                       "before deleting the email message!" % subscription_titles)
         md.run()
         md.destroy()
         return
     # Delete from core config
     self.save_email_message(None, email_message_key=message_key, delete=True)
 def on_button_copy_to_clipboard(self, menuitem):
     torrent_title = get_value_in_selected_row(self.matching_treeView,
                                              self.matching_store, column_index=1)
     if torrent_title is not None:
         gtk.clipboard_get().set_text(torrent_title)
Esempio n. 18
0
 def on_button_delete_subscription_clicked(self,Event=None, a=None, col=None):
     key = get_value_in_selected_row(self.subscriptions_treeview, self.subscriptions_store)
     if key:
         self.save_subscription(None, subscription_key=key, delete=True)
Esempio n. 19
0
 def on_button_delete_cookie_clicked(self, button):
     key = get_value_in_selected_row(self.cookies_treeview,
                                     self.cookies_store)
     if key:
         # Delete from core config
         self.save_cookie(None, cookie_key=key, delete=True)
Esempio n. 20
0
 def on_button_copy_to_clipboard(self, menuitem):
     torrent_title = get_value_in_selected_row(self.matching_treeView,
                                               self.matching_store,
                                               column_index=1)
     if torrent_title is not None:
         gtk.clipboard_get().set_text(torrent_title)
Esempio n. 21
0
 def on_button_delete_cookie_clicked(self, button):
     key = get_value_in_selected_row(self.cookies_treeview, self.cookies_store)
     if key:
         # Delete from core config
         self.save_cookie(None, cookie_key=key, delete=True)
 def on_button_add_torrent_clicked(self, menuitem):
     torrent_link = get_value_in_selected_row(self.matching_treeView,
                                              self.matching_store, column_index=3)
     if torrent_link is not None:
         self.gtkUI.add_torrent(torrent_link)
Esempio n. 23
0
 def on_button_add_torrent_clicked(self, menuitem):
     torrent_link = get_value_in_selected_row(self.matching_treeView,
                                              self.matching_store,
                                              column_index=3)
     if torrent_link is not None:
         self.gtkUI.add_torrent(torrent_link)
Esempio n. 24
0
 def on_button_run_subscription_clicked(self, menuitem):
     key = get_value_in_selected_row(self.subscriptions_treeview, self.subscriptions_store)
     if key:
         self.subscriptions[key]["last_match"] = ""
         self.save_subscription(self.subscriptions[key])
         client.yarss2.initiate_rssfeed_update(None, subscription_key=key)