maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] ProfilesX (more profiles) (https://talk.maemo.org/showthread.php?t=50266)

AapoRantalainen 2012-01-28 19:19

Re: [Announce] ProfilesX (more profiles)
 
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')

AapoRantalainen 2012-01-28 21:48

Re: [Announce] ProfilesX (more profiles)
 
1 Attachment(s)
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)

Estel 2012-01-29 10:06

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by AapoRantalainen (Post 1157131)

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

nicolai 2012-01-29 23:38

Re: [Announce] ProfilesX (more profiles)
 
Quote:

Originally Posted by AapoRantalainen (Post 1157086)
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

kent_autistic 2012-04-15 12:45

Re: [Announce] ProfilesX (more profiles)
 
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.

AapoRantalainen 2012-07-21 11:24

Re: [Announce] ProfilesX (more profiles)
 
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.

nicolai 2012-07-23 08:31

Re: [Announce] ProfilesX (more profiles)
 
gconf would be a good place to save settings.
What settings would you like to have?

AapoRantalainen 2012-07-23 18:34

Re: [Announce] ProfilesX (more profiles)
 
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);


ForeverYoung 2012-11-16 12:03

Re: [Announce] ProfilesX (more profiles)
 
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 2012-11-16 20:35

Re: [Announce] ProfilesX (more profiles)
 
I don't have any problems with profilesx - no crashes.
Do you use any other application for profiles.


All times are GMT. The time now is 05:49.

vBulletin® Version 3.8.8