![]() |
2012-01-28
, 19:19
|
Posts: 839 |
Thanked: 3,386 times |
Joined on Mar 2009
|
#231
|
![]() |
2012-01-28
, 21:48
|
Posts: 839 |
Thanked: 3,386 times |
Joined on Mar 2009
|
#232
|
--- a/profilesx-status-panel-plugin.c +++ b/profilesx-status-panel-plugin.c @@ -54,6 +54,8 @@ #define GC_ROOT "/apps/maemo/profilesx" +gboolean only_choosing_mode = TRUE; //TODO: Where this should come? + struct _ProfilesxStatusPluginPrivate { GtkWidget* button; @@ -132,6 +134,12 @@ profilesx_dialog_size_changed(GdkScreen* screen, GDK_HINT_MIN_SIZE); } + +static void +profile_selected(GtkToggleButton* button, GtkDialog* dialog) { + gtk_dialog_response (dialog, GTK_RESPONSE_OK); +} + static void show_profile_selection_dlg(GtkButton* button, ProfilesxStatusPlugin* plugin) { @@ -139,10 +147,20 @@ show_profile_selection_dlg(GtkButton* button, ProfilesxStatusPlugin* plugin) GtkWidget* pannable_area; GtkWidget* content_area; - GtkWidget* dialog = gtk_dialog_new_with_buttons(dgettext ("osso-profiles", "profi_ti_select_profiles"), + GtkWidget* dialog; + if (only_choosing_mode) { + dialog = gtk_dialog_new_with_buttons(dgettext ("osso-profiles", "profi_ti_select_profiles"), + NULL, + GTK_DIALOG_MODAL, + NULL); + } + else { + dialog = gtk_dialog_new_with_buttons(dgettext ("osso-profiles", "profi_ti_select_profiles"), NULL, GTK_DIALOG_MODAL, dgettext("hildon-libs", "wdgt_bd_done"), GTK_RESPONSE_OK, NULL); + } + gtk_window_set_default_size(GTK_WINDOW(dialog), -1, 300); content_area = gtk_hbox_new(FALSE, 3); @@ -176,7 +194,15 @@ show_profile_selection_dlg(GtkButton* button, ProfilesxStatusPlugin* plugin) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); } + + if (only_choosing_mode) { + g_signal_connect(button, "toggled", G_CALLBACK(profile_selected), dialog); + } + previousRadioButton = button; + gtk_box_pack_start(GTK_BOX(left_box), button, FALSE, FALSE, 3); + + if (!only_choosing_mode) { GtkWidget* vib_button = hildon_check_button_new(HILDON_SIZE_FINGER_HEIGHT); hildon_check_button_set_active(HILDON_CHECK_BUTTON(vib_button), profile_get_value_as_bool(*profilePtr, PROFILEKEY_VIBRATING_ALERT_ENABLED)); @@ -184,9 +210,9 @@ show_profile_selection_dlg(GtkButton* button, ProfilesxStatusPlugin* plugin) idx++; gtk_button_set_label(GTK_BUTTON(vib_button), dgettext("osso-profiles", "profi_fi_general_vibrate")); - - gtk_box_pack_start(GTK_BOX(left_box), button, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(right_box), vib_button, FALSE, FALSE, 3); + } + } }
![]() |
2012-01-29
, 10:06
|
|
Posts: 5,028 |
Thanked: 8,613 times |
Joined on Mar 2011
|
#233
|
For me (personally), 'profile-editor' is so good that I want edit and tweak everything there and nothing on profile-switcher.
The Following 3 Users Say Thank You to Estel For This Useful Post: | ||
![]() |
2012-01-29
, 23:38
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#234
|
Hi Nicolai, seems bug in comment #159 (and reminded on #221) is still not fixed. Here we go: ....
The Following 5 Users Say Thank You to nicolai For This Useful Post: | ||
![]() |
2012-04-15
, 12:45
|
Posts: 304 |
Thanked: 235 times |
Joined on May 2010
@ Manila
|
#235
|
![]() |
2012-07-21
, 11:24
|
Posts: 839 |
Thanked: 3,386 times |
Joined on Mar 2009
|
#236
|
--- a/control_panel_plugin_src/profilesx-control-panel-plugin.c +++ b/control_panel_plugin_src/profilesx-control-panel-plugin.c @@ -151,6 +151,35 @@ ask_user_for_profile_name(user_data_t* data) } void +general_settings(GtkButton* button, user_data_t* data) +{ + + GtkWidget* dialog; + dialog = gtk_dialog_new_with_buttons("General settings", + GTK_WINDOW(data->main_dialog), + GTK_DIALOG_MODAL, + dgettext("hildon-libs", "wdgt_bd_save"), GTK_RESPONSE_OK, + NULL); + profilesx_dialog_size_changed(gdk_display_get_default_screen(gdk_display_get_default()), + dialog); + g_signal_connect(gdk_display_get_default_screen(gdk_display_get_default()), + "size-changed", + G_CALLBACK(profilesx_dialog_size_changed), dialog); + + //Add buttons, sliders... + gtk_widget_show_all(dialog); + + int ret = gtk_dialog_run(GTK_DIALOG(dialog)); + if(ret == GTK_RESPONSE_OK) + { + //DO SAVING + } + gtk_widget_destroy(dialog); + +} + + +void new_profile(GtkButton* button, user_data_t* data) { gchar* new_profile_name = ask_user_for_profile_name(data); @@ -210,22 +239,29 @@ void add_main_dialog_buttons(user_data_t* data) { GtkWidget* content_area; + GtkWidget* settings_button; + GtkWidget* edit_button; GtkWidget* new_button; data->profile_delete_button = hildon_gtk_button_new(HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT); + settings_button = hildon_gtk_button_new(HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT); edit_button = hildon_gtk_button_new(HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT); new_button = hildon_gtk_button_new(HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT); + gtk_button_set_label(GTK_BUTTON(settings_button), "Settings"); gtk_button_set_label(GTK_BUTTON(data->profile_delete_button), dgettext("hildon-libs", "wdgt_bd_delete")); gtk_button_set_label(GTK_BUTTON(edit_button), dgettext("hildon-libs", "wdgt_bd_edit")); gtk_button_set_label(GTK_BUTTON(new_button), dgettext("hildon-libs", "wdgt_bd_new")); + g_signal_connect(settings_button, "clicked", G_CALLBACK(general_settings), data); g_signal_connect(edit_button, "clicked", G_CALLBACK(edit_profile), data); g_signal_connect(new_button, "clicked", G_CALLBACK(new_profile), data); g_signal_connect(data->profile_delete_button, "clicked", G_CALLBACK(delete_profile), data); content_area = gtk_dialog_get_action_area(GTK_DIALOG(data->main_dialog)); gtk_box_pack_start(GTK_BOX(content_area), + settings_button, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(content_area), data->profile_delete_button, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(content_area), edit_button, FALSE, FALSE, 0);
![]() |
2012-07-23
, 08:31
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#237
|
The Following User Says Thank You to nicolai For This Useful Post: | ||
![]() |
2012-07-23
, 18:34
|
Posts: 839 |
Thanked: 3,386 times |
Joined on Mar 2009
|
#238
|
--- a/status_panel_plugin_src/profilesx-status-panel-plugin.c +++ b/status_panel_plugin_src/profilesx-status-panel-plugin.c @@ -54,6 +54,10 @@ #define GC_ROOT "/apps/maemo/profilesx" +//True = status panel is used only for selecting profile (control panel is used for edit profiles) +//False = when selecting profile, they can be also edited e.g. vibration +gboolean only_choosing_mode = TRUE; //Todo: load from settings + struct _ProfilesxStatusPluginPrivate { GtkWidget* button; @@ -132,6 +136,12 @@ profilesx_dialog_size_changed(GdkScreen* screen, GDK_HINT_MIN_SIZE); } + +static void +profile_selected(GtkToggleButton* button, GtkDialog* dialog) { + gtk_dialog_response (dialog, GTK_RESPONSE_OK); +} + static void show_profile_selection_dlg(GtkButton* button, ProfilesxStatusPlugin* plugin) { @@ -139,10 +149,20 @@ show_profile_selection_dlg(GtkButton* button, ProfilesxStatusPlugin* plugin) GtkWidget* pannable_area; GtkWidget* content_area; - GtkWidget* dialog = gtk_dialog_new_with_buttons(dgettext("osso-profiles", "profi_ti_select_profiles"), + GtkWidget* dialog; + if (only_choosing_mode) { + dialog = gtk_dialog_new_with_buttons(dgettext ("osso-profiles", "profi_ti_select_profiles"), NULL, GTK_DIALOG_MODAL, - dgettext("hildon-libs", "wdgt_bd_done"), GTK_RESPONSE_OK, NULL); + NULL); + } + else { + dialog = gtk_dialog_new_with_buttons(dgettext ("osso-profiles", "profi_ti_select_profiles"), + NULL, + GTK_DIALOG_MODAL, + dgettext("hildon-libs", "wdgt_bd_done"), GTK_RESPONSE_OK, NULL); + } + gtk_window_set_default_size(GTK_WINDOW(dialog), -1, 300); content_area = gtk_hbox_new(FALSE, 3); @@ -176,12 +196,23 @@ show_profile_selection_dlg(GtkButton* button, ProfilesxStatusPlugin* plugin) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); } - previousRadioButton = button; + + if (only_choosing_mode) { + g_signal_connect(button, "toggled", G_CALLBACK(profile_selected), dialog); + } + + previousRadioButton = button; + gtk_box_pack_start(GTK_BOX(left_box), button, FALSE, FALSE, 3); + + GtkWidget* vib_button = hildon_check_button_new(HILDON_SIZE_FINGER_HEIGHT); hildon_check_button_set_active(HILDON_CHECK_BUTTON(vib_button), profile_get_value_as_bool(*profilePtr, PROFILEKEY_VIBRATING_ALERT_ENABLED)); vibs[idx] = vib_button; idx++; + + if (!only_choosing_mode) { + gtk_button_set_label(GTK_BUTTON(vib_button), dgettext("osso-profiles", "profi_fi_general_vibrate")); @@ -189,6 +220,7 @@ show_profile_selection_dlg(GtkButton* button, ProfilesxStatusPlugin* plugin) gtk_box_pack_start(GTK_BOX(right_box), vib_button, FALSE, FALSE, 3); } } + } gtk_box_pack_start(GTK_BOX(content_area), left_box, TRUE, TRUE, 3); gtk_box_pack_start(GTK_BOX(content_area), right_box, FALSE, FALSE, 3);
The Following User Says Thank You to AapoRantalainen For This Useful Post: | ||
![]() |
2012-11-16
, 12:03
|
Posts: 123 |
Thanked: 99 times |
Joined on Sep 2010
@ Russia
|
#239
|
![]() |
2012-11-16
, 20:35
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#240
|