comparison src/gtkpounce.c @ 9206:13bfd59e164f

[gaim-migrate @ 10001] The action defaults for buddy pounces are now set to the action(s) set for the last pounce. The main default is once again set to "Send a message." This is designed to impress the users coming from AIM, but I am of the belief that a default of "Shiny sparkly" action would be more fitting here. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 06 Jun 2004 04:48:41 +0000
parents 5b35a6b96726
children 12ce3d23c662
comparison
equal deleted inserted replaced
9205:5b35a6b96726 9206:13bfd59e164f
186 GaimGtkBuddyList *gtkblist; 186 GaimGtkBuddyList *gtkblist;
187 GaimPounceEvent events = GAIM_POUNCE_NONE; 187 GaimPounceEvent events = GAIM_POUNCE_NONE;
188 188
189 name = gtk_entry_get_text(GTK_ENTRY(dialog->buddy_entry)); 189 name = gtk_entry_get_text(GTK_ENTRY(dialog->buddy_entry));
190 190
191 if (*name == '\0') { 191 if (*name == '\0')
192 {
192 gaim_notify_error(NULL, NULL, 193 gaim_notify_error(NULL, NULL,
193 _("Please enter a buddy to pounce."), NULL); 194 _("Please enter a buddy to pounce."), NULL);
194 return; 195 return;
195 } 196 }
196 197
237 gaim_pounce_set_events(dialog->pounce, events); 238 gaim_pounce_set_events(dialog->pounce, events);
238 gaim_pounce_set_pouncer(dialog->pounce, dialog->account); 239 gaim_pounce_set_pouncer(dialog->pounce, dialog->account);
239 gaim_pounce_set_pouncee(dialog->pounce, name); 240 gaim_pounce_set_pouncee(dialog->pounce, name);
240 } 241 }
241 242
242 /* Actions*/ 243 /* Actions */
243 gaim_pounce_action_set_enabled(dialog->pounce, "open-window", 244 gaim_pounce_action_set_enabled(dialog->pounce, "open-window",
244 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->open_win))); 245 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->open_win)));
245 gaim_pounce_action_set_enabled(dialog->pounce, "popup-notify", 246 gaim_pounce_action_set_enabled(dialog->pounce, "popup-notify",
246 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->popup))); 247 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->popup)));
247 gaim_pounce_action_set_enabled(dialog->pounce, "send-message", 248 gaim_pounce_action_set_enabled(dialog->pounce, "send-message",
255 "message", message); 256 "message", message);
256 gaim_pounce_action_set_attribute(dialog->pounce, "execute-command", 257 gaim_pounce_action_set_attribute(dialog->pounce, "execute-command",
257 "command", command); 258 "command", command);
258 gaim_pounce_action_set_attribute(dialog->pounce, "play-sound", 259 gaim_pounce_action_set_attribute(dialog->pounce, "play-sound",
259 "filename", sound); 260 "filename", sound);
261
262 /* Set the defaults for next time. */
263 gaim_prefs_set_bool("/gaim/gtk/pounces/default_actions/open-window",
264 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->open_win)));
265 gaim_prefs_set_bool("/gaim/gtk/pounces/default_actions/popup-notify",
266 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->popup)));
267 gaim_prefs_set_bool("/gaim/gtk/pounces/default_actions/send-message",
268 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->send_msg)));
269 gaim_prefs_set_bool("/gaim/gtk/pounces/default_actions/execute-command",
270 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd)));
271 gaim_prefs_set_bool("/gaim/gtk/pounces/default_actions/play-sound",
272 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->play_sound)));
260 273
261 gaim_pounce_set_save(dialog->pounce, 274 gaim_pounce_set_save(dialog->pounce,
262 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->save_pounce))); 275 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->save_pounce)));
263 276
264 delete_win_cb(NULL, NULL, dialog); 277 delete_win_cb(NULL, NULL, dialog);
798 GTK_TOGGLE_BUTTON(dialog->signon), TRUE); 811 GTK_TOGGLE_BUTTON(dialog->signon), TRUE);
799 } 812 }
800 } 813 }
801 } 814 }
802 815
803 gtk_toggle_button_set_active( 816 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->open_win),
804 GTK_TOGGLE_BUTTON(dialog->popup), TRUE); 817 gaim_prefs_get_bool("/gaim/gtk/pounces/default_actions/open-window"));
818 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->popup),
819 gaim_prefs_get_bool("/gaim/gtk/pounces/default_actions/popup-notify"));
820 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->send_msg),
821 gaim_prefs_get_bool("/gaim/gtk/pounces/default_actions/send-message"));
822 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->exec_cmd),
823 gaim_prefs_get_bool("/gaim/gtk/pounces/default_actions/execute-command"));
824 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->play_sound),
825 gaim_prefs_get_bool("/gaim/gtk/pounces/default_actions/play-sound"));
805 } 826 }
806 827
807 gtk_widget_show_all(vbox2); 828 gtk_widget_show_all(vbox2);
808 gtk_widget_show(window); 829 gtk_widget_show(window);
809 } 830 }
1104 void 1125 void
1105 gaim_gtk_pounces_init(void) 1126 gaim_gtk_pounces_init(void)
1106 { 1127 {
1107 gaim_pounces_register_handler(GAIM_GTK_UI, pounce_cb, new_pounce, 1128 gaim_pounces_register_handler(GAIM_GTK_UI, pounce_cb, new_pounce,
1108 free_pounce); 1129 free_pounce);
1109 } 1130
1131 gaim_prefs_add_none("/gaim/gtk/pounces");
1132 gaim_prefs_add_none("/gaim/gtk/pounces/default_actions");
1133 gaim_prefs_add_bool("/gaim/gtk/pounces/default_actions/open-window",
1134 FALSE);
1135 gaim_prefs_add_bool("/gaim/gtk/pounces/default_actions/popup-notify",
1136 FALSE);
1137 gaim_prefs_add_bool("/gaim/gtk/pounces/default_actions/send-message",
1138 TRUE);
1139 gaim_prefs_add_bool("/gaim/gtk/pounces/default_actions/execute-command",
1140 FALSE);
1141 gaim_prefs_add_bool("/gaim/gtk/pounces/default_actions/play-sound",
1142 FALSE);
1143 }