Notices


Reply
Thread Tools
Posts: 838 | Thanked: 3,384 times | Joined on Mar 2009
#231
Hi Nicolai, seems bug in comment #159 (and reminded on #221) is still not fixed. Here we go:
Code:
--- a/profilesx-status-panel-plugin.c
+++ b/profilesx-status-panel-plugin.c
@@ -139,7 +139,7 @@ show_profile_selection_dlg(GtkButton* button, ProfilesxStatusPlugin* plugin)
 
   GtkWidget* pannable_area;
   GtkWidget* content_area;
-  GtkWidget* dialog = gtk_dialog_new_with_buttons("Profiles",
+  GtkWidget* 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);
(localized title 'Profiles')
 

The Following 3 Users Say Thank You to AapoRantalainen For This Useful Post:
Posts: 838 | Thanked: 3,384 times | Joined on Mar 2009
#232
This is my 2 cents.
ProfilesX is two components (for user's perspective):
*control-panel entry for editing profiles
*status-bar-applet for selecting which profile is used

For me (personally), 'profile-editor' is so good that I want edit and tweak everything there and nothing on profile-switcher. So my use case is: Create/edit/tweak profiles.
And when I want switch profile I don't want see anything extra.

Here is the initial-patch:
Code:
--- 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);
+                       }
+
     }
   }
See screenshot. There are no toggle-buttons for vibration (they belongs to the profile-editor). And then there are no need for separate 'ok'-button. So clicking entry will select it and close dialog. Pressing outside dialog is cancel (as expected). I haven't tested it with more than three profiles.
(And here you can also see localized title)
Attached Images
 

Last edited by AapoRantalainen; 2012-01-28 at 21:51. Reason: typo
 

The Following 2 Users Say Thank You to AapoRantalainen For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#233
Originally Posted by AapoRantalainen View Post

For me (personally), 'profile-editor' is so good that I want edit and tweak everything there and nothing on profile-switcher.
It isn't the case of every user. As ProfileX is enhancement to existing thing/possible part of CSSU, it shouldn't 'cripple' existing features.

Personally, I don't like idea of going into profile editor, just to enable or disable vibration, while changing profiles on the go.

/Estel
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 

The Following 3 Users Say Thank You to Estel For This Useful Post:
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#234
Originally Posted by AapoRantalainen View Post
Hi Nicolai, seems bug in comment #159 (and reminded on #221) is still not fixed. Here we go: ....
fixed, thank you!

As for the vibra on/off button. I use it very often.
Most of the time I use the silent profile, but sometimes
I need to turn on/off vibration only. So I am quite happy
to have this option right from the status-menu.

nicolai
 

The Following 5 Users Say Thank You to nicolai For This Useful Post:
Posts: 304 | Thanked: 235 times | Joined on May 2010 @ Manila
#235
It would be great to have a version that enables vibration per tone. For example, in general profile, each tone for messages, call, or im, has its own tick box for if you want it to vibrate or not. Reason behind this is i want call to vibrate but leave sms and IMs not to vibrate.
 

The Following 2 Users Say Thank You to kent_autistic For This Useful Post:
Posts: 838 | Thanked: 3,384 times | Joined on Mar 2009
#236
Feature request / Discussion / Initial patch

General settings for application 'ProfilesX' itself.

This patch adds button 'Settings' above 'modify/new/delete/done'. Clicking it will open new dialog for settings. New dialog is currently empty as I'm not sure where to save modifications.

Code:
--- 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);
I'm not asking to merge empty dialog, but I'm asking discussion how to properly save and load settings.
 

The Following 2 Users Say Thank You to AapoRantalainen For This Useful Post:
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#237
gconf would be a good place to save settings.
What settings would you like to have?
 

The Following User Says Thank You to nicolai For This Useful Post:
Posts: 838 | Thanked: 3,384 times | Joined on Mar 2009
#238
I know how many profiles I want ever use. Then I made/tuned them perfect on control panel. Now there are no reason to modify them when switching profile on status panel. One place/application for editing, another place/application for switching.
(Edit: seems I have wrote this earlier, just little bit different wording)

I also read and understand that some people want toggle vibration when switching profile.


Code:
--- 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:
Posts: 123 | Thanked: 99 times | Joined on Sep 2010 @ Russia
#239
I didn't use ProfilesX control panel item for long time, since I set up some profiles. Today I decided to change some of them, change ringtone, volume - and I got random crashes when I click save after edit, then Done - and all Settings application crashes.
Anyone got such behavior?
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#240
I don't have any problems with profilesx - no crashes.
Do you use any other application for profiles.
 
Reply


 
Forum Jump


All times are GMT. The time now is 19:10.